text stringlengths 2.5k 6.39M | kind stringclasses 3
values |
|---|---|
-- complain if script is sourced in psql, rather than via ALTER EXTENSION
\echo Use "ALTER EXTENSION ""babelfishpg_tsql"" UPDATE TO '1.1.0'" to load this file. \quit
SELECT set_config('search_path', 'sys, '||current_setting('search_path'), false);
/* Caution: Be careful while dropping an object in a minor version upgrade
* script as the object might be getting used in some user defined
* objects and dropping it here might result in upgrade failure or
* even user defined objects getting dropped.
* The following sys.sysindexes view was not working previously, so dropping
* it here is ok.
*/
DROP VIEW IF EXISTS sys.sysindexes;
CREATE FUNCTION sys.columns_internal()
RETURNS TABLE (
out_object_id int,
out_name sys.sysname,
out_column_id int,
out_system_type_id int,
out_user_type_id int,
out_max_length smallint,
out_precision sys.tinyint,
out_scale sys.tinyint,
out_collation_name sys.sysname,
out_collation_id int,
out_offset smallint,
out_is_nullable sys.bit,
out_is_ansi_padded sys.bit,
out_is_rowguidcol sys.bit,
out_is_identity sys.bit,
out_is_computed sys.bit,
out_is_filestream sys.bit,
out_is_replicated sys.bit,
out_is_non_sql_subscribed sys.bit,
out_is_merge_published sys.bit,
out_is_dts_replicated sys.bit,
out_is_xml_document sys.bit,
out_xml_collection_id int,
out_default_object_id int,
out_rule_object_id int,
out_is_sparse sys.bit,
out_is_column_set sys.bit,
out_generated_always_type sys.tinyint,
out_generated_always_type_desc sys.nvarchar(60),
out_encryption_type int,
out_encryption_type_desc sys.nvarchar(64),
out_encryption_algorithm_name sys.sysname,
out_column_encryption_key_id int,
out_column_encryption_key_database_name sys.sysname,
out_is_hidden sys.bit,
out_is_masked sys.bit,
out_graph_type int,
out_graph_type_desc sys.nvarchar(60)
)
AS
$$
BEGIN
RETURN QUERY
SELECT CAST(c.oid AS int),
CAST(a.attname AS sys.sysname),
CAST(a.attnum AS int),
CAST(t.oid AS int),
CAST(t.oid AS int),
CAST(a.attlen AS smallint),
CAST(case when isc.datetime_precision is null then coalesce(isc.numeric_precision, 0) else isc.datetime_precision end AS sys.tinyint),
CAST(coalesce(isc.numeric_scale, 0) AS sys.tinyint),
CAST(coll.collname AS sys.sysname),
CAST(a.attcollation AS int),
CAST(a.attnum AS smallint),
CAST(case when a.attnotnull then 0 else 1 end AS sys.bit),
CAST(case when t.typname in ('bpchar', 'nchar', 'binary') then 1 else 0 end AS sys.bit),
CAST(0 AS sys.bit),
CAST(case when a.attidentity <> ''::"char" then 1 else 0 end AS sys.bit),
CAST(case when a.attgenerated <> ''::"char" then 1 else 0 end AS sys.bit),
CAST(0 AS sys.bit),
CAST(0 AS sys.bit),
CAST(0 AS sys.bit),
CAST(0 AS sys.bit),
CAST(0 AS sys.bit),
CAST(0 AS sys.bit),
CAST(0 AS int),
CAST(coalesce(d.oid, 0) AS int),
CAST(coalesce((select oid from pg_constraint where conrelid = t.oid
and contype = 'c' and a.attnum = any(conkey) limit 1), 0) AS int),
CAST(0 AS sys.bit),
CAST(0 AS sys.bit),
CAST(0 AS sys.tinyint),
CAST('NOT_APPLICABLE' AS sys.nvarchar(60)),
CAST(null AS int),
CAST(null AS sys.nvarchar(64)),
CAST(null AS sys.sysname),
CAST(null AS int),
CAST(null AS sys.sysname),
CAST(0 AS sys.bit),
CAST(0 AS sys.bit),
CAST(null AS int),
CAST(null AS sys.nvarchar(60))
FROM pg_attribute a
INNER JOIN pg_class c ON c.oid = a.attrelid
INNER JOIN pg_type t ON t.oid = a.atttypid
INNER JOIN pg_namespace s ON s.oid = c.relnamespace
INNER JOIN information_schema.columns isc ON c.relname = isc.table_name AND s.nspname = isc.table_schema AND a.attname = isc.column_name
LEFT JOIN pg_attrdef d ON c.oid = d.adrelid AND a.attnum = d.adnum
LEFT JOIN pg_collation coll ON coll.oid = a.attcollation
WHERE NOT a.attisdropped
AND a.attnum > 0
-- r = ordinary table, i = index, S = sequence, t = TOAST table, v = view, m = materialized view, c = composite type, f = foreign table, p = partitioned table
AND c.relkind IN ('r', 'v', 'm', 'f', 'p')
AND s.nspname NOT IN ('information_schema', 'pg_catalog', 'sys')
AND has_schema_privilege(s.oid, 'USAGE')
AND has_column_privilege(quote_ident(s.nspname) ||'.'||quote_ident(c.relname), a.attname, 'SELECT,INSERT,UPDATE,REFERENCES');
END;
$$
language plpgsql;
create or replace view sys.columns AS
select out_object_id::oid as object_id
, out_name::name as name
, out_column_id::smallint as column_id
, out_system_type_id::oid as system_type_id
, out_user_type_id::oid as user_type_id
, out_max_length::smallint as max_length
, out_precision::integer as precision
, out_scale::integer as scale
, out_collation_name::name as collation_name
, out_is_nullable::integer as is_nullable
, out_is_ansi_padded::integer as is_ansi_padded
, out_is_rowguidcol::integer as is_rowguidcol
, out_is_identity::integer as is_identity
, out_is_computed::integer as is_computed
, out_is_filestream::integer as is_filestream
, out_is_replicated::integer as is_replicated
, out_is_non_sql_subscribed::integer as is_non_sql_subscribed
, out_is_merge_published::integer as is_merge_published
, out_is_dts_replicated::integer as is_dts_replicated
, out_is_xml_document::integer as is_xml_document
, out_xml_collection_id::integer as xml_collection_id
, out_default_object_id::oid as default_object_id
, out_rule_object_id::oid as rule_object_id
, out_is_sparse::integer as is_sparse
, out_is_column_set::integer as is_column_set
, out_generated_always_type::integer as generated_always_type
, out_generated_always_type_desc::varchar(60) as generated_always_type_desc
, out_encryption_type::integer as encryption_type
, out_encryption_type_desc::varchar(64) as encryption_type_desc
, out_encryption_algorithm_name::varchar as encryption_algorithm_name
, out_column_encryption_key_id::integer as column_encryption_key_id
, out_column_encryption_key_database_name::varchar as column_encryption_key_database_name
, out_is_hidden::integer as is_hidden
, out_is_masked::integer as is_masked
, out_graph_type as graph_type
, out_graph_type_desc as graph_type_desc
from sys.columns_internal();
GRANT SELECT ON sys.columns TO PUBLIC;
create or replace view sys.views as
select
t.relname as name
, t.oid as object_id
, null::integer as principal_id
, s.oid as schema_id
, 0 as parent_object_id
, 'V'::varchar(2) as type
, 'VIEW'::varchar(60) as type_desc
, null::timestamp as create_date
, null::timestamp as modify_date
, 0 as is_ms_shipped
, 0 as is_published
, 0 as is_schema_published
, 0 as with_check_option
, 0 as is_date_correlation_view
, 0 as is_tracked_by_cdc
from pg_class t inner join pg_namespace s on s.oid = t.relnamespace
where t.relkind = 'v'
and has_schema_privilege(s.oid, 'USAGE')
and has_table_privilege(quote_ident(s.nspname) ||'.'||quote_ident(t.relname), 'SELECT,INSERT,UPDATE,DELETE,TRUNCATE,TRIGGER')
and s.nspname not in ('information_schema', 'pg_catalog');
GRANT SELECT ON sys.views TO PUBLIC;
create or replace view sys.all_columns as
select c.oid as object_id
, a.attname as name
, a.attnum as column_id
, t.oid as system_type_id
, t.oid as user_type_id
, a.attlen as max_length
, null::integer as precision
, null::integer as scale
, coll.collname as collation_name
, case when a.attnotnull then 0 else 1 end as is_nullable
, 0 as is_ansi_padded
, 0 as is_rowguidcol
, 0 as is_identity
, 0 as is_computed
, 0 as is_filestream
, 0 as is_replicated
, 0 as is_non_sql_subscribed
, 0 as is_merge_published
, 0 as is_dts_replicated
, 0 as is_xml_document
, 0 as xml_collection_id
, coalesce(d.oid, 0) as default_object_id
, coalesce((select oid from pg_constraint where conrelid = t.oid and contype = 'c' and a.attnum = any(conkey) limit 1), 0) as rule_object_id
, 0 as is_sparse
, 0 as is_column_set
, 0 as generated_always_type
, 'NOT_APPLICABLE'::varchar(60) as generated_always_type_desc
, null::integer as encryption_type
, null::varchar(64) as encryption_type_desc
, null::varchar as encryption_algorithm_name
, null::integer as column_encryption_key_id
, null::varchar as column_encryption_key_database_name
, 0 as is_hidden
, 0 as is_masked
from pg_attribute a
inner join pg_class c on c.oid = a.attrelid
inner join pg_type t on t.oid = a.atttypid
inner join pg_namespace s on s.oid = c.relnamespace
left join pg_attrdef d on c.oid = d.adrelid and a.attnum = d.adnum
left join pg_collation coll on coll.oid = a.attcollation
where not a.attisdropped
-- r = ordinary table, i = index, S = sequence, t = TOAST table, v = view, m = materialized view, c = composite type, f = foreign table, p = partitioned table
and c.relkind in ('r', 'v', 'm', 'f', 'p')
and has_column_privilege(quote_ident(s.nspname) ||'.'||quote_ident(c.relname), a.attname, 'SELECT,INSERT,UPDATE,REFERENCES')
and has_schema_privilege(s.oid, 'USAGE')
and a.attnum > 0;
GRANT SELECT ON sys.all_columns TO PUBLIC;
create or replace view sys.all_views as
select
t.relname as name
, t.oid as object_id
, null::integer as principal_id
, s.oid as schema_id
, 0 as parent_object_id
, 'V'::varchar(2) as type
, 'VIEW'::varchar(60) as type_desc
, null::timestamp as create_date
, null::timestamp as modify_date
, 0 as is_ms_shipped
, 0 as is_published
, 0 as is_schema_published
, 0 as with_check_option
, 0 as is_date_correlation_view
, 0 as is_tracked_by_cdc
from pg_class t inner join pg_namespace s on s.oid = t.relnamespace
where t.relkind = 'v'
and has_schema_privilege(s.oid, 'USAGE')
and has_table_privilege(quote_ident(s.nspname) ||'.'||quote_ident(t.relname), 'SELECT,INSERT,UPDATE,DELETE,TRUNCATE,TRIGGER');
GRANT SELECT ON sys.all_views TO PUBLIC;
create or replace view sys.identity_columns as
select
sys.babelfish_get_id_by_name(c.oid::text||a.attname) as object_id
, a.attname as name
, a.attnum as column_id
, t.oid as system_type_id
, t.oid as user_type_id
, a.attlen as max_length
, null::integer as precision
, null::integer as scale
, coll.collname as collation_name
, case when a.attnotnull then 0 else 1 end as is_nullable
, 0 as is_ansi_padded
, 0 as is_rowguidcol
, 1 as is_identity
, 0 as is_computed
, 0 as is_filestream
, 0 as is_replicated
, 0 as is_non_sql_subscribed
, 0 as is_merge_published
, 0 as is_dts_replicated
, 0 as is_xml_document
, 0 as xml_collection_id
, coalesce(d.oid, 0) as default_object_id
, coalesce((select oid from pg_constraint where conrelid = t.oid and contype = 'c' and a.attnum = any(conkey) limit 1), 0) as rule_object_id
, 0 as is_sparse
, 0 as is_column_set
, 0 as generated_always_type
, 'NOT_APPLICABLE'::varchar(60) as generated_always_type_desc
, null::integer as encryption_type
, null::varchar(64) as encryption_type_desc
, null::varchar as encryption_algorithm_name
, null::integer as column_encryption_key_id
, null::varchar as column_encryption_key_database_name
, 0 as is_hidden
, 0 as is_masked
, null::bigint as seed_value
, null::bigint as increment_value
, sys.babelfish_get_sequence_value(pg_get_serial_sequence(quote_ident(s.nspname)||'.'||quote_ident(c.relname), a.attname)) as last_value
from pg_attribute a
left join pg_attrdef d on a.attrelid = d.adrelid and a.attnum = d.adnum
inner join pg_class c on c.oid = a.attrelid
inner join pg_namespace s on s.oid = c.relnamespace
left join pg_type t on t.oid = a.atttypid
left join pg_collation coll on coll.oid = t.typcollation
where not a.attisdropped
and pg_get_serial_sequence(quote_ident(s.nspname)||'.'||quote_ident(c.relname), a.attname) is not null
and s.nspname not in ('information_schema', 'pg_catalog')
and has_schema_privilege(s.oid, 'USAGE')
and has_sequence_privilege(pg_get_serial_sequence(quote_ident(s.nspname)||'.'||quote_ident(c.relname), a.attname), 'USAGE,SELECT,UPDATE');
GRANT SELECT ON sys.identity_columns TO PUBLIC;
create or replace view sys.all_objects as
select
t.name
, t.object_id
, t.principal_id
, t.schema_id
, t.parent_object_id
, 'U' as type
, 'USER_TABLE' as type_desc
, t.create_date
, t.modify_date
, t.is_ms_shipped
, t.is_published
, t.is_schema_published
from sys.tables t
where has_schema_privilege(t.schema_id, 'USAGE')
union all
select
v.name
, v.object_id
, v.principal_id
, v.schema_id
, v.parent_object_id
, 'V' as type
, 'VIEW' as type_desc
, v.create_date
, v.modify_date
, v.is_ms_shipped
, v.is_published
, v.is_schema_published
from sys.all_views v
where has_schema_privilege(v.schema_id, 'USAGE')
union all
select
f.name
, f.object_id
, f.principal_id
, f.schema_id
, f.parent_object_id
, 'F' as type
, 'FOREIGN_KEY_CONSTRAINT'
, f.create_date
, f.modify_date
, f.is_ms_shipped
, f.is_published
, f.is_schema_published
from sys.foreign_keys f
where has_schema_privilege(f.schema_id, 'USAGE')
union all
select
p.name
, p.object_id
, p.principal_id
, p.schema_id
, p.parent_object_id
, 'PK' as type
, 'PRIMARY_KEY_CONSTRAINT' as type_desc
, p.create_date
, p.modify_date
, p.is_ms_shipped
, p.is_published
, p.is_schema_published
from sys.key_constraints p
where has_schema_privilege(p.schema_id, 'USAGE')
union all
select
pr.name
, pr.object_id
, pr.principal_id
, pr.schema_id
, pr.parent_object_id
, pr.type
, pr.type_desc
, pr.create_date
, pr.modify_date
, pr.is_ms_shipped
, pr.is_published
, pr.is_schema_published
from sys.procedures pr
where has_schema_privilege(pr.schema_id, 'USAGE')
union all
select
p.relname as name
,p.oid as object_id
, null::integer as principal_id
, s.oid as schema_id
, 0 as parent_object_id
, 'SO'::varchar(2) as type
, 'SEQUENCE_OBJECT'::varchar(60) as type_desc
, null::timestamp as create_date
, null::timestamp as modify_date
, 0 as is_ms_shipped
, 0 as is_published
, 0 as is_schema_published
from pg_class p
inner join pg_namespace s on s.oid = p.relnamespace
where p.relkind = 'S'
and has_schema_privilege(s.oid, 'USAGE');
GRANT SELECT ON sys.all_objects TO PUBLIC;
create or replace function sys.square(in x double precision) returns double precision
AS
$BODY$
DECLARE
res double precision;
BEGIN
res = pow(x, 2::float);
return res;
END;
$BODY$
LANGUAGE plpgsql PARALLEL SAFE IMMUTABLE RETURNS NULL ON NULL INPUT;
create or replace view sys.sysindexes as
select
i.object_id::integer as id
, null::integer as status
, null::binary(6) as first
, i.type::smallint as indid
, null::binary(6) as root
, 0::smallint as minlen
, 1::smallint as keycnt
, null::smallint as groupid
, 0 as dpages
, 0 as reserved
, 0 as used
, 0::bigint as rowcnt
, 0 as rowmodctr
, 0 as reserved3
, 0 as reserved4
, 0::smallint as xmaxlen
, null::smallint as maxirow
, 90::sys.tinyint as "OrigFillFactor"
, 0::sys.tinyint as "StatVersion"
, 0 as reserved2
, null::binary(6) as "FirstIAM"
, 0::smallint as impid
, 0::smallint as lockflags
, 0 as pgmodctr
, null::sys.varbinary(816) as keys
, i.name::sys.sysname as name
, null::sys.image as statblob
, 0 as maxlen
, 0 as rows
from sys.indexes i;
GRANT SELECT ON sys.sysindexes TO PUBLIC;
CREATE OR REPLACE FUNCTION sys.exp(IN arg DOUBLE PRECISION)
RETURNS DOUBLE PRECISION
AS 'babelfishpg_tsql', 'tsql_exp'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
GRANT EXECUTE ON FUNCTION sys.exp(DOUBLE PRECISION) TO PUBLIC;
CREATE OR REPLACE FUNCTION sys.exp(IN arg NUMERIC)
RETURNS DOUBLE PRECISION
AS
$BODY$
SELECT sys.exp(arg::DOUBLE PRECISION);
$BODY$
LANGUAGE SQL IMMUTABLE PARALLEL SAFE;
GRANT EXECUTE ON FUNCTION sys.exp(NUMERIC) TO PUBLIC;
-- BABEL-2259: Support sp_databases System Stored Procedure
-- Lists databases that either reside in an instance of the SQL Server or
-- are accessible through a database gateway
CREATE OR REPLACE VIEW sys.sp_databases_view AS
SELECT CAST(database_name AS sys.SYSNAME),
-- DATABASE_SIZE returns a NULL value for databases larger than 2.15 TB
CASE WHEN (sum(table_size)/1024.0) > 2.15 * 1024.0 * 1024.0 * 1024.0 THEN NULL
ELSE CAST((sum(table_size)/1024.0) AS int) END as database_size,
CAST(NULL AS sys.VARCHAR(254)) as remarks
FROM (
SELECT pg_catalog.pg_namespace.oid as schema_oid,
pg_catalog.pg_namespace.nspname as schema_name,
INT.name AS database_name,
coalesce(pg_relation_size(pg_catalog.pg_class.oid), 0) as table_size
FROM
sys.babelfish_namespace_ext EXT
JOIN sys.babelfish_sysdatabases INT ON EXT.dbid = INT.dbid
JOIN pg_catalog.pg_namespace ON pg_catalog.pg_namespace.nspname = EXT.nspname
LEFT JOIN pg_catalog.pg_class ON relnamespace = pg_catalog.pg_namespace.oid
) t
GROUP BY database_name
ORDER BY database_name;
GRANT SELECT on sys.sp_databases_view TO PUBLIC;
CREATE OR REPLACE PROCEDURE sys.sp_databases ()
AS $$
BEGIN
SELECT database_name as "DATABASE_NAME",
database_size as "DATABASE_SIZE",
remarks as "REMARKS" from sys.sp_databases_view;
END;
$$
LANGUAGE 'pltsql';
GRANT EXECUTE on PROCEDURE sys.sp_databases TO PUBLIC;
-- For numeric/decimal and float/double precision there is already inbuilt functions,
-- Following sign functions are for remaining datatypes
CREATE OR REPLACE FUNCTION sys.sign(IN arg INT) RETURNS INT AS
$BODY$
SELECT
CASE
WHEN arg > 0 THEN 1::INT
WHEN arg < 0 THEN -1::INT
ELSE 0::INT
END;
$BODY$
STRICT
LANGUAGE SQL IMMUTABLE PARALLEL SAFE;
GRANT EXECUTE ON FUNCTION sys.sign(INT) TO PUBLIC;
CREATE OR REPLACE FUNCTION sys.sign(IN arg SMALLINT) RETURNS INT AS
$BODY$
SELECT sys.sign(arg::INT);
$BODY$
LANGUAGE SQL IMMUTABLE PARALLEL SAFE;
GRANT EXECUTE ON FUNCTION sys.sign(SMALLINT) TO PUBLIC;
CREATE OR REPLACE FUNCTION sys.sign(IN arg SYS.TINYINT) RETURNS INT AS
$BODY$
SELECT sys.sign(arg::INT);
$BODY$
LANGUAGE SQL IMMUTABLE PARALLEL SAFE;
GRANT EXECUTE ON FUNCTION sys.sign(SYS.TINYINT) TO PUBLIC;
CREATE OR REPLACE FUNCTION sys.sign(IN arg BIGINT) RETURNS BIGINT AS
$BODY$
SELECT
CASE
WHEN arg > 0::BIGINT THEN 1::BIGINT
WHEN arg < 0::BIGINT THEN -1::BIGINT
ELSE 0::BIGINT
END;
$BODY$
LANGUAGE SQL IMMUTABLE PARALLEL SAFE;
GRANT EXECUTE ON FUNCTION sys.sign(BIGINT) TO PUBLIC;
CREATE OR REPLACE FUNCTION sys.sign(IN arg SYS.MONEY) RETURNS SYS.MONEY AS
$BODY$
SELECT
CASE
WHEN arg > 0::SYS.MONEY THEN 1::SYS.MONEY
WHEN arg < 0::SYS.MONEY THEN -1::SYS.MONEY
ELSE 0::SYS.MONEY
END;
$BODY$
LANGUAGE SQL IMMUTABLE PARALLEL SAFE;
GRANT EXECUTE ON FUNCTION sys.sign(SYS.MONEY) TO PUBLIC;
CREATE OR REPLACE FUNCTION sys.sign(IN arg SYS.SMALLMONEY) RETURNS SYS.MONEY AS
$BODY$
SELECT sys.sign(arg::SYS.MONEY);
$BODY$
LANGUAGE SQL IMMUTABLE PARALLEL SAFE;
GRANT EXECUTE ON FUNCTION sys.sign(SYS.SMALLMONEY) TO PUBLIC;
-- To handle remaining input datatypes
CREATE OR REPLACE FUNCTION sys.sign(IN arg ANYELEMENT) RETURNS SYS.FLOAT AS
$BODY$
SELECT
sign(arg::SYS.FLOAT);
$BODY$
LANGUAGE SQL IMMUTABLE PARALLEL SAFE;
GRANT EXECUTE ON FUNCTION sys.sign(ANYELEMENT) TO PUBLIC;
-- Duplicate functions with arg TEXT since ANYELEMNT cannot handle type unknown.
CREATE OR REPLACE FUNCTION sys.sign(IN arg TEXT) RETURNS SYS.FLOAT AS
$BODY$
SELECT
sign(arg::SYS.FLOAT);
$BODY$
LANGUAGE SQL IMMUTABLE PARALLEL SAFE;
GRANT EXECUTE ON FUNCTION sys.sign(TEXT) TO PUBLIC;
CREATE OR REPLACE FUNCTION sys.lock_timeout()
RETURNS integer
LANGUAGE plpgsql
STRICT
AS $$
declare return_value integer;
begin
return_value := (select s.setting FROM pg_catalog.pg_settings s where name = 'lock_timeout');
RETURN return_value;
EXCEPTION
WHEN others THEN
RETURN NULL;
END;
$$;
GRANT EXECUTE ON FUNCTION sys.lock_timeout() TO PUBLIC;
CREATE OR REPLACE FUNCTION sys.max_connections()
RETURNS integer
LANGUAGE plpgsql
STRICT
AS $$
declare return_value integer;
begin
return_value := (select s.setting FROM pg_catalog.pg_settings s where name = 'max_connections');
RETURN return_value;
EXCEPTION
WHEN others THEN
RETURN NULL;
END;
$$;
GRANT EXECUTE ON FUNCTION sys.max_connections() TO PUBLIC;
CREATE OR REPLACE FUNCTION sys.trigger_nestlevel()
RETURNS integer
LANGUAGE plpgsql
STRICT
AS $$
declare return_value integer;
begin
return_value := (select pg_trigger_depth());
RETURN return_value;
EXCEPTION
WHEN others THEN
RETURN NULL;
END;
$$;
GRANT EXECUTE ON FUNCTION sys.trigger_nestlevel() TO PUBLIC;
CREATE OR REPLACE FUNCTION sys.schema_name()
RETURNS sys.sysname
LANGUAGE plpgsql
STRICT
AS $function$
begin
RETURN (select orig_name from sys.babelfish_namespace_ext ext
where ext.nspname = (select current_schema()) and ext.dbid::oid = sys.db_id()::oid)::sys.sysname;
EXCEPTION
WHEN others THEN
RETURN NULL;
END;
$function$
;
GRANT EXECUTE ON FUNCTION sys.schema_name() TO PUBLIC;
CREATE OR REPLACE FUNCTION sys.original_login()
RETURNS sys.sysname
LANGUAGE plpgsql
STRICT
AS $$
declare return_value text;
begin
RETURN (select session_user)::sys.sysname;
EXCEPTION
WHEN others THEN
RETURN NULL;
END;
$$;
GRANT EXECUTE ON FUNCTION sys.original_login() TO PUBLIC;
CREATE OR REPLACE FUNCTION sys.columnproperty(object_id oid, property name, property_name text)
RETURNS integer
LANGUAGE plpgsql
STRICT
AS $$
declare extra_bytes CONSTANT integer := 4;
declare return_value integer;
begin
return_value := (
select
case LOWER(property_name)
when 'charmaxlen' then
(select CASE WHEN a.atttypmod > 0 THEN a.atttypmod - extra_bytes ELSE NULL END from pg_catalog.pg_attribute a where a.attrelid = object_id and a.attname = property)
when 'allowsnull' then
(select CASE WHEN a.attnotnull THEN 0 ELSE 1 END from pg_catalog.pg_attribute a where a.attrelid = object_id and a.attname = property)
else
null
end
);
RETURN return_value::integer;
EXCEPTION
WHEN others THEN
RETURN NULL;
END;
$$;
GRANT EXECUTE ON FUNCTION sys.columnproperty(object_id oid, property name, property_name text) TO PUBLIC;
COMMENT ON FUNCTION sys.columnproperty
IS 'This function returns column or parameter information. Currently only works with "charmaxlen", and "allowsnull" otherwise returns 0.';
create or replace view sys.default_constraints
AS
select CAST(('DF_' || o.relname || '_' || d.oid) as sys.sysname) as name
, d.oid as object_id
, null::int as principal_id
, o.relnamespace as schema_id
, d.adrelid as parent_object_id
, 'D'::char(2) as type
, 'DEFAULT_CONSTRAINT'::sys.nvarchar(60) AS type_desc
, null::timestamp as create_date
, null::timestamp as modified_date
, 0::sys.bit as is_ms_shipped
, 0::sys.bit as is_published
, 0::sys.bit as is_schema_published
, d.adnum::int as parent_column_id
, pg_get_expr(d.adbin, d.adrelid) as definition
, 1::sys.bit as is_system_named
from pg_catalog.pg_attrdef as d
inner join pg_catalog.pg_class as o on (d.adrelid = o.oid);
GRANT SELECT ON sys.default_constraints TO PUBLIC;
CREATE OR REPLACE VIEW sys.computed_columns
AS
SELECT out_object_id as object_id
, out_name as name
, out_column_id as column_id
, out_system_type_id as system_type_id
, out_user_type_id as user_type_id
, out_max_length as max_length
, out_precision as precision
, out_scale as scale
, out_collation_name as collation_name
, out_is_nullable as is_nullable
, out_is_ansi_padded as is_ansi_padded
, out_is_rowguidcol as is_rowguidcol
, out_is_identity as is_identity
, out_is_computed as is_computed
, out_is_filestream as is_filestream
, out_is_replicated as is_replicated
, out_is_non_sql_subscribed as is_non_sql_subscribed
, out_is_merge_published as is_merge_published
, out_is_dts_replicated as is_dts_replicated
, out_is_xml_document as is_xml_document
, out_xml_collection_id as xml_collection_id
, out_default_object_id as default_object_id
, out_rule_object_id as rule_object_id
, out_is_sparse as is_sparse
, out_is_column_set as is_column_set
, out_generated_always_type as generated_always_type
, out_generated_always_type_desc as generated_always_type_desc
, out_encryption_type as encryption_type
, out_encryption_type_desc as encryption_type_desc
, out_encryption_algorithm_name as encryption_algorithm_name
, out_column_encryption_key_id as column_encryption_key_id
, out_column_encryption_key_database_name as column_encryption_key_database_name
, out_is_hidden as is_hidden
, out_is_masked as is_masked
, out_graph_type as graph_type
, out_graph_type_desc as graph_type_desc
, substring(pg_get_expr(d.adbin, d.adrelid), 1, 4000)::sys.nvarchar(4000) AS definition
, 1::sys.bit AS uses_database_collation
, 0::sys.bit AS is_persisted
FROM sys.columns_internal() sc
INNER JOIN pg_attribute a ON sc.out_name = a.attname AND sc.out_column_id = a.attnum
INNER JOIN pg_attrdef d ON d.adrelid = a.attrelid AND d.adnum = a.attnum
WHERE a.attgenerated = 's' AND sc.out_is_computed::integer = 1;
GRANT SELECT ON sys.computed_columns TO PUBLIC;
create or replace view sys.index_columns
as
select i.indrelid::integer as object_id
, i.indexrelid::integer as index_id
, a.attrelid::integer as index_column_id
, a.attnum::integer as column_id
, a.attnum::sys.tinyint as key_ordinal
, 0::sys.tinyint as partition_ordinal
, 0::sys.bit as is_descending_key
, 1::sys.bit as is_included_column
from pg_index as i
inner join pg_catalog.pg_attribute a on i.indexrelid = a.attrelid;
GRANT SELECT ON sys.index_columns TO PUBLIC;
CREATE or replace VIEW sys.check_constraints AS
SELECT CAST(c.conname as sys.sysname) as name
, oid::integer as object_id
, c.connamespace::integer as principal_id
, c.connamespace::integer as schema_id
, conrelid::integer as parent_object_id
, 'C'::char(2) as type
, 'CHECK_CONSTRAINT'::sys.nvarchar(60) as type_desc
, null::sys.datetime as create_date
, null::sys.datetime as modify_date
, 0::sys.bit as is_ms_shipped
, 0::sys.bit as is_published
, 0::sys.bit as is_schema_published
, 0::sys.bit as is_disabled
, 0::sys.bit as is_not_for_replication
, 0::sys.bit as is_not_trusted
, c.conkey[1]::integer AS parent_column_id
, substring(pg_get_constraintdef(c.oid) from 7) AS definition
, 1::sys.bit as uses_database_collation
, 0::sys.bit as is_system_named
FROM pg_catalog.pg_constraint as c
WHERE c.contype = 'c' and c.conrelid != 0;
GRANT SELECT ON sys.check_constraints TO PUBLIC;
create or replace view sys.indexes as
select
i.indrelid as object_id
, c.relname as name
, case when i.indisclustered then 1 else 2 end as type
, case when i.indisclustered then 'CLUSTERED'::varchar(60) else 'NONCLUSTERED'::varchar(60) end as type_desc
, case when i.indisunique then 1 else 0 end as is_unique
, c.reltablespace as data_space_id
, 0 as ignore_dup_key
, case when i.indisprimary then 1 else 0 end as is_primary_key
, case when constr.oid is null then 0 else 1 end as is_unique_constraint
, 0 as fill_factor
, case when i.indpred is null then 0 else 1 end as is_padded
, case when i.indisready then 0 else 1 end is_disabled
, 0 as is_hypothetical
, 1 as allow_row_locks
, 1 as allow_page_locks
, 0 as has_filter
, null::varchar as filter_definition
, 0 as auto_created
, c.oid as index_id
from pg_class c
inner join pg_namespace s on s.oid = c.relnamespace
inner join pg_index i on i.indexrelid = c.oid
left join pg_constraint constr on constr.conindid = c.oid
where c.relkind = 'i' and i.indislive
and s.nspname not in ('information_schema', 'pg_catalog');
GRANT SELECT ON sys.indexes TO PUBLIC;
-- substring --
CREATE OR REPLACE FUNCTION sys.substring(string TEXT, i INTEGER, j INTEGER)
RETURNS sys.VARCHAR
AS 'babelfishpg_tsql', 'tsql_varchar_substr' LANGUAGE C IMMUTABLE PARALLEL SAFE;
CREATE OR REPLACE FUNCTION sys.substring(string sys.VARCHAR, i INTEGER, j INTEGER)
RETURNS sys.VARCHAR
AS 'babelfishpg_tsql', 'tsql_varchar_substr' LANGUAGE C IMMUTABLE PARALLEL SAFE;
CREATE OR REPLACE FUNCTION sys.substring(string sys.VARCHAR, i INTEGER, j INTEGER)
RETURNS sys.VARCHAR
AS 'babelfishpg_tsql', 'tsql_varchar_substr' LANGUAGE C IMMUTABLE PARALLEL SAFE;
CREATE OR REPLACE FUNCTION sys.substring(string sys.NVARCHAR, i INTEGER, j INTEGER)
RETURNS sys.NVARCHAR
AS 'babelfishpg_tsql', 'tsql_varchar_substr' LANGUAGE C IMMUTABLE PARALLEL SAFE;
CREATE OR REPLACE FUNCTION sys.substring(string sys.NCHAR, i INTEGER, j INTEGER)
RETURNS sys.NVARCHAR
AS 'babelfishpg_tsql', 'tsql_varchar_substr' LANGUAGE C IMMUTABLE PARALLEL SAFE;
CREATE OR REPLACE FUNCTION sys.microsoftversion()
RETURNS INTEGER AS
$BODY$
SELECT 201332885::INTEGER;
$BODY$
LANGUAGE SQL IMMUTABLE STRICT PARALLEL SAFE;
CREATE VIEW sys.sp_pkeys_view AS
SELECT
CAST(t2.dbname AS sys.sysname) AS TABLE_QUALIFIER,
CAST(t3.rolname AS sys.sysname) AS TABLE_OWNER,
CAST(t1.relname AS sys.sysname) AS TABLE_NAME,
CAST(t4.column_name AS sys.sysname) AS COLUMN_NAME,
CAST(seq AS smallint) AS KEY_SEQ,
CAST(t5.conname AS sys.sysname) AS PK_NAME
FROM pg_catalog.pg_class t1
JOIN sys.pg_namespace_ext t2 ON t1.relnamespace = t2.oid
JOIN pg_catalog.pg_roles t3 ON t1.relowner = t3.oid
JOIN information_schema.columns t4 ON t1.relname = t4.table_name
JOIN pg_constraint t5 ON t1.oid = t5.conrelid
, generate_series(1,16) seq -- SQL server has max 16 columns per primary key
WHERE t5.contype = 'p'
AND CAST(t4.dtd_identifier AS smallint) = ANY (t5.conkey)
AND CAST(t4.dtd_identifier AS smallint) = t5.conkey[seq];
GRANT SELECT on sys.sp_pkeys_view TO PUBLIC;
-- internal function in order to workaround BABEL-1597
create function sys.sp_pkeys_internal(
in_table_name sys.nvarchar(384),
in_table_owner sys.nvarchar(384) = '',
in_table_qualifier sys.nvarchar(384) = ''
)
returns table(
out_table_qualifier sys.sysname,
out_table_owner sys.sysname,
out_table_name sys.sysname,
out_column_name sys.sysname,
out_key_seq smallint,
out_pk_name sys.sysname
)
as $$
begin
return query
select * from sys.sp_pkeys_view
where in_table_name = table_name
and ((SELECT coalesce(in_table_owner,'')) = '' or table_owner = in_table_owner)
and ((SELECT coalesce(in_table_qualifier,'')) = '' or table_qualifier = in_table_qualifier)
order by table_qualifier, table_owner, table_name, key_seq;
end;
$$
LANGUAGE plpgsql;
CREATE OR REPLACE PROCEDURE sys.sp_pkeys(
"@table_name" sys.nvarchar(384),
"@table_owner" sys.nvarchar(384) = '',
"@table_qualifier" sys.nvarchar(384) = ''
)
AS $$
BEGIN
select out_table_qualifier as table_qualifier,
out_table_owner as table_owner,
out_table_name as table_name,
out_column_name as column_name,
out_key_seq as key_seq,
out_pk_name as pk_name
from sys.sp_pkeys_internal(@table_name, @table_owner, @table_qualifier);
END;
$$
LANGUAGE 'pltsql';
GRANT ALL on PROCEDURE sys.sp_pkeys TO PUBLIC;
CREATE VIEW sys.sp_statistics_view AS
SELECT
CAST(t2.dbname AS sys.sysname) AS TABLE_QUALIFIER,
CAST(t3.rolname AS sys.sysname) AS TABLE_OWNER,
CAST(t1.relname AS sys.sysname) AS TABLE_NAME,
CASE
WHEN t5.indisunique = 't' THEN CAST(0 AS smallint)
ELSE CAST(1 AS smallint)
END AS NON_UNIQUE,
CAST(t1.relname AS sys.sysname) AS INDEX_QUALIFIER,
-- the index name created by CREATE INDEX is re-mapped, find it (by checking
-- the ones not in pg_constraint) and restoring it back before display
CASE
WHEN t8.oid > 0 THEN CAST(t6.relname AS sys.sysname)
ELSE CAST(SUBSTRING(t6.relname,1,LENGTH(t6.relname)-32-LENGTH(t1.relname)) AS sys.sysname)
END AS INDEX_NAME,
CASE
WHEN t7.starelid > 0 THEN CAST(0 AS smallint)
ELSE
CASE
WHEN t5.indisclustered = 't' THEN CAST(1 AS smallint)
ELSE CAST(3 AS smallint)
END
END AS TYPE,
CAST(seq + 1 AS smallint) AS SEQ_IN_INDEX,
CAST(t4.column_name AS sys.sysname) AS COLUMN_NAME,
CAST('A' AS sys.varchar(1)) AS COLLATION,
CAST(t7.stadistinct AS int) AS CARDINALITY,
CAST(0 AS int) AS PAGES, --not supported
CAST(NULL AS sys.varchar(128)) AS FILTER_CONDITION
FROM pg_catalog.pg_class t1
JOIN sys.pg_namespace_ext t2 ON t1.relnamespace = t2.oid
JOIN pg_catalog.pg_roles t3 ON t1.relowner = t3.oid
JOIN information_schema.columns t4 ON t1.relname = t4.table_name
JOIN (pg_catalog.pg_index t5 JOIN
pg_catalog.pg_class t6 ON t5.indexrelid = t6.oid) ON t1.oid = t5.indrelid
LEFT JOIN pg_catalog.pg_statistic t7 ON t1.oid = t7.starelid
LEFT JOIN pg_catalog.pg_constraint t8 ON t5.indexrelid = t8.conindid
, generate_series(0,31) seq -- SQL server has max 32 columns per index
WHERE CAST(t4.dtd_identifier AS smallint) = ANY (t5.indkey)
AND CAST(t4.dtd_identifier AS smallint) = t5.indkey[seq];
GRANT SELECT on sys.sp_statistics_view TO PUBLIC;
create function sys.sp_statistics_internal(
in_table_name sys.sysname,
in_table_owner sys.sysname = '',
in_table_qualifier sys.sysname = '',
in_index_name sys.sysname = '',
in_is_unique char = 'N',
in_accuracy char = 'Q'
)
returns table(
out_table_qualifier sys.sysname,
out_table_owner sys.sysname,
out_table_name sys.sysname,
out_non_unique smallint,
out_index_qualifier sys.sysname,
out_index_name sys.sysname,
out_type smallint,
out_seq_in_index smallint,
out_column_name sys.sysname,
out_collation sys.varchar(1),
out_cardinality int,
out_pages int,
out_filter_condition sys.varchar(128)
)
as $$
begin
return query
select * from sys.sp_statistics_view
where in_table_name = table_name
and ((SELECT coalesce(in_table_owner,'')) = '' or table_owner = in_table_owner)
and ((SELECT coalesce(in_table_qualifier,'')) = '' or table_qualifier = in_table_qualifier)
and ((SELECT coalesce(in_index_name,'')) = '' or index_name like in_index_name)
and ((in_is_unique = 'N') or (in_is_unique = 'Y' and non_unique = 0))
order by non_unique, type, index_name, seq_in_index;
end;
$$
LANGUAGE plpgsql;
CREATE OR REPLACE PROCEDURE sys.sp_statistics(
"@table_name" sys.sysname,
"@table_owner" sys.sysname = '',
"@table_qualifier" sys.sysname = '',
"@index_name" sys.sysname = '',
"@is_unique" char = 'N',
"@accuracy" char = 'Q'
)
AS $$
BEGIN
select out_table_qualifier as table_qualifier,
out_table_owner as table_owner,
out_table_name as table_name,
out_non_unique as non_unique,
out_index_qualifier as index_qualifier,
out_index_name as index_name,
out_type as type,
out_seq_in_index as seq_in_index,
out_column_name as column_name,
out_collation as collation,
out_cardinality as cardinality,
out_pages as pages,
out_filter_condition as filter_condition
from sys.sp_statistics_internal(@table_name, @table_owner, @table_qualifier, @index_name, @is_unique, @accuracy);
END;
$$
LANGUAGE 'pltsql';
GRANT ALL on PROCEDURE sys.sp_statistics TO PUBLIC;
-- same as sp_statistics
CREATE OR REPLACE PROCEDURE sys.sp_statistics_100(
"@table_name" sys.sysname,
"@table_owner" sys.sysname = '',
"@table_qualifier" sys.sysname = '',
"@index_name" sys.sysname = '',
"@is_unique" char = 'N',
"@accuracy" char = 'Q'
)
AS $$
BEGIN
select out_table_qualifier as table_qualifier,
out_table_owner as table_owner,
out_table_name as table_name,
out_non_unique as non_unique,
out_index_qualifier as index_qualifier,
out_index_name as index_name,
out_type as type,
out_seq_in_index as seq_in_index,
out_column_name as column_name,
out_collation as collation,
out_cardinality as cardinality,
out_pages as pages,
out_filter_condition as filter_condition
from sys.sp_statistics_internal(@table_name, @table_owner, @table_qualifier, @index_name, @is_unique, @accuracy);
END;
$$
LANGUAGE 'pltsql';
GRANT ALL on PROCEDURE sys.sp_statistics_100 TO PUBLIC;
-- Duplicate function with arg TEXT since ANYELEMENT cannot handle type unknown.
CREATE OR REPLACE FUNCTION sys.datepart(IN datepart PG_CATALOG.TEXT, IN arg TEXT) RETURNS INTEGER
AS
$body$
BEGIN
IF pg_typeof(arg) = 'sys.DATETIMEOFFSET'::regtype THEN
return sys.datepart_internal(datepart, arg::timestamp,
sys.babelfish_get_datetimeoffset_tzoffset(arg)::integer);
ELSE
return sys.datepart_internal(datepart, arg);
END IF;
END;
$body$
LANGUAGE plpgsql IMMUTABLE;
-- Duplicate functions with arg TEXT since ANYELEMENT cannot handle type unknown.
CREATE OR REPLACE FUNCTION sys.dateadd(IN datepart PG_CATALOG.TEXT, IN num INTEGER, IN startdate TEXT) RETURNS DATETIME
AS
$body$
BEGIN
IF pg_typeof(startdate) = 'sys.DATETIMEOFFSET'::regtype THEN
return sys.dateadd_internal_df(datepart, num,
startdate);
ELSE
return sys.dateadd_internal(datepart, num,
startdate);
END IF;
END;
$body$
LANGUAGE plpgsql IMMUTABLE;
-- Duplicate functions with arg TEXT since ANYELEMENT cannot handle type unknown.
CREATE OR REPLACE FUNCTION sys.datename(IN dp PG_CATALOG.TEXT, IN arg TEXT) RETURNS TEXT AS
$BODY$
SELECT
CASE
WHEN dp = 'month'::text THEN
to_char(arg::date, 'TMMonth')
-- '1969-12-28' is a Sunday
WHEN dp = 'dow'::text THEN
to_char(arg::date, 'TMDay')
ELSE
sys.datepart(dp, arg)::TEXT
END
$BODY$
STRICT
LANGUAGE sql IMMUTABLE;
CREATE OR REPLACE VIEW sys.spt_tablecollations_view AS
SELECT
o.object_id AS object_id,
o.schema_id AS schema_id,
c.column_id AS colid,
CASE WHEN p.attoptions[1] LIKE 'bbf_original_name=%' THEN split_part(p.attoptions[1], '=', 2)
ELSE c.name END AS name,
CAST(CollationProperty(c.collation_name,'tdscollation') AS binary(5)) AS tds_collation_28,
CAST(CollationProperty(c.collation_name,'tdscollation') AS binary(5)) AS tds_collation_90,
CAST(CollationProperty(c.collation_name,'tdscollation') AS binary(5)) AS tds_collation_100,
CAST(c.collation_name AS nvarchar(128)) AS collation_28,
CAST(c.collation_name AS nvarchar(128)) AS collation_90,
CAST(c.collation_name AS nvarchar(128)) AS collation_100
FROM
sys.all_columns c INNER JOIN
sys.all_objects o ON (c.object_id = o.object_id) JOIN
pg_attribute p ON (c.name = p.attname)
WHERE
c.is_sparse = 0 AND p.attnum >= 0;
GRANT SELECT ON sys.spt_tablecollations_view TO PUBLIC;
CREATE OR REPLACE PROCEDURE sys.sp_tablecollations_100
(
IN "@object" nvarchar(4000)
)
AS $$
BEGIN
select
s_tcv.colid AS colid,
s_tcv.name AS name,
s_tcv.tds_collation_100 AS tds_collation,
s_tcv.collation_100 AS collation
from
sys.spt_tablecollations_view s_tcv
where
s_tcv.object_id = sys.object_id(@object)
order by colid;
END;
$$
LANGUAGE 'pltsql';
CREATE OR REPLACE PROCEDURE sys.printarg(IN "@message" TEXT)
AS $$
BEGIN
PRINT @message;
END;
$$ LANGUAGE pltsql;
GRANT EXECUTE ON PROCEDURE sys.printarg(IN "@message" TEXT) TO PUBLIC;
CREATE OR REPLACE PROCEDURE sys.sp_updatestats(IN "@resample" VARCHAR(8) DEFAULT 'NO')
AS $$
BEGIN
IF sys.user_name() != 'dbo' THEN
RAISE EXCEPTION 'user does not have permission';
END IF;
IF lower("@resample") = 'resample' THEN
RAISE NOTICE 'ignoring resample option';
ELSIF lower("@resample") != 'no' THEN
RAISE EXCEPTION 'Invalid option name %', "@resample";
END IF;
ANALYZE VERBOSE;
CALL printarg('Statistics for all tables have been updated. Refer logs for details.');
END;
$$ LANGUAGE plpgsql;
GRANT EXECUTE on PROCEDURE sys.sp_updatestats(IN "@resample" VARCHAR(8)) TO PUBLIC;
-- internal function that returns relevant info needed
-- by sys.syscolumns view for all procedure parameters.
-- This separate function was needed to workaround BABEL-1597
CREATE FUNCTION sys.proc_param_helper()
RETURNS TABLE (
name sys.sysname,
id int,
xtype int,
colid smallint,
collationid int,
prec smallint,
scale int,
isoutparam int,
collation sys.sysname
)
AS
$$
BEGIN
RETURN QUERY
select params.parameter_name::sys.sysname
, pgproc.oid::int
, CAST(case when pgproc.proallargtypes is null then split_part(pgproc.proargtypes::varchar, ' ', params.ordinal_position)
else split_part(btrim(pgproc.proallargtypes::text,'{}'), ',', params.ordinal_position) end AS int)
, params.ordinal_position::smallint
, coll.oid::int
, params.numeric_precision::smallint
, params.numeric_scale::int
, case params.parameter_mode when 'OUT' then 1 when 'INOUT' then 1 else 0 end
, params.collation_name::sys.sysname
from information_schema.routines routine
left join information_schema.parameters params
on routine.specific_schema = params.specific_schema
and routine.specific_name = params.specific_name
left join pg_collation coll on coll.collname = params.collation_name
/* assuming routine.specific_name is constructed by concatenating procedure name and oid */
left join pg_proc pgproc on routine.specific_name = nameconcatoid(pgproc.proname, pgproc.oid)
where routine.routine_schema not in ('pg_catalog', 'information_schema')
and routine.routine_type = 'PROCEDURE';
END;
$$
LANGUAGE plpgsql;
CREATE OR REPLACE VIEW sys.syscolumns AS
SELECT out_name as name
, out_object_id as id
, out_system_type_id as xtype
, 0::sys.tinyint as typestat
, (case when out_user_type_id < 32767 then out_user_type_id else null end)::smallint as xusertype
, out_max_length as length
, 0::sys.tinyint as xprec
, 0::sys.tinyint as xscale
, out_column_id::smallint as colid
, 0::smallint as xoffset
, 0::sys.tinyint as bitpos
, 0::sys.tinyint as reserved
, 0::smallint as colstat
, out_default_object_id::int as cdefault
, out_rule_object_id::int as domain
, 0::smallint as number
, 0::smallint as colorder
, null::sys.varbinary(8000) as autoval
, out_offset as offset
, out_collation_id as collationid
, (case out_is_nullable::int when 1 then 8 else 0 end +
case out_is_identity::int when 1 then 128 else 0 end)::sys.tinyint as status
, out_system_type_id as type
, (case when out_user_type_id < 32767 then out_user_type_id else null end)::smallint as usertype
, null::varchar(255) as printfmt
, out_precision::smallint as prec
, out_scale::int as scale
, out_is_computed::int as iscomputed
, 0::int as isoutparam
, out_is_nullable::int as isnullable
, out_collation_name::sys.sysname as collation
FROM sys.columns_internal()
union all
SELECT p.name
, p.id
, p.xtype
, 0::sys.tinyint as typestat
, (case when p.xtype < 32767 then p.xtype else null end)::smallint as xusertype
, null as length
, 0::sys.tinyint as xprec
, 0::sys.tinyint as xscale
, p.colid
, 0::smallint as xoffset
, 0::sys.tinyint as bitpos
, 0::sys.tinyint as reserved
, 0::smallint as colstat
, null::int as cdefault
, null::int as domain
, 0::smallint as number
, 0::smallint as colorder
, null::sys.varbinary(8000) as autoval
, 0::smallint as offset
, collationid
, (case p.isoutparam when 1 then 64 else 0 end)::sys.tinyint as status
, p.xtype as type
, (case when p.xtype < 32767 then p.xtype else null end)::smallint as usertype
, null::varchar(255) as printfmt
, p.prec
, p.scale
, 0::int as iscomputed
, p.isoutparam
, 1::int as isnullable
, p.collation
FROM sys.proc_param_helper() as p;
GRANT SELECT ON sys.syscolumns TO PUBLIC;
-- Reset search_path to not affect any subsequent scripts
SELECT set_config('search_path', trim(leading 'sys, ' from current_setting('search_path')), false); | the_stack |
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for c_appendix
-- ----------------------------
DROP TABLE IF EXISTS `c_appendix`;
CREATE TABLE `c_appendix` (
`id` bigint(20) NOT NULL COMMENT 'ID',
`biz_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '业务id',
`biz_type` varchar(255) NOT NULL DEFAULT '' COMMENT '业务类型',
`file_type` varchar(255) DEFAULT NULL COMMENT '文件类型',
`bucket` varchar(255) DEFAULT '' COMMENT '桶',
`path` varchar(255) DEFAULT '' COMMENT '文件相对地址',
`original_file_name` varchar(255) DEFAULT '' COMMENT '原始文件名',
`content_type` varchar(255) DEFAULT '' COMMENT '文件类型',
`size` bigint(20) DEFAULT '0' COMMENT '大小',
`create_time` datetime NOT NULL COMMENT '创建时间',
`created_by` bigint(20) NOT NULL COMMENT '创建人',
`update_time` datetime NOT NULL COMMENT '最后修改时间',
`updated_by` bigint(20) NOT NULL COMMENT '最后修改人',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='业务附件';
-- ----------------------------
-- Table structure for c_application
-- ----------------------------
DROP TABLE IF EXISTS `c_application`;
CREATE TABLE `c_application` (
`id` bigint(20) NOT NULL COMMENT 'ID',
`client_id` varchar(24) DEFAULT '' COMMENT '客户端ID',
`client_secret` varchar(32) DEFAULT '' COMMENT '客户端密码',
`website` varchar(100) DEFAULT '' COMMENT '官网',
`name` varchar(255) NOT NULL DEFAULT '' COMMENT '应用名称',
`icon` varchar(255) DEFAULT '' COMMENT '应用图标',
`app_type` varchar(10) DEFAULT '' COMMENT '类型 \n#{SERVER:服务应用;APP:手机应用;PC:PC网页应用;WAP:手机网页应用}',
`describe_` varchar(200) DEFAULT '' COMMENT '备注',
`state` bit(1) DEFAULT b'1' COMMENT '状态',
`created_by` bigint(20) DEFAULT NULL COMMENT '创建人id',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`updated_by` bigint(20) DEFAULT NULL COMMENT '更新人id',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE KEY `uk_client_id` (`client_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='应用';
-- ----------------------------
-- Table structure for c_area
-- ----------------------------
DROP TABLE IF EXISTS `c_area`;
CREATE TABLE `c_area` (
`id` bigint(20) NOT NULL COMMENT 'id',
`code` varchar(64) NOT NULL COMMENT '编码',
`label` varchar(255) NOT NULL COMMENT '名称',
`full_name` varchar(255) DEFAULT '' COMMENT '全名',
`sort_value` int(10) DEFAULT '1' COMMENT '排序',
`longitude` varchar(255) DEFAULT '' COMMENT '经度',
`latitude` varchar(255) DEFAULT '' COMMENT '维度',
`level` varchar(10) DEFAULT '' COMMENT '行政区级 \n@Echo(api = DICTIONARY_ITEM_CLASS, dictType = DictionaryType.AREA_LEVEL)',
`source_` varchar(255) DEFAULT '' COMMENT '数据来源',
`state` bit(1) DEFAULT b'0' COMMENT '状态',
`parent_id` bigint(20) DEFAULT '0' COMMENT '父ID',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`created_by` bigint(20) DEFAULT NULL COMMENT '创建人',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
`updated_by` bigint(20) DEFAULT NULL COMMENT '更新人',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE KEY `uk_code` (`code`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='地区表';
-- ----------------------------
-- Table structure for c_attachment
-- ----------------------------
DROP TABLE IF EXISTS `c_attachment`;
CREATE TABLE `c_attachment` (
`id` bigint(20) NOT NULL COMMENT 'ID',
`biz_id` varchar(255) DEFAULT NULL COMMENT '业务ID',
`biz_type` varchar(255) DEFAULT '' COMMENT '业务类型 \n#AttachmentType',
`file_type` varchar(255) DEFAULT NULL COMMENT '文件类型',
`storage_type` varchar(255) DEFAULT NULL COMMENT '存储类型\nLOCAL FAST_DFS MIN_IO ALI \n',
`group_` varchar(255) DEFAULT '' COMMENT 'FastDFS中的组 MinIO中的bucket\n用于FastDFS 或 MinIO',
`path` varchar(255) DEFAULT '' COMMENT 'FastDFS的远程文件名 MinIO的文件路径\n用于FastDFS 和MinIO',
`url` varchar(500) DEFAULT '' COMMENT '文件访问链接\n需要通过nginx配置路由,才能访问',
`unique_file_name` varchar(255) DEFAULT '' COMMENT '唯一文件名\nUUID规则',
`file_md5` varchar(255) DEFAULT '' COMMENT '文件md5值',
`original_file_name` varchar(255) DEFAULT '' COMMENT '原始文件名',
`content_type` varchar(255) DEFAULT '' COMMENT '文件原始类型',
`ext` varchar(64) DEFAULT '' COMMENT '后缀\n',
`size` bigint(20) DEFAULT '0' COMMENT '文件大小',
`org_id` bigint(20) DEFAULT NULL COMMENT '组织\n#c_org',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`created_by` bigint(20) DEFAULT NULL COMMENT '创建人',
`update_time` datetime DEFAULT NULL COMMENT '最后修改时间',
`updated_by` bigint(20) DEFAULT NULL COMMENT '最后修改人',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='附件';
-- ----------------------------
-- Table structure for c_dict
-- ----------------------------
DROP TABLE IF EXISTS `c_dict`;
CREATE TABLE `c_dict` (
`id` bigint(20) NOT NULL COMMENT 'ID',
`parent_id` bigint(20) DEFAULT NULL COMMENT '字典ID',
`key` varchar(255) NOT NULL COMMENT '字典标识',
`name` varchar(255) NOT NULL DEFAULT '' COMMENT '字典名称',
`item_key` varchar(255) NOT NULL COMMENT '字典项标识',
`item_name` varchar(255) NOT NULL COMMENT '字典项名称',
`state` bit(1) DEFAULT b'1' COMMENT '状态',
`describe_` varchar(255) DEFAULT '' COMMENT '描述',
`sort_value` int(10) DEFAULT '1' COMMENT '排序',
`icon` varchar(255) DEFAULT '' COMMENT '图标',
`css_style` varchar(255) DEFAULT '' COMMENT 'css样式',
`css_class` varchar(255) DEFAULT '' COMMENT 'css class',
`readonly_` bit(1) DEFAULT b'0' COMMENT '内置',
`created_by` bigint(20) DEFAULT NULL COMMENT '创建人id',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`updated_by` bigint(20) DEFAULT NULL COMMENT '更新人id',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE KEY `uk_type_code` (`key`,`item_key`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='字典项';
-- ----------------------------
-- Table structure for c_dictionary
-- ----------------------------
DROP TABLE IF EXISTS `c_dictionary`;
CREATE TABLE `c_dictionary` (
`id` bigint(20) NOT NULL COMMENT 'ID',
`type` varchar(255) NOT NULL COMMENT '类型',
`label` varchar(255) NOT NULL DEFAULT '' COMMENT '类型标签',
`code` varchar(64) NOT NULL COMMENT '编码',
`name` varchar(64) NOT NULL COMMENT '名称',
`state` bit(1) DEFAULT b'1' COMMENT '状态',
`describe_` varchar(255) DEFAULT '' COMMENT '描述',
`sort_value` int(10) DEFAULT '1' COMMENT '排序',
`icon` varchar(255) DEFAULT '' COMMENT '图标',
`css_style` varchar(255) DEFAULT '' COMMENT 'css样式',
`css_class` varchar(255) DEFAULT '' COMMENT 'css class',
`readonly_` bit(1) DEFAULT b'0' COMMENT '内置',
`created_by` bigint(20) DEFAULT NULL COMMENT '创建人id',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`updated_by` bigint(20) DEFAULT NULL COMMENT '更新人id',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE KEY `uk_type_code` (`type`,`code`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='字典项';
-- ----------------------------
-- Table structure for c_file
-- ----------------------------
DROP TABLE IF EXISTS `c_file`;
CREATE TABLE `c_file` (
`id` bigint(20) NOT NULL COMMENT 'ID',
`biz_type` varchar(255) NOT NULL DEFAULT '' COMMENT '业务类型',
`file_type` varchar(255) DEFAULT NULL COMMENT '文件类型',
`storage_type` varchar(255) DEFAULT NULL COMMENT '存储类型\nLOCAL FAST_DFS MIN_IO ALI \n',
`bucket` varchar(255) DEFAULT '' COMMENT '桶',
`path` varchar(255) DEFAULT '' COMMENT '文件相对地址',
`url` varchar(255) DEFAULT NULL COMMENT '文件访问地址',
`unique_file_name` varchar(255) DEFAULT '' COMMENT '唯一文件名',
`file_md5` varchar(255) DEFAULT NULL COMMENT '文件md5',
`original_file_name` varchar(255) DEFAULT '' COMMENT '原始文件名',
`content_type` varchar(255) DEFAULT '' COMMENT '文件类型',
`suffix` varchar(255) DEFAULT '' COMMENT '后缀',
`size` bigint(20) DEFAULT '0' COMMENT '大小',
`create_time` datetime NOT NULL COMMENT '创建时间',
`created_by` bigint(20) NOT NULL COMMENT '创建人',
`update_time` datetime NOT NULL COMMENT '最后修改时间',
`updated_by` bigint(20) NOT NULL COMMENT '最后修改人',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='增量文件上传日志';
-- ----------------------------
-- Table structure for c_login_log
-- ----------------------------
DROP TABLE IF EXISTS `c_login_log`;
CREATE TABLE `c_login_log` (
`id` bigint(20) NOT NULL COMMENT '主键',
`request_ip` varchar(50) DEFAULT '' COMMENT '登录IP',
`user_id` bigint(20) DEFAULT NULL COMMENT '登录人ID',
`user_name` varchar(50) DEFAULT '' COMMENT '登录人姓名',
`account` varchar(30) DEFAULT '' COMMENT '登录人账号',
`description` varchar(255) DEFAULT '' COMMENT '登录描述',
`login_date` char(10) DEFAULT '' COMMENT '登录时间',
`ua` varchar(500) DEFAULT '' COMMENT '浏览器请求头',
`browser` varchar(255) DEFAULT '' COMMENT '浏览器名称',
`browser_version` varchar(255) DEFAULT '' COMMENT '浏览器版本',
`operating_system` varchar(255) DEFAULT '' COMMENT '操作系统',
`location` varchar(50) DEFAULT '' COMMENT '登录地点',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`created_by` bigint(20) DEFAULT NULL COMMENT '创建人',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='登录日志';
-- ----------------------------
-- Table structure for c_menu
-- ----------------------------
DROP TABLE IF EXISTS `c_menu`;
CREATE TABLE `c_menu` (
`id` bigint(20) NOT NULL COMMENT 'ID',
`label` varchar(20) NOT NULL DEFAULT '' COMMENT '名称',
`describe_` varchar(200) DEFAULT '' COMMENT '描述',
`is_general` bit(1) DEFAULT b'0' COMMENT '通用菜单 \nTrue表示无需分配所有人就可以访问的',
`path` varchar(255) DEFAULT '' COMMENT '路径',
`component` varchar(255) DEFAULT '' COMMENT '组件',
`state` bit(1) DEFAULT b'1' COMMENT '状态',
`sort_value` int(10) DEFAULT '1' COMMENT '排序',
`icon` varchar(255) DEFAULT '' COMMENT '菜单图标',
`group_` varchar(20) DEFAULT '' COMMENT '分组',
`parent_id` bigint(20) DEFAULT '0' COMMENT '父级菜单ID',
`readonly_` bit(1) DEFAULT b'0' COMMENT '内置',
`created_by` bigint(20) DEFAULT NULL COMMENT '创建人id',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`updated_by` bigint(20) DEFAULT NULL COMMENT '更新人id',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE KEY `uk_path` (`path`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='菜单';
-- ----------------------------
-- Table structure for c_opt_log
-- ----------------------------
DROP TABLE IF EXISTS `c_opt_log`;
CREATE TABLE `c_opt_log` (
`id` bigint(20) NOT NULL COMMENT '主键',
`request_ip` varchar(50) DEFAULT '' COMMENT '操作IP',
`type` varchar(5) DEFAULT '' COMMENT '日志类型 \n#LogType{OPT:操作类型;EX:异常类型}',
`user_name` varchar(50) DEFAULT '' COMMENT '操作人',
`description` varchar(255) DEFAULT '' COMMENT '操作描述',
`class_path` varchar(255) DEFAULT '' COMMENT '类路径',
`action_method` varchar(50) DEFAULT '' COMMENT '请求方法',
`request_uri` varchar(50) DEFAULT '' COMMENT '请求地址',
`http_method` varchar(10) DEFAULT '' COMMENT '请求类型 \n#HttpMethod{GET:GET请求;POST:POST请求;PUT:PUT请求;DELETE:DELETE请求;PATCH:PATCH请求;TRACE:TRACE请求;HEAD:HEAD请求;OPTIONS:OPTIONS请求;}',
`start_time` timestamp NULL DEFAULT NULL COMMENT '开始时间',
`finish_time` timestamp NULL DEFAULT NULL COMMENT '完成时间',
`consuming_time` bigint(20) DEFAULT NULL COMMENT '消耗时间',
`ua` varchar(500) DEFAULT '' COMMENT '浏览器',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`created_by` bigint(20) DEFAULT NULL COMMENT '创建人',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='系统日志';
-- ----------------------------
-- Table structure for c_opt_log_ext
-- ----------------------------
DROP TABLE IF EXISTS `c_opt_log_ext`;
CREATE TABLE `c_opt_log_ext` (
`id` bigint(20) NOT NULL COMMENT '主键',
`params` longtext COMMENT '请求参数',
`result` longtext COMMENT '返回值',
`ex_detail` longtext COMMENT '异常描述',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`created_by` bigint(20) DEFAULT NULL COMMENT '创建人',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='系统日志扩展';
-- ----------------------------
-- Table structure for c_org
-- ----------------------------
DROP TABLE IF EXISTS `c_org`;
CREATE TABLE `c_org` (
`id` bigint(20) NOT NULL COMMENT 'ID',
`label` varchar(255) NOT NULL COMMENT '名称',
`type_` char(2) DEFAULT '' COMMENT '类型 \n@Echo(api = DICTIONARY_ITEM_CLASS, dictType = DictionaryType.ORG_TYPE)',
`abbreviation` varchar(255) DEFAULT '' COMMENT '简称',
`parent_id` bigint(20) DEFAULT '0' COMMENT '父ID',
`tree_path` varchar(255) DEFAULT '' COMMENT '树结构',
`sort_value` int(10) DEFAULT '1' COMMENT '排序',
`state` bit(1) DEFAULT b'1' COMMENT '状态',
`describe_` varchar(255) DEFAULT '' COMMENT '描述',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`created_by` bigint(20) DEFAULT NULL COMMENT '创建人',
`update_time` datetime DEFAULT NULL COMMENT '修改时间',
`updated_by` bigint(20) DEFAULT NULL COMMENT '修改人',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE KEY `uk_name` (`label`) USING HASH,
FULLTEXT KEY `fu_path` (`tree_path`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='组织';
-- ----------------------------
-- Table structure for c_parameter
-- ----------------------------
DROP TABLE IF EXISTS `c_parameter`;
CREATE TABLE `c_parameter` (
`id` bigint(20) NOT NULL COMMENT 'ID',
`key_` varchar(255) NOT NULL COMMENT '参数键',
`value` varchar(255) NOT NULL COMMENT '参数值',
`name` varchar(255) NOT NULL COMMENT '参数名称',
`describe_` varchar(255) DEFAULT '' COMMENT '描述',
`state` bit(1) DEFAULT b'1' COMMENT '状态',
`readonly_` bit(1) DEFAULT b'0' COMMENT '内置',
`created_by` bigint(20) DEFAULT NULL COMMENT '创建人id',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`updated_by` bigint(20) DEFAULT NULL COMMENT '更新人id',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE KEY `uk_key` (`key_`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='参数配置';
-- ----------------------------
-- Table structure for c_resource
-- ----------------------------
DROP TABLE IF EXISTS `c_resource`;
CREATE TABLE `c_resource` (
`id` bigint(20) NOT NULL COMMENT 'ID',
`code` varchar(500) DEFAULT '' COMMENT '编码',
`name` varchar(255) NOT NULL DEFAULT '' COMMENT '名称',
`menu_id` bigint(20) DEFAULT NULL COMMENT '菜单\n#c_menu',
`describe_` varchar(255) DEFAULT '' COMMENT '描述',
`readonly_` bit(1) DEFAULT b'1' COMMENT '内置',
`created_by` bigint(20) DEFAULT NULL COMMENT '创建人id',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`updated_by` bigint(20) DEFAULT NULL COMMENT '更新人id',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE KEY `uk_code` (`code`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='资源';
-- ----------------------------
-- Table structure for c_role
-- ----------------------------
DROP TABLE IF EXISTS `c_role`;
CREATE TABLE `c_role` (
`id` bigint(20) NOT NULL COMMENT 'ID',
`name` varchar(30) NOT NULL DEFAULT '' COMMENT '名称',
`code` varchar(20) DEFAULT '' COMMENT '编码',
`describe_` varchar(100) DEFAULT '' COMMENT '描述',
`state` bit(1) DEFAULT b'1' COMMENT '状态',
`readonly_` bit(1) DEFAULT b'0' COMMENT '内置角色',
`ds_type` varchar(20) NOT NULL DEFAULT '' COMMENT '数据权限 \n#DataScopeType{ALL:1,全部;THIS_LEVEL:2,本级;THIS_LEVEL_CHILDREN:3,本级以及子级;CUSTOMIZE:4,自定义;SELF:5,个人;}',
`created_by` bigint(20) DEFAULT NULL COMMENT '创建人id',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`updated_by` bigint(20) DEFAULT NULL COMMENT '更新人id',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE KEY `uk_code` (`code`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='角色';
-- ----------------------------
-- Table structure for c_role_authority
-- ----------------------------
DROP TABLE IF EXISTS `c_role_authority`;
CREATE TABLE `c_role_authority` (
`id` bigint(20) NOT NULL COMMENT '主键',
`authority_id` bigint(20) NOT NULL COMMENT '资源id \n#c_resource #c_menu',
`authority_type` varchar(10) NOT NULL COMMENT '权限类型 \n#AuthorizeType{MENU:菜单;RESOURCE:资源;}',
`role_id` bigint(20) NOT NULL COMMENT '角色id \n#c_role',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`created_by` bigint(20) DEFAULT NULL COMMENT '创建人',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE KEY `uk_role_authority` (`authority_id`,`authority_type`,`role_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='角色的资源';
-- ----------------------------
-- Table structure for c_role_org
-- ----------------------------
DROP TABLE IF EXISTS `c_role_org`;
CREATE TABLE `c_role_org` (
`id` bigint(20) NOT NULL COMMENT 'ID',
`role_id` bigint(20) NOT NULL COMMENT '角色\n#c_role',
`org_id` bigint(20) NOT NULL COMMENT '部门\n#c_org',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`created_by` bigint(20) DEFAULT NULL COMMENT '创建人',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE KEY `uk_role_org` (`org_id`,`role_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='角色组织关系';
-- ----------------------------
-- Table structure for c_station
-- ----------------------------
DROP TABLE IF EXISTS `c_station`;
CREATE TABLE `c_station` (
`id` bigint(20) NOT NULL COMMENT 'ID',
`name` varchar(255) NOT NULL DEFAULT '' COMMENT '名称',
`org_id` bigint(20) DEFAULT NULL COMMENT '组织\n#c_org\n@Echo(api = ORG_ID_CLASS, beanClass = Org.class)',
`state` bit(1) DEFAULT b'1' COMMENT '状态',
`describe_` varchar(255) DEFAULT '' COMMENT '描述',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`created_by` bigint(20) DEFAULT NULL COMMENT '创建人',
`update_time` datetime DEFAULT NULL COMMENT '修改时间',
`updated_by` bigint(20) DEFAULT NULL COMMENT '修改人',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE KEY `uk_name` (`name`) USING HASH
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='岗位';
-- ----------------------------
-- Table structure for c_user
-- ----------------------------
DROP TABLE IF EXISTS `c_user`;
CREATE TABLE `c_user` (
`id` bigint(20) NOT NULL COMMENT 'ID',
`account` varchar(30) NOT NULL DEFAULT '' COMMENT '账号',
`name` varchar(50) NOT NULL DEFAULT '' COMMENT '姓名',
`org_id` bigint(20) DEFAULT NULL COMMENT '组织\n#c_org\n@Echo(api = ORG_ID_CLASS, beanClass = Org.class)',
`station_id` bigint(20) DEFAULT NULL COMMENT '岗位\n#c_station\n@Echo(api = STATION_ID_CLASS)',
`readonly` bit(1) NOT NULL DEFAULT b'0' COMMENT '内置',
`email` varchar(255) DEFAULT '' COMMENT '邮箱',
`mobile` varchar(20) DEFAULT '' COMMENT '手机',
`sex` varchar(1) DEFAULT '' COMMENT '性别 \n#Sex{W:女;M:男;N:未知}',
`state` bit(1) DEFAULT b'1' COMMENT '状态',
`avatar` varchar(255) DEFAULT '' COMMENT '头像',
`nation` char(2) DEFAULT '' COMMENT '民族 \n@Echo(api = DICTIONARY_ITEM_CLASS, dictType = DictionaryType.NATION)',
`education` char(2) DEFAULT '' COMMENT '学历 \n@Echo(api = DICTIONARY_ITEM_CLASS, dictType = DictionaryType.EDUCATION)',
`position_status` char(2) DEFAULT '' COMMENT '职位状态 \n@Echo(api = DICTIONARY_ITEM_CLASS, dictType = DictionaryType.POSITION_STATUS)',
`work_describe` varchar(255) DEFAULT '' COMMENT '工作描述',
`password_error_last_time` datetime DEFAULT NULL COMMENT '最后一次输错密码时间',
`password_error_num` int(10) DEFAULT '0' COMMENT '密码错误次数',
`password_expire_time` datetime DEFAULT NULL COMMENT '密码过期时间',
`password` varchar(64) NOT NULL DEFAULT '' COMMENT '密码',
`salt` varchar(20) NOT NULL DEFAULT '' COMMENT '密码盐',
`last_login_time` datetime DEFAULT NULL COMMENT '最后登录时间',
`created_by` bigint(20) DEFAULT NULL COMMENT '创建人id',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`updated_by` bigint(20) DEFAULT NULL COMMENT '更新人id',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE KEY `uk_account` (`account`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户';
-- ----------------------------
-- Table structure for c_user_role
-- ----------------------------
DROP TABLE IF EXISTS `c_user_role`;
CREATE TABLE `c_user_role` (
`id` bigint(20) NOT NULL COMMENT 'ID',
`role_id` bigint(20) NOT NULL COMMENT '角色\n#c_role',
`user_id` bigint(20) NOT NULL COMMENT '用户\n#c_user',
`created_by` bigint(20) DEFAULT NULL COMMENT '创建人ID',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE KEY `uk_user_role` (`role_id`,`user_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='角色分配\n账号角色绑定';
-- ----------------------------
-- Table structure for b_order
-- ----------------------------
DROP TABLE IF EXISTS `b_order`;
CREATE TABLE `b_order` (
`id` bigint(20) NOT NULL COMMENT 'ID',
`name` varchar(255) DEFAULT NULL COMMENT '名称',
`education` varchar(255) DEFAULT NULL COMMENT '学历 \n@Echo(api = "orderServiceImpl", dictType = DictionaryType.EDUCATION)',
`nation` varchar(255) DEFAULT NULL COMMENT '民族 \n@Echo(api = DICTIONARY_ITEM_FEIGN_CLASS, dictType = DictionaryType.NATION)',
`org_id` bigint(20) DEFAULT NULL COMMENT '组织ID \n#c_org@Echo(api = ORG_ID_FEIGN_CLASS)',
`code` varchar(255) DEFAULT NULL COMMENT '编号',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`created_by` bigint(20) DEFAULT NULL COMMENT '创建人',
`update_time` datetime DEFAULT NULL COMMENT '修改时间',
`updated_by` bigint(20) DEFAULT NULL COMMENT '修改人',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='订单';
-- ----------------------------
-- Table structure for b_product
-- ----------------------------
DROP TABLE IF EXISTS `b_product`;
CREATE TABLE `b_product` (
`id` bigint(20) NOT NULL COMMENT 'ID',
`name` varchar(24) NOT NULL COMMENT '名称',
`stock` int(10) NOT NULL COMMENT '库存',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`created_by` bigint(20) DEFAULT NULL COMMENT '创建人',
`update_time` datetime DEFAULT NULL COMMENT '修改时间',
`updated_by` bigint(20) DEFAULT NULL COMMENT '修改人',
`type_` text COMMENT '商品类型 \n#ProductType{ordinary:普通;gift:赠品}',
`type2` longtext COMMENT '商品类型2 \n#{ordinary:普通;gift:赠品;}',
`type3` varchar(255) DEFAULT NULL COMMENT '学历 \n@Echo(api = DICTIONARY_ITEM_FEIGN_CLASS, dictType = DictionaryType.EDUCATION)',
`state` bit(1) DEFAULT NULL COMMENT '状态',
`test4` tinyint(3) DEFAULT NULL COMMENT '测试',
`test5` date DEFAULT NULL COMMENT '时间',
`test6` datetime DEFAULT NULL COMMENT '日期',
`parent_id` bigint(20) DEFAULT NULL COMMENT '父id',
`label` varchar(255) DEFAULT NULL COMMENT '名称',
`sort_value` int(10) DEFAULT NULL COMMENT '排序',
`test7` char(10) DEFAULT NULL COMMENT '测试字段 \n@InjectionField(api = "userApi") RemoteData<Long, String>',
`user_id` bigint(20) DEFAULT NULL COMMENT '用户 \n@Echo(api = USER_ID_FEIGN_CLASS)',
`org_id` bigint(20) DEFAULT NULL COMMENT '组织 \n@Echo(api = ORG_ID_FEIGN_CLASS)',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='商品';
-- ----------------------------
-- Table structure for e_block_list
-- ----------------------------
DROP TABLE IF EXISTS `e_block_list`;
CREATE TABLE `e_block_list` (
`id` bigint(20) NOT NULL COMMENT 'ID',
`ip` varchar(20) DEFAULT '' COMMENT '阻止访问ip',
`request_uri` varchar(255) DEFAULT '' COMMENT '请求URI',
`request_method` varchar(10) DEFAULT '' COMMENT '请求方法 \n如果为ALL则表示对所有方法生效',
`limit_start` varchar(8) DEFAULT '' COMMENT '限制时间起',
`limit_end` varchar(8) DEFAULT '' COMMENT '限制时间止',
`state` bit(1) DEFAULT b'0' COMMENT '状态',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`created_by` bigint(20) DEFAULT NULL COMMENT '创建人',
`update_time` datetime DEFAULT NULL COMMENT '修改时间',
`updated_by` bigint(20) DEFAULT NULL COMMENT '修改人',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='阻止访问';
-- ----------------------------
-- Table structure for e_msg
-- ----------------------------
DROP TABLE IF EXISTS `e_msg`;
CREATE TABLE `e_msg` (
`id` bigint(20) NOT NULL COMMENT 'ID',
`biz_id` varchar(64) DEFAULT '' COMMENT '业务ID',
`biz_type` varchar(64) DEFAULT '' COMMENT '业务类型 \n#MsgBizType{USER_LOCK:账号锁定;USER_REG:账号申请;WORK_APPROVAL:考勤审批;}',
`msg_type` varchar(20) NOT NULL COMMENT '消息类型 \n#MsgType{WAIT:待办;NOTIFY:通知;PUBLICITY:公告;WARN:预警;}',
`title` varchar(255) DEFAULT '' COMMENT '标题',
`content` text COMMENT '内容',
`author` varchar(50) DEFAULT '' COMMENT '发布人',
`handler_url` varchar(255) DEFAULT '' COMMENT '处理地址 \n以http开头时直接跳转,否则与#c_application表拼接后跳转http可带参数',
`handler_params` varchar(500) DEFAULT '' COMMENT '处理参数',
`is_single_handle` bit(1) DEFAULT b'1' COMMENT '是否单人处理',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`created_by` bigint(20) DEFAULT NULL COMMENT '创建人id',
`update_time` datetime DEFAULT NULL COMMENT '最后修改时间',
`updated_by` bigint(20) DEFAULT NULL COMMENT '最后修改人',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='消息表';
-- ----------------------------
-- Table structure for e_msg_receive
-- ----------------------------
DROP TABLE IF EXISTS `e_msg_receive`;
CREATE TABLE `e_msg_receive` (
`id` bigint(20) NOT NULL COMMENT 'ID',
`msg_id` bigint(20) NOT NULL COMMENT '消息ID \n#msg',
`user_id` bigint(20) NOT NULL COMMENT '接收人ID \n#c_user',
`is_read` bit(1) DEFAULT b'0' COMMENT '是否已读',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`created_by` bigint(20) DEFAULT NULL COMMENT '创建人',
`update_time` datetime DEFAULT NULL COMMENT '最后修改时间',
`updated_by` bigint(20) DEFAULT NULL COMMENT '最后修改人',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='消息接收表';
-- ----------------------------
-- Table structure for e_rate_limiter
-- ----------------------------
DROP TABLE IF EXISTS `e_rate_limiter`;
CREATE TABLE `e_rate_limiter` (
`id` bigint(20) NOT NULL COMMENT 'ID',
`count` int(10) DEFAULT '0' COMMENT '次数',
`request_uri` varchar(255) DEFAULT '' COMMENT '请求URI',
`request_method` varchar(10) DEFAULT '' COMMENT '请求方法 \n如果为ALL则表示对所有方法生效',
`limit_start` varchar(8) DEFAULT '' COMMENT '限制时间起',
`limit_end` varchar(8) DEFAULT '' COMMENT '限制时间止',
`state` bit(1) DEFAULT b'0' COMMENT '状态',
`interval_sec` bigint(20) DEFAULT '0' COMMENT '时间窗口',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`created_by` bigint(20) DEFAULT NULL COMMENT '创建人',
`update_time` datetime DEFAULT NULL COMMENT '修改时间',
`updated_by` bigint(20) DEFAULT NULL COMMENT '修改人',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='限流';
-- ----------------------------
-- Table structure for e_sms_send_status
-- ----------------------------
DROP TABLE IF EXISTS `e_sms_send_status`;
CREATE TABLE `e_sms_send_status` (
`id` bigint(20) NOT NULL COMMENT 'ID',
`task_id` bigint(20) NOT NULL COMMENT '任务ID \n#e_sms_task',
`send_status` varchar(10) NOT NULL COMMENT '发送状态 \n#SendStatus{WAITING:等待发送;SUCCESS:发送成功;FAIL:发送失败}',
`tel_num` varchar(20) NOT NULL COMMENT '接收者手机\n单个手机号 \n阿里:发送回执ID,可根据该ID查询具体的发送状态 腾讯:sid 标识本次发送id,标识一次短信下发记录 百度:requestId 短信发送请求唯一流水ID',
`biz_id` varchar(255) DEFAULT '' COMMENT '发送回执ID',
`ext` varchar(255) DEFAULT '' COMMENT '发送返回 \n阿里:RequestId 请求ID 腾讯:ext:用户的session内容,腾讯server回包中会原样返回 百度:无',
`code` varchar(255) DEFAULT '' COMMENT '状态码 \n阿里:返回OK代表请求成功,其他错误码详见错误码列表 腾讯:0表示成功(计费依据),非0表示失败 百度:1000 表示成功',
`message` varchar(500) DEFAULT '' COMMENT '状态码的描述',
`fee` int(10) DEFAULT NULL COMMENT '短信计费的条数\n腾讯专用',
`created_by` bigint(20) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`updated_by` bigint(20) DEFAULT NULL COMMENT '最后修改人',
`update_time` datetime DEFAULT NULL COMMENT '最后修改时间',
PRIMARY KEY (`id`) USING BTREE,
KEY `task_id_tel_num` (`task_id`,`tel_num`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='短信发送状态';
-- ----------------------------
-- Table structure for e_sms_task
-- ----------------------------
DROP TABLE IF EXISTS `e_sms_task`;
CREATE TABLE `e_sms_task` (
`id` bigint(20) NOT NULL COMMENT '短信记录ID',
`template_id` bigint(20) NOT NULL COMMENT '短信模板\n@Echo(api = SMS_TEMPLATE_ID_CLASS)\n#e_sms_template',
`status` varchar(10) DEFAULT '' COMMENT '执行状态 \n(手机号具体发送状态看sms_send_status表) \n#TaskStatus{WAITING:等待执行;SUCCESS:执行成功;FAIL:执行失败}',
`source_type` varchar(10) DEFAULT '' COMMENT '发送渠道\n#SourceType{APP:应用;SERVICE:服务}',
`topic` varchar(255) DEFAULT '' COMMENT '主题',
`template_params` varchar(500) DEFAULT '' COMMENT '参数 \n需要封装为{‘key’:’value’, ...}格式且key必须有序',
`send_time` datetime DEFAULT NULL COMMENT '发送时间',
`content` varchar(500) DEFAULT '' COMMENT '发送内容 \n需要封装正确格式化: 您好,张三,您有一个新的快递。',
`draft` bit(1) DEFAULT b'0' COMMENT '是否草稿',
`created_by` bigint(20) DEFAULT NULL COMMENT '创建人ID',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`updated_by` bigint(20) DEFAULT NULL COMMENT '最后修改人',
`update_time` datetime DEFAULT NULL COMMENT '最后修改时间',
PRIMARY KEY (`id`) USING BTREE,
KEY `tempate_id_topic_content` (`template_id`,`topic`,`content`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='发送任务';
-- ----------------------------
-- Table structure for e_sms_template
-- ----------------------------
DROP TABLE IF EXISTS `e_sms_template`;
CREATE TABLE `e_sms_template` (
`id` bigint(20) NOT NULL COMMENT '模板ID',
`provider_type` varchar(10) NOT NULL DEFAULT '' COMMENT '供应商类型 \n#ProviderType{ALI:OK,阿里云短信;TENCENT:0,腾讯云短信;BAIDU:1000,百度云短信}',
`app_id` varchar(255) NOT NULL DEFAULT '' COMMENT '应用ID',
`app_secret` varchar(255) NOT NULL DEFAULT '' COMMENT '应用密码',
`url` varchar(255) DEFAULT '' COMMENT 'SMS服务域名 \n百度、其他厂商会用',
`name` varchar(255) DEFAULT '' COMMENT '模板名称',
`content` varchar(255) NOT NULL DEFAULT '' COMMENT '模板内容',
`template_params` varchar(255) NOT NULL DEFAULT '' COMMENT '模板参数',
`template_code` varchar(50) NOT NULL DEFAULT '' COMMENT '模板编码',
`sign_name` varchar(100) DEFAULT '' COMMENT '签名',
`template_describe` varchar(255) DEFAULT '' COMMENT '备注',
`created_by` bigint(20) DEFAULT NULL COMMENT '创建人ID',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`updated_by` bigint(20) DEFAULT NULL COMMENT '最后修改人',
`update_time` datetime DEFAULT NULL COMMENT '最后修改时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='短信模板';
-- ----------------------------
-- Table structure for undo_log
-- ----------------------------
DROP TABLE IF EXISTS `undo_log`;
CREATE TABLE `undo_log` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'increment id',
`branch_id` bigint(20) NOT NULL COMMENT 'branch transaction id',
`xid` varchar(100) NOT NULL COMMENT 'global transaction id',
`context` varchar(128) NOT NULL COMMENT 'undo_log context,such as serialization',
`rollback_info` longblob NOT NULL COMMENT 'rollback info',
`log_status` int(11) NOT NULL COMMENT '0:normal status,1:defense status',
`log_created` datetime(6) NOT NULL COMMENT 'create datetime',
`log_modified` datetime(6) NOT NULL COMMENT 'modify datetime',
PRIMARY KEY (`id`),
UNIQUE KEY `ux_undo_log` (`xid`,`branch_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='AT transaction mode undo table';
SET FOREIGN_KEY_CHECKS = 1; | the_stack |
-- Using the convention of a double-underscore prefix to denote a temp table.
/*
* ====================================
* Gather label key, value info
* ====================================
*/
DROP TABLE IF EXISTS hive.{{schema | sqlsafe}}.__label_summary_gather_{{uuid | sqlsafe}};
CREATE TABLE hive.{{schema | sqlsafe}}.__label_summary_gather_{{uuid | sqlsafe}} (
interval_start timestamp,
namespace varchar,
node varchar,
label_key varchar,
label_value varchar
)
;
/*
* Gather pod labels with node labels
*/
INSERT INTO hive.{{schema | sqlsafe}}.__label_summary_gather_{{uuid | sqlsafe}} (
interval_start,
namespace,
node,
label_key,
label_value
)
SELECT pl.interval_start,
pl.namespace,
pl.node,
pl.label_key,
pl.label_value
FROM (
SELECT u.interval_start,
u.namespace,
u.node,
l.label_key,
l.label_value
FROM (
SELECT opu.interval_start,
opu.namespace,
opu.node,
opu.pod_labels as "labels"
FROM hive.{{schema | sqlsafe}}.openshift_pod_usage_line_items opu
WHERE opu.source = {{source}}
AND opu.year = {{year}}
AND opu.month = {{month}}
AND opu.interval_start >= TIMESTAMP {{start_date}}
AND opu.interval_start < date_add('day', 1, TIMESTAMP {{end_date}})
UNION
SELECT nl.interval_start,
opu1.namespace,
nl.node,
nl.node_labels as "labels"
FROM hive.{{schema | sqlsafe}}.openshift_node_labels_line_items nl
JOIN hive.{{schema | sqlsafe}}.openshift_pod_usage_line_items opu1
ON opu1.interval_start = nl.interval_start
AND opu1.node = nl.node
WHERE nl.source = {{source}}
AND nl.year = {{year}}
AND nl.month = {{month}}
AND nl.interval_start >= TIMESTAMP {{start_date}}
AND nl.interval_start < date_add('day', 1, TIMESTAMP {{end_date}})
AND nl.node_labels != '{}'
) as "u",
unnest(cast(json_parse(u.labels) as map(varchar, varchar))) as l(label_key, label_value)
) as "pl"
;
/*
* Gather volume and volume claim labels with node labels
*/
INSERT INTO hive.{{schema | sqlsafe}}.__label_summary_gather_{{uuid | sqlsafe}} (
interval_start,
namespace,
node,
label_key,
label_value
)
SELECT vl.interval_start,
vl.namespace,
vl.node,
vl.label_key,
vl.label_value
FROM (
SELECT u.interval_start,
u.namespace,
u.node,
l.label_key,
l.label_value
FROM (
SELECT ops.interval_start,
ops.namespace,
opu.node,
ops.persistentvolume_labels as "labels"
FROM hive.{{schema | sqlsafe}}.openshift_storage_usage_line_items ops
JOIN hive.{{schema | sqlsafe}}.openshift_pod_usage_line_items opu
ON opu.interval_start = ops.interval_start
AND opu.namespace = ops.namespace
AND opu.pod = ops.pod
WHERE ops.source = {{source}}
AND ops.year = {{year}}
AND ops.month = {{month}}
AND ops.interval_start >= TIMESTAMP {{start_date}}
AND ops.interval_start < date_add('day', 1, TIMESTAMP {{end_date}})
UNION
SELECT opsc.interval_start,
opsc.namespace,
opu.node,
opsc.persistentvolumeclaim_labels as "labels"
FROM hive.{{schema | sqlsafe}}.openshift_storage_usage_line_items opsc
JOIN hive.{{schema | sqlsafe}}.openshift_pod_usage_line_items opu
ON opu.interval_start = opsc.interval_start
AND opu.namespace = opsc.namespace
AND opu.pod = opsc.pod
WHERE opsc.source = {{source}}
AND opsc.year = {{year}}
AND opsc.month = {{month}}
AND opsc.interval_start >= TIMESTAMP {{start_date}}
AND opsc.interval_start < date_add('day', 1, TIMESTAMP {{end_date}})
UNION
SELECT nl.interval_start,
ops1.namespace,
nl.node,
nl.node_labels as "labels"
FROM hive.{{schema | sqlsafe}}.openshift_node_labels_line_items nl
JOIN hive.{{schema | sqlsafe}}.openshift_pod_usage_line_items opu1
ON opu1.interval_start = nl.interval_start
AND opu1.node = nl.node
JOIN hive.{{schema | sqlsafe}}.openshift_storage_usage_line_items ops1
ON ops1.interval_start = opu1.interval_start
AND ops1.pod = opu1.pod
WHERE nl.source = {{source}}
AND nl.year = {{year}}
AND nl.month = {{month}}
AND nl.interval_start >= TIMESTAMP {{start_date}}
AND nl.interval_start < date_add('day', 1, TIMESTAMP {{end_date}})
AND nl.node_labels != '{}'
) as "u",
unnest(cast(json_parse(u.labels) as map(varchar, varchar))) as l(label_key, label_value)
) as "vl"
;
/*
* De-duplicate the gathered values
*/
DROP TABLE IF EXISTS hive.{{schema | sqlsafe}}.__label_summary_{{uuid | sqlsafe}};
CREATE TABLE hive.{{schema | sqlsafe}}.__label_summary_{{uuid | sqlsafe}} (
report_period_id integer,
cluster_id varchar,
cluster_alias varchar,
namespace varchar,
node varchar,
label_key varchar,
label_value varchar
)
;
INSERT INTO hive.{{schema | sqlsafe}}.__label_summary_{{uuid | sqlsafe}} (
report_period_id,
cluster_id,
cluster_alias,
namespace,
node,
label_key,
label_value
)
SELECT DISTINCT
prp.id as "report_period_id",
prp.cluster_id,
prp.cluster_alias,
lsg.namespace,
lsg.node,
lsg.label_key,
lsg.label_value
FROM hive.{{schema | sqlsafe}}.__label_summary_gather_{{uuid | sqlsafe}} lsg
JOIN postgres.{{schema | sqlsafe}}.reporting_ocpusagereportperiod prp
ON prp.id in {{report_period_ids | inclause}}
AND lsg.interval_start >= prp.report_period_start
AND lsg.interval_start <= prp.report_period_end
;
-- DROP gather table as it is no longer needed
DELETE from hive.{{schema | sqlsafe}}.__label_summary_gather_{{uuid | sqlsafe}};
DROP TABLE IF EXISTS hive.{{schema | sqlsafe}}.__label_summary_gather_{{uuid | sqlsafe}};
/*
* ====================================
* Update the reporting_reporting_ocpusagepodlabel_summary data
* ====================================
*/
/*
* Store primary key values for any overlapping data for
* (report_period_id, namespace, node, label_key)
* for use in the delete log wrapper
*/
INSERT INTO postgres.{{schema | sqlsafe}}.presto_pk_delete_wrapper_log (
transaction_id,
action_ts,
table_name,
pk_column,
pk_value,
pk_value_cast
)
SELECT DISTINCT
{{uuid}},
const_time.action_ts,
'reporting_ocpusagepodlabel_summary',
'uuid',
cast(pls.uuid as varchar),
'uuid'
FROM postgres.{{schema | sqlsafe}}.reporting_ocpusagepodlabel_summary pls
JOIN hive.{{schema | sqlsafe}}.__label_summary_{{uuid | sqlsafe}} ls
ON ls.report_period_id = pls.report_period_id
AND ls.namespace = pls.namespace
AND ls.node = pls.node
AND ls.label_key = pls.key
CROSS
JOIN (
SELECT now() as action_ts
) as const_time;
/*
* Delete any conflicting entries as we cannot do update processing from presto
* Inserting a record in this log will trigger a delete against the specified table
* in the same schema as the log table with the specified where_clause
* start_date and end_date MUST be strings in order for this to work properly.
*/
INSERT
INTO postgres.{{schema | sqlsafe}}.presto_delete_wrapper_log
(
id,
action_ts,
table_name,
where_clause,
result_rows
)
VALUES (
uuid(),
now(),
'reporting_ocpusagepodlabel_summary',
'using {{schema | sqlsafe}}.presto_pk_delete_wrapper_log ' ||
'where presto_pk_delete_wrapper_log.transaction_id = '{{uuid}}' ' ||
'and presto_pk_delete_wrapper_log.table_name = ''reporting_ocpusagepodlabel_summary'' ' ||
'and reporting_ocpusagepodlabel_summary."uuid" = presto_pk_delete_wrapper_log.pk_value::uuid ; ',
null
)
;
/*
* Insert new/updated records
*/
INSERT INTO postgres.{{schema | sqlsafe}}.reporting_ocpusagepodlabel_summary (
"uuid",
report_period_id,
namespace,
node,
key,
"values"
)
SELECT uuid() as "uuid",
als.report_period_id,
als.namespace,
als.node,
als.key,
als."values"
FROM (
SELECT report_period_id,
namespace,
node,
label_key as "key",
array_agg(label_value) as "values"
FROM hive.{{schema | sqlsafe}}.__label_summary_{{uuid | sqlsafe}}
GROUP
BY report_period_id,
namespace,
node,
label_key
) as "als"
;
/*
* Delete the queued primary key deletes
*/
INSERT
INTO postgres.{{schema | sqlsafe}}.presto_delete_wrapper_log
(
id,
action_ts,
table_name,
where_clause,
result_rows
)
VALUES (
uuid(),
now(),
'presto_pk_delete_wrapper_log',
'where transaction_id = '{{uuid}}' ' ||
'and table_name = ''reporting_ocpusagepodlabel_summary'' ;',
null
)
;
/*
* ====================================
* Update the reporting_ocptags_values data
* ====================================
*/
/*
* Store primary key values for any overlapping data for
* (key, value)
* for use in the delete log wrapper
*/
INSERT INTO postgres.{{schema | sqlsafe}}.presto_pk_delete_wrapper_log (
transaction_id,
action_ts,
table_name,
pk_column,
pk_value,
pk_value_cast
)
SELECT DISTINCT
{{uuid}},
const_time.action_ts,
'reporting_ocptags_values',
'uuid',
cast(tv.uuid as varchar),
'uuid'
FROM postgres.{{schema | sqlsafe}}.reporting_ocptags_values tv
JOIN hive.{{schema | sqlsafe}}.__label_summary_{{uuid | sqlsafe}} ls
ON ls.label_key = tv.key
AND ls.label_value = tv.value
CROSS
JOIN (
SELECT now() as action_ts
) as const_time;
/*
* Delete any conflicting entries as we cannot do update processing from presto
* Inserting a record in this log will trigger a delete against the specified table
* in the same schema as the log table with the specified where_clause
* start_date and end_date MUST be strings in order for this to work properly.
*/
INSERT
INTO postgres.{{schema | sqlsafe}}.presto_delete_wrapper_log
(
id,
action_ts,
table_name,
where_clause,
result_rows
)
VALUES (
uuid(),
now(),
'reporting_ocptags_values',
'using {{schema | sqlsafe}}.presto_pk_delete_wrapper_log ' ||
'where presto_pk_delete_wrapper_log.transaction_id = '{{uuid}}' ' ||
'and presto_pk_delete_wrapper_log.table_name = ''reporting_ocptags_values'' ' ||
'and reporting_ocptags_values."uuid" = presto_pk_delete_wrapper_log.pk_value::uuid ; ',
null
)
;
/*
* Insert the new/updated records
*/
INSERT
INTO postgres.{{schema | sqlsafe}}.reporting_ocptags_values (
"uuid",
key,
value,
cluster_ids,
cluster_aliases,
namespaces,
nodes
)
SELECT uuid() as "uuid",
lsa.key,
lsa.value,
lsa.cluster_ids,
lsa.cluster_aliases,
lsa.namespaces,
lsa.nodes
FROM (
SELECT label_key as "key",
label_value as "value",
array_agg(distinct cluster_id) as "cluster_ids",
array_agg(distinct cluster_alias) as "cluster_aliases",
array_agg(distinct namespace) as "namespaces",
array_agg(distinct node) as "nodes"
FROM hive.{{schema | sqlsafe}}.__label_summary_{{uuid | sqlsafe}}
GROUP
BY label_key,
label_value
) lsa
;
/*
* Delete the queued primary key deletes
*/
INSERT
INTO postgres.{{schema | sqlsafe}}.presto_delete_wrapper_log
(
id,
action_ts,
table_name,
where_clause,
result_rows
)
VALUES (
uuid(),
now(),
'presto_pk_delete_wrapper_log',
'where transaction_id = '{{uuid}}' ' ||
'and table_name = ''reporting_ocptags_values'' ;',
null
)
;
/*
* ====================================
* CLEANUP
* ====================================
*/
DELETE FROM hive.{{schema | sqlsafe}}.__label_summary_{{uuid | sqlsafe}};
DROP TABLE IF EXISTS hive.{{schema | sqlsafe}}.__label_summary_{{uuid | sqlsafe}}; | the_stack |
--liquibase formatted sql
--changeset bunny:1487849040814-1 dbms:postgresql
CREATE TYPE backend_status AS ENUM (
'ACTIVE',
'INACTIVE'
);
--rollback DROP TYPE backend_status;
--changeset bunny:1487849040814-2 dbms:postgresql
CREATE TYPE backend_type AS ENUM (
'LOCAL',
'ACTIVE_MQ',
'RABBIT_MQ'
);
--rollback DROP TYPE backend_type;
--changeset bunny:1487849040814-3 dbms:postgresql
CREATE TYPE context_record_status AS ENUM (
'RUNNING',
'COMPLETED',
'FAILED',
'ABORTED'
);
--rollback DROP TYPE context_record_status;
--changeset bunny:1487849040814-4 dbms:postgresql
CREATE TYPE event_status AS ENUM (
'PROCESSED',
'UNPROCESSED',
'FAILED'
);
--rollback DROP TYPE event_status;
--changeset bunny:1487849040814-5 dbms:postgresql
CREATE TYPE job_record_state AS ENUM (
'PENDING',
'READY',
'RUNNING',
'COMPLETED',
'FAILED',
'ABORTED'
);
--rollback DROP TYPE job_record_state;
--changeset bunny:1487849040814-6 dbms:postgresql
CREATE TYPE job_status AS ENUM (
'PENDING',
'READY',
'STARTED',
'ABORTED',
'FAILED',
'COMPLETED',
'RUNNING'
);
--rollback DROP TYPE job_status;
--changeset bunny:1487849040814-7 dbms:postgresql
CREATE TYPE link_merge_type AS ENUM (
'merge_nested',
'merge_flattened'
);
--rollback DROP TYPE link_merge_type;
--changeset bunny:1487849040814-8 dbms:postgresql
CREATE TYPE persistent_event_type AS ENUM (
'INIT',
'JOB_STATUS_UPDATE_RUNNING',
'JOB_STATUS_UPDATE_COMPLETED'
);
--rollback DROP TYPE persistent_event_type;
--changeset bunny:1487849040814-9 dbms:postgresql
CREATE TYPE port_type AS ENUM (
'INPUT',
'OUTPUT'
);
--rollback DROP TYPE port_type;
--changeset bunny:1487849040814-10 dbms:postgresql
CREATE TABLE application (
hash text NOT NULL,
app text,
created_at timestamp NOT NULL DEFAULT now(),
modified_at timestamp NOT NULL DEFAULT now()
);
--rollback DROP TABLE application;
--changeset bunny:1487849040814-11 dbms:postgresql
CREATE TABLE backend (
id uuid NOT NULL,
name text,
type backend_type,
heartbeat_info timestamp without time zone NOT NULL,
status backend_status NOT NULL,
configuration jsonb
);
--rollback DROP TABLE backend;
--changeset bunny:1487849040814-12 dbms:postgresql
CREATE TABLE context_record (
id uuid NOT NULL,
status context_record_status NOT NULL,
config jsonb,
created_at timestamp NOT NULL DEFAULT now(),
modified_at timestamp NOT NULL DEFAULT now()
);
--rollback DROP TABLE context_record;
--changeset bunny:1487849040814-13 dbms:postgresql
CREATE TABLE dag_node (
id uuid NOT NULL,
dag jsonb,
created_at timestamp NOT NULL DEFAULT now(),
modified_at timestamp NOT NULL DEFAULT now()
);
--rollback DROP TABLE dag_node;
--changeset bunny:1487849040814-14 dbms:postgresql
CREATE TABLE event (
id uuid NOT NULL,
type persistent_event_type,
status event_status NOT NULL,
event jsonb,
created_at timestamp NOT NULL DEFAULT now(),
modified_at timestamp NOT NULL DEFAULT now()
);
--rollback DROP TABLE event;
--changeset bunny:1487849040814-15 dbms:postgresql
CREATE TABLE job (
id uuid NOT NULL,
root_id uuid,
name text NOT NULL,
parent_id uuid,
status job_status NOT NULL,
message text,
inputs jsonb,
outputs jsonb,
resources jsonb,
group_id uuid,
produced_by_node text,
backend_id uuid,
app text,
config jsonb,
created_at timestamp NOT NULL DEFAULT now(),
modified_at timestamp NOT NULL DEFAULT now(),
CONSTRAINT job_backend_status_check CHECK (((backend_id IS NOT NULL) OR (status <> 'RUNNING'::job_status) OR (parent_id IS NULL)))
);
--rollback DROP TABLE job;
--changeset bunny:1487849040814-16 dbms:postgresql
CREATE TABLE job_record (
external_id uuid NOT NULL,
id text NOT NULL,
root_id uuid,
parent_id uuid,
blocking boolean NOT NULL,
job_state job_record_state NOT NULL,
input_counters jsonb NOT NULL,
output_counters jsonb NOT NULL,
is_scattered boolean NOT NULL,
is_container boolean NOT NULL,
is_scatter_wrapper boolean NOT NULL,
global_inputs_count integer NOT NULL,
global_outputs_count integer NOT NULL,
scatter_strategy jsonb,
dag_hash text,
created_at timestamp NOT NULL DEFAULT now(),
modified_at timestamp NOT NULL DEFAULT now()
);
--rollback DROP TABLE job_record;
--changeset bunny:1487849040814-17 dbms:postgresql
CREATE TABLE link_record (
context_id uuid,
source_job_id text NOT NULL,
source_job_port_id text NOT NULL,
source_type port_type NOT NULL,
destination_job_id text NOT NULL,
destination_job_port_id text NOT NULL,
destination_type port_type NOT NULL,
"position" integer NOT NULL,
created_at timestamp NOT NULL DEFAULT now(),
modified_at timestamp NOT NULL DEFAULT now()
);
--rollback DROP TABLE link_record;
--changeset bunny:1487849040814-18 dbms:postgresql
CREATE TABLE variable_record (
job_id text NOT NULL,
value jsonb,
port_id text NOT NULL,
type port_type NOT NULL,
link_merge link_merge_type NOT NULL,
is_wrapped boolean NOT NULL,
globals_count integer NOT NULL,
times_updated_count integer NOT NULL,
context_id uuid,
is_default boolean NOT NULL,
transform jsonb,
created_at timestamp NOT NULL DEFAULT now(),
modified_at timestamp NOT NULL DEFAULT now()
);
--rollback DROP TABLE variable_record;
--changeset bunny:1487849040814-19 dbms:postgresql
ALTER TABLE ONLY application
ADD CONSTRAINT application_pkey PRIMARY KEY (hash);
--rollback ALTER TABLE ONLY application DROP CONSTRAINT application_pkey;
--changeset bunny:1487849040814-20 dbms:postgresql
ALTER TABLE ONLY backend
ADD CONSTRAINT backend_pkey PRIMARY KEY (id);
--rollback ALTER TABLE ONLY backend DROP CONSTRAINT backend_pkey;
--changeset bunny:1487849040814-21 dbms:postgresql
ALTER TABLE ONLY context_record
ADD CONSTRAINT context_record_pkey PRIMARY KEY (id);
--rollback ALTER TABLE ONLY context_record DROP CONSTRAINT context_record_pkey;
--changeset bunny:1487849040814-22 dbms:postgresql
ALTER TABLE ONLY dag_node
ADD CONSTRAINT dag_node_pkey PRIMARY KEY (id);
--rollback ALTER TABLE ONLY dag_node DROP CONSTRAINT dag_node_pkey;
--changeset bunny:1487849040814-23 dbms:postgresql
ALTER TABLE ONLY job
ADD CONSTRAINT job_pkey PRIMARY KEY (id);
--rollback ALTER TABLE ONLY job DROP CONSTRAINT job_pkey;
--changeset bunny:1487849040814-24 dbms:postgresql
ALTER TABLE ONLY job_record
ADD CONSTRAINT job_record_pkey PRIMARY KEY (external_id);
--rollback ALTER TABLE ONLY job_record DROP CONSTRAINT job_record_pkey;
--changeset bunny:1487849040814-25 dbms:postgresql
CREATE INDEX application_id_index ON application USING btree (hash);
--rollback DROP INDEX application_id_index;
--changeset bunny:1487849040814-26 dbms:postgresql
CREATE INDEX backend_id_index ON backend USING btree (id);
--rollback DROP INDEX backend_id_index;
--changeset bunny:1487849040814-27 dbms:postgresql
CREATE INDEX backend_status_index ON backend USING btree (status);
--rollback DROP INDEX backend_status_index;
--changeset bunny:1487849040814-28 dbms:postgresql
CREATE INDEX context_record_id_index ON context_record USING btree (id);
--rollback DROP INDEX context_record_id_index;
--changeset bunny:1487849040814-29 dbms:postgresql
CREATE INDEX context_record_status_index ON context_record USING btree (status);
--rollback DROP INDEX context_record_status_index;
--changeset bunny:1487849040814-30 dbms:postgresql
CREATE UNIQUE INDEX event_id_type_index ON event USING btree (id, type);
--rollback DROP INDEX event_id_type_index;
--changeset bunny:1487849040814-31 dbms:postgresql
CREATE INDEX event_status_index ON event USING btree (status);
--rollback DROP INDEX event_status_index;
--changeset bunny:1487849040814-32 dbms:postgresql
CREATE INDEX job_backend_index ON job USING btree (backend_id);
--rollback DROP INDEX job_backend_index;
--changeset bunny:1487849040814-33 dbms:postgresql
CREATE INDEX job_backend_status_index ON job USING btree (backend_id, status);
--rollback DROP INDEX job_backend_status_index;
--changeset bunny:1487849040814-34 dbms:postgresql
CREATE INDEX job_backend_status_root_index ON job USING btree (backend_id, status, root_id);
--rollback DROP INDEX job_backend_status_root_index;
--changeset bunny:1487849040814-35 dbms:postgresql
CREATE INDEX job_group_index ON job USING btree (group_id);
--rollback DROP INDEX job_group_index;
--changeset bunny:1487849040814-36 dbms:postgresql
CREATE INDEX job_id_index ON job USING btree (id);
--rollback DROP INDEX job_id_index;
--changeset bunny:1487849040814-37 dbms:postgresql
CREATE INDEX job_parent_index ON job USING btree (parent_id);
--rollback DROP INDEX job_parent_index;
--changeset bunny:1487849040814-38 dbms:postgresql
CREATE UNIQUE INDEX job_record_name_index ON job_record USING btree (root_id, id);
--rollback DROP INDEX job_record_name_index;
--changeset bunny:1487849040814-39 dbms:postgresql
CREATE INDEX job_record_parent_index ON job_record USING btree (root_id, parent_id);
--rollback DROP INDEX job_record_parent_index;
--changeset bunny:1487849040814-40 dbms:postgresql
CREATE INDEX job_record_root_index ON job_record USING btree (root_id);
--rollback DROP INDEX job_record_root_index;
--changeset bunny:1487849040814-41 dbms:postgresql
CREATE INDEX job_record_state_index ON job_record USING btree (root_id, job_state);
--rollback DROP INDEX job_record_state_index;
--changeset bunny:1487849040814-42 dbms:postgresql
CREATE INDEX job_root_index ON job USING btree (root_id);
--rollback DROP INDEX job_root_index;
--changeset bunny:1487849040814-43 dbms:postgresql
CREATE UNIQUE INDEX job_root_name_index ON job USING btree (root_id, name);
--rollback DROP
--changeset bunny:1487849040814-44 dbms:postgresql
CREATE INDEX job_status_index ON job USING btree (status);
--rollback DROP INDEX job_status_index;
--changeset bunny:1487849040814-45 dbms:postgresql
CREATE INDEX link_record_context_index ON link_record USING btree (context_id);
--rollback DROP INDEX link_record_context_index;
--changeset bunny:1487849040814-46 dbms:postgresql
CREATE INDEX link_record_destination_job_index ON link_record USING btree (context_id, destination_job_id);
--rollback DROP INDEX link_record_destination_job_index;
--changeset bunny:1487849040814-47 dbms:postgresql
CREATE UNIQUE INDEX link_record_index ON link_record USING btree (context_id, source_job_id, source_job_port_id, source_type, destination_job_id, destination_job_port_id, destination_type);
--rollback DROP INDEX link_record_index;
--changeset bunny:1487849040814-48 dbms:postgresql
CREATE INDEX link_record_source_index ON link_record USING btree (context_id, source_job_id, source_job_port_id);
--rollback DROP INDEX link_record_source_index;
--changeset bunny:1487849040814-49 dbms:postgresql
CREATE INDEX link_record_source_job_index ON link_record USING btree (context_id, source_job_id);
--rollback DROP INDEX link_record_source_job_index;
--changeset bunny:1487849040814-50 dbms:postgresql
CREATE INDEX link_record_source_port_destination_type_index ON link_record USING btree (context_id, source_job_id, source_job_port_id, destination_type);
--rollback DROP INDEX link_record_source_port_destination_type_index;
--changeset bunny:1487849040814-51 dbms:postgresql
CREATE INDEX link_record_source_type_index ON link_record USING btree (context_id, source_job_id, source_type);
--rollback DROP INDEX link_record_source_type_index;
--changeset bunny:1487849040814-52 dbms:postgresql
CREATE INDEX variable_record_context_index ON variable_record USING btree (context_id);
--rollback DROP INDEX variable_record_context_index;
--changeset bunny:1487849040814-53 dbms:postgresql
CREATE UNIQUE INDEX variable_record_index ON variable_record USING btree (job_id, port_id, type, context_id);
--rollback DROP INDEX variable_record_index;
--changeset bunny:1487849040814-54 dbms:postgresql
CREATE INDEX variable_record_job_index ON variable_record USING btree (job_id, context_id);
--rollback DROP INDEX variable_record_job_index;
--changeset bunny:1487849040814-55 dbms:postgresql
CREATE INDEX variable_record_port_index ON variable_record USING btree (job_id, port_id, context_id);
--rollback DROP INDEX variable_record_port_index;
--changeset bunny:1487849040814-56 dbms:postgresql
CREATE INDEX variable_record_type_index ON variable_record USING btree (job_id, type, context_id);
--rollback DROP INDEX variable_record_type_index;
--changeset bunny:1487849040814-57 dbms:postgresql
ALTER TABLE ONLY job
ADD CONSTRAINT job_backend_id_fkey FOREIGN KEY (backend_id) REFERENCES backend(id) ON DELETE SET NULL;
--rollback ALTER TABLE ONLY job DROP CONSTRAINT job_backend_id_fkey;
--changeset bunny:1487849040814-58 dbms:postgresql
ALTER TABLE ONLY job_record
ADD CONSTRAINT job_record_root_id_fkey FOREIGN KEY (root_id) REFERENCES context_record(id) ON DELETE CASCADE;
--rollback ALTER TABLE ONLY job_record DROP CONSTRAINT job_record_root_id_fkey;
--changeset bunny:1487849040814-59 dbms:postgresql
ALTER TABLE ONLY link_record
ADD CONSTRAINT link_record_context_id_fkey FOREIGN KEY (context_id) REFERENCES context_record(id) ON DELETE CASCADE;
--rollback ALTER TABLE ONLY link_record DROP CONSTRAINT link_record_context_id_fkey;
--changeset bunny:1487849040814-60 dbms:postgresql
ALTER TABLE ONLY link_record
ADD CONSTRAINT link_record_destination_job_id_fkey FOREIGN KEY (destination_job_id, context_id) REFERENCES job_record(id, root_id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED;
--rollback ALTER TABLE ONLY link_record DROP CONSTRAINT link_record_destination_job_id_fkey;
--changeset bunny:1487849040814-61 dbms:postgresql
ALTER TABLE ONLY link_record
ADD CONSTRAINT link_record_source_job_id_fkey FOREIGN KEY (source_job_id, context_id) REFERENCES job_record(id, root_id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED;
--rollback ALTER TABLE ONLY link_record DROP CONSTRAINT link_record_source_job_id_fkey;
--changeset bunny:1487849040814-62 dbms:postgresql
ALTER TABLE ONLY variable_record
ADD CONSTRAINT variable_record_context_id_fkey FOREIGN KEY (context_id) REFERENCES context_record(id) ON DELETE CASCADE;
--rollback ALTER TABLE ONLY variable_record DROP CONSTRAINT variable_record_context_id_fkey;
--changeset bunny:1487849040814-63 dbms:postgresql
ALTER TABLE ONLY variable_record
ADD CONSTRAINT variable_record_job_id_fkey FOREIGN KEY (job_id, context_id) REFERENCES job_record(id, root_id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED;
--rollback ALTER TABLE ONLY variable_record DROP CONSTRAINT variable_record_job_id_fkey;
--changeset bunny:1487849040814-64 dbms:postgresql
CREATE TABLE job_stats (
root_id uuid NOT NULL,
completed integer NOT NULL,
running integer NOT NULL,
total integer NOT NULL
);
--rollback DROP TABLE job_stats
--changeset bunny:1487849040814-65 dbms:postgresql
ALTER TABLE ONLY job_stats
ADD CONSTRAINT job_stats_pkey PRIMARY KEY (root_id);
--rollback ALTER TABLE ONLY job_stats DROP CONSTRAINT job_stats_pkey;
--changeset bunny:1487849040814-66 dbms:postgresql
ALTER TABLE ONLY job_stats
ADD CONSTRAINT job_stats_id_fkey FOREIGN KEY (root_id) REFERENCES job(id) ON DELETE CASCADE;
--rollback ALTER TABLE ONLY job_stats DROP CONSTRAINT job_stats_id_fkey;
--changeset bunny:1487849040814-67 dbms:postgresql
CREATE TABLE intermediary_files (
root_id uuid NOT NULL,
filename text NOT NULL,
count integer NOT NULL
);
--rollback DROP TABLE intermediary_files
--changeset bunny:1487849040814-68 dbms:postgresql
ALTER TABLE event ADD COLUMN message text;
--rollback ALTER TABLE event drop column message;
--changeset bunny:1487849040814-69 dbms:postgresql
ALTER TABLE event drop column type;
--rollback ALTER TABLE event ADD COLUMN type persistent_event_type;
--changeset bunny:1487849040814-70 dbms:postgresql
alter table job alter column outputs type bytea using convert_to(outputs::text,'UTF8');
alter table job alter column inputs type bytea using convert_to(inputs::text,'UTF8');
alter table event alter column event type bytea using convert_to(event::text,'UTF8');
alter table variable_record alter column value type bytea using convert_to(value::text,'UTF8');
--changeset bunny:1487849040814-71 dbms:postgresql
alter table backend alter column configuration type text
--rollback alter table backend alter column configuration type jsonb USING configuration::jsonb
--changeset bunny:1487849040814-72 dbms:postgresql
ALTER TABLE intermediary_files ADD CONSTRAINT key PRIMARY KEY (root_id, filename);
--rollback ALTER TABLE public.intermediary_files DROP CONSTRAINT key PRIMARY KEY (root_id, filename);
--changeset bunny:1487849040814-73 dbms:postgresql
ALTER TABLE public.job drop CONSTRAINT job_backend_status_check;
--rollback ALTER TABLE job ADD CONSTRAINT job_backend_status_check CHECK (backend_id IS NOT NULL OR status <> 'RUNNING'::job_status OR parent_id IS NULL);
--changeset bunny:1487849040814-74 dbms:postgresql
ALTER TABLE job_stats
DROP CONSTRAINT job_stats_id_fkey;
ALTER TABLE job_stats ADD CONSTRAINT job_stats_context_fkey FOREIGN KEY (root_id) REFERENCES context_record (id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE CASCADE;
--rollback ALTER TABLE job_stats DROP CONSTRAINT job_stats_context_fkey; ALTER TABLE job_stats ADD CONSTRAINT job_stats_id_fkey FOREIGN KEY (root_id) REFERENCES job (id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE CASCADE;
--changeset bunny:1487849040814-75 dbms:postgresql
ALTER TABLE event ADD COLUMN root_id uuid;
--rollback ALTER TABLE event drop column root_id;
--changeset bunny:1487849040814-76 dbms:postgresql
DROP INDEX IF EXISTS event_status_index;
DROP INDEX IF EXISTS event_id_type_index;
DROP INDEX IF EXISTS backend_id_index;
DROP INDEX IF EXISTS context_record_id_index;
DROP INDEX IF EXISTS context_record_status_index;
--changeset bunny:1487849040814-77 dbms:postgresql
CREATE UNIQUE INDEX intermediary_files_index ON intermediary_files USING btree (root_id, filename);
--rollback DROP INDEX intermediary_files_index; | the_stack |
-- 2019-04-24T11:26:43.958
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET Parent_Column_ID=567817,Updated=TO_TIMESTAMP('2019-04-24 11:26:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=541751
;
-- 2019-04-24T11:27:13.160
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET AD_Column_ID=567847,Updated=TO_TIMESTAMP('2019-04-24 11:27:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=541751
;
-- 2019-04-24T11:27:49.918
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table SET AD_Window_ID=540635,Updated=TO_TIMESTAMP('2019-04-24 11:27:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Table_ID=541352
;
-- 2019-04-24T11:28:20.614
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table SET AD_Window_ID=540635,Updated=TO_TIMESTAMP('2019-04-24 11:28:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Table_ID=541351
;
-- 2019-04-24T11:29:40.178
-- 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,541671,542524,TO_TIMESTAMP('2019-04-24 11:29:40','YYYY-MM-DD HH24:MI:SS'),100,'Y','flags',10,TO_TIMESTAMP('2019-04-24 11:29:40','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-04-24T11:29:43.628
-- 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,541671,542525,TO_TIMESTAMP('2019-04-24 11:29:43','YYYY-MM-DD HH24:MI:SS'),100,'Y','org',20,TO_TIMESTAMP('2019-04-24 11:29:43','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-04-24T11:29:59.587
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=542524, SeqNo=10,Updated=TO_TIMESTAMP('2019-04-24 11:29:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558949
;
-- 2019-04-24T11:30:24.893
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=542525, SeqNo=10,Updated=TO_TIMESTAMP('2019-04-24 11:30:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558948
;
-- 2019-04-24T11:30:31.273
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=542525, SeqNo=20,Updated=TO_TIMESTAMP('2019-04-24 11:30:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558947
;
-- 2019-04-24T11:31:12.443
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=542524, SeqNo=20,Updated=TO_TIMESTAMP('2019-04-24 11:31:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558951
;
-- 2019-04-24T11:32:09.253
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET Name='M_Shipment_Declaration_Config',Updated=TO_TIMESTAMP('2019-04-24 11:32:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558950
;
-- 2019-04-24T11:34:55.570
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed='N',Updated=TO_TIMESTAMP('2019-04-24 11:34:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558950
;
-- 2019-04-24T11:35:01.630
-- 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,Description,DisplayLength,EntityType,Help,IsActive,IsDisplayed,IsDisplayedGrid,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,567885,580085,0,541752,TO_TIMESTAMP('2019-04-24 11:35:01','YYYY-MM-DD HH24:MI:SS'),100,'',40,'D','','Y','N','N','N','N','N','N','N','Name',TO_TIMESTAMP('2019-04-24 11:35:01','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-04-24T11:35:01.630
-- 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=580085 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)
;
-- 2019-04-24T11:35:01.650
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(469)
;
-- 2019-04-24T11:35:01.810
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=580085
;
-- 2019-04-24T11:35:01.810
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Field(580085)
;
-- 2019-04-24T11:35:21.987
-- 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_Element_ID,AD_UI_ElementGroup_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayed_SideList,IsDisplayedGrid,IsMultiLine,MultiLine_LinesCount,Name,SeqNo,SeqNo_SideList,SeqNoGrid,Updated,UpdatedBy) VALUES (0,580085,0,541752,559009,542520,'F',TO_TIMESTAMP('2019-04-24 11:35:21','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','N',0,'Name',80,0,0,TO_TIMESTAMP('2019-04-24 11:35:21','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-04-24T12:04:18.742
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET IsInsertRecord='N', IsReadOnly='Y',Updated=TO_TIMESTAMP('2019-04-24 12:04:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=541751
;
-- 2019-04-24T12:04:23.035
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET IsInsertRecord='N', IsReadOnly='Y',Updated=TO_TIMESTAMP('2019-04-24 12:04:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=541750
;
-- 2019-04-24T12:11:58.323
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=10,Updated=TO_TIMESTAMP('2019-04-24 12:11:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=559009
;
-- 2019-04-24T12:12:01.355
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=20,Updated=TO_TIMESTAMP('2019-04-24 12:12:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558952
;
-- 2019-04-24T12:12:04.208
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=30,Updated=TO_TIMESTAMP('2019-04-24 12:12:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558953
;
-- 2019-04-24T12:12:51.932
-- 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,541673,542526,TO_TIMESTAMP('2019-04-24 12:12:51','YYYY-MM-DD HH24:MI:SS'),100,'Y','flags',10,TO_TIMESTAMP('2019-04-24 12:12:51','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-04-24T12:12:56.841
-- 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,541673,542527,TO_TIMESTAMP('2019-04-24 12:12:56','YYYY-MM-DD HH24:MI:SS'),100,'Y','org',20,TO_TIMESTAMP('2019-04-24 12:12:56','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-04-24T12:13:49.411
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_ElementGroup SET SeqNo=20,Updated=TO_TIMESTAMP('2019-04-24 12:13:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_ElementGroup_ID=542526
;
-- 2019-04-24T12:13:52.526
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_ElementGroup SET SeqNo=30,Updated=TO_TIMESTAMP('2019-04-24 12:13:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_ElementGroup_ID=542527
;
-- 2019-04-24T12:14:01.214
-- 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,541673,542528,TO_TIMESTAMP('2019-04-24 12:14:00','YYYY-MM-DD HH24:MI:SS'),100,'Y','doc',10,TO_TIMESTAMP('2019-04-24 12:14:00','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-04-24T12:14:53.088
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=542528, SeqNo=10,Updated=TO_TIMESTAMP('2019-04-24 12:14:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558964
;
-- 2019-04-24T12:16:12.554
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=542528, SeqNo=20,Updated=TO_TIMESTAMP('2019-04-24 12:16:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558968
;
-- 2019-04-24T12:49:28.137
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=542528, SeqNo=30,Updated=TO_TIMESTAMP('2019-04-24 12:49:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558963
;
-- 2019-04-24T12:50:14.458
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=542527, SeqNo=10,Updated=TO_TIMESTAMP('2019-04-24 12:50:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558955
;
-- 2019-04-24T12:50:23.968
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=542527, SeqNo=20,Updated=TO_TIMESTAMP('2019-04-24 12:50:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558954
;
-- 2019-04-24T12:51:05.975
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed='N',Updated=TO_TIMESTAMP('2019-04-24 12:51:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558956
;
-- 2019-04-24T12:51:12.326
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=10,Updated=TO_TIMESTAMP('2019-04-24 12:51:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558965
;
-- 2019-04-24T12:53:58.576
-- 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,Description,DisplayLength,EntityType,Help,IsActive,IsDisplayed,IsDisplayedGrid,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,567887,580086,0,541750,TO_TIMESTAMP('2019-04-24 12:53:58','YYYY-MM-DD HH24:MI:SS'),100,'User within the system - Internal or Business Partner Contact',10,'D','The User identifies a unique user in the system. This could be an internal user or a business partner contact','Y','N','N','N','N','N','N','N','Ansprechpartner',TO_TIMESTAMP('2019-04-24 12:53:58','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-04-24T12:53:58.576
-- 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=580086 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)
;
-- 2019-04-24T12:53:58.586
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(138)
;
-- 2019-04-24T12:53:58.596
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=580086
;
-- 2019-04-24T12:53:58.596
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Field(580086)
;
-- 2019-04-24T12:54:25.922
-- 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_Element_ID,AD_UI_ElementField_ID,Created,CreatedBy,IsActive,SeqNo,Type,Updated,UpdatedBy) VALUES (0,580086,0,558965,540345,TO_TIMESTAMP('2019-04-24 12:54:25','YYYY-MM-DD HH24:MI:SS'),100,'Y',20,'widget',TO_TIMESTAMP('2019-04-24 12:54:25','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-04-24T13:00:17.133
-- 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,541750,541310,TO_TIMESTAMP('2019-04-24 13:00:16','YYYY-MM-DD HH24:MI:SS'),100,'Y',20,TO_TIMESTAMP('2019-04-24 13:00:16','YYYY-MM-DD HH24:MI:SS'),100,'advanced')
;
-- 2019-04-24T13:00:17.143
-- 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=541310 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-04-24T13:01:28.939
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=12,Updated=TO_TIMESTAMP('2019-04-24 13:01:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558962
;
-- 2019-04-24T13:01:36.318
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=20,Updated=TO_TIMESTAMP('2019-04-24 13:01:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558962
;
-- 2019-04-24T13:02:15.325
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Section_Trl WHERE AD_UI_Section_ID=541310
;
-- 2019-04-24T13:02:15.335
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Section WHERE AD_UI_Section_ID=541310
;
-- 2019-04-24T13:03:12.255
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed='N',Updated=TO_TIMESTAMP('2019-04-24 13:03:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558958
;
-- 2019-04-24T13:03:20.075
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed='N',Updated=TO_TIMESTAMP('2019-04-24 13:03:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558961
;
-- 2019-04-24T13:03:21.416
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed='N',Updated=TO_TIMESTAMP('2019-04-24 13:03:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558957
;
-- 2019-04-24T13:10:57.335
-- 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,Description,DisplayLength,EntityType,IsActive,IsDisplayed,IsDisplayedGrid,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,567888,580087,0,541751,TO_TIMESTAMP('2019-04-24 13:10:57','YYYY-MM-DD HH24:MI:SS'),100,'Zeile Nr.',22,'D','Y','N','N','N','N','N','N','N','Position',TO_TIMESTAMP('2019-04-24 13:10:57','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-04-24T13:10:57.345
-- 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=580087 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)
;
-- 2019-04-24T13:10:57.345
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(2945)
;
-- 2019-04-24T13:10:57.355
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=580087
;
-- 2019-04-24T13:10:57.355
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Field(580087)
;
-- 2019-04-24T13:11:35.958
-- 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_Element_ID,AD_UI_ElementGroup_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayed_SideList,IsDisplayedGrid,IsMultiLine,MultiLine_LinesCount,Name,SeqNo,SeqNo_SideList,SeqNoGrid,Updated,UpdatedBy) VALUES (0,580087,0,541751,559010,542523,'F',TO_TIMESTAMP('2019-04-24 13:11:35','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','N',0,'line',110,0,0,TO_TIMESTAMP('2019-04-24 13:11:35','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-04-24T13:11:41.426
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=10,Updated=TO_TIMESTAMP('2019-04-24 13:11:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=559010
;
-- 2019-04-24T13:11:46.657
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=20,Updated=TO_TIMESTAMP('2019-04-24 13:11:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558974
;
-- 2019-04-24T13:11:51.388
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=20,Updated=TO_TIMESTAMP('2019-04-24 13:11:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558975
;
-- 2019-04-24T13:11:53.717
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=30,Updated=TO_TIMESTAMP('2019-04-24 13:11:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558974
;
-- 2019-04-24T13:12:04.081
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=40,Updated=TO_TIMESTAMP('2019-04-24 13:12:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558976
;
-- 2019-04-24T13:12:06.648
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=50,Updated=TO_TIMESTAMP('2019-04-24 13:12:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558977
;
-- 2019-04-24T13:12:09.785
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=60,Updated=TO_TIMESTAMP('2019-04-24 13:12:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558978
;
-- 2019-04-24T13:12:26.786
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed='N',Updated=TO_TIMESTAMP('2019-04-24 13:12:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558973
;
-- 2019-04-24T13:12:33.434
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed='N',Updated=TO_TIMESTAMP('2019-04-24 13:12:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558972
;
-- 2019-04-24T13:12:38.631
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=70,Updated=TO_TIMESTAMP('2019-04-24 13:12:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558971
;
-- 2019-04-24T13:12:41.062
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=80,Updated=TO_TIMESTAMP('2019-04-24 13:12:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558970
;
-- 2019-04-24T13:12:44.567
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=90,Updated=TO_TIMESTAMP('2019-04-24 13:12:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558969
;
-- 2019-04-24T13:13:07.635
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=10,Updated=TO_TIMESTAMP('2019-04-24 13:13:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=559010
;
-- 2019-04-24T13:13:07.645
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=20,Updated=TO_TIMESTAMP('2019-04-24 13:13:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558975
;
-- 2019-04-24T13:13:07.645
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=30,Updated=TO_TIMESTAMP('2019-04-24 13:13:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558974
;
-- 2019-04-24T13:13:07.645
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=40,Updated=TO_TIMESTAMP('2019-04-24 13:13:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558976
;
-- 2019-04-24T13:13:07.645
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=50,Updated=TO_TIMESTAMP('2019-04-24 13:13:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558977
;
-- 2019-04-24T13:13:07.655
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=60,Updated=TO_TIMESTAMP('2019-04-24 13:13:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558978
;
-- 2019-04-24T13:13:07.655
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=70,Updated=TO_TIMESTAMP('2019-04-24 13:13:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558970
;
-- 2019-04-24T13:13:58.060
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=10,Updated=TO_TIMESTAMP('2019-04-24 13:13:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558968
;
-- 2019-04-24T13:13:58.060
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=20,Updated=TO_TIMESTAMP('2019-04-24 13:13:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558962
;
-- 2019-04-24T13:13:58.070
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=30,Updated=TO_TIMESTAMP('2019-04-24 13:13:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558965
;
-- 2019-04-24T13:13:58.070
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=40,Updated=TO_TIMESTAMP('2019-04-24 13:13:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558963
;
-- 2019-04-24T13:13:58.070
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=50,Updated=TO_TIMESTAMP('2019-04-24 13:13:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558964
;
-- 2019-04-24T13:13:58.070
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=60,Updated=TO_TIMESTAMP('2019-04-24 13:13:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558959
;
-- 2019-04-24T13:13:58.080
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=70,Updated=TO_TIMESTAMP('2019-04-24 13:13:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558960
;
-- 2019-04-24T13:13:58.080
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=80,Updated=TO_TIMESTAMP('2019-04-24 13:13:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558955
;
-- 2019-04-24T13:15:20.051
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=10,Updated=TO_TIMESTAMP('2019-04-24 13:15:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558964
;
-- 2019-04-24T13:15:20.061
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=20,Updated=TO_TIMESTAMP('2019-04-24 13:15:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558968
;
-- 2019-04-24T13:15:20.061
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=30,Updated=TO_TIMESTAMP('2019-04-24 13:15:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558963
;
-- 2019-04-24T13:15:20.061
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=40,Updated=TO_TIMESTAMP('2019-04-24 13:15:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558962
;
-- 2019-04-24T13:15:20.061
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=50,Updated=TO_TIMESTAMP('2019-04-24 13:15:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558965
;
-- 2019-04-24T13:15:59.323
-- 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_Element_ID,AD_UI_ElementGroup_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayed_SideList,IsDisplayedGrid,IsMultiLine,MultiLine_LinesCount,Name,SeqNo,SeqNo_SideList,SeqNoGrid,Updated,UpdatedBy) VALUES (0,580050,0,541750,559011,542521,'F',TO_TIMESTAMP('2019-04-24 13:15:59','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','N',0,'loc',90,0,0,TO_TIMESTAMP('2019-04-24 13:15:59','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-04-24T13:16:01.641
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed='N',Updated=TO_TIMESTAMP('2019-04-24 13:16:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=559011
;
-- 2019-04-24T13:17:05.076
-- 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_Element_ID,AD_UI_ElementGroup_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayed_SideList,IsDisplayedGrid,IsMultiLine,MultiLine_LinesCount,Name,SeqNo,SeqNo_SideList,SeqNoGrid,Updated,UpdatedBy) VALUES (0,580086,0,541750,559012,542521,'F',TO_TIMESTAMP('2019-04-24 13:17:04','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','N',0,'user',100,0,0,TO_TIMESTAMP('2019-04-24 13:17:04','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-04-24T13:17:06.609
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed='N',Updated=TO_TIMESTAMP('2019-04-24 13:17:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=559012
;
-- 2019-04-24T13:17:20.467
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=60,Updated=TO_TIMESTAMP('2019-04-24 13:17:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=559011
;
-- 2019-04-24T13:17:20.467
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=70,Updated=TO_TIMESTAMP('2019-04-24 13:17:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=559012
;
-- 2019-04-24T13:17:20.467
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=80,Updated=TO_TIMESTAMP('2019-04-24 13:17:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558959
;
-- 2019-04-24T13:17:20.467
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=90,Updated=TO_TIMESTAMP('2019-04-24 13:17:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558960
;
-- 2019-04-24T13:17:20.467
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=100,Updated=TO_TIMESTAMP('2019-04-24 13:17:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558955
;
-- 2019-04-24T13:17:34.138
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2019-04-24 13:17:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558960
;
-- 2019-04-24T13:17:34.138
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=90,Updated=TO_TIMESTAMP('2019-04-24 13:17:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558955
;
-- 2019-04-24T13:24:04.789
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsGenericZoomOrigin='Y', IsUpdateable='N',Updated=TO_TIMESTAMP('2019-04-24 13:24:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=567860
; | the_stack |
EXEC tSQLt.NewTestClass 'UndoTestDoublesTests';
GO
CREATE PROCEDURE UndoTestDoublesTests.[test doesn't fail if there's no test double in the database]
AS
BEGIN
EXEC tSQLt.ExpectNoException;
EXEC tSQLt.UndoTestDoubles;
END;
GO
CREATE PROCEDURE UndoTestDoublesTests.[test restores a faked table]
AS
BEGIN
CREATE TABLE UndoTestDoublesTests.aSimpleTable ( Id INT );
DECLARE @OriginalObjectId INT = OBJECT_ID('UndoTestDoublesTests.aSimpleTable');
EXEC tSQLt.FakeTable @TableName = 'UndoTestDoublesTests.aSimpleTable';
EXEC tSQLt.UndoTestDoubles;
DECLARE @RestoredObjectId INT = OBJECT_ID('UndoTestDoublesTests.aSimpleTable');
EXEC tSQLt.AssertEquals @Expected = @OriginalObjectId, @Actual = @RestoredObjectId;
END;
GO
CREATE PROCEDURE UndoTestDoublesTests.[test works with names in need of quotes]
AS
BEGIN
EXEC('CREATE SCHEMA [A Random Schema];');
CREATE TABLE [A Random Schema].[A Simple Table]
(
Id INT
);
DECLARE @OriginalObjectId INT = OBJECT_ID('[A Random Schema].[A Simple Table]');
EXEC tSQLt.FakeTable @TableName = '[A Random Schema].[A Simple Table]';
EXEC tSQLt.UndoTestDoubles;
DECLARE @RestoredObjectId INT = OBJECT_ID('[A Random Schema].[A Simple Table]');
EXEC tSQLt.AssertEquals @Expected = @OriginalObjectId, @Actual = @RestoredObjectId;
END;
GO
CREATE PROCEDURE UndoTestDoublesTests.[test restores many faked tables]
AS
BEGIN
CREATE TABLE UndoTestDoublesTests.aSimpleTable1 ( Id INT );
CREATE TABLE UndoTestDoublesTests.aSimpleTable2 ( Id INT );
CREATE TABLE UndoTestDoublesTests.aSimpleTable3 ( Id INT );
SELECT X.TableName, OBJECT_ID('UndoTestDoublesTests.'+X.TableName) ObjectId
INTO #OriginalObjectIds
FROM (VALUES('aSimpleTable1'),('aSimpleTable2'),('aSimpleTable3')) X (TableName);
EXEC tSQLt.FakeTable @TableName = 'UndoTestDoublesTests.aSimpleTable1';
EXEC tSQLt.FakeTable @TableName = 'UndoTestDoublesTests.aSimpleTable2';
EXEC tSQLt.FakeTable @TableName = 'UndoTestDoublesTests.aSimpleTable3';
EXEC tSQLt.UndoTestDoubles;
SELECT X.TableName, OBJECT_ID('UndoTestDoublesTests.'+X.TableName) ObjectId
INTO #RestoredObjectIds
FROM (VALUES('aSimpleTable1'),('aSimpleTable2'),('aSimpleTable3')) X (TableName);
EXEC tSQLt.AssertEqualsTable @Expected = '#OriginalObjectIds', @Actual = '#RestoredObjectIds';
END;
GO
CREATE PROCEDURE UndoTestDoublesTests.[test restores a constraint]
AS
BEGIN
CREATE TABLE UndoTestDoublesTests.aSimpleTable ( Id INT CONSTRAINT aSimpleTableConstraint CHECK(Id > 0));
SELECT X.ObjectName, OBJECT_ID('UndoTestDoublesTests.'+X.ObjectName) ObjectId
INTO #OriginalObjectIds
FROM (VALUES('aSimpleTableConstraint')) X (ObjectName);
EXEC tSQLt.FakeTable @TableName = 'UndoTestDoublesTests.aSimpleTable';
EXEC tSQLt.ApplyConstraint @TableName = 'UndoTestDoublesTests.aSimpleTable', @ConstraintName = 'aSimpleTableConstraint';
EXEC tSQLt.UndoTestDoubles;
SELECT X.ObjectName, OBJECT_ID('UndoTestDoublesTests.'+X.ObjectName) ObjectId
INTO #RestoredObjectIds
FROM (VALUES('aSimpleTableConstraint')) X (ObjectName);
EXEC tSQLt.AssertEqualsTable @Expected = '#OriginalObjectIds', @Actual = '#RestoredObjectIds';
END;
GO
CREATE PROCEDURE UndoTestDoublesTests.[test restores a table that has been faked multiple times]
AS
BEGIN
CREATE TABLE UndoTestDoublesTests.aSimpleTable ( Id INT );
DECLARE @OriginalObjectId INT = OBJECT_ID('UndoTestDoublesTests.aSimpleTable');
EXEC tSQLt.FakeTable @TableName = 'UndoTestDoublesTests.aSimpleTable';
EXEC tSQLt.FakeTable @TableName = 'UndoTestDoublesTests.aSimpleTable';
EXEC tSQLt.FakeTable @TableName = 'UndoTestDoublesTests.aSimpleTable';
EXEC tSQLt.UndoTestDoubles;
DECLARE @RestoredObjectId INT = OBJECT_ID('UndoTestDoublesTests.aSimpleTable');
EXEC tSQLt.AssertEquals @Expected = @OriginalObjectId, @Actual = @RestoredObjectId;
END;
GO
CREATE PROCEDURE UndoTestDoublesTests.[test restores a trigger]
AS
BEGIN
CREATE TABLE UndoTestDoublesTests.aSimpleTable ( Id INT );
EXEC('CREATE TRIGGER aSimpleTrigger ON UndoTestDoublesTests.aSimpleTable FOR INSERT AS RETURN;');
SELECT X.ObjectName, OBJECT_ID('UndoTestDoublesTests.'+X.ObjectName) ObjectId
INTO #OriginalObjectIds
FROM (VALUES('aSimpleTrigger')) X (ObjectName);
EXEC tSQLt.FakeTable @TableName = 'UndoTestDoublesTests.aSimpleTable';
EXEC tSQLt.ApplyTrigger @TableName = 'UndoTestDoublesTests.aSimpleTable', @TriggerName = 'aSimpleTrigger';
EXEC tSQLt.UndoTestDoubles;
SELECT X.ObjectName, OBJECT_ID('UndoTestDoublesTests.'+X.ObjectName) ObjectId
INTO #RestoredObjectIds
FROM (VALUES('aSimpleTrigger')) X (ObjectName);
EXEC tSQLt.AssertEqualsTable @Expected = '#OriginalObjectIds', @Actual = '#RestoredObjectIds';
END;
GO
CREATE PROCEDURE UndoTestDoublesTests.CreateTableWithTriggersAndConstraints
@Number NVARCHAR(MAX)
AS
BEGIN
DECLARE @cmd NVARCHAR(MAX);
SELECT @cmd = 'CREATE TABLE UndoTestDoublesTests.aSimpleTable0 ( Id INT CONSTRAINT aSimpleTable0C1 CHECK(Id > 9) CONSTRAINT aSimpleTable0PK PRIMARY KEY);';
SET @cmd = REPLACE(@cmd,'0',@Number);EXEC(@cmd);
SET @cmd = 'CREATE TRIGGER aSimpleTrigger0i ON UndoTestDoublesTests.aSimpleTable0 FOR INSERT AS RETURN;';
SET @cmd = REPLACE(@cmd,'0',@Number);EXEC(@cmd);
SET @cmd = 'CREATE TRIGGER aSimpleTrigger0u ON UndoTestDoublesTests.aSimpleTable0 FOR UPDATE AS RETURN;';
SET @cmd = REPLACE(@cmd,'0',@Number);EXEC(@cmd);
END;
GO
CREATE PROCEDURE UndoTestDoublesTests.FakeTableAndApplyTriggersAndConstraints
@Number NVARCHAR(MAX)
AS
BEGIN
DECLARE @cmd NVARCHAR(MAX);
SELECT @cmd = '
EXEC tSQLt.FakeTable @TableName=''UndoTestDoublesTests.aSimpleTable0'';
EXEC tSQLt.ApplyConstraint @TableName=''UndoTestDoublesTests.aSimpleTable0'', @ConstraintName = ''aSimpleTable0C1'';
EXEC tSQLt.ApplyConstraint @TableName=''UndoTestDoublesTests.aSimpleTable0'', @ConstraintName = ''aSimpleTable0PK'';
EXEC tSQLt.ApplyTrigger @TableName=''UndoTestDoublesTests.aSimpleTable0'', @TriggerName = ''aSimpleTrigger0i'';
EXEC tSQLt.ApplyTrigger @TableName=''UndoTestDoublesTests.aSimpleTable0'', @TriggerName = ''aSimpleTrigger0u'';
';
SET @cmd = REPLACE(@cmd,'0',@Number);EXEC(@cmd);
END;
GO
CREATE PROCEDURE UndoTestDoublesTests.[test restores objects after multiple fake actions and deletes test doubles]
AS
BEGIN
EXEC UndoTestDoublesTests.CreateTableWithTriggersAndConstraints '1';
EXEC UndoTestDoublesTests.CreateTableWithTriggersAndConstraints '2';
EXEC UndoTestDoublesTests.CreateTableWithTriggersAndConstraints '3';
SELECT O.object_id,SCHEMA_NAME(O.schema_id) schema_name, O.name object_name
INTO #OriginalObjectIds
FROM sys.objects O;
EXEC UndoTestDoublesTests.FakeTableAndApplyTriggersAndConstraints '1';
EXEC UndoTestDoublesTests.FakeTableAndApplyTriggersAndConstraints '2';
EXEC UndoTestDoublesTests.FakeTableAndApplyTriggersAndConstraints '3';
EXEC UndoTestDoublesTests.FakeTableAndApplyTriggersAndConstraints '1';
EXEC UndoTestDoublesTests.FakeTableAndApplyTriggersAndConstraints '2';
EXEC UndoTestDoublesTests.FakeTableAndApplyTriggersAndConstraints '3';
EXEC UndoTestDoublesTests.FakeTableAndApplyTriggersAndConstraints '1';
EXEC UndoTestDoublesTests.FakeTableAndApplyTriggersAndConstraints '2';
EXEC UndoTestDoublesTests.FakeTableAndApplyTriggersAndConstraints '3';
EXEC tSQLt.UndoTestDoubles;
SELECT O.object_id,SCHEMA_NAME(O.schema_id) schema_name, O.name object_name
INTO #RestoredObjectIds
FROM sys.objects O;
SELECT * INTO #ShouldBeEmpty
FROM
(
SELECT 'Expected' T,* FROM (SELECT * FROM #OriginalObjectIds EXCEPT SELECT * FROM #RestoredObjectIds) E
UNION ALL
SELECT 'Actual' T,* FROM (SELECT * FROM #RestoredObjectIds EXCEPT SELECT * FROM #OriginalObjectIds) A
) T;
EXEC tSQLt.AssertEmptyTable @TableName = '#ShouldBeEmpty';
END;
GO
CREATE PROCEDURE UndoTestDoublesTests.[test tSQLt.Private_RenamedObjectLog is empty after execution]
AS
BEGIN
CREATE TABLE UndoTestDoublesTests.aSimpleTable ( Id INT );
EXEC tSQLt.FakeTable @TableName = 'UndoTestDoublesTests.aSimpleTable';
EXEC tSQLt.UndoTestDoubles;
EXEC tSQLt.AssertEmptyTable @TableName = 'tSQLt.Private_RenamedObjectLog';
END;
GO
CREATE PROCEDURE UndoTestDoublesTests.[test restores a faked stored procedure]
AS
BEGIN
EXEC ('CREATE PROCEDURE UndoTestDoublesTests.aSimpleSSP @Id INT AS RETURN;');
DECLARE @OriginalObjectId INT = OBJECT_ID('UndoTestDoublesTests.aSimpleSSP');
EXEC tSQLt.SpyProcedure @ProcedureName = 'UndoTestDoublesTests.aSimpleSSP';
EXEC tSQLt.UndoTestDoubles;
DECLARE @RestoredObjectId INT = OBJECT_ID('UndoTestDoublesTests.aSimpleSSP');
EXEC tSQLt.AssertEquals @Expected = @OriginalObjectId, @Actual = @RestoredObjectId;
END;
GO
CREATE PROCEDURE UndoTestDoublesTests.[test restores a faked view]
AS
BEGIN
EXEC ('CREATE VIEW UndoTestDoublesTests.aSimpleView AS SELECT NULL X;');
DECLARE @OriginalObjectId INT = OBJECT_ID('UndoTestDoublesTests.aSimpleView');
EXEC tSQLt.FakeTable @TableName = 'UndoTestDoublesTests.aSimpleView';
EXEC tSQLt.UndoTestDoubles;
DECLARE @RestoredObjectId INT = OBJECT_ID('UndoTestDoublesTests.aSimpleView');
EXEC tSQLt.AssertEquals @Expected = @OriginalObjectId, @Actual = @RestoredObjectId;
END;
GO
CREATE PROCEDURE UndoTestDoublesTests.[test restores a faked function]
AS
BEGIN
EXEC ('CREATE FUNCTION UndoTestDoublesTests.aSimpleITVF() RETURNS TABLE AS RETURN SELECT NULL X;');
EXEC ('CREATE FUNCTION UndoTestDoublesTests.aSimpleTVF() RETURNS @R TABLE(i INT) AS BEGIN RETURN; END;');
EXEC ('CREATE FUNCTION UndoTestDoublesTests.aSimpleSVF() RETURNS INT AS BEGIN RETURN NULL; END;');
EXEC ('CREATE FUNCTION UndoTestDoublesTests.aTempSVF() RETURNS INT AS BEGIN RETURN NULL; END;');
SELECT O.object_id,SCHEMA_NAME(O.schema_id) schema_name, O.name object_name, O.type_desc
INTO #OriginalObjectIds
FROM sys.objects O;
EXEC tSQLt.FakeFunction @FunctionName = 'UndoTestDoublesTests.aSimpleITVF', @FakeDataSource = '(VALUES(NULL))X(X)';
EXEC tSQLt.FakeFunction @FunctionName = 'UndoTestDoublesTests.aSimpleTVF', @FakeDataSource = '(VALUES(NULL))X(X)';
EXEC tSQLt.FakeFunction @FunctionName = 'UndoTestDoublesTests.aSimpleSVF', @FakeFunctionName = 'UndoTestDoublesTests.aTempSVF';
EXEC tSQLt.UndoTestDoubles;
SELECT O.object_id,SCHEMA_NAME(O.schema_id) schema_name, O.name object_name, O.type_desc
INTO #RestoredObjectIds
FROM sys.objects O;
SELECT * INTO #ShouldBeEmpty
FROM
(
SELECT 'Expected' T,* FROM (SELECT * FROM #OriginalObjectIds EXCEPT SELECT * FROM #RestoredObjectIds) E
UNION ALL
SELECT 'Actual' T,* FROM (SELECT * FROM #RestoredObjectIds EXCEPT SELECT * FROM #OriginalObjectIds) A
) T;
EXEC tSQLt.AssertEmptyTable @TableName = '#ShouldBeEmpty';
END;
GO
CREATE PROCEDURE UndoTestDoublesTests.[test objects renamed by RemoveObject are restored if there is no other object of the same original name]
AS
BEGIN
EXEC ('CREATE TABLE UndoTestDoublesTests.aSimpleTable(i INT);');
SELECT O.object_id,SCHEMA_NAME(O.schema_id) schema_name, O.name object_name, O.type_desc
INTO #OriginalObjectIds
FROM sys.objects O;
EXEC tSQLt.RemoveObject @ObjectName='UndoTestDoublesTests.aSimpleTable';
EXEC tSQLt.UndoTestDoubles;
SELECT O.object_id,SCHEMA_NAME(O.schema_id) schema_name, O.name object_name, O.type_desc
INTO #RestoredObjectIds
FROM sys.objects O;
SELECT * INTO #ShouldBeEmpty
FROM
(
SELECT 'Expected' T,* FROM (SELECT * FROM #OriginalObjectIds EXCEPT SELECT * FROM #RestoredObjectIds) E
UNION ALL
SELECT 'Actual' T,* FROM (SELECT * FROM #RestoredObjectIds EXCEPT SELECT * FROM #OriginalObjectIds) A
) T;
EXEC tSQLt.AssertEmptyTable @TableName = '#ShouldBeEmpty';
END;
GO
CREATE PROCEDURE UndoTestDoublesTests.[test objects renamed by RemoveObject are restored and conflicting objects with IsTempObject property are deleted]
AS
BEGIN
EXEC ('CREATE TABLE UndoTestDoublesTests.aSimpleTable(i INT);');
SELECT O.object_id,SCHEMA_NAME(O.schema_id) schema_name, O.name object_name, O.type_desc
INTO #OriginalObjectIds
FROM sys.objects O;
EXEC tSQLt.RemoveObject @ObjectName='UndoTestDoublesTests.aSimpleTable';
EXEC ('CREATE PROCEDURE UndoTestDoublesTests.aSimpleTable AS PRINT ''Who came up with that name?'';');
EXEC tSQLt.Private_MarktSQLtTempObject @ObjectName = 'UndoTestDoublesTests.aSimpleTable', @ObjectType = N'PROCEDURE', @NewNameOfOriginalObject = '';
EXEC tSQLt.UndoTestDoubles;
SELECT O.object_id,SCHEMA_NAME(O.schema_id) schema_name, O.name object_name, O.type_desc
INTO #RestoredObjectIds
FROM sys.objects O;
SELECT * INTO #ShouldBeEmpty
FROM
(
SELECT 'Expected' T,* FROM (SELECT * FROM #OriginalObjectIds EXCEPT SELECT * FROM #RestoredObjectIds) E
UNION ALL
SELECT 'Actual' T,* FROM (SELECT * FROM #RestoredObjectIds EXCEPT SELECT * FROM #OriginalObjectIds) A
) T;
EXEC tSQLt.AssertEmptyTable @TableName = '#ShouldBeEmpty';
END;
GO
CREATE PROCEDURE UndoTestDoublesTests.[test synonyms are restored]
AS
BEGIN
EXEC ('CREATE TABLE UndoTestDoublesTests.aSimpleTable(i INT);');
EXEC ('CREATE SYNONYM UndoTestDoublesTests.aSimpleSynonym FOR UndoTestDoublesTests.aSimpleTable;');
SELECT O.object_id,SCHEMA_NAME(O.schema_id) schema_name, O.name object_name, O.type_desc
INTO #OriginalObjectIds
FROM sys.objects O;
EXEC tSQLt.FakeTable @TableName = 'UndoTestDoublesTests.aSimpleSynonym';
EXEC tSQLt.UndoTestDoubles;
SELECT O.object_id,SCHEMA_NAME(O.schema_id) schema_name, O.name object_name, O.type_desc
INTO #RestoredObjectIds
FROM sys.objects O;
SELECT * INTO #ShouldBeEmpty
FROM
(
SELECT 'Expected' T,* FROM (SELECT * FROM #OriginalObjectIds EXCEPT SELECT * FROM #RestoredObjectIds) E
UNION ALL
SELECT 'Actual' T,* FROM (SELECT * FROM #RestoredObjectIds EXCEPT SELECT * FROM #OriginalObjectIds) A
) T;
EXEC tSQLt.AssertEmptyTable @TableName = '#ShouldBeEmpty';
END;
GO
CREATE PROCEDURE UndoTestDoublesTests.[test doubled synonyms with IsTempObject property are deleted]
AS
BEGIN
EXEC ('CREATE TABLE UndoTestDoublesTests.aSimpleTable(i INT);');
EXEC ('CREATE VIEW UndoTestDoublesTests.aSimpleObject AS SELECT 1 X;');
SELECT O.object_id,SCHEMA_NAME(O.schema_id) schema_name, O.name object_name, O.type_desc
INTO #OriginalObjectIds
FROM sys.objects O;
EXEC tSQLt.RemoveObject @ObjectName='UndoTestDoublesTests.aSimpleObject';
EXEC ('CREATE SYNONYM UndoTestDoublesTests.aSimpleObject FOR UndoTestDoublesTests.aSimpleTable;');
EXEC tSQLt.Private_MarktSQLtTempObject @ObjectName='UndoTestDoublesTests.aSimpleObject', @ObjectType='SYNONYM', @NewNameOfOriginalObject = '';
EXEC tSQLt.UndoTestDoubles;
SELECT O.object_id,SCHEMA_NAME(O.schema_id) schema_name, O.name object_name, O.type_desc
INTO #RestoredObjectIds
FROM sys.objects O;
SELECT * INTO #ShouldBeEmpty
FROM
(
SELECT 'Expected' T,* FROM (SELECT * FROM #OriginalObjectIds EXCEPT SELECT * FROM #RestoredObjectIds) E
UNION ALL
SELECT 'Actual' T,* FROM (SELECT * FROM #RestoredObjectIds EXCEPT SELECT * FROM #OriginalObjectIds) A
) T;
EXEC tSQLt.AssertEmptyTable @TableName = '#ShouldBeEmpty';
END;
GO
CREATE PROCEDURE UndoTestDoublesTests.[test drops only objects that are marked as temporary (IsTempObject = 1)]
AS
BEGIN
CREATE TABLE UndoTestDoublesTests.SimpleTable1 (i INT);
EXEC tSQLt.RemoveObject @ObjectName = 'UndoTestDoublesTests.SimpleTable1';
CREATE TABLE UndoTestDoublesTests.SimpleTable1 (i INT);
EXEC tSQLt.ExpectException @ExpectedMessage = 'Attempting to remove object(s) that is/are not marked as temporary. Use @Force = 1 to override. ([UndoTestDoublesTests].[SimpleTable1])', @ExpectedSeverity = 16, @ExpectedState = 10;
EXEC tSQLt.UndoTestDoubles;
END;
GO
CREATE PROCEDURE UndoTestDoublesTests.[test does not drop multiple unmarked objects (IsTempObject is not set or is not 1)]
AS
BEGIN
CREATE TABLE UndoTestDoublesTests.SimpleTable1 (i INT);
CREATE TABLE UndoTestDoublesTests.SimpleTable2 (i INT);
CREATE TABLE UndoTestDoublesTests.SimpleTable3 (i INT);
EXEC tSQLt.RemoveObject @ObjectName = 'UndoTestDoublesTests.SimpleTable1';
EXEC tSQLt.RemoveObject @ObjectName = 'UndoTestDoublesTests.SimpleTable2';
EXEC tSQLt.RemoveObject @ObjectName = 'UndoTestDoublesTests.SimpleTable3';
CREATE TABLE UndoTestDoublesTests.SimpleTable1 (i INT);
CREATE TABLE UndoTestDoublesTests.SimpleTable2 (i INT);
CREATE TABLE UndoTestDoublesTests.SimpleTable3 (i INT);
EXEC tSQLt.ExpectException @ExpectedMessage = 'Attempting to remove object(s) that is/are not marked as temporary. Use @Force = 1 to override. ([UndoTestDoublesTests].[SimpleTable1], [UndoTestDoublesTests].[SimpleTable2], [UndoTestDoublesTests].[SimpleTable3])', @ExpectedSeverity = 16, @ExpectedState = 10;
EXEC tSQLt.UndoTestDoubles;
END;
GO
CREATE PROCEDURE UndoTestDoublesTests.[test does not drop marked object where IsTempObject is not 1]
AS
BEGIN
CREATE TABLE UndoTestDoublesTests.SimpleTable1 (i INT);
EXEC tSQLt.RemoveObject @ObjectName = 'UndoTestDoublesTests.SimpleTable1';
CREATE TABLE UndoTestDoublesTests.SimpleTable1 (i INT);
EXEC sys.sp_addextendedproperty
@name = N'tSQLt.IsTempObject',
@value = 42,
@level0type = N'SCHEMA', @level0name = 'UndoTestDoublesTests',
@level1type = N'TABLE', @level1name = 'SimpleTable1';
EXEC tSQLt.ExpectException @ExpectedMessage = 'Attempting to remove object(s) that is/are not marked as temporary. Use @Force = 1 to override. ([UndoTestDoublesTests].[SimpleTable1])', @ExpectedSeverity = 16, @ExpectedState = 10;
EXEC tSQLt.UndoTestDoubles;
END;
GO
CREATE PROCEDURE UndoTestDoublesTests.[test objects renamed by RemoveObject are restored and conflicting objects without IsTempObject property are deleted if @Force=1]
AS
BEGIN
EXEC ('CREATE TABLE UndoTestDoublesTests.aSimpleTable(i INT);');
SELECT O.object_id,SCHEMA_NAME(O.schema_id) schema_name, O.name object_name, O.type_desc
INTO #OriginalObjectIds
FROM sys.objects O;
EXEC tSQLt.RemoveObject @ObjectName='UndoTestDoublesTests.aSimpleTable';
EXEC ('CREATE PROCEDURE UndoTestDoublesTests.aSimpleTable AS PRINT ''Who came up with that name?'';');
EXEC tSQLt.UndoTestDoubles @Force=1;
SELECT O.object_id,SCHEMA_NAME(O.schema_id) schema_name, O.name object_name, O.type_desc
INTO #RestoredObjectIds
FROM sys.objects O;
SELECT * INTO #ShouldBeEmpty
FROM
(
SELECT 'Expected' T,* FROM (SELECT * FROM #OriginalObjectIds EXCEPT SELECT * FROM #RestoredObjectIds) E
UNION ALL
SELECT 'Actual' T,* FROM (SELECT * FROM #RestoredObjectIds EXCEPT SELECT * FROM #OriginalObjectIds) A
) T;
EXEC tSQLt.AssertEmptyTable @TableName = '#ShouldBeEmpty';
END;
GO
CREATE PROCEDURE UndoTestDoublesTests.[test warning message is printed for objects without IsTempObject property that are deleted if @Force=1]
AS
BEGIN
EXEC ('CREATE TABLE UndoTestDoublesTests.aSimpleTable(i INT);');
EXEC tSQLt.RemoveObject @ObjectName='UndoTestDoublesTests.aSimpleTable';
EXEC ('CREATE PROCEDURE UndoTestDoublesTests.aSimpleTable AS PRINT ''Who came up with that name?'';');
EXEC tSQLt.SpyProcedure @ProcedureName = 'tSQLt.Private_Print';
EXEC sys.sp_dropextendedproperty
@name = N'tSQLt.IsTempObject',
@level0type = N'SCHEMA', @level0name = 'tSQLt',
@level1type = N'TABLE', @level1name = 'Private_Print_SpyProcedureLog';
EXEC tSQLt.UndoTestDoubles @Force=1;
SELECT Message INTO #Actual FROM tSQLt.Private_Print_SpyProcedureLog;
SELECT TOP(0) A.* INTO #Expected FROM #Actual A RIGHT JOIN #Actual X ON 1=0;
INSERT INTO #Expected
VALUES('WARNING: @Force has been set to 1. Overriding the following error(s):Attempting to remove object(s) that is/are not marked as temporary. Use @Force = 1 to override. ([UndoTestDoublesTests].[aSimpleTable])');
EXEC tSQLt.AssertEqualsTable '#Expected','#Actual';
END;
GO
/* --------------------------------------------------------------------------------------------- */
GO
CREATE PROCEDURE UndoTestDoublesTests.[test objects that are replaced multiple times by objects not marked as IsTempObject are restored if @Force=1]
AS
BEGIN
EXEC ('CREATE TABLE UndoTestDoublesTests.aSimpleTable(i INT);');
SELECT O.object_id,SCHEMA_NAME(O.schema_id) schema_name, O.name object_name, O.type_desc
INTO #OriginalObjectIds
FROM sys.objects O;
EXEC tSQLt.RemoveObject @ObjectName='UndoTestDoublesTests.aSimpleTable';
EXEC ('CREATE PROCEDURE UndoTestDoublesTests.aSimpleTable AS PRINT ''Replacement 1'';');
EXEC tSQLt.RemoveObject @ObjectName='UndoTestDoublesTests.aSimpleTable';
EXEC ('CREATE PROCEDURE UndoTestDoublesTests.aSimpleTable AS PRINT ''Replacement 2'';');
EXEC tSQLt.RemoveObject @ObjectName='UndoTestDoublesTests.aSimpleTable';
EXEC ('CREATE PROCEDURE UndoTestDoublesTests.aSimpleTable AS PRINT ''Replacement 3'';');
EXEC tSQLt.UndoTestDoubles @Force=1;
SELECT O.object_id,SCHEMA_NAME(O.schema_id) schema_name, O.name object_name, O.type_desc
INTO #RestoredObjectIds
FROM sys.objects O;
SELECT * INTO #ShouldBeEmpty
FROM
(
SELECT 'Expected' T,* FROM (SELECT * FROM #OriginalObjectIds EXCEPT SELECT * FROM #RestoredObjectIds) E
UNION ALL
SELECT 'Actual' T,* FROM (SELECT * FROM #RestoredObjectIds EXCEPT SELECT * FROM #OriginalObjectIds) A
) T;
EXEC tSQLt.AssertEmptyTable @TableName = '#ShouldBeEmpty';
END;
GO
/* --------------------------------------------------------------------------------------------- */
GO
CREATE PROCEDURE UndoTestDoublesTests.[test non-testdouble object with @IsTempObjects=1 is also dropped]
AS
BEGIN
SELECT O.object_id,SCHEMA_NAME(O.schema_id) schema_name, O.name object_name, O.type_desc
INTO #OriginalObjectIds
FROM sys.objects O;
CREATE TABLE UndoTestDoublesTests.SimpleTable1 (i INT);
EXEC tSQLt.Private_MarktSQLtTempObject @ObjectName = 'UndoTestDoublesTests.SimpleTable1', @ObjectType=N'TABLE', @NewNameOfOriginalObject=NULL;
EXEC tSQLt.UndoTestDoubles;
SELECT O.object_id,SCHEMA_NAME(O.schema_id) schema_name, O.name object_name, O.type_desc
INTO #RestoredObjectIds
FROM sys.objects O;
SELECT * INTO #ShouldBeEmpty
FROM
(
SELECT 'Expected' T,* FROM (SELECT * FROM #OriginalObjectIds EXCEPT SELECT * FROM #RestoredObjectIds) E
UNION ALL
SELECT 'Actual' T,* FROM (SELECT * FROM #RestoredObjectIds EXCEPT SELECT * FROM #OriginalObjectIds) A
) T;
EXEC tSQLt.AssertEmptyTable @TableName = '#ShouldBeEmpty';
END;
GO
/* --------------------------------------------------------------------------------------------- */
GO
CREATE PROCEDURE UndoTestDoublesTests.[test multiple non-testdouble objects with @IsTempObjects=1 are all dropped]
AS
BEGIN
SELECT O.object_id,SCHEMA_NAME(O.schema_id) schema_name, O.name object_name, O.type_desc
INTO #OriginalObjectIds
FROM sys.objects O;
CREATE TABLE UndoTestDoublesTests.SimpleTable1 (i INT);
CREATE TABLE UndoTestDoublesTests.SimpleTable2 (i INT);
CREATE TABLE UndoTestDoublesTests.SimpleTable3 (i INT);
EXEC tSQLt.Private_MarktSQLtTempObject @ObjectName = 'UndoTestDoublesTests.SimpleTable1', @ObjectType = 'TABLE', @NewNameOfOriginalObject = NULL;
EXEC tSQLt.Private_MarktSQLtTempObject @ObjectName = 'UndoTestDoublesTests.SimpleTable2', @ObjectType = 'TABLE', @NewNameOfOriginalObject = NULL;
EXEC tSQLt.Private_MarktSQLtTempObject @ObjectName = 'UndoTestDoublesTests.SimpleTable3', @ObjectType = 'TABLE', @NewNameOfOriginalObject = NULL;
EXEC tSQLt.UndoTestDoubles;
SELECT O.object_id,SCHEMA_NAME(O.schema_id) schema_name, O.name object_name, O.type_desc
INTO #RestoredObjectIds
FROM sys.objects O;
SELECT * INTO #ShouldBeEmpty
FROM
(
SELECT 'Expected' T,* FROM (SELECT * FROM #OriginalObjectIds EXCEPT SELECT * FROM #RestoredObjectIds) E
UNION ALL
SELECT 'Actual' T,* FROM (SELECT * FROM #RestoredObjectIds EXCEPT SELECT * FROM #OriginalObjectIds) A
) T;
EXEC tSQLt.AssertEmptyTable @TableName = '#ShouldBeEmpty';
END;
GO
/** ------------------------------------------------------------------------------------------- **/
GO
CREATE PROCEDURE UndoTestDoublesTests.[test recovers table that was first faked and then removed]
AS
BEGIN
CREATE TABLE UndoTestDoublesTests.SimpleTable1 (i INT);
SELECT O.object_id,SCHEMA_NAME(O.schema_id) schema_name, O.name object_name, O.type_desc
INTO #OriginalObjectIds
FROM sys.objects O;
EXEC tSQLt.FakeTable @TableName = 'UndoTestDoublesTests.SimpleTable1';
EXEC tSQLt.RemoveObject @ObjectName = 'UndoTestDoublesTests.SimpleTable1';
EXEC tSQLt.UndoTestDoubles;
SELECT O.object_id,SCHEMA_NAME(O.schema_id) schema_name, O.name object_name, O.type_desc
INTO #RestoredObjectIds
FROM sys.objects O;
SELECT * INTO #ShouldBeEmpty
FROM
(
SELECT 'Expected' T,* FROM (SELECT * FROM #OriginalObjectIds EXCEPT SELECT * FROM #RestoredObjectIds) E
UNION ALL
SELECT 'Actual' T,* FROM (SELECT * FROM #RestoredObjectIds EXCEPT SELECT * FROM #OriginalObjectIds) A
) T;
EXEC tSQLt.AssertEmptyTable @TableName = '#ShouldBeEmpty';
END;
GO
/** ------------------------------------------------------------------------------------------- **/
GO
CREATE PROCEDURE UndoTestDoublesTests.[test throws useful error if two objects with @IsTempObject<>1 need to be renamed to the same name]
AS
BEGIN
CREATE TABLE UndoTestDoublesTests.SimpleTable1 (i INT);
EXEC tSQLt.RemoveObject @ObjectName = 'UndoTestDoublesTests.SimpleTable1';
CREATE TABLE UndoTestDoublesTests.SimpleTable1 (i INT);
EXEC tSQLt.RemoveObject @ObjectName = 'UndoTestDoublesTests.SimpleTable1';
EXEC tSQLt.ExpectException @ExpectedMessagePattern = 'Attempting to rename two or more objects to the same name. Use @Force = 1 to override, only first object of each rename survives. ({[[]tSQLt_tempobject_%], [[]tSQLt_tempobject_%]}-->[[]UndoTestDoublesTests].[[]SimpleTable1])', @ExpectedSeverity = 16, @ExpectedState = 10;
EXEC tSQLt.UndoTestDoubles;
END;
GO
/** ------------------------------------------------------------------------------------------- **/
GO
CREATE PROCEDURE UndoTestDoublesTests.[test throws useful error if there are multiple object tuples with @IsTempObject<>1 needing to be renamed to the same name]
AS
BEGIN
CREATE TABLE UndoTestDoublesTests.SimpleTable1 (i INT);
EXEC tSQLt.RemoveObject @ObjectName = 'UndoTestDoublesTests.SimpleTable1';
CREATE TABLE UndoTestDoublesTests.SimpleTable1 (i INT);
EXEC tSQLt.RemoveObject @ObjectName = 'UndoTestDoublesTests.SimpleTable1';
CREATE TABLE UndoTestDoublesTests.SimpleTable2 (i INT);
EXEC tSQLt.RemoveObject @ObjectName = 'UndoTestDoublesTests.SimpleTable2';
CREATE TABLE UndoTestDoublesTests.SimpleTable2 (i INT);
EXEC tSQLt.RemoveObject @ObjectName = 'UndoTestDoublesTests.SimpleTable2';
CREATE TABLE UndoTestDoublesTests.SimpleTable2 (i INT);
EXEC tSQLt.RemoveObject @ObjectName = 'UndoTestDoublesTests.SimpleTable2';
CREATE TABLE UndoTestDoublesTests.SimpleTable3 (i INT);
EXEC tSQLt.RemoveObject @ObjectName = 'UndoTestDoublesTests.SimpleTable3';
CREATE TABLE UndoTestDoublesTests.SimpleTable3 (i INT);
EXEC tSQLt.RemoveObject @ObjectName = 'UndoTestDoublesTests.SimpleTable3';
EXEC tSQLt.ExpectException @ExpectedMessagePattern = 'Attempting to rename two or more objects to the same name. Use @Force = 1 to override, only first object of each rename survives. ({[[]tSQLt_tempobject_%], [[]tSQLt_tempobject_%]}-->[[]UndoTestDoublesTests].[[]SimpleTable1]; {[[]tSQLt_tempobject_%], [[]tSQLt_tempobject_%], [[]tSQLt_tempobject_%]}-->[[]UndoTestDoublesTests].[[]SimpleTable2]; {[[]tSQLt_tempobject_%], [[]tSQLt_tempobject_%]}-->[[]UndoTestDoublesTests].[[]SimpleTable3])', @ExpectedSeverity = 16, @ExpectedState = 10;
EXEC tSQLt.UndoTestDoubles;
END;
GO
/*-----------------------------------------------------------------------------------------------*/
GO
CREATE PROCEDURE UndoTestDoublesTests.[test if two objects with @IsTempObject<>1 need to be renamed to the same name and @Force=1 the oldest survives]
AS
BEGIN
CREATE TABLE UndoTestDoublesTests.SimpleTable1 (i INT);
INSERT INTO UndoTestDoublesTests.SimpleTable1 VALUES (6);
EXEC tSQLt.RemoveObject @ObjectName = 'UndoTestDoublesTests.SimpleTable1';
CREATE TABLE UndoTestDoublesTests.SimpleTable1 (i INT);
INSERT INTO UndoTestDoublesTests.SimpleTable1 VALUES (4);
EXEC tSQLt.RemoveObject @ObjectName = 'UndoTestDoublesTests.SimpleTable1';
EXEC tSQLt.UndoTestDoubles @Force=1;
SELECT i INTO #Actual FROM UndoTestDoublesTests.SimpleTable1;
SELECT TOP(0) A.* INTO #Expected FROM #Actual A RIGHT JOIN #Actual X ON 1=0;
INSERT INTO #Expected VALUES(6);
EXEC tSQLt.AssertEqualsTable '#Expected','#Actual';
END;
GO
/** ------------------------------------------------------------------------------------------- **/
GO
CREATE PROCEDURE UndoTestDoublesTests.[test two objects with @IsTempObject<>1 and the same name but in different schemas are restored]
AS
BEGIN
EXEC('CREATE SCHEMA RandomSchema1;');
CREATE TABLE RandomSchema1.SimpleTable1 (i INT);
INSERT INTO RandomSchema1.SimpleTable1 VALUES (4);
EXEC tSQLt.RemoveObject @ObjectName = 'RandomSchema1.SimpleTable1';
EXEC('CREATE SCHEMA RandomSchema2;');
CREATE TABLE RandomSchema2.SimpleTable1 (i INT);
INSERT INTO RandomSchema2.SimpleTable1 VALUES (6);
EXEC tSQLt.RemoveObject @ObjectName = 'RandomSchema2.SimpleTable1';
EXEC tSQLt.UndoTestDoubles;
SELECT * INTO #Actual
FROM(
SELECT 'RandomSchema1' [schema_name], i FROM RandomSchema1.SimpleTable1
UNION
SELECT 'RandomSchema2' [schema_name], i FROM RandomSchema2.SimpleTable1
) A
SELECT TOP(0) A.* INTO #Expected FROM #Actual A RIGHT JOIN #Actual X ON 1=0;
INSERT INTO #Expected VALUES('RandomSchema1', 4),('RandomSchema2',6);
EXEC tSQLt.AssertEqualsTable '#Expected','#Actual';
END;
GO
/** ------------------------------------------------------------------------------------------- **/
GO
CREATE PROCEDURE UndoTestDoublesTests.[test throws useful error if there are multiple object tuples in separate schemata but all with the same name]
AS
BEGIN
EXEC('CREATE SCHEMA RandomSchema1;');
EXEC('CREATE SCHEMA RandomSchema2;');
DECLARE @CurrentTableObjectId INT
CREATE TABLE RandomSchema1.SimpleTable1 (i INT);
SET @CurrentTableObjectId = OBJECT_ID('RandomSchema1.SimpleTable1');
EXEC tSQLt.RemoveObject @ObjectName = 'RandomSchema1.SimpleTable1';
DECLARE @Name1A NVARCHAR(MAX) = OBJECT_NAME(@CurrentTableObjectId);
CREATE TABLE RandomSchema1.SimpleTable1 (i INT);
SET @CurrentTableObjectId = OBJECT_ID('RandomSchema1.SimpleTable1');
EXEC tSQLt.RemoveObject @ObjectName = 'RandomSchema1.SimpleTable1';
DECLARE @Name1B NVARCHAR(MAX) = OBJECT_NAME(@CurrentTableObjectId);
CREATE TABLE RandomSchema2.SimpleTable1 (i INT);
SET @CurrentTableObjectId = OBJECT_ID('RandomSchema2.SimpleTable1');
EXEC tSQLt.RemoveObject @ObjectName = 'RandomSchema2.SimpleTable1';
DECLARE @Name2A NVARCHAR(MAX) = OBJECT_NAME(@CurrentTableObjectId);
CREATE TABLE RandomSchema2.SimpleTable1 (i INT);
SET @CurrentTableObjectId = OBJECT_ID('RandomSchema2.SimpleTable1');
EXEC tSQLt.RemoveObject @ObjectName = 'RandomSchema2.SimpleTable1';
DECLARE @Name2B NVARCHAR(MAX) = OBJECT_NAME(@CurrentTableObjectId);
DECLARE @ExpectedMessage NVARCHAR(MAX) = 'Attempting to rename two or more objects to the same name. Use @Force = 1 to override, only first object of each rename survives. ({['+@Name1A+'], ['+@Name1B+']}-->[RandomSchema1].[SimpleTable1]; {['+@Name2A+'], ['+@Name2B+']}-->[RandomSchema2].[SimpleTable1])'
EXEC tSQLt.ExpectException @ExpectedMessage = @ExpectedMessage, @ExpectedSeverity = 16, @ExpectedState = 10;
EXEC tSQLt.UndoTestDoubles;
END;
GO
/** ------------------------------------------------------------------------------------------- **/
GO
CREATE PROCEDURE UndoTestDoublesTests.[test can handle the kitchen sink]
AS
BEGIN
EXEC('CREATE SCHEMA RandomSchema1;');
EXEC('CREATE SCHEMA RandomSchema2;');
CREATE TABLE RandomSchema1.SimpleTable1 (i INT);
CREATE TABLE RandomSchema1.SimpleTable2 (i INT CONSTRAINT [s1t2pk] PRIMARY KEY);
CREATE TABLE RandomSchema1.SimpleTable3 (i INT);
CREATE TABLE RandomSchema2.SimpleTable1 (i INT);
CREATE TABLE RandomSchema2.SimpleTable2 (i INT);
CREATE TABLE RandomSchema2.SimpleTable3 (i INT);
EXEC('CREATE PROCEDURE RandomSchema1.Proc1 AS RETURN;')
EXEC('CREATE PROCEDURE RandomSchema1.Proc2 AS RETURN;')
EXEC('CREATE PROCEDURE RandomSchema1.Proc3 AS RETURN;')
SELECT O.object_id,SCHEMA_NAME(O.schema_id) schema_name, O.name object_name, O.type_desc
INTO #OriginalObjectIds
FROM sys.objects O;
EXEC tSQLt.FakeTable @TableName = 'RandomSchema1.SimpleTable1';
CREATE TABLE UndoTestDoublesTests.SimpleTable1 (i INT);
EXEC tSQLt.Private_MarktSQLtTempObject @ObjectName = 'UndoTestDoublesTests.SimpleTable1', @ObjectType = 'TABLE', @NewNameOfOriginalObject = NULL;
EXEC tSQLt.SpyProcedure @ProcedureName = 'RandomSchema1.Proc1';
EXEC tSQLt.FakeTable @TableName = 'RandomSchema1.SimpleTable1';
EXEC tSQLt.RemoveObject @ObjectName = 'RandomSchema1.SimpleTable3';
EXEC tSQLt.SpyProcedure @ProcedureName = 'RandomSchema1.Proc1';
EXEC tSQLt.FakeTable @TableName = 'RandomSchema1.SimpleTable2';
CREATE TABLE UndoTestDoublesTests.SimpleTable2 (i INT);
EXEC tSQLt.Private_MarktSQLtTempObject @ObjectName = 'UndoTestDoublesTests.SimpleTable2', @ObjectType = 'TABLE', @NewNameOfOriginalObject = NULL;
EXEC tSQLt.FakeTable @TableName = 'RandomSchema1.SimpleTable1';
EXEC tSQLt.ApplyConstraint @TableName = 'RandomSchema1.SimpleTable2', @ConstraintName = 's1t2pk';
EXEC tSQLt.SpyProcedure @ProcedureName = 'RandomSchema1.Proc1';
EXEC tSQLt.FakeTable @TableName = 'RandomSchema2.SimpleTable3';
EXEC tSQLt.RemoveObject @ObjectName = 'RandomSchema1.Proc3';
EXEC tSQLt.FakeTable @TableName = 'RandomSchema1.SimpleTable2';
EXEC tSQLt.SpyProcedure @ProcedureName = 'RandomSchema1.Proc1';
EXEC tSQLt.SpyProcedure @ProcedureName = 'RandomSchema1.Proc2';
EXEC tSQLt.SpyProcedure @ProcedureName = 'RandomSchema1.Proc1';
EXEC tSQLt.FakeTable @TableName = 'RandomSchema2.SimpleTable1';
EXEC tSQLt.FakeTable @TableName = 'RandomSchema2.SimpleTable3';
CREATE TABLE UndoTestDoublesTests.SimpleTable3 (i INT);
EXEC tSQLt.Private_MarktSQLtTempObject @ObjectName = 'UndoTestDoublesTests.SimpleTable3', @ObjectType = 'TABLE', @NewNameOfOriginalObject = NULL;
EXEC tSQLt.ApplyConstraint @TableName = 'RandomSchema1.SimpleTable2', @ConstraintName = 's1t2pk';
EXEC tSQLt.RemoveObject @ObjectName = 'RandomSchema1.SimpleTable2';
EXEC tSQLt.RemoveObject @ObjectName = 'RandomSchema1.SimpleTable1';
EXEC tSQLt.UndoTestDoubles;
SELECT O.object_id,SCHEMA_NAME(O.schema_id) schema_name, O.name object_name, O.type_desc
INTO #RestoredObjectIds
FROM sys.objects O;
SELECT * INTO #ShouldBeEmpty
FROM
(
SELECT 'Expected' T,* FROM (SELECT * FROM #OriginalObjectIds EXCEPT SELECT * FROM #RestoredObjectIds) E
UNION ALL
SELECT 'Actual' T,* FROM (SELECT * FROM #RestoredObjectIds EXCEPT SELECT * FROM #OriginalObjectIds) A
) T;
EXEC tSQLt.AssertEmptyTable @TableName = '#ShouldBeEmpty';
END;
GO
/*-----------------------------------------------------------------------------------------------*/
GO | the_stack |
alter table ACT_RE_PROCDEF add ENGINE_VERSION_ nvarchar(255);
update ACT_RE_PROCDEF set ENGINE_VERSION_ = 'v5';
alter table ACT_RE_DEPLOYMENT add ENGINE_VERSION_ nvarchar(255);
update ACT_RE_DEPLOYMENT set ENGINE_VERSION_ = 'v5';
alter table ACT_RU_EXECUTION add ROOT_PROC_INST_ID_ nvarchar(64);
create index ACT_IDX_EXEC_ROOT on ACT_RU_EXECUTION(ROOT_PROC_INST_ID_);
alter table ACT_RU_EXECUTION add IS_MI_ROOT_ tinyint;
create table ACT_RU_TIMER_JOB (
ID_ nvarchar(64) NOT NULL,
REV_ int,
TYPE_ nvarchar(255) NOT NULL,
LOCK_EXP_TIME_ datetime,
LOCK_OWNER_ nvarchar(255),
EXCLUSIVE_ bit,
EXECUTION_ID_ nvarchar(64),
PROCESS_INSTANCE_ID_ nvarchar(64),
PROC_DEF_ID_ nvarchar(64),
RETRIES_ int,
EXCEPTION_STACK_ID_ nvarchar(64),
EXCEPTION_MSG_ nvarchar(4000),
DUEDATE_ datetime NULL,
REPEAT_ nvarchar(255),
HANDLER_TYPE_ nvarchar(255),
HANDLER_CFG_ nvarchar(4000),
TENANT_ID_ nvarchar(255) default '',
primary key (ID_)
);
create table ACT_RU_SUSPENDED_JOB (
ID_ nvarchar(64) NOT NULL,
REV_ int,
TYPE_ nvarchar(255) NOT NULL,
EXCLUSIVE_ bit,
EXECUTION_ID_ nvarchar(64),
PROCESS_INSTANCE_ID_ nvarchar(64),
PROC_DEF_ID_ nvarchar(64),
RETRIES_ int,
EXCEPTION_STACK_ID_ nvarchar(64),
EXCEPTION_MSG_ nvarchar(4000),
DUEDATE_ datetime NULL,
REPEAT_ nvarchar(255),
HANDLER_TYPE_ nvarchar(255),
HANDLER_CFG_ nvarchar(4000),
TENANT_ID_ nvarchar(255) default '',
primary key (ID_)
);
create table ACT_RU_DEADLETTER_JOB (
ID_ nvarchar(64) NOT NULL,
REV_ int,
TYPE_ nvarchar(255) NOT NULL,
EXCLUSIVE_ bit,
EXECUTION_ID_ nvarchar(64),
PROCESS_INSTANCE_ID_ nvarchar(64),
PROC_DEF_ID_ nvarchar(64),
EXCEPTION_STACK_ID_ nvarchar(64),
EXCEPTION_MSG_ nvarchar(4000),
DUEDATE_ datetime NULL,
REPEAT_ nvarchar(255),
HANDLER_TYPE_ nvarchar(255),
HANDLER_CFG_ nvarchar(4000),
TENANT_ID_ nvarchar(255) default '',
primary key (ID_)
);
create index ACT_IDX_JOB_EXECUTION_ID on ACT_RU_JOB(EXECUTION_ID_);
create index ACT_IDX_JOB_PROCESS_INSTANCE_ID on ACT_RU_JOB(PROCESS_INSTANCE_ID_);
create index ACT_IDX_JOB_PROC_DEF_ID on ACT_RU_JOB(PROC_DEF_ID_);
create index ACT_IDX_TIMER_JOB_EXECUTION_ID on ACT_RU_TIMER_JOB(EXECUTION_ID_);
create index ACT_IDX_TIMER_JOB_PROCESS_INSTANCE_ID on ACT_RU_TIMER_JOB(PROCESS_INSTANCE_ID_);
create index ACT_IDX_TIMER_JOB_PROC_DEF_ID on ACT_RU_TIMER_JOB(PROC_DEF_ID_);
create index ACT_IDX_TIMER_JOB_EXCEPTION_STACK_ID on ACT_RU_TIMER_JOB(EXCEPTION_STACK_ID_);
create index ACT_IDX_SUSPENDED_JOB_EXECUTION_ID on ACT_RU_SUSPENDED_JOB(EXECUTION_ID_);
create index ACT_IDX_SUSPENDED_JOB_PROCESS_INSTANCE_ID on ACT_RU_SUSPENDED_JOB(PROCESS_INSTANCE_ID_);
create index ACT_IDX_SUSPENDED_JOB_PROC_DEF_ID on ACT_RU_SUSPENDED_JOB(PROC_DEF_ID_);
create index ACT_IDX_SUSPENDED_JOB_EXCEPTION_STACK_ID on ACT_RU_SUSPENDED_JOB(EXCEPTION_STACK_ID_);
create index ACT_IDX_DEADLETTER_JOB_EXECUTION_ID on ACT_RU_DEADLETTER_JOB(EXECUTION_ID_);
create index ACT_IDX_DEADLETTER_JOB_PROCESS_INSTANCE_ID on ACT_RU_DEADLETTER_JOB(PROCESS_INSTANCE_ID_);
create index ACT_IDX_DEADLETTER_JOB_PROC_DEF_ID on ACT_RU_DEADLETTER_JOB(PROC_DEF_ID_);
create index ACT_IDX_DEADLETTER_JOB_EXCEPTION_STACK_ID on ACT_RU_DEADLETTER_JOB(EXCEPTION_STACK_ID_);
alter table ACT_RU_JOB
add constraint ACT_FK_JOB_EXECUTION
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_JOB
add constraint ACT_FK_JOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_JOB
add constraint ACT_FK_JOB_PROC_DEF
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
alter table ACT_RU_TIMER_JOB
add constraint ACT_FK_TIMER_JOB_EXECUTION
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_TIMER_JOB
add constraint ACT_FK_TIMER_JOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_TIMER_JOB
add constraint ACT_FK_TIMER_JOB_PROC_DEF
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
alter table ACT_RU_TIMER_JOB
add constraint ACT_FK_TIMER_JOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
references ACT_GE_BYTEARRAY (ID_);
alter table ACT_RU_SUSPENDED_JOB
add constraint ACT_FK_SUSPENDED_JOB_EXECUTION
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_SUSPENDED_JOB
add constraint ACT_FK_SUSPENDED_JOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_SUSPENDED_JOB
add constraint ACT_FK_SUSPENDED_JOB_PROC_DEF
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
alter table ACT_RU_SUSPENDED_JOB
add constraint ACT_FK_SUSPENDED_JOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
references ACT_GE_BYTEARRAY (ID_);
alter table ACT_RU_DEADLETTER_JOB
add constraint ACT_FK_DEADLETTER_JOB_EXECUTION
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_DEADLETTER_JOB
add constraint ACT_FK_DEADLETTER_JOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_DEADLETTER_JOB
add constraint ACT_FK_DEADLETTER_JOB_PROC_DEF
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
alter table ACT_RU_DEADLETTER_JOB
add constraint ACT_FK_DEADLETTER_JOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
references ACT_GE_BYTEARRAY (ID_);
-- Moving jobs with retries <= 0 to ACT_RU_DEADLETTER_JOB
INSERT INTO ACT_RU_DEADLETTER_JOB (ID_, REV_, TYPE_, EXCLUSIVE_, EXECUTION_ID_, PROCESS_INSTANCE_ID_, PROC_DEF_ID_,
EXCEPTION_STACK_ID_, EXCEPTION_MSG_, DUEDATE_, REPEAT_, HANDLER_TYPE_, HANDLER_CFG_, TENANT_ID_)
(SELECT ID_, REV_, TYPE_, EXCLUSIVE_, EXECUTION_ID_, PROCESS_INSTANCE_ID_, PROC_DEF_ID_,
EXCEPTION_STACK_ID_, EXCEPTION_MSG_, DUEDATE_, REPEAT_, HANDLER_TYPE_, HANDLER_CFG_, TENANT_ID_
from ACT_RU_JOB WHERE RETRIES_ <= 0);
DELETE FROM ACT_RU_JOB
WHERE RETRIES_ <= 0;
-- Moving suspended jobs to ACT_RU_SUSPENDED_JOB
INSERT INTO ACT_RU_SUSPENDED_JOB (ID_, REV_, TYPE_, EXCLUSIVE_, EXECUTION_ID_, PROCESS_INSTANCE_ID_, PROC_DEF_ID_,
RETRIES_, EXCEPTION_STACK_ID_, EXCEPTION_MSG_, DUEDATE_, REPEAT_, HANDLER_TYPE_, HANDLER_CFG_, TENANT_ID_)
(SELECT job.ID_, job.REV_, job.TYPE_, job.EXCLUSIVE_, job.EXECUTION_ID_, job.PROCESS_INSTANCE_ID_, job.PROC_DEF_ID_,
job.RETRIES_, job.EXCEPTION_STACK_ID_, job.EXCEPTION_MSG_, job.DUEDATE_, job.REPEAT_, job.HANDLER_TYPE_, job.HANDLER_CFG_, job.TENANT_ID_
from ACT_RU_JOB job INNER JOIN ACT_RU_EXECUTION execution on execution.ID_ = job.PROCESS_INSTANCE_ID_ where execution.SUSPENSION_STATE_ = 2);
DELETE FROM ACT_RU_JOB
WHERE PROCESS_INSTANCE_ID_ IN (SELECT ID_ FROM ACT_RU_EXECUTION execution WHERE execution.PARENT_ID_ is null and execution.SUSPENSION_STATE_ = 2);
-- Moving timer jobs to ACT_RU_TIMER_JOB
INSERT INTO ACT_RU_TIMER_JOB (ID_, REV_, TYPE_, LOCK_EXP_TIME_, LOCK_OWNER_, EXCLUSIVE_, EXECUTION_ID_, PROCESS_INSTANCE_ID_,
PROC_DEF_ID_, RETRIES_, EXCEPTION_STACK_ID_, EXCEPTION_MSG_, DUEDATE_, REPEAT_, HANDLER_TYPE_, HANDLER_CFG_, TENANT_ID_)
(SELECT ID_, REV_, TYPE_, LOCK_EXP_TIME_, LOCK_OWNER_, EXCLUSIVE_, EXECUTION_ID_, PROCESS_INSTANCE_ID_,
PROC_DEF_ID_, RETRIES_, EXCEPTION_STACK_ID_, EXCEPTION_MSG_, DUEDATE_, REPEAT_, HANDLER_TYPE_, HANDLER_CFG_, TENANT_ID_
from ACT_RU_JOB WHERE (HANDLER_TYPE_ = 'activate-processdefinition' or HANDLER_TYPE_ = 'suspend-processdefinition'
or HANDLER_TYPE_ = 'timer-intermediate-transition' or HANDLER_TYPE_ = 'timer-start-event' or HANDLER_TYPE_ = 'timer-transition') and LOCK_EXP_TIME_ is null);
DELETE FROM ACT_RU_JOB
WHERE (HANDLER_TYPE_ = 'activate-processdefinition'
or HANDLER_TYPE_ = 'suspend-processdefinition'
or HANDLER_TYPE_ = 'timer-intermediate-transition'
or HANDLER_TYPE_ = 'timer-start-event'
or HANDLER_TYPE_ = 'timer-transition')
and LOCK_EXP_TIME_ is null;
alter table ACT_RU_EXECUTION add START_TIME_ datetime;
alter table ACT_RU_EXECUTION add START_USER_ID_ nvarchar(255);
alter table ACT_RU_TASK add CLAIM_TIME_ datetime;
alter table ACT_RE_DEPLOYMENT add KEY_ nvarchar(255);
-- Upgrade added in upgradestep.52001.to.52002.engine, which is not applied when already on beta2
update ACT_RU_EVENT_SUBSCR set PROC_DEF_ID_ = CONFIGURATION_ where EVENT_TYPE_ = 'message' and PROC_INST_ID_ is null and EXECUTION_ID_ is null and PROC_DEF_ID_ is null;
-- Adding count columns for execution relationship count feature
alter table ACT_RU_EXECUTION add IS_COUNT_ENABLED_ tinyint;
alter table ACT_RU_EXECUTION add EVT_SUBSCR_COUNT_ int;
alter table ACT_RU_EXECUTION add TASK_COUNT_ int;
alter table ACT_RU_EXECUTION add JOB_COUNT_ int;
alter table ACT_RU_EXECUTION add TIMER_JOB_COUNT_ int;
alter table ACT_RU_EXECUTION add SUSP_JOB_COUNT_ int;
alter table ACT_RU_EXECUTION add DEADLETTER_JOB_COUNT_ int;
alter table ACT_RU_EXECUTION add VAR_COUNT_ int;
alter table ACT_RU_EXECUTION add ID_LINK_COUNT_ int;
alter table ACT_RU_TASK add IS_COUNT_ENABLED_ tinyint;
alter table ACT_RU_TASK add VAR_COUNT_ int;
alter table ACT_RU_TASK add ID_LINK_COUNT_ int;
update ACT_GE_PROPERTY set VALUE_ = '6.0.0.5' where NAME_ = 'schema.version';
CREATE TABLE [ACT_DMN_DATABASECHANGELOGLOCK] ([ID] [int] NOT NULL, [LOCKED] [bit] NOT NULL, [LOCKGRANTED] [datetime2](3), [LOCKEDBY] [nvarchar](255), CONSTRAINT [PK_ACT_DMN_DATABASECHANGELOGLOCK] PRIMARY KEY ([ID]))
DELETE FROM [ACT_DMN_DATABASECHANGELOGLOCK]
INSERT INTO [ACT_DMN_DATABASECHANGELOGLOCK] ([ID], [LOCKED]) VALUES (1, 0)
UPDATE [ACT_DMN_DATABASECHANGELOGLOCK] SET [LOCKED] = 1, [LOCKEDBY] = '192.168.1.5 (192.168.1.5)', [LOCKGRANTED] = '2019-03-13T21:37:36.267' WHERE [ID] = 1 AND [LOCKED] = 0
CREATE TABLE [ACT_DMN_DATABASECHANGELOG] ([ID] [nvarchar](255) NOT NULL, [AUTHOR] [nvarchar](255) NOT NULL, [FILENAME] [nvarchar](255) NOT NULL, [DATEEXECUTED] [datetime2](3) NOT NULL, [ORDEREXECUTED] [int] NOT NULL, [EXECTYPE] [nvarchar](10) NOT NULL, [MD5SUM] [nvarchar](35), [DESCRIPTION] [nvarchar](255), [COMMENTS] [nvarchar](255), [TAG] [nvarchar](255), [LIQUIBASE] [nvarchar](20), [CONTEXTS] [nvarchar](255), [LABELS] [nvarchar](255), [DEPLOYMENT_ID] [nvarchar](10))
CREATE TABLE [ACT_DMN_DEPLOYMENT] ([ID_] [varchar](255) NOT NULL, [NAME_] [varchar](255), [CATEGORY_] [varchar](255), [DEPLOY_TIME_] [datetime], [TENANT_ID_] [varchar](255), [PARENT_DEPLOYMENT_ID_] [varchar](255), CONSTRAINT [PK_ACT_DMN_DEPLOYMENT] PRIMARY KEY ([ID_]))
CREATE TABLE [ACT_DMN_DEPLOYMENT_RESOURCE] ([ID_] [varchar](255) NOT NULL, [NAME_] [varchar](255), [DEPLOYMENT_ID_] [varchar](255), [RESOURCE_BYTES_] [varbinary](MAX), CONSTRAINT [PK_ACT_DMN_DEPLOYMENT_RESOURCE] PRIMARY KEY ([ID_]))
CREATE TABLE [ACT_DMN_DECISION_TABLE] ([ID_] [varchar](255) NOT NULL, [NAME_] [varchar](255), [VERSION_] [int], [KEY_] [varchar](255), [CATEGORY_] [varchar](255), [DEPLOYMENT_ID_] [varchar](255), [PARENT_DEPLOYMENT_ID_] [varchar](255), [TENANT_ID_] [varchar](255), [RESOURCE_NAME_] [varchar](255), [DESCRIPTION_] [varchar](255), CONSTRAINT [PK_ACT_DMN_DECISION_TABLE] PRIMARY KEY ([ID_]))
INSERT INTO [ACT_DMN_DATABASECHANGELOG] ([ID], [AUTHOR], [FILENAME], [DATEEXECUTED], [ORDEREXECUTED], [MD5SUM], [DESCRIPTION], [COMMENTS], [EXECTYPE], [CONTEXTS], [LABELS], [LIQUIBASE], [DEPLOYMENT_ID]) VALUES ('1', 'activiti', 'org/flowable/dmn/db/liquibase/flowable-dmn-db-changelog.xml', GETDATE(), 1, '7:d878c2672ead57b5801578fd39c423af', 'createTable tableName=ACT_DMN_DEPLOYMENT; createTable tableName=ACT_DMN_DEPLOYMENT_RESOURCE; createTable tableName=ACT_DMN_DECISION_TABLE', '', 'EXECUTED', NULL, NULL, '3.5.3', '2509456381')
UPDATE [ACT_DMN_DATABASECHANGELOGLOCK] SET [LOCKED] = 0, [LOCKEDBY] = NULL, [LOCKGRANTED] = NULL WHERE [ID] = 1
CREATE TABLE [ACT_FO_DATABASECHANGELOGLOCK] ([ID] [int] NOT NULL, [LOCKED] [bit] NOT NULL, [LOCKGRANTED] [datetime2](3), [LOCKEDBY] [nvarchar](255), CONSTRAINT [PK_ACT_FO_DATABASECHANGELOGLOCK] PRIMARY KEY ([ID]))
DELETE FROM [ACT_FO_DATABASECHANGELOGLOCK]
INSERT INTO [ACT_FO_DATABASECHANGELOGLOCK] ([ID], [LOCKED]) VALUES (1, 0)
UPDATE [ACT_FO_DATABASECHANGELOGLOCK] SET [LOCKED] = 1, [LOCKEDBY] = '192.168.1.5 (192.168.1.5)', [LOCKGRANTED] = '2019-03-13T21:37:42.929' WHERE [ID] = 1 AND [LOCKED] = 0
CREATE TABLE [ACT_FO_DATABASECHANGELOG] ([ID] [nvarchar](255) NOT NULL, [AUTHOR] [nvarchar](255) NOT NULL, [FILENAME] [nvarchar](255) NOT NULL, [DATEEXECUTED] [datetime2](3) NOT NULL, [ORDEREXECUTED] [int] NOT NULL, [EXECTYPE] [nvarchar](10) NOT NULL, [MD5SUM] [nvarchar](35), [DESCRIPTION] [nvarchar](255), [COMMENTS] [nvarchar](255), [TAG] [nvarchar](255), [LIQUIBASE] [nvarchar](20), [CONTEXTS] [nvarchar](255), [LABELS] [nvarchar](255), [DEPLOYMENT_ID] [nvarchar](10))
CREATE TABLE [ACT_FO_FORM_DEPLOYMENT] ([ID_] [varchar](255) NOT NULL, [NAME_] [varchar](255), [CATEGORY_] [varchar](255), [DEPLOY_TIME_] [datetime], [TENANT_ID_] [varchar](255), [PARENT_DEPLOYMENT_ID_] [varchar](255), CONSTRAINT [PK_ACT_FO_FORM_DEPLOYMENT] PRIMARY KEY ([ID_]))
CREATE TABLE [ACT_FO_FORM_RESOURCE] ([ID_] [varchar](255) NOT NULL, [NAME_] [varchar](255), [DEPLOYMENT_ID_] [varchar](255), [RESOURCE_BYTES_] [varbinary](MAX), CONSTRAINT [PK_ACT_FO_FORM_RESOURCE] PRIMARY KEY ([ID_]))
CREATE TABLE [ACT_FO_FORM_DEFINITION] ([ID_] [varchar](255) NOT NULL, [NAME_] [varchar](255), [VERSION_] [int], [KEY_] [varchar](255), [CATEGORY_] [varchar](255), [DEPLOYMENT_ID_] [varchar](255), [PARENT_DEPLOYMENT_ID_] [varchar](255), [TENANT_ID_] [varchar](255), [RESOURCE_NAME_] [varchar](255), [DESCRIPTION_] [varchar](255), CONSTRAINT [PK_ACT_FO_FORM_DEFINITION] PRIMARY KEY ([ID_]))
CREATE TABLE [ACT_FO_FORM_INSTANCE] ([ID_] [varchar](255) NOT NULL, [FORM_DEFINITION_ID_] [varchar](255) NOT NULL, [TASK_ID_] [varchar](255), [PROC_INST_ID_] [varchar](255), [PROC_DEF_ID_] [varchar](255), [SUBMITTED_DATE_] [datetime], [SUBMITTED_BY_] [varchar](255), [FORM_VALUES_ID_] [varchar](255), [TENANT_ID_] [varchar](255), CONSTRAINT [PK_ACT_FO_FORM_INSTANCE] PRIMARY KEY ([ID_]))
INSERT INTO [ACT_FO_DATABASECHANGELOG] ([ID], [AUTHOR], [FILENAME], [DATEEXECUTED], [ORDEREXECUTED], [MD5SUM], [DESCRIPTION], [COMMENTS], [EXECTYPE], [CONTEXTS], [LABELS], [LIQUIBASE], [DEPLOYMENT_ID]) VALUES ('1', 'activiti', 'org/flowable/form/db/liquibase/flowable-form-db-changelog.xml', GETDATE(), 1, '7:252bd5cb28cf86685ed67eb15d910118', 'createTable tableName=ACT_FO_FORM_DEPLOYMENT; createTable tableName=ACT_FO_FORM_RESOURCE; createTable tableName=ACT_FO_FORM_DEFINITION; createTable tableName=ACT_FO_FORM_INSTANCE', '', 'EXECUTED', NULL, NULL, '3.5.3', '2509463014')
UPDATE [ACT_FO_DATABASECHANGELOGLOCK] SET [LOCKED] = 0, [LOCKEDBY] = NULL, [LOCKGRANTED] = NULL WHERE [ID] = 1
CREATE TABLE [ACT_CO_DATABASECHANGELOGLOCK] ([ID] [int] NOT NULL, [LOCKED] [bit] NOT NULL, [LOCKGRANTED] [datetime2](3), [LOCKEDBY] [nvarchar](255), CONSTRAINT [PK_ACT_CO_DATABASECHANGELOGLOCK] PRIMARY KEY ([ID]))
DELETE FROM [ACT_CO_DATABASECHANGELOGLOCK]
INSERT INTO [ACT_CO_DATABASECHANGELOGLOCK] ([ID], [LOCKED]) VALUES (1, 0)
UPDATE [ACT_CO_DATABASECHANGELOGLOCK] SET [LOCKED] = 1, [LOCKEDBY] = '192.168.1.5 (192.168.1.5)', [LOCKGRANTED] = '2019-03-13T21:37:49.517' WHERE [ID] = 1 AND [LOCKED] = 0
CREATE TABLE [ACT_CO_DATABASECHANGELOG] ([ID] [nvarchar](255) NOT NULL, [AUTHOR] [nvarchar](255) NOT NULL, [FILENAME] [nvarchar](255) NOT NULL, [DATEEXECUTED] [datetime2](3) NOT NULL, [ORDEREXECUTED] [int] NOT NULL, [EXECTYPE] [nvarchar](10) NOT NULL, [MD5SUM] [nvarchar](35), [DESCRIPTION] [nvarchar](255), [COMMENTS] [nvarchar](255), [TAG] [nvarchar](255), [LIQUIBASE] [nvarchar](20), [CONTEXTS] [nvarchar](255), [LABELS] [nvarchar](255), [DEPLOYMENT_ID] [nvarchar](10))
CREATE TABLE [ACT_CO_CONTENT_ITEM] ([ID_] [varchar](255) NOT NULL, [NAME_] [varchar](255) NOT NULL, [MIME_TYPE_] [varchar](255), [TASK_ID_] [varchar](255), [PROC_INST_ID_] [varchar](255), [CONTENT_STORE_ID_] [varchar](255), [CONTENT_STORE_NAME_] [varchar](255), [FIELD_] [varchar](400), [CONTENT_AVAILABLE_] [bit] CONSTRAINT [DF_ACT_CO_CONTENT_ITEM_CONTENT_AVAILABLE_] DEFAULT 0, [CREATED_] [datetime], [CREATED_BY_] [varchar](255), [LAST_MODIFIED_] [datetime], [LAST_MODIFIED_BY_] [varchar](255), [CONTENT_SIZE_] [bigint] CONSTRAINT [DF_ACT_CO_CONTENT_ITEM_CONTENT_SIZE_] DEFAULT 0, [TENANT_ID_] [varchar](255), CONSTRAINT [PK_ACT_CO_CONTENT_ITEM] PRIMARY KEY ([ID_]))
CREATE NONCLUSTERED INDEX idx_contitem_taskid ON [ACT_CO_CONTENT_ITEM]([TASK_ID_])
CREATE NONCLUSTERED INDEX idx_contitem_procid ON [ACT_CO_CONTENT_ITEM]([PROC_INST_ID_])
INSERT INTO [ACT_CO_DATABASECHANGELOG] ([ID], [AUTHOR], [FILENAME], [DATEEXECUTED], [ORDEREXECUTED], [MD5SUM], [DESCRIPTION], [COMMENTS], [EXECTYPE], [CONTEXTS], [LABELS], [LIQUIBASE], [DEPLOYMENT_ID]) VALUES ('1', 'activiti', 'org/flowable/content/db/liquibase/flowable-content-db-changelog.xml', GETDATE(), 1, '7:a17df43ed0c96adfef5271e1781aaed2', 'createTable tableName=ACT_CO_CONTENT_ITEM; createIndex indexName=idx_contitem_taskid, tableName=ACT_CO_CONTENT_ITEM; createIndex indexName=idx_contitem_procid, tableName=ACT_CO_CONTENT_ITEM', '', 'EXECUTED', NULL, NULL, '3.5.3', '2509469591')
UPDATE [ACT_CO_DATABASECHANGELOGLOCK] SET [LOCKED] = 0, [LOCKEDBY] = NULL, [LOCKGRANTED] = NULL WHERE [ID] = 1 | the_stack |
-- 2019-09-16T08:48:05.321Z
-- 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,IsTranslateExcelHeaders,IsUseBPartnerLanguage,LockWaitTimeout,Name,RefreshAllAfterExecution,ShowHelp,Type,Updated,UpdatedBy,Value) VALUES ('3',0,0,541193,'Y','de.metas.handlingunits.expiry.process.M_HU_Update_MonthsUntilExpiry_Attribute','N',TO_TIMESTAMP('2019-09-16 11:48:05','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','N','N','N','N','N','N','Y','Y',0,'Undate Months Until Expiry','N','N','Java',TO_TIMESTAMP('2019-09-16 11:48:05','YYYY-MM-DD HH24:MI:SS'),100,'M_HU_Update_MonthsUntilExpiry_Attribute')
;
-- 2019-09-16T08:48:05.335Z
-- 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=541193 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)
;
-- 2019-09-16T08:46:04.848Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,577068,0,TO_TIMESTAMP('2019-09-16 11:46:04','YYYY-MM-DD HH24:MI:SS'),100,'U','Y','Upadete Monthas Until Expiry','Upadete Monthas Until Expiry',TO_TIMESTAMP('2019-09-16 11:46:04','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-09-16T08:46:04.865Z
-- 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=577068 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)
;
-- 2019-09-16T08:49:00.603Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element SET EntityType='D',Updated=TO_TIMESTAMP('2019-09-16 11:49:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=577068
;
-- 2019-09-16T08:49:20.033Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element SET Name='Update Months Until Expiry', PrintName='Update Months Until Expiry',Updated=TO_TIMESTAMP('2019-09-16 11:49:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=577068
;
-- 2019-09-16T08:49:20.039Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName=NULL, Name='Update Months Until Expiry', Description=NULL, Help=NULL WHERE AD_Element_ID=577068
;
-- 2019-09-16T08:49:20.041Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName=NULL, Name='Update Months Until Expiry', Description=NULL, Help=NULL WHERE AD_Element_ID=577068 AND IsCentrallyMaintained='Y'
;
-- 2019-09-16T08:49:20.080Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Update Months Until Expiry', Description=NULL, Help=NULL WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=577068) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 577068)
;
-- 2019-09-16T08:49:20.274Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_PrintFormatItem pi SET PrintName='Update Months Until Expiry', Name='Update Months Until Expiry' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=577068)
;
-- 2019-09-16T08:49:20.317Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET Name='Update Months Until Expiry', Description=NULL, Help=NULL, CommitWarning = NULL WHERE AD_Element_ID = 577068
;
-- 2019-09-16T08:49:20.319Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_WINDOW SET Name='Update Months Until Expiry', Description=NULL, Help=NULL WHERE AD_Element_ID = 577068
;
-- 2019-09-16T08:49:20.321Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu SET Name = 'Update Months Until Expiry', Description = NULL, WEBUI_NameBrowse = NULL, WEBUI_NameNew = NULL, WEBUI_NameNewBreadcrumb = NULL WHERE AD_Element_ID = 577068
;
-- 2019-09-16T08:49:29.315Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET Name='Upadete Months Until Expiry', PrintName='Upadete Months Until Expiry',Updated=TO_TIMESTAMP('2019-09-16 11:49:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=577068 AND AD_Language='de_CH'
;
-- 2019-09-16T08:49:29.346Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(577068,'de_CH')
;
-- 2019-09-16T08:49:33.377Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET Name='Upadete Months Until Expiry', PrintName='Upadete Months Until Expiry',Updated=TO_TIMESTAMP('2019-09-16 11:49:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=577068 AND AD_Language='de_DE'
;
-- 2019-09-16T08:49:33.380Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(577068,'de_DE')
;
-- 2019-09-16T08:49:33.402Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_ad_element_on_ad_element_trl_update(577068,'de_DE')
;
-- 2019-09-16T08:49:33.405Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName=NULL, Name='Upadete Months Until Expiry', Description=NULL, Help=NULL WHERE AD_Element_ID=577068
;
-- 2019-09-16T08:49:33.406Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName=NULL, Name='Upadete Months Until Expiry', Description=NULL, Help=NULL WHERE AD_Element_ID=577068 AND IsCentrallyMaintained='Y'
;
-- 2019-09-16T08:49:33.407Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Upadete Months Until Expiry', Description=NULL, Help=NULL WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=577068) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 577068)
;
-- 2019-09-16T08:49:33.412Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_PrintFormatItem pi SET PrintName='Upadete Months Until Expiry', Name='Upadete Months Until Expiry' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=577068)
;
-- 2019-09-16T08:49:33.413Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET Name='Upadete Months Until Expiry', Description=NULL, Help=NULL, CommitWarning = NULL WHERE AD_Element_ID = 577068
;
-- 2019-09-16T08:49:33.415Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_WINDOW SET Name='Upadete Months Until Expiry', Description=NULL, Help=NULL WHERE AD_Element_ID = 577068
;
-- 2019-09-16T08:49:33.415Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu SET Name = 'Upadete Months Until Expiry', Description = NULL, WEBUI_NameBrowse = NULL, WEBUI_NameNew = NULL, WEBUI_NameNewBreadcrumb = NULL WHERE AD_Element_ID = 577068
;
-- 2019-09-16T08:49:37.045Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET Name='Upadete Months Until Expiry', PrintName='Upadete Months Until Expiry',Updated=TO_TIMESTAMP('2019-09-16 11:49:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=577068 AND AD_Language='en_US'
;
-- 2019-09-16T08:49:37.049Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(577068,'en_US')
;
-- 2019-09-16T08:49:57.903Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET Name='Update Months Until Expiry', PrintName='Update Months Until Expiry',Updated=TO_TIMESTAMP('2019-09-16 11:49:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=577068 AND AD_Language='nl_NL'
;
-- 2019-09-16T08:49:57.906Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(577068,'nl_NL')
;
-- 2019-09-16T08:50:00.887Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET Name='Update Months Until Expiry', PrintName='Update Months Until Expiry',Updated=TO_TIMESTAMP('2019-09-16 11:50:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=577068 AND AD_Language='en_US'
;
-- 2019-09-16T08:50:00.890Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(577068,'en_US')
;
-- 2019-09-16T08:50:03.359Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET Name='Update Months Until Expiry', PrintName='Update Months Until Expiry',Updated=TO_TIMESTAMP('2019-09-16 11:50:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=577068 AND AD_Language='de_DE'
;
-- 2019-09-16T08:50:03.362Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(577068,'de_DE')
;
-- 2019-09-16T08:50:03.384Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_ad_element_on_ad_element_trl_update(577068,'de_DE')
;
-- 2019-09-16T08:50:03.387Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName=NULL, Name='Update Months Until Expiry', Description=NULL, Help=NULL WHERE AD_Element_ID=577068
;
-- 2019-09-16T08:50:03.389Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName=NULL, Name='Update Months Until Expiry', Description=NULL, Help=NULL WHERE AD_Element_ID=577068 AND IsCentrallyMaintained='Y'
;
-- 2019-09-16T08:50:03.391Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Update Months Until Expiry', Description=NULL, Help=NULL WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=577068) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 577068)
;
-- 2019-09-16T08:50:03.398Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_PrintFormatItem pi SET PrintName='Update Months Until Expiry', Name='Update Months Until Expiry' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=577068)
;
-- 2019-09-16T08:50:03.399Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET Name='Update Months Until Expiry', Description=NULL, Help=NULL, CommitWarning = NULL WHERE AD_Element_ID = 577068
;
-- 2019-09-16T08:50:03.400Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_WINDOW SET Name='Update Months Until Expiry', Description=NULL, Help=NULL WHERE AD_Element_ID = 577068
;
-- 2019-09-16T08:50:03.401Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu SET Name = 'Update Months Until Expiry', Description = NULL, WEBUI_NameBrowse = NULL, WEBUI_NameNew = NULL, WEBUI_NameNewBreadcrumb = NULL WHERE AD_Element_ID = 577068
;
-- 2019-09-16T08:50:07.024Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET Name='Update Months Until Expiry', PrintName='Update Months Until Expiry',Updated=TO_TIMESTAMP('2019-09-16 11:50:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=577068 AND AD_Language='de_CH'
;
-- 2019-09-16T08:50:07.025Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(577068,'de_CH')
;
-- 2019-09-16T08:51:03.815Z
-- 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,AD_Table_Process_ID,AD_Window_ID,Created,CreatedBy,EntityType,IsActive,Updated,UpdatedBy,WEBUI_DocumentAction,WEBUI_IncludedTabTopAction,WEBUI_ViewAction,WEBUI_ViewQuickAction,WEBUI_ViewQuickAction_Default) VALUES (0,0,541193,540516,540744,540189,TO_TIMESTAMP('2019-09-16 11:51:03','YYYY-MM-DD HH24:MI:SS'),100,'D','Y',TO_TIMESTAMP('2019-09-16 11:51:03','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N')
;
-- 2019-09-16T09:48:59.439Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET WEBUI_DocumentAction='N',Updated=TO_TIMESTAMP('2019-09-16 12:48:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Table_Process_ID=540744
;
-- 2019-09-16T09:49:41.226Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET WEBUI_ViewQuickAction='Y',Updated=TO_TIMESTAMP('2019-09-16 12:49:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Table_Process_ID=540744
;
-- 2019-09-16T09:49:54.440Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process SET Name='Update Months Until Expiry',Updated=TO_TIMESTAMP('2019-09-16 12:49:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=541193
;
-- 2019-09-16T13:19:22.467Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Scheduler (AD_Client_ID,AD_Org_ID,AD_Process_ID,AD_Role_ID,AD_Scheduler_ID,Created,CreatedBy,CronPattern,Description,EntityType,Frequency,FrequencyType,IsActive,IsIgnoreProcessingTime,KeepLogDays,ManageScheduler,Name,Processing,SchedulerProcessType,ScheduleType,Status,Supervisor_ID,Updated,UpdatedBy) VALUES (1000000,0,541193,1000000,550056,TO_TIMESTAMP('2019-09-16 16:19:22','YYYY-MM-DD HH24:MI:SS'),100,'23 03 * * *','Update the number of months until the HU expires','de.metas.swat',0,'D','Y','N',7,'N','M_HU_Update_MonthsUntilExpiry_Attribute','N','P','C','NEW',100,TO_TIMESTAMP('2019-09-16 16:19:22','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-09-16T14:18:33.056Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Trl SET Name='Update Months Until Expiry',Updated=TO_TIMESTAMP('2019-09-16 17:18:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_CH' AND AD_Process_ID=541193
;
-- 2019-09-16T14:18:37.229Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Trl SET Name='Update Months Until Expiry',Updated=TO_TIMESTAMP('2019-09-16 17:18:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_DE' AND AD_Process_ID=541193
;
-- 2019-09-16T14:18:40.133Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Trl SET Name='Update Months Until Expiry',Updated=TO_TIMESTAMP('2019-09-16 17:18:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='en_US' AND AD_Process_ID=541193
;
-- 2019-09-16T14:18:43.931Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Trl SET Name='Update Months Until Expiry',Updated=TO_TIMESTAMP('2019-09-16 17:18:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='nl_NL' AND AD_Process_ID=541193
;
-- 2019-09-16T14:21:15.446Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Trl SET IsTranslated='Y', Name='MHD Restlaufzeit in Monaten Aktualisieren',Updated=TO_TIMESTAMP('2019-09-16 17:21:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_DE' AND AD_Process_ID=541193
;
-- 2019-09-16T14:21:18.834Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Trl SET IsTranslated='Y', Name='MHD Restlaufzeit in Monaten Aktualisieren',Updated=TO_TIMESTAMP('2019-09-16 17:21:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_CH' AND AD_Process_ID=541193
;
-- 2019-09-16T14:59:22.749Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Trl SET Name=' MHD Restlaufzeit in Monaten aktualisieren',Updated=TO_TIMESTAMP('2019-09-16 17:59:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_CH' AND AD_Process_ID=541193
;
-- 2019-09-16T14:59:28.874Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Trl SET Name='MHD Restlaufzeit in Monaten aktualisieren',Updated=TO_TIMESTAMP('2019-09-16 17:59:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_CH' AND AD_Process_ID=541193
;
-- 2019-09-16T14:59:33.977Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Trl SET Name='MHD Restlaufzeit in Monaten aktualisieren',Updated=TO_TIMESTAMP('2019-09-16 17:59:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_DE' AND AD_Process_ID=541193
; | the_stack |
-- 2021-01-12T14:27:46.794Z
-- URL zum Konzept
UPDATE AD_UI_Element SET WidgetSize='S',Updated=TO_TIMESTAMP('2021-01-12 16:27:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548695
;
-- 2021-01-12T14:35:04.400Z
-- URL zum Konzept
UPDATE AD_UI_Element SET WidgetSize='S',Updated=TO_TIMESTAMP('2021-01-12 16:35:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=547259
;
-- 2021-01-12T14:37:12.283Z
-- URL zum Konzept
UPDATE AD_UI_Element SET WidgetSize='S',Updated=TO_TIMESTAMP('2021-01-12 16:37:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=547261
;
-- 2021-01-12T15:07:31.142Z
-- URL zum Konzept
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=130,Updated=TO_TIMESTAMP('2021-01-12 17:07:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=547215
;
-- 2021-01-12T15:07:31.507Z
-- URL zum Konzept
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=140,Updated=TO_TIMESTAMP('2021-01-12 17:07:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=547261
;
-- 2021-01-12T15:07:31.696Z
-- URL zum Konzept
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=150,Updated=TO_TIMESTAMP('2021-01-12 17:07:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=547260
;
-- 2021-01-12T15:07:31.908Z
-- URL zum Konzept
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=160,Updated=TO_TIMESTAMP('2021-01-12 17:07:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=547259
;
-- 2021-01-12T15:07:32.099Z
-- URL zum Konzept
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=170,Updated=TO_TIMESTAMP('2021-01-12 17:07:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548695
;
-- 2021-01-12T15:09:50.196Z
-- URL zum Konzept
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,554080,0,540282,540962,576297,'F',TO_TIMESTAMP('2021-01-12 17:09:49','YYYY-MM-DD HH24:MI:SS'),100,'Zugesagter Termin für diesen Auftrag','Y','N','N','Y','N','N','N',0,'Zugesagter Termin eff.',640,0,0,TO_TIMESTAMP('2021-01-12 17:09:49','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2021-01-12T15:10:22.379Z
-- URL zum Konzept
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2021-01-12 17:10:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=547215
;
-- 2021-01-12T15:10:22.606Z
-- URL zum Konzept
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=130,Updated=TO_TIMESTAMP('2021-01-12 17:10:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=576297
;
-- 2021-01-14T07:50:11.478Z
-- URL zum Konzept
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,Created,CreatedBy,Description,EntityType,Help,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,578639,0,TO_TIMESTAMP('2021-01-14 09:50:10','YYYY-MM-DD HH24:MI:SS'),100,'Checkbox sagt aus, ob der Beleg verarbeitet wurde. ','de.metas.ordercandidate','Verarbeitete Belege dürfen in der Regel nich mehr geändert werden.','Y','Verarb.','Verarb.',TO_TIMESTAMP('2021-01-14 09:50:10','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2021-01-14T07:50:12.094Z
-- 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=578639 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-01-14T07:52:47.666Z
-- URL zum Konzept
UPDATE AD_Element_Trl SET Description='The document has been processed', Help='The Processed checkbox indicates that a document has been processed.', IsTranslated='Y', Name='Processed', PrintName='Processed',Updated=TO_TIMESTAMP('2021-01-14 09:52:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=578639 AND AD_Language='en_US'
;
-- 2021-01-14T07:52:47.750Z
-- URL zum Konzept
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(578639,'en_US')
;
-- 2021-01-14T07:55:31.644Z
-- URL zum Konzept
UPDATE AD_Field SET IsDisplayedGrid='N',Updated=TO_TIMESTAMP('2021-01-14 09:55:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=547094
;
-- 2021-01-14T07:57:31.095Z
-- URL zum Konzept
UPDATE AD_Field SET AD_Name_ID=578639, Description='Checkbox sagt aus, ob der Beleg verarbeitet wurde. ', Help='Verarbeitete Belege dürfen in der Regel nich mehr geändert werden.', IsDisplayedGrid='Y', Name='Verarb.',Updated=TO_TIMESTAMP('2021-01-14 09:57:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=547094
;
-- 2021-01-14T07:57:31.208Z
-- URL zum Konzept
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(578639)
;
-- 2021-01-14T07:57:31.267Z
-- URL zum Konzept
DELETE FROM AD_Element_Link WHERE AD_Field_ID=547094
;
-- 2021-01-14T07:57:31.309Z
-- URL zum Konzept
/* DDL */ select AD_Element_Link_Create_Missing_Field(547094)
;
-- 2021-01-14T08:29:00.835Z
-- URL zum Konzept
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,Created,CreatedBy,Description,EntityType,Help,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,578640,0,TO_TIMESTAMP('2021-01-14 10:29:00','YYYY-MM-DD HH24:MI:SS'),100,'Preisdifferenz (imp. - int.)','de.metas.ordercandidate','Preisdifferenz (imp. - int.)','Y','Preisdiff.','Preisdiff.',TO_TIMESTAMP('2021-01-14 10:29:00','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2021-01-14T08:29:01.083Z
-- 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=578640 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-01-14T08:30:10.621Z
-- URL zum Konzept
UPDATE AD_Element_Trl SET IsTranslated='Y', Name='Price diff.', PrintName='Price diff.',Updated=TO_TIMESTAMP('2021-01-14 10:30:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=578640 AND AD_Language='en_US'
;
-- 2021-01-14T08:30:10.658Z
-- URL zum Konzept
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(578640,'en_US')
;
-- 2021-01-14T08:31:14.925Z
-- URL zum Konzept
UPDATE AD_Field SET AD_Name_ID=578640, Description='Preisdifferenz (imp. - int.)', Help='Preisdifferenz (imp. - int.)', Name='Preisdiff.',Updated=TO_TIMESTAMP('2021-01-14 10:31:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=555186
;
-- 2021-01-14T08:31:15.005Z
-- URL zum Konzept
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(578640)
;
-- 2021-01-14T08:31:15.048Z
-- URL zum Konzept
DELETE FROM AD_Element_Link WHERE AD_Field_ID=555186
;
-- 2021-01-14T08:31:15.087Z
-- URL zum Konzept
/* DDL */ select AD_Element_Link_Create_Missing_Field(555186)
;
-- 2021-01-14T08:37:24.769Z
-- URL zum Konzept
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,Created,CreatedBy,Description,EntityType,Help,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,578641,0,TO_TIMESTAMP('2021-01-14 10:37:24','YYYY-MM-DD HH24:MI:SS'),100,'Freigabe erforderlich','org.adempiere.process.rpl','Freigabe erforderlich','Y','Freig.','Freig.',TO_TIMESTAMP('2021-01-14 10:37:24','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2021-01-14T08:37:24.850Z
-- 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=578641 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-01-14T08:38:31.610Z
-- URL zum Konzept
UPDATE AD_Element_Trl SET Description='Approval needed', Help='Approval needed', IsTranslated='Y', Name='Approval needed', PrintName='Approval needed',Updated=TO_TIMESTAMP('2021-01-14 10:38:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=578641 AND AD_Language='en_US'
;
-- 2021-01-14T08:38:31.651Z
-- URL zum Konzept
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(578641,'en_US')
;
-- 2021-01-14T08:39:07.268Z
-- URL zum Konzept
UPDATE AD_Field SET AD_Name_ID=578641, Description='Freigabe erforderlich', Help='Freigabe erforderlich', Name='Freig.',Updated=TO_TIMESTAMP('2021-01-14 10:39:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=554017
;
-- 2021-01-14T08:39:07.540Z
-- URL zum Konzept
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(578641)
;
-- 2021-01-14T08:39:07.582Z
-- URL zum Konzept
DELETE FROM AD_Element_Link WHERE AD_Field_ID=554017
;
-- 2021-01-14T08:39:07.624Z
-- URL zum Konzept
/* DDL */ select AD_Element_Link_Create_Missing_Field(554017)
;
-- 2021-01-15T12:23:29.080Z
-- URL zum Konzept
UPDATE AD_Element SET Name='Zuges. Termin (eff.)',Updated=TO_TIMESTAMP('2021-01-15 14:23:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=542422
;
-- 2021-01-15T12:23:29.630Z
-- URL zum Konzept
UPDATE AD_Column SET ColumnName='DatePromised_Effective', Name='Zuges. Termin (eff.)', Description='Zugesagter Termin für diesen Auftrag', Help=NULL WHERE AD_Element_ID=542422
;
-- 2021-01-15T12:23:29.669Z
-- URL zum Konzept
UPDATE AD_Process_Para SET ColumnName='DatePromised_Effective', Name='Zuges. Termin (eff.)', Description='Zugesagter Termin für diesen Auftrag', Help=NULL, AD_Element_ID=542422 WHERE UPPER(ColumnName)='DATEPROMISED_EFFECTIVE' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2021-01-15T12:23:29.708Z
-- URL zum Konzept
UPDATE AD_Process_Para SET ColumnName='DatePromised_Effective', Name='Zuges. Termin (eff.)', Description='Zugesagter Termin für diesen Auftrag', Help=NULL WHERE AD_Element_ID=542422 AND IsCentrallyMaintained='Y'
;
/*
* #%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-01-15T12:23:29.748Z
-- URL zum Konzept
UPDATE AD_Field SET Name='Zuges. Termin (eff.)', Description='Zugesagter Termin für diesen Auftrag', Help=NULL WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=542422) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 542422)
;
-- 2021-01-15T12:23:29.812Z
-- URL zum Konzept
UPDATE AD_PrintFormatItem pi SET PrintName='Zugesagter Termin eff.', Name='Zuges. Termin (eff.)' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=542422)
;
-- 2021-01-15T12:23:29.853Z
-- URL zum Konzept
UPDATE AD_Tab SET Name='Zuges. Termin (eff.)', Description='Zugesagter Termin für diesen Auftrag', Help=NULL, CommitWarning = NULL WHERE AD_Element_ID = 542422
;
-- 2021-01-15T12:23:29.903Z
-- URL zum Konzept
UPDATE AD_WINDOW SET Name='Zuges. Termin (eff.)', Description='Zugesagter Termin für diesen Auftrag', Help=NULL WHERE AD_Element_ID = 542422
;
-- 2021-01-15T12:23:29.941Z
-- URL zum Konzept
UPDATE AD_Menu SET Name = 'Zuges. Termin (eff.)', Description = 'Zugesagter Termin für diesen Auftrag', WEBUI_NameBrowse = NULL, WEBUI_NameNew = NULL, WEBUI_NameNewBreadcrumb = NULL WHERE AD_Element_ID = 542422
; | the_stack |
-- 2018-07-19T18:01:28.483
-- 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,544180,0,'DefaultAddressType',TO_TIMESTAMP('2018-07-19 18:01:28','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','DefaultAddressType','DefaultAddressType',TO_TIMESTAMP('2018-07-19 18:01:28','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-07-23T16:20:24.110
-- 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,540874,TO_TIMESTAMP('2018-07-23 16:20:23','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.marketing.base','Y','N','DefaultAddressTypes',TO_TIMESTAMP('2018-07-23 16:20:23','YYYY-MM-DD HH24:MI:SS'),100,'L')
;
-- 2018-07-23T16:20:24.120
-- 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=540874 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)
;
-- 2018-07-23T16:20:56.753
-- 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,541661,540874,TO_TIMESTAMP('2018-07-23 16:20:56','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.marketing.base','Y','BillToDefault',TO_TIMESTAMP('2018-07-23 16:20:56','YYYY-MM-DD HH24:MI:SS'),100,'B','BillToDefault')
;
-- 2018-07-23T16:20:56.763
-- 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=541661 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)
;
-- 2018-07-23T16:21:17.578
-- 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,541662,540874,TO_TIMESTAMP('2018-07-23 16:21:17','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.marketing.base','Y','ShipToDefault',TO_TIMESTAMP('2018-07-23 16:21:17','YYYY-MM-DD HH24:MI:SS'),100,'S','ShipToDefault')
;
-- 2018-07-23T16:21:17.578
-- 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=541662 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)
;
-- 2018-07-19T18:01:28.486
-- 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=544180 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)
;
-- 2018-07-20T10:13:01.710
-- 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,IsUseBPartnerLanguage,LockWaitTimeout,Name,RefreshAllAfterExecution,ShowHelp,Type,Updated,UpdatedBy,Value) VALUES ('3',0,0,540990,'Y','N',TO_TIMESTAMP('2018-07-20 10:13:01','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.marketing.base','Y','N','N','N','N','N','N','Y',0,'Export in Serienbrief Kampagne','N','Y','Java',TO_TIMESTAMP('2018-07-20 10:13:01','YYYY-MM-DD HH24:MI:SS'),100,'MKTG_ContactPerson_CreateFrom_C_BPartner_WithAddress')
;
-- 2018-07-20T10:13:01.720
-- 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=540990 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-07-20T14:40:18.598
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process SET Classname='de.metas.marketing.base.process.MKTG_ContactPerson_CreateFrom_C_BPartner_WithAddress',Updated=TO_TIMESTAMP('2018-07-20 14:40:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=540990
;
-- 2018-07-20T14:40:58.444
-- 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,EntityType,FieldLength,IsActive,IsAutocomplete,IsCentrallyMaintained,IsEncrypted,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy) VALUES (0,544034,0,540990,541324,19,'MKTG_Campaign_ID',TO_TIMESTAMP('2018-07-20 14:40:58','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.marketing.base',0,'Y','N','Y','N','N','N','MKTG_Campaign',10,TO_TIMESTAMP('2018-07-20 14:40:58','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-07-20T14:40:58.448
-- 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=541324 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-07-20T14:41:17.903
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET AD_Reference_ID=30,Updated=TO_TIMESTAMP('2018-07-20 14:41:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=541324
;
-- 2018-07-20T14:41:36.160
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET IsMandatory='Y',Updated=TO_TIMESTAMP('2018-07-20 14:41:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=541324
;
-- 2018-07-20T14:42:06.945
-- 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,AD_Reference_Value_ID,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAutocomplete,IsCentrallyMaintained,IsEncrypted,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy) VALUES (0,544180,0,540990,541325,17,540874,'DefaultAddressType',TO_TIMESTAMP('2018-07-20 14:42:06','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.marketing.base',0,'Y','N','Y','N','N','N','DefaultAddressType',20,TO_TIMESTAMP('2018-07-20 14:42:06','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-07-20T14:42:06.947
-- 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=541325 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-07-20T14:42:09.558
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET IsMandatory='Y',Updated=TO_TIMESTAMP('2018-07-20 14:42:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=541325
;
-- 2018-07-20T14:42:51.070
-- 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,540990,291,TO_TIMESTAMP('2018-07-20 14:42:51','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.marketing.base','Y',TO_TIMESTAMP('2018-07-20 14:42:51','YYYY-MM-DD HH24:MI:SS'),100,'N','N')
; | the_stack |
-- Fill in type shells for types defined in the 4.0 Catalog:
-- Handle small number of composite types by hand
CREATE TYPE nb_classification AS (classes text[], accum float8[], apriori bigint[]);
-- Create dummy functions to handle refcursor:
-- This deals with the problem that the normal io functions for refcursor are not actually over
-- the correct datatypes.
CREATE FUNCTION dummy_cast_functions.textin(cstring) returns upg_catalog.refcursor
LANGUAGE internal as 'textout' STRICT IMMUTABLE;
CREATE FUNCTION dummy_cast_functions.textout(upg_catalog.refcursor) returns cstring
LANGUAGE internal as 'textout' STRICT IMMUTABLE;
CREATE FUNCTION dummy_cast_functions.textrecv(internal) returns upg_catalog.refcursor
LANGUAGE internal as 'textrecv' STRICT IMMUTABLE;
CREATE FUNCTION dummy_cast_functions.textsend(upg_catalog.refcursor) returns bytea
LANGUAGE internal as 'textsend' STRICT IMMUTABLE;
-- Derived via the following SQL run within a 4.0 catalog
/*
\o /tmp/types.sql
SELECT 'CREATE TYPE upg_catalog.' || quote_ident(t.typname)
|| '('
|| E'\n INPUT = '
|| case when pin.prorettype = t.oid
then 'upg_catalog.'
else 'dummy_cast_functions.'
end || pin.proname
|| E',\n OUTPUT = '
|| case when pout.proargtypes[0] = t.oid
then 'upg_catalog.'
else 'dummy_cast_functions.'
end || pout.proname
|| case when precv.proname is not null
then E',\n RECEIVE = ' ||
case when precv.prorettype = t.oid
then 'upg_catalog.'
else 'dummy_cast_functions.'
end || precv.proname
else '' end
|| case when psend.proname is not null
then E',\n SEND = ' ||
case when psend.proargtypes[0] = t.oid
then 'upg_catalog.'
else 'dummy_cast_functions.'
end || psend.proname
else '' end
|| case when panalyze.proname is not null
then E',\n ANALYZE = upg_catalog.' || panalyze.proname
else '' end
|| case when t.typlen = -1
then E',\n INTERNALLENGTH = VARIABLE'
else E',\n INTERNALLENGTH = ' || t.typlen end
|| case when t.typbyval
then E',\n PASSEDBYVALUE' else '' end
|| E',\n STORAGE = '
|| case when t.typstorage = 'p' then 'plain'
when t.typstorage = 'x' then 'extended'
when t.typstorage = 'm' then 'main'
when t.typstorage = 'e' then 'external'
else 'BROKEN' end
|| case when t.typdefault is not null
then E',\n DEFAULT = ' || t.typdefault else '' end
|| case when telement.typname is not null
then E',\n ELEMENT = ' || telement.typname else '' end
|| E',\n DELIMITER = ''' || t.typdelim || ''''
|| E',\n ALIGNMENT = '
|| case when t.typalign = 'c' then 'char'
when t.typalign = 's' then 'int2'
when t.typalign = 'i' then 'int4'
when t.typalign = 'd' then 'double'
else 'BROKEN' end
|| E'\n);'
|| case when (t.typtype = 'p' or t.typname in ('smgr', 'unknown'))
then E'\nDROP TYPE upg_catalog._' || t.typname || ';'
else '' end
FROM pg_type t
join pg_namespace n on (t.typnamespace = n.oid)
join pg_proc pin on (t.typinput = pin.oid)
join pg_proc pout on (t.typoutput = pout.oid)
left join pg_proc precv on (t.typreceive = precv.oid)
left join pg_proc psend on (t.typsend = psend.oid)
left join pg_proc panalyze on (t.typanalyze = panalyze.oid)
left join pg_type telement on (t.typelem = telement.oid)
WHERE t.typtype in ('b', 'p') and t.typname !~ '^_' and n.nspname = 'pg_catalog'
order by 1
;
*/
CREATE TYPE upg_catalog."any"(
INPUT = upg_catalog.any_in,
OUTPUT = upg_catalog.any_out,
INTERNALLENGTH = 4,
PASSEDBYVALUE,
STORAGE = plain,
DELIMITER = ',',
ALIGNMENT = int4
);
DROP TYPE upg_catalog._any;
CREATE TYPE upg_catalog."bit"(
INPUT = upg_catalog.bit_in,
OUTPUT = upg_catalog.bit_out,
RECEIVE = upg_catalog.bit_recv,
SEND = upg_catalog.bit_send,
INTERNALLENGTH = VARIABLE,
STORAGE = extended,
DELIMITER = ',',
ALIGNMENT = int4
);
CREATE TYPE upg_catalog."char"(
INPUT = upg_catalog.charin,
OUTPUT = upg_catalog.charout,
RECEIVE = upg_catalog.charrecv,
SEND = upg_catalog.charsend,
INTERNALLENGTH = 1,
PASSEDBYVALUE,
STORAGE = plain,
DELIMITER = ',',
ALIGNMENT = char
);
CREATE TYPE upg_catalog."interval"(
INPUT = upg_catalog.interval_in,
OUTPUT = upg_catalog.interval_out,
RECEIVE = upg_catalog.interval_recv,
SEND = upg_catalog.interval_send,
INTERNALLENGTH = 16,
STORAGE = plain,
DELIMITER = ',',
ALIGNMENT = double
);
CREATE TYPE upg_catalog."numeric"(
INPUT = upg_catalog.numeric_in,
OUTPUT = upg_catalog.numeric_out,
RECEIVE = upg_catalog.numeric_recv,
SEND = upg_catalog.numeric_send,
INTERNALLENGTH = VARIABLE,
STORAGE = main,
DELIMITER = ',',
ALIGNMENT = int4
);
CREATE TYPE upg_catalog."time"(
INPUT = upg_catalog.time_in,
OUTPUT = upg_catalog.time_out,
RECEIVE = upg_catalog.time_recv,
SEND = upg_catalog.time_send,
INTERNALLENGTH = 8,
PASSEDBYVALUE,
STORAGE = plain,
DELIMITER = ',',
ALIGNMENT = double
);
CREATE TYPE upg_catalog."timestamp"(
INPUT = upg_catalog.timestamp_in,
OUTPUT = upg_catalog.timestamp_out,
RECEIVE = upg_catalog.timestamp_recv,
SEND = upg_catalog.timestamp_send,
INTERNALLENGTH = 8,
PASSEDBYVALUE,
STORAGE = plain,
DELIMITER = ',',
ALIGNMENT = double
);
CREATE TYPE upg_catalog."varchar"(
INPUT = upg_catalog.varcharin,
OUTPUT = upg_catalog.varcharout,
RECEIVE = upg_catalog.varcharrecv,
SEND = upg_catalog.varcharsend,
INTERNALLENGTH = VARIABLE,
STORAGE = extended,
DELIMITER = ',',
ALIGNMENT = int4
);
CREATE TYPE upg_catalog.abstime(
INPUT = upg_catalog.abstimein,
OUTPUT = upg_catalog.abstimeout,
RECEIVE = upg_catalog.abstimerecv,
SEND = upg_catalog.abstimesend,
INTERNALLENGTH = 4,
PASSEDBYVALUE,
STORAGE = plain,
DELIMITER = ',',
ALIGNMENT = int4
);
CREATE TYPE upg_catalog.aclitem(
INPUT = upg_catalog.aclitemin,
OUTPUT = upg_catalog.aclitemout,
INTERNALLENGTH = 12,
STORAGE = plain,
DELIMITER = ',',
ALIGNMENT = int4
);
CREATE TYPE upg_catalog.anyarray(
INPUT = upg_catalog.anyarray_in,
OUTPUT = upg_catalog.anyarray_out,
RECEIVE = upg_catalog.anyarray_recv,
SEND = upg_catalog.anyarray_send,
INTERNALLENGTH = VARIABLE,
STORAGE = extended,
DELIMITER = ',',
ALIGNMENT = double
);
DROP TYPE upg_catalog._anyarray;
CREATE TYPE upg_catalog.anyelement(
INPUT = upg_catalog.anyelement_in,
OUTPUT = upg_catalog.anyelement_out,
INTERNALLENGTH = 4,
PASSEDBYVALUE,
STORAGE = plain,
DELIMITER = ',',
ALIGNMENT = int4
);
DROP TYPE upg_catalog._anyelement;
CREATE TYPE upg_catalog.bool(
INPUT = upg_catalog.boolin,
OUTPUT = upg_catalog.boolout,
RECEIVE = upg_catalog.boolrecv,
SEND = upg_catalog.boolsend,
INTERNALLENGTH = 1,
PASSEDBYVALUE,
STORAGE = plain,
DELIMITER = ',',
ALIGNMENT = char
);
CREATE TYPE upg_catalog.box(
INPUT = upg_catalog.box_in,
OUTPUT = upg_catalog.box_out,
RECEIVE = upg_catalog.box_recv,
SEND = upg_catalog.box_send,
INTERNALLENGTH = 32,
STORAGE = plain,
ELEMENT = point,
DELIMITER = ';',
ALIGNMENT = double
);
CREATE TYPE upg_catalog.bpchar(
INPUT = upg_catalog.bpcharin,
OUTPUT = upg_catalog.bpcharout,
RECEIVE = upg_catalog.bpcharrecv,
SEND = upg_catalog.bpcharsend,
INTERNALLENGTH = VARIABLE,
STORAGE = extended,
DELIMITER = ',',
ALIGNMENT = int4
);
CREATE TYPE upg_catalog.bytea(
INPUT = upg_catalog.byteain,
OUTPUT = upg_catalog.byteaout,
RECEIVE = upg_catalog.bytearecv,
SEND = upg_catalog.byteasend,
INTERNALLENGTH = VARIABLE,
STORAGE = extended,
DELIMITER = ',',
ALIGNMENT = int4
);
CREATE TYPE upg_catalog.cid(
INPUT = upg_catalog.cidin,
OUTPUT = upg_catalog.cidout,
RECEIVE = upg_catalog.cidrecv,
SEND = upg_catalog.cidsend,
INTERNALLENGTH = 4,
PASSEDBYVALUE,
STORAGE = plain,
DELIMITER = ',',
ALIGNMENT = int4
);
CREATE TYPE upg_catalog.cidr(
INPUT = upg_catalog.cidr_in,
OUTPUT = upg_catalog.cidr_out,
RECEIVE = upg_catalog.cidr_recv,
SEND = upg_catalog.cidr_send,
INTERNALLENGTH = VARIABLE,
STORAGE = plain,
DELIMITER = ',',
ALIGNMENT = int4
);
CREATE TYPE upg_catalog.circle(
INPUT = upg_catalog.circle_in,
OUTPUT = upg_catalog.circle_out,
RECEIVE = upg_catalog.circle_recv,
SEND = upg_catalog.circle_send,
INTERNALLENGTH = 24,
STORAGE = plain,
DELIMITER = ',',
ALIGNMENT = double
);
CREATE TYPE upg_catalog.cstring(
INPUT = upg_catalog.cstring_in,
OUTPUT = upg_catalog.cstring_out,
RECEIVE = upg_catalog.cstring_recv,
SEND = upg_catalog.cstring_send,
INTERNALLENGTH = -2,
STORAGE = plain,
DELIMITER = ',',
ALIGNMENT = char
);
DROP TYPE upg_catalog._cstring;
CREATE TYPE upg_catalog.date(
INPUT = upg_catalog.date_in,
OUTPUT = upg_catalog.date_out,
RECEIVE = upg_catalog.date_recv,
SEND = upg_catalog.date_send,
INTERNALLENGTH = 4,
PASSEDBYVALUE,
STORAGE = plain,
DELIMITER = ',',
ALIGNMENT = int4
);
CREATE TYPE upg_catalog.float4(
INPUT = upg_catalog.float4in,
OUTPUT = upg_catalog.float4out,
RECEIVE = upg_catalog.float4recv,
SEND = upg_catalog.float4send,
INTERNALLENGTH = 4,
PASSEDBYVALUE,
STORAGE = plain,
DELIMITER = ',',
ALIGNMENT = int4
);
CREATE TYPE upg_catalog.float8(
INPUT = upg_catalog.float8in,
OUTPUT = upg_catalog.float8out,
RECEIVE = upg_catalog.float8recv,
SEND = upg_catalog.float8send,
INTERNALLENGTH = 8,
PASSEDBYVALUE,
STORAGE = plain,
DELIMITER = ',',
ALIGNMENT = double
);
CREATE TYPE upg_catalog.gpaotid(
INPUT = upg_catalog.gpaotidin,
OUTPUT = upg_catalog.gpaotidout,
RECEIVE = upg_catalog.gpaotidrecv,
SEND = upg_catalog.gpaotidsend,
INTERNALLENGTH = 6,
STORAGE = plain,
DELIMITER = ',',
ALIGNMENT = int2
);
CREATE TYPE upg_catalog.gpxlogloc(
INPUT = upg_catalog.gpxloglocin,
OUTPUT = upg_catalog.gpxloglocout,
RECEIVE = upg_catalog.gpxloglocrecv,
SEND = upg_catalog.gpxloglocsend,
INTERNALLENGTH = 8,
STORAGE = plain,
DELIMITER = ',',
ALIGNMENT = int4
);
CREATE TYPE upg_catalog.inet(
INPUT = upg_catalog.inet_in,
OUTPUT = upg_catalog.inet_out,
RECEIVE = upg_catalog.inet_recv,
SEND = upg_catalog.inet_send,
INTERNALLENGTH = VARIABLE,
STORAGE = plain,
DELIMITER = ',',
ALIGNMENT = int4
);
CREATE TYPE upg_catalog.int2(
INPUT = upg_catalog.int2in,
OUTPUT = upg_catalog.int2out,
RECEIVE = upg_catalog.int2recv,
SEND = upg_catalog.int2send,
INTERNALLENGTH = 2,
PASSEDBYVALUE,
STORAGE = plain,
DELIMITER = ',',
ALIGNMENT = int2
);
CREATE TYPE upg_catalog.int2vector(
INPUT = upg_catalog.int2vectorin,
OUTPUT = upg_catalog.int2vectorout,
RECEIVE = upg_catalog.int2vectorrecv,
SEND = upg_catalog.int2vectorsend,
INTERNALLENGTH = VARIABLE,
STORAGE = plain,
ELEMENT = int2,
DELIMITER = ',',
ALIGNMENT = int4
);
CREATE TYPE upg_catalog.int4(
INPUT = upg_catalog.int4in,
OUTPUT = upg_catalog.int4out,
RECEIVE = upg_catalog.int4recv,
SEND = upg_catalog.int4send,
INTERNALLENGTH = 4,
PASSEDBYVALUE,
STORAGE = plain,
DELIMITER = ',',
ALIGNMENT = int4
);
CREATE TYPE upg_catalog.int8(
INPUT = upg_catalog.int8in,
OUTPUT = upg_catalog.int8out,
RECEIVE = upg_catalog.int8recv,
SEND = upg_catalog.int8send,
INTERNALLENGTH = 8,
PASSEDBYVALUE,
STORAGE = plain,
DELIMITER = ',',
ALIGNMENT = double
);
CREATE TYPE upg_catalog.internal(
INPUT = upg_catalog.internal_in,
OUTPUT = upg_catalog.internal_out,
INTERNALLENGTH = 4,
PASSEDBYVALUE,
STORAGE = plain,
DELIMITER = ',',
ALIGNMENT = int4
);
DROP TYPE upg_catalog._internal;
CREATE TYPE upg_catalog.language_handler(
INPUT = upg_catalog.language_handler_in,
OUTPUT = upg_catalog.language_handler_out,
INTERNALLENGTH = 4,
PASSEDBYVALUE,
STORAGE = plain,
DELIMITER = ',',
ALIGNMENT = int4
);
DROP TYPE upg_catalog._language_handler;
CREATE TYPE upg_catalog.line(
INPUT = upg_catalog.line_in,
OUTPUT = upg_catalog.line_out,
RECEIVE = upg_catalog.line_recv,
SEND = upg_catalog.line_send,
INTERNALLENGTH = 32,
STORAGE = plain,
ELEMENT = float8,
DELIMITER = ',',
ALIGNMENT = double
);
CREATE TYPE upg_catalog.lseg(
INPUT = upg_catalog.lseg_in,
OUTPUT = upg_catalog.lseg_out,
RECEIVE = upg_catalog.lseg_recv,
SEND = upg_catalog.lseg_send,
INTERNALLENGTH = 32,
STORAGE = plain,
ELEMENT = point,
DELIMITER = ',',
ALIGNMENT = double
);
CREATE TYPE upg_catalog.macaddr(
INPUT = upg_catalog.macaddr_in,
OUTPUT = upg_catalog.macaddr_out,
RECEIVE = upg_catalog.macaddr_recv,
SEND = upg_catalog.macaddr_send,
INTERNALLENGTH = 6,
STORAGE = plain,
DELIMITER = ',',
ALIGNMENT = int4
);
CREATE TYPE upg_catalog.money(
INPUT = upg_catalog.cash_in,
OUTPUT = upg_catalog.cash_out,
RECEIVE = upg_catalog.cash_recv,
SEND = upg_catalog.cash_send,
INTERNALLENGTH = 4,
STORAGE = plain,
DELIMITER = ',',
ALIGNMENT = int4
);
CREATE TYPE upg_catalog.name(
INPUT = upg_catalog.namein,
OUTPUT = upg_catalog.nameout,
RECEIVE = upg_catalog.namerecv,
SEND = upg_catalog.namesend,
INTERNALLENGTH = 64,
STORAGE = plain,
ELEMENT = char,
DELIMITER = ',',
ALIGNMENT = int4
);
CREATE TYPE upg_catalog.oid(
INPUT = upg_catalog.oidin,
OUTPUT = upg_catalog.oidout,
RECEIVE = upg_catalog.oidrecv,
SEND = upg_catalog.oidsend,
INTERNALLENGTH = 4,
PASSEDBYVALUE,
STORAGE = plain,
DELIMITER = ',',
ALIGNMENT = int4
);
CREATE TYPE upg_catalog.oidvector(
INPUT = upg_catalog.oidvectorin,
OUTPUT = upg_catalog.oidvectorout,
RECEIVE = upg_catalog.oidvectorrecv,
SEND = upg_catalog.oidvectorsend,
INTERNALLENGTH = VARIABLE,
STORAGE = plain,
ELEMENT = oid,
DELIMITER = ',',
ALIGNMENT = int4
);
CREATE TYPE upg_catalog.opaque(
INPUT = upg_catalog.opaque_in,
OUTPUT = upg_catalog.opaque_out,
INTERNALLENGTH = 4,
PASSEDBYVALUE,
STORAGE = plain,
DELIMITER = ',',
ALIGNMENT = int4
);
DROP TYPE upg_catalog._opaque;
CREATE TYPE upg_catalog.path(
INPUT = upg_catalog.path_in,
OUTPUT = upg_catalog.path_out,
RECEIVE = upg_catalog.path_recv,
SEND = upg_catalog.path_send,
INTERNALLENGTH = VARIABLE,
STORAGE = extended,
DELIMITER = ',',
ALIGNMENT = double
);
CREATE TYPE upg_catalog.point(
INPUT = upg_catalog.point_in,
OUTPUT = upg_catalog.point_out,
RECEIVE = upg_catalog.point_recv,
SEND = upg_catalog.point_send,
INTERNALLENGTH = 16,
STORAGE = plain,
ELEMENT = float8,
DELIMITER = ',',
ALIGNMENT = double
);
CREATE TYPE upg_catalog.polygon(
INPUT = upg_catalog.poly_in,
OUTPUT = upg_catalog.poly_out,
RECEIVE = upg_catalog.poly_recv,
SEND = upg_catalog.poly_send,
INTERNALLENGTH = VARIABLE,
STORAGE = extended,
DELIMITER = ',',
ALIGNMENT = double
);
CREATE TYPE upg_catalog.record(
INPUT = upg_catalog.record_in,
OUTPUT = upg_catalog.record_out,
RECEIVE = upg_catalog.record_recv,
SEND = upg_catalog.record_send,
INTERNALLENGTH = VARIABLE,
STORAGE = extended,
DELIMITER = ',',
ALIGNMENT = double
);
DROP TYPE upg_catalog._record;
CREATE TYPE upg_catalog.refcursor(
INPUT = dummy_cast_functions.textin,
OUTPUT = dummy_cast_functions.textout,
RECEIVE = dummy_cast_functions.textrecv,
SEND = dummy_cast_functions.textsend,
INTERNALLENGTH = VARIABLE,
STORAGE = extended,
DELIMITER = ',',
ALIGNMENT = int4
);
CREATE TYPE upg_catalog.regclass(
INPUT = upg_catalog.regclassin,
OUTPUT = upg_catalog.regclassout,
RECEIVE = upg_catalog.regclassrecv,
SEND = upg_catalog.regclasssend,
INTERNALLENGTH = 4,
PASSEDBYVALUE,
STORAGE = plain,
DELIMITER = ',',
ALIGNMENT = int4
);
CREATE TYPE upg_catalog.regoper(
INPUT = upg_catalog.regoperin,
OUTPUT = upg_catalog.regoperout,
RECEIVE = upg_catalog.regoperrecv,
SEND = upg_catalog.regopersend,
INTERNALLENGTH = 4,
PASSEDBYVALUE,
STORAGE = plain,
DELIMITER = ',',
ALIGNMENT = int4
);
CREATE TYPE upg_catalog.regoperator(
INPUT = upg_catalog.regoperatorin,
OUTPUT = upg_catalog.regoperatorout,
RECEIVE = upg_catalog.regoperatorrecv,
SEND = upg_catalog.regoperatorsend,
INTERNALLENGTH = 4,
PASSEDBYVALUE,
STORAGE = plain,
DELIMITER = ',',
ALIGNMENT = int4
);
CREATE TYPE upg_catalog.regproc(
INPUT = upg_catalog.regprocin,
OUTPUT = upg_catalog.regprocout,
RECEIVE = upg_catalog.regprocrecv,
SEND = upg_catalog.regprocsend,
INTERNALLENGTH = 4,
PASSEDBYVALUE,
STORAGE = plain,
DELIMITER = ',',
ALIGNMENT = int4
);
CREATE TYPE upg_catalog.regprocedure(
INPUT = upg_catalog.regprocedurein,
OUTPUT = upg_catalog.regprocedureout,
RECEIVE = upg_catalog.regprocedurerecv,
SEND = upg_catalog.regproceduresend,
INTERNALLENGTH = 4,
PASSEDBYVALUE,
STORAGE = plain,
DELIMITER = ',',
ALIGNMENT = int4
);
CREATE TYPE upg_catalog.regtype(
INPUT = upg_catalog.regtypein,
OUTPUT = upg_catalog.regtypeout,
RECEIVE = upg_catalog.regtyperecv,
SEND = upg_catalog.regtypesend,
INTERNALLENGTH = 4,
PASSEDBYVALUE,
STORAGE = plain,
DELIMITER = ',',
ALIGNMENT = int4
);
CREATE TYPE upg_catalog.reltime(
INPUT = upg_catalog.reltimein,
OUTPUT = upg_catalog.reltimeout,
RECEIVE = upg_catalog.reltimerecv,
SEND = upg_catalog.reltimesend,
INTERNALLENGTH = 4,
PASSEDBYVALUE,
STORAGE = plain,
DELIMITER = ',',
ALIGNMENT = int4
);
CREATE TYPE upg_catalog.smgr(
INPUT = upg_catalog.smgrin,
OUTPUT = upg_catalog.smgrout,
INTERNALLENGTH = 2,
PASSEDBYVALUE,
STORAGE = plain,
DELIMITER = ',',
ALIGNMENT = int2
);
DROP TYPE upg_catalog._smgr;
CREATE TYPE upg_catalog.text(
INPUT = upg_catalog.textin,
OUTPUT = upg_catalog.textout,
RECEIVE = upg_catalog.textrecv,
SEND = upg_catalog.textsend,
INTERNALLENGTH = VARIABLE,
STORAGE = extended,
DELIMITER = ',',
ALIGNMENT = int4
);
CREATE TYPE upg_catalog.tid(
INPUT = upg_catalog.tidin,
OUTPUT = upg_catalog.tidout,
RECEIVE = upg_catalog.tidrecv,
SEND = upg_catalog.tidsend,
INTERNALLENGTH = 6,
STORAGE = plain,
DELIMITER = ',',
ALIGNMENT = int2
);
CREATE TYPE upg_catalog.timestamptz(
INPUT = upg_catalog.timestamptz_in,
OUTPUT = upg_catalog.timestamptz_out,
RECEIVE = upg_catalog.timestamptz_recv,
SEND = upg_catalog.timestamptz_send,
INTERNALLENGTH = 8,
PASSEDBYVALUE,
STORAGE = plain,
DELIMITER = ',',
ALIGNMENT = double
);
CREATE TYPE upg_catalog.timetz(
INPUT = upg_catalog.timetz_in,
OUTPUT = upg_catalog.timetz_out,
RECEIVE = upg_catalog.timetz_recv,
SEND = upg_catalog.timetz_send,
INTERNALLENGTH = 12,
STORAGE = plain,
DELIMITER = ',',
ALIGNMENT = double
);
CREATE TYPE upg_catalog.tinterval(
INPUT = upg_catalog.tintervalin,
OUTPUT = upg_catalog.tintervalout,
RECEIVE = upg_catalog.tintervalrecv,
SEND = upg_catalog.tintervalsend,
INTERNALLENGTH = 12,
STORAGE = plain,
DELIMITER = ',',
ALIGNMENT = int4
);
CREATE TYPE upg_catalog.trigger(
INPUT = upg_catalog.trigger_in,
OUTPUT = upg_catalog.trigger_out,
INTERNALLENGTH = 4,
PASSEDBYVALUE,
STORAGE = plain,
DELIMITER = ',',
ALIGNMENT = int4
);
DROP TYPE upg_catalog._trigger;
CREATE TYPE upg_catalog.unknown(
INPUT = upg_catalog.unknownin,
OUTPUT = upg_catalog.unknownout,
RECEIVE = upg_catalog.unknownrecv,
SEND = upg_catalog.unknownsend,
INTERNALLENGTH = -2,
STORAGE = plain,
DELIMITER = ',',
ALIGNMENT = char
);
DROP TYPE upg_catalog._unknown;
CREATE TYPE upg_catalog.varbit(
INPUT = upg_catalog.varbit_in,
OUTPUT = upg_catalog.varbit_out,
RECEIVE = upg_catalog.varbit_recv,
SEND = upg_catalog.varbit_send,
INTERNALLENGTH = VARIABLE,
STORAGE = extended,
DELIMITER = ',',
ALIGNMENT = int4
);
CREATE TYPE upg_catalog.void(
INPUT = upg_catalog.void_in,
OUTPUT = upg_catalog.void_out,
INTERNALLENGTH = 4,
PASSEDBYVALUE,
STORAGE = plain,
DELIMITER = ',',
ALIGNMENT = int4
);
DROP TYPE upg_catalog._void;
CREATE TYPE upg_catalog.xid(
INPUT = upg_catalog.xidin,
OUTPUT = upg_catalog.xidout,
RECEIVE = upg_catalog.xidrecv,
SEND = upg_catalog.xidsend,
INTERNALLENGTH = 4,
PASSEDBYVALUE,
STORAGE = plain,
DELIMITER = ',',
ALIGNMENT = int4
); | the_stack |
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for tb_collect
-- ----------------------------
DROP TABLE IF EXISTS `tb_collect`;
CREATE TABLE `tb_collect` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`tid` int(11) NOT NULL,
`uid` int(11) NOT NULL,
`in_time` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of tb_collect
-- ----------------------------
-- ----------------------------
-- Table structure for tb_notification
-- ----------------------------
DROP TABLE IF EXISTS `tb_notification`;
CREATE TABLE `tb_notification` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`read` tinyint(1) NOT NULL COMMENT '是否已读:0默认 1已读',
`author` varchar(50) NOT NULL DEFAULT '' COMMENT '发起通知用户昵称',
`target_author` varchar(50) NOT NULL COMMENT '要通知用户的昵称',
`in_time` datetime NOT NULL COMMENT '录入时间',
`action` varchar(255) NOT NULL DEFAULT '' COMMENT '通知动作',
`tid` int(11) NOT NULL COMMENT '话题id',
`content` longtext,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;
-- ----------------------------
-- Records of tb_notification
-- ----------------------------
-- ----------------------------
-- Table structure for tb_permission
-- ----------------------------
DROP TABLE IF EXISTS `tb_permission`;
CREATE TABLE `tb_permission` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(45) NOT NULL DEFAULT '' COMMENT '权限名称',
`url` varchar(255) DEFAULT NULL COMMENT '授权路径',
`description` varchar(255) NOT NULL COMMENT '权限描述',
`pid` int(11) NOT NULL COMMENT '父节点0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=90 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;
-- ----------------------------
-- Records of tb_permission
-- ----------------------------
INSERT INTO `tb_permission` VALUES ('55', 'section', '', '板块节点', '0');
INSERT INTO `tb_permission` VALUES ('56', 'system', '', '系统设置', '0');
INSERT INTO `tb_permission` VALUES ('57', 'topic', '', '话题节点', '0');
INSERT INTO `tb_permission` VALUES ('58', 'reply', '', '回复节点', '0');
INSERT INTO `tb_permission` VALUES ('59', 'system:users', '/manage/users', '用户列表', '56');
INSERT INTO `tb_permission` VALUES ('60', 'system:roles', '/manage/roles', '角色列表', '56');
INSERT INTO `tb_permission` VALUES ('61', 'system:permissions', '/manage/permissions', '权限列表', '56');
INSERT INTO `tb_permission` VALUES ('62', 'system:user:role', '/manage/userrole', '用户角色关联', '56');
INSERT INTO `tb_permission` VALUES ('63', 'system:role:permission', '/manage/rolepermission', '角色权限关联', '56');
INSERT INTO `tb_permission` VALUES ('64', 'system:add:permission', '/manage/addpermission', '添加权限', '56');
INSERT INTO `tb_permission` VALUES ('65', 'system:edit:permission', '/manage/editpermission', '编辑权限', '56');
INSERT INTO `tb_permission` VALUES ('66', 'system:add:role', '/manage/addrole', '添加角色', '56');
INSERT INTO `tb_permission` VALUES ('67', 'system:add:role', '/manage/addrole', '添加角色', '56');
INSERT INTO `tb_permission` VALUES ('68', 'system:delete:user', '/manage/deleteuser', '删除用户', '56');
INSERT INTO `tb_permission` VALUES ('69', 'system:delete:role', '/manage/deleterole', '删除角色', '56');
INSERT INTO `tb_permission` VALUES ('70', 'system:delete:permission', '/manage/deletepermission', '删除权限', '56');
INSERT INTO `tb_permission` VALUES ('71', 'topic:delete', '/topic/delete', '删除话题', '57');
INSERT INTO `tb_permission` VALUES ('73', 'reply:delete', '/reply/delete', '删除回复', '58');
INSERT INTO `tb_permission` VALUES ('74', 'reply:edit', '/reply/edit', '编辑回复', '58');
INSERT INTO `tb_permission` VALUES ('75', 'topic:edit', '/topic/edit', '话题编辑', '57');
INSERT INTO `tb_permission` VALUES ('76', 'topic:append:edit', '/topic/appendedit', '追加编辑', '57');
INSERT INTO `tb_permission` VALUES ('77', 'topic:top', '/topic/top', '话题置顶', '57');
INSERT INTO `tb_permission` VALUES ('78', 'topic:good', '/topic/good', '话题加精', '57');
INSERT INTO `tb_permission` VALUES ('79', 'system:clear:cache', '/clear', '删除所有缓存', '56');
INSERT INTO `tb_permission` VALUES ('80', 'system:user:block', '/manage/userblock', '禁用用户', '56');
INSERT INTO `tb_permission` VALUES ('81', 'section:list', '/section/list', '板块列表', '55');
INSERT INTO `tb_permission` VALUES ('82', 'section:change:show:status', '/section/changeshowstatus', '改变板块显示状态', '55');
INSERT INTO `tb_permission` VALUES ('83', 'section:delete', '/section/delete', '删除板块', '55');
INSERT INTO `tb_permission` VALUES ('84', 'section:add', '/section/add', '添加板块', '55');
INSERT INTO `tb_permission` VALUES ('85', 'section:edit', '/section/edit', '编辑板块', '55');
INSERT INTO `tb_permission` VALUES ('86', 'reply:list', '/reply/list', '回复列表', '58');
INSERT INTO `tb_permission` VALUES ('87', 'system:solr', '/solr', '索引所有话题(慎用)', '56');
INSERT INTO `tb_permission` VALUES ('88', 'system:delete:all:index', '/deleteallindex', '删除所有索引', '56');
-- ----------------------------
-- Table structure for tb_reply
-- ----------------------------
DROP TABLE IF EXISTS `tb_reply`;
CREATE TABLE `tb_reply` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`tid` int(11) NOT NULL COMMENT '话题id',
`content` longtext NOT NULL COMMENT '回复内容',
`in_time` datetime NOT NULL COMMENT '录入时间',
`author` varchar(32) NOT NULL COMMENT '当前回复用户id',
`is_delete` tinyint(1) NOT NULL COMMENT '是否删除0 默认 1删除',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;
-- ----------------------------
-- Records of tb_reply
-- ----------------------------
-- ----------------------------
-- Table structure for tb_role
-- ----------------------------
DROP TABLE IF EXISTS `tb_role`;
CREATE TABLE `tb_role` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(45) NOT NULL DEFAULT '',
`description` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;
-- ----------------------------
-- Records of tb_role
-- ----------------------------
INSERT INTO `tb_role` VALUES ('1', 'admin', '超级管理员');
INSERT INTO `tb_role` VALUES ('2', 'banzhu', '版主');
INSERT INTO `tb_role` VALUES ('3', 'user', '普通用户');
-- ----------------------------
-- Table structure for tb_role_permission
-- ----------------------------
DROP TABLE IF EXISTS `tb_role_permission`;
CREATE TABLE `tb_role_permission` (
`rid` int(11) NOT NULL,
`pid` int(11) NOT NULL,
KEY `fk_role_permission` (`rid`),
KEY `fk_permission_role` (`pid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;
-- ----------------------------
-- Records of tb_role_permission
-- ----------------------------
INSERT INTO `tb_role_permission` VALUES ('2', '71');
INSERT INTO `tb_role_permission` VALUES ('2', '75');
INSERT INTO `tb_role_permission` VALUES ('2', '76');
INSERT INTO `tb_role_permission` VALUES ('2', '77');
INSERT INTO `tb_role_permission` VALUES ('2', '78');
INSERT INTO `tb_role_permission` VALUES ('2', '73');
INSERT INTO `tb_role_permission` VALUES ('2', '74');
INSERT INTO `tb_role_permission` VALUES ('1', '59');
INSERT INTO `tb_role_permission` VALUES ('1', '60');
INSERT INTO `tb_role_permission` VALUES ('1', '61');
INSERT INTO `tb_role_permission` VALUES ('1', '62');
INSERT INTO `tb_role_permission` VALUES ('1', '63');
INSERT INTO `tb_role_permission` VALUES ('1', '64');
INSERT INTO `tb_role_permission` VALUES ('1', '65');
INSERT INTO `tb_role_permission` VALUES ('1', '66');
INSERT INTO `tb_role_permission` VALUES ('1', '67');
INSERT INTO `tb_role_permission` VALUES ('1', '68');
INSERT INTO `tb_role_permission` VALUES ('1', '69');
INSERT INTO `tb_role_permission` VALUES ('1', '70');
INSERT INTO `tb_role_permission` VALUES ('1', '79');
INSERT INTO `tb_role_permission` VALUES ('1', '87');
INSERT INTO `tb_role_permission` VALUES ('1', '88');
INSERT INTO `tb_role_permission` VALUES ('1', '89');
INSERT INTO `tb_role_permission` VALUES ('1', '71');
INSERT INTO `tb_role_permission` VALUES ('1', '75');
INSERT INTO `tb_role_permission` VALUES ('1', '76');
INSERT INTO `tb_role_permission` VALUES ('1', '77');
INSERT INTO `tb_role_permission` VALUES ('1', '78');
INSERT INTO `tb_role_permission` VALUES ('1', '73');
INSERT INTO `tb_role_permission` VALUES ('1', '74');
INSERT INTO `tb_role_permission` VALUES ('1', '86');
INSERT INTO `tb_role_permission` VALUES ('1', '81');
INSERT INTO `tb_role_permission` VALUES ('1', '82');
INSERT INTO `tb_role_permission` VALUES ('1', '83');
INSERT INTO `tb_role_permission` VALUES ('1', '84');
INSERT INTO `tb_role_permission` VALUES ('1', '85');
-- ----------------------------
-- Table structure for tb_section
-- ----------------------------
DROP TABLE IF EXISTS `tb_section`;
CREATE TABLE `tb_section` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(45) NOT NULL DEFAULT '' COMMENT '板块名称',
`tab` varchar(45) NOT NULL DEFAULT '' COMMENT '板块标签',
`show_status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否显示,0不显示1显示',
`display_index` int(11) NOT NULL COMMENT '板块排序',
`default_show` tinyint(1) NOT NULL DEFAULT '0' COMMENT '默认显示板块 0默认,1显示',
`pid` int(11) NOT NULL DEFAULT '0' COMMENT '模块父节点',
PRIMARY KEY (`id`),
UNIQUE KEY `tabunique` (`tab`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;
-- ----------------------------
-- Records of tb_section
-- ----------------------------
INSERT INTO `tb_section` VALUES ('1', '问答', 'ask', '1', '4', '0', '0');
INSERT INTO `tb_section` VALUES ('2', '博客', 'blog', '1', '5', '0', '0');
INSERT INTO `tb_section` VALUES ('3', '资讯', 'news', '1', '2', '0', '0');
INSERT INTO `tb_section` VALUES ('4', '分享', 'share', '1', '3', '1', '0');
-- ----------------------------
-- Table structure for tb_topic
-- ----------------------------
DROP TABLE IF EXISTS `tb_topic`;
CREATE TABLE `tb_topic` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`tab` varchar(50) NOT NULL COMMENT '版块标识',
`title` varchar(128) NOT NULL COMMENT '话题标题',
`tag` varchar(255) DEFAULT NULL COMMENT '话题内容标签',
`content` longtext COMMENT '话题内容',
`in_time` datetime NOT NULL COMMENT '录入时间',
`modify_time` datetime DEFAULT NULL COMMENT '修改时间',
`last_reply_time` datetime DEFAULT NULL COMMENT '最后回复话题时间,用于排序',
`last_reply_author` varchar(50) DEFAULT '' COMMENT '最后回复话题的用户id',
`view` int(11) NOT NULL COMMENT '浏览量',
`author` varchar(50) NOT NULL COMMENT '话题作者id',
`top` tinyint(1) NOT NULL COMMENT '1置顶 0默认',
`good` tinyint(1) NOT NULL COMMENT '1精华 0默认',
`show_status` tinyint(1) NOT NULL COMMENT '1显示0不显示',
`reply_count` int(11) NOT NULL DEFAULT '0' COMMENT '回复数量',
`is_delete` tinyint(1) NOT NULL COMMENT '1删除0默认',
`tag_is_count` tinyint(1) DEFAULT '0' COMMENT '话题内容标签是否被统计过1是0否默认',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;
-- ----------------------------
-- Records of tb_topic
-- ----------------------------
-- ----------------------------
-- Table structure for tb_topic_append
-- ----------------------------
DROP TABLE IF EXISTS `tb_topic_append`;
CREATE TABLE `tb_topic_append` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`tid` int(11) NOT NULL,
`content` longtext NOT NULL,
`in_time` datetime NOT NULL,
`is_delete` tinyint(1) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of tb_topic_append
-- ----------------------------
-- ----------------------------
-- Table structure for tb_user
-- ----------------------------
DROP TABLE IF EXISTS `tb_user`;
CREATE TABLE `tb_user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`nickname` varchar(50) NOT NULL DEFAULT '' COMMENT '昵称',
`score` int(11) NOT NULL COMMENT '积分',
`avatar` varchar(255) NOT NULL DEFAULT '' COMMENT '头像',
`email` varchar(255) DEFAULT NULL COMMENT '邮箱',
`url` varchar(255) DEFAULT NULL COMMENT '个人主页',
`signature` varchar(1000) DEFAULT NULL COMMENT '个性签名',
`third_id` varchar(50) NOT NULL DEFAULT '' COMMENT '第三方账户id',
`access_token` varchar(45) NOT NULL,
`receive_msg` tinyint(1) NOT NULL COMMENT '邮箱是否接收社区消息',
`in_time` datetime NOT NULL COMMENT '录入时间',
`expire_time` datetime NOT NULL,
`channel` varchar(50) NOT NULL,
`is_block` tinyint(1) NOT NULL COMMENT '禁用0默认 1禁用',
`third_access_token` varchar(50) DEFAULT NULL COMMENT '第三方登录获取的access_token',
PRIMARY KEY (`id`),
UNIQUE KEY `NICKNAME_UNIQUE` (`nickname`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;
-- ----------------------------
-- Records of tb_user
-- ----------------------------
-- ----------------------------
-- Table structure for tb_user_role
-- ----------------------------
DROP TABLE IF EXISTS `tb_user_role`;
CREATE TABLE `tb_user_role` (
`uid` int(11) NOT NULL,
`rid` int(11) NOT NULL,
KEY `fk_user_role` (`uid`),
KEY `fk_role_user` (`rid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;
-- ----------------------------
-- Records of tb_user_role
-- ----------------------------
INSERT INTO `tb_user_role` VALUES ('1', '1'); | the_stack |
-- TABLE: entries
CREATE TABLE IF NOT EXISTS `bx_classes_classes` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`author` int(11) NOT NULL,
`added` int(11) NOT NULL,
`changed` int(11) NOT NULL,
`published` int(11) NOT NULL,
`module_id` int(10) unsigned NOT NULL,
`order` int(11) NOT NULL,
`start_date` int(11) NOT NULL,
`end_date` int(11) NOT NULL,
`thumb` int(11) NOT NULL,
`title` varchar(255) NOT NULL,
`avail` int(11) NOT NULL,
`cmts` int(11) NOT NULL,
`completed_when` int(11) NOT NULL,
`text` mediumtext NOT NULL,
`labels` text NOT NULL,
`location` text NOT NULL,
`views` int(11) NOT NULL default '0',
`rate` float NOT NULL default '0',
`votes` int(11) NOT NULL default '0',
`rrate` float NOT NULL default '0',
`rvotes` int(11) NOT NULL default '0',
`score` int(11) NOT NULL default '0',
`sc_up` int(11) NOT NULL default '0',
`sc_down` int(11) NOT NULL default '0',
`favorites` int(11) NOT NULL default '0',
`comments` int(11) NOT NULL default '0',
`reports` int(11) NOT NULL default '0',
`featured` int(11) NOT NULL default '0',
`allow_view_to` varchar(16) NOT NULL DEFAULT '3',
`status` enum('active','awaiting','failed','hidden') NOT NULL DEFAULT 'active',
`status_admin` enum('active','hidden','pending') NOT NULL DEFAULT 'active',
PRIMARY KEY (`id`),
FULLTEXT KEY `title_text` (`title`,`text`)
);
-- TABLE: modules
CREATE TABLE IF NOT EXISTS `bx_classes_modules` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`profile_id` int(10) unsigned NOT NULL,
`module_title` varchar(255) NOT NULL,
`author` int(11) NOT NULL,
`added` int(11) NOT NULL,
`changed` int(11) NOT NULL,
`order` int(11) NOT NULL,
PRIMARY KEY (`id`)
);
-- TABLE: status
CREATE TABLE IF NOT EXISTS `bx_classes_statuses` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`class_id` int(10) unsigned NOT NULL,
`student_profile_id` int(11) NOT NULL,
`viewed` int(11) NOT NULL,
`replied` int(11) NOT NULL,
`completed` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE `class_student` (`class_id`,`student_profile_id`)
);
-- TABLE: storages & transcoders
CREATE TABLE IF NOT EXISTS `bx_classes_covers` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`profile_id` int(10) unsigned NOT NULL,
`remote_id` varchar(128) NOT NULL,
`path` varchar(255) NOT NULL,
`file_name` varchar(255) NOT NULL,
`mime_type` varchar(128) NOT NULL,
`ext` varchar(32) NOT NULL,
`size` bigint(20) NOT NULL,
`added` int(11) NOT NULL,
`modified` int(11) NOT NULL,
`private` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `remote_id` (`remote_id`)
);
CREATE TABLE IF NOT EXISTS `bx_classes_files` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`profile_id` int(10) unsigned NOT NULL,
`remote_id` varchar(128) NOT NULL,
`path` varchar(255) NOT NULL,
`file_name` varchar(255) NOT NULL,
`mime_type` varchar(128) NOT NULL,
`ext` varchar(32) NOT NULL,
`size` bigint(20) NOT NULL,
`added` int(11) NOT NULL,
`modified` int(11) NOT NULL,
`private` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `remote_id` (`remote_id`)
);
CREATE TABLE IF NOT EXISTS `bx_classes_photos` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`profile_id` int(10) unsigned NOT NULL,
`remote_id` varchar(128) NOT NULL,
`path` varchar(255) NOT NULL,
`file_name` varchar(255) NOT NULL,
`mime_type` varchar(128) NOT NULL,
`ext` varchar(32) NOT NULL,
`size` bigint(20) NOT NULL,
`added` int(11) NOT NULL,
`modified` int(11) NOT NULL,
`private` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `remote_id` (`remote_id`)
);
CREATE TABLE IF NOT EXISTS `bx_classes_photos_resized` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`profile_id` int(10) unsigned NOT NULL,
`remote_id` varchar(128) NOT NULL,
`path` varchar(255) NOT NULL,
`file_name` varchar(255) NOT NULL,
`mime_type` varchar(128) NOT NULL,
`ext` varchar(32) NOT NULL,
`size` bigint(20) NOT NULL,
`added` int(11) NOT NULL,
`modified` int(11) NOT NULL,
`private` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `remote_id` (`remote_id`)
);
CREATE TABLE IF NOT EXISTS `bx_classes_videos` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`profile_id` int(10) unsigned NOT NULL,
`remote_id` varchar(128) NOT NULL,
`path` varchar(255) NOT NULL,
`file_name` varchar(255) NOT NULL,
`mime_type` varchar(128) NOT NULL,
`ext` varchar(32) NOT NULL,
`size` bigint(20) NOT NULL,
`dimensions` varchar(12) NOT NULL,
`added` int(11) NOT NULL,
`modified` int(11) NOT NULL,
`private` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `remote_id` (`remote_id`)
);
CREATE TABLE IF NOT EXISTS `bx_classes_videos_resized` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`profile_id` int(10) unsigned NOT NULL,
`remote_id` varchar(128) NOT NULL,
`path` varchar(255) NOT NULL,
`file_name` varchar(255) NOT NULL,
`mime_type` varchar(128) NOT NULL,
`ext` varchar(32) NOT NULL,
`size` bigint(20) NOT NULL,
`added` int(11) NOT NULL,
`modified` int(11) NOT NULL,
`private` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `remote_id` (`remote_id`)
);
CREATE TABLE IF NOT EXISTS `bx_classes_sounds` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`profile_id` int(10) unsigned NOT NULL,
`remote_id` varchar(128) NOT NULL,
`path` varchar(255) NOT NULL,
`file_name` varchar(255) NOT NULL,
`mime_type` varchar(128) NOT NULL,
`ext` varchar(32) NOT NULL,
`size` bigint(20) NOT NULL,
`added` int(11) NOT NULL,
`modified` int(11) NOT NULL,
`private` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `remote_id` (`remote_id`)
);
CREATE TABLE IF NOT EXISTS `bx_classes_sounds_resized` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`profile_id` int(10) unsigned NOT NULL,
`remote_id` varchar(128) NOT NULL,
`path` varchar(255) NOT NULL,
`file_name` varchar(255) NOT NULL,
`mime_type` varchar(128) NOT NULL,
`ext` varchar(32) NOT NULL,
`size` bigint(20) NOT NULL,
`added` int(11) NOT NULL,
`modified` int(11) NOT NULL,
`private` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `remote_id` (`remote_id`)
);
-- TABLE: comments
CREATE TABLE IF NOT EXISTS `bx_classes_cmts` (
`cmt_id` int(11) NOT NULL AUTO_INCREMENT,
`cmt_parent_id` int(11) NOT NULL DEFAULT '0',
`cmt_vparent_id` int(11) NOT NULL DEFAULT '0',
`cmt_object_id` int(11) NOT NULL DEFAULT '0',
`cmt_author_id` int(11) NOT NULL DEFAULT '0',
`cmt_level` int(11) NOT NULL DEFAULT '0',
`cmt_text` text NOT NULL,
`cmt_mood` tinyint(4) NOT NULL DEFAULT '0',
`cmt_rate` int(11) NOT NULL DEFAULT '0',
`cmt_rate_count` int(11) NOT NULL DEFAULT '0',
`cmt_time` int(11) unsigned NOT NULL DEFAULT '0',
`cmt_replies` int(11) NOT NULL DEFAULT '0',
`cmt_pinned` int(11) NOT NULL default '0',
PRIMARY KEY (`cmt_id`),
KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
FULLTEXT KEY `search_fields` (`cmt_text`)
);
CREATE TABLE IF NOT EXISTS `bx_classes_cmts_notes` (
`cmt_id` int(11) NOT NULL AUTO_INCREMENT,
`cmt_parent_id` int(11) NOT NULL DEFAULT '0',
`cmt_vparent_id` int(11) NOT NULL DEFAULT '0',
`cmt_object_id` int(11) NOT NULL DEFAULT '0',
`cmt_author_id` int(11) NOT NULL DEFAULT '0',
`cmt_level` int(11) NOT NULL DEFAULT '0',
`cmt_text` text NOT NULL,
`cmt_mood` tinyint(4) NOT NULL DEFAULT '0',
`cmt_rate` int(11) NOT NULL DEFAULT '0',
`cmt_rate_count` int(11) NOT NULL DEFAULT '0',
`cmt_time` int(11) unsigned NOT NULL DEFAULT '0',
`cmt_replies` int(11) NOT NULL DEFAULT '0',
`cmt_pinned` int(11) NOT NULL default '0',
PRIMARY KEY (`cmt_id`),
KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
FULLTEXT KEY `search_fields` (`cmt_text`)
);
-- TABLE: votes
CREATE TABLE IF NOT EXISTS `bx_classes_votes` (
`object_id` int(11) NOT NULL default '0',
`count` int(11) NOT NULL default '0',
`sum` int(11) NOT NULL default '0',
UNIQUE KEY `object_id` (`object_id`)
);
CREATE TABLE IF NOT EXISTS `bx_classes_votes_track` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`object_id` int(11) NOT NULL default '0',
`author_id` int(11) NOT NULL default '0',
`author_nip` int(11) unsigned NOT NULL default '0',
`value` tinyint(4) NOT NULL default '0',
`date` int(11) NOT NULL default '0',
PRIMARY KEY (`id`),
KEY `vote` (`object_id`, `author_nip`)
);
CREATE TABLE IF NOT EXISTS `bx_classes_reactions` (
`object_id` int(11) NOT NULL default '0',
`reaction` varchar(32) NOT NULL default '',
`count` int(11) NOT NULL default '0',
`sum` int(11) NOT NULL default '0',
UNIQUE KEY `reaction` (`object_id`, `reaction`)
);
CREATE TABLE IF NOT EXISTS `bx_classes_reactions_track` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`object_id` int(11) NOT NULL default '0',
`author_id` int(11) NOT NULL default '0',
`author_nip` int(11) unsigned NOT NULL default '0',
`reaction` varchar(32) NOT NULL default '',
`value` tinyint(4) NOT NULL default '0',
`date` int(11) NOT NULL default '0',
PRIMARY KEY (`id`),
KEY `vote` (`object_id`, `author_nip`)
);
-- TABLE: views
CREATE TABLE `bx_classes_views_track` (
`object_id` int(11) NOT NULL default '0',
`viewer_id` int(11) NOT NULL default '0',
`viewer_nip` int(11) unsigned NOT NULL default '0',
`date` int(11) NOT NULL default '0',
KEY `id` (`object_id`,`viewer_id`,`viewer_nip`)
);
-- TABLE: metas
CREATE TABLE `bx_classes_meta_keywords` (
`object_id` int(10) unsigned NOT NULL,
`keyword` varchar(255) NOT NULL,
KEY `object_id` (`object_id`),
KEY `keyword` (`keyword`)
);
CREATE TABLE `bx_classes_meta_mentions` (
`object_id` int(10) unsigned NOT NULL,
`profile_id` int(10) unsigned NOT NULL,
KEY `object_id` (`object_id`),
KEY `profile_id` (`profile_id`)
);
CREATE TABLE `bx_classes_meta_locations` (
`object_id` int(10) unsigned NOT NULL,
`lat` double NOT NULL,
`lng` double NOT NULL,
`country` varchar(2) NOT NULL,
`state` varchar(255) NOT NULL,
`city` varchar(255) NOT NULL,
`zip` varchar(255) NOT NULL,
`street` varchar(255) NOT NULL,
`street_number` varchar(255) NOT NULL,
PRIMARY KEY (`object_id`),
KEY `country_state_city` (`country`,`state`(8),`city`(8))
);
-- TABLE: reports
CREATE TABLE IF NOT EXISTS `bx_classes_reports` (
`object_id` int(11) NOT NULL default '0',
`count` int(11) NOT NULL default '0',
UNIQUE KEY `object_id` (`object_id`)
);
CREATE TABLE IF NOT EXISTS `bx_classes_reports_track` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`object_id` int(11) NOT NULL default '0',
`author_id` int(11) NOT NULL default '0',
`author_nip` int(11) unsigned NOT NULL default '0',
`type` varchar(32) NOT NULL default '',
`text` text NOT NULL default '',
`date` int(11) NOT NULL default '0',
`checked_by` int(11) NOT NULL default '0',
`status` tinyint(11) NOT NULL default '0',
PRIMARY KEY (`id`),
KEY `report` (`object_id`, `author_nip`)
);
-- TABLE: favorites
CREATE TABLE `bx_classes_favorites_track` (
`object_id` int(11) NOT NULL default '0',
`author_id` int(11) NOT NULL default '0',
`date` int(11) NOT NULL default '0',
KEY `id` (`object_id`,`author_id`)
);
-- TABLE: scores
CREATE TABLE IF NOT EXISTS `bx_classes_scores` (
`object_id` int(11) NOT NULL default '0',
`count_up` int(11) NOT NULL default '0',
`count_down` int(11) NOT NULL default '0',
UNIQUE KEY `object_id` (`object_id`)
);
CREATE TABLE IF NOT EXISTS `bx_classes_scores_track` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`object_id` int(11) NOT NULL default '0',
`author_id` int(11) NOT NULL default '0',
`author_nip` int(11) unsigned NOT NULL default '0',
`type` varchar(8) NOT NULL default '',
`date` int(11) NOT NULL default '0',
PRIMARY KEY (`id`),
KEY `vote` (`object_id`, `author_nip`)
);
-- TABLE: polls
CREATE TABLE IF NOT EXISTS `bx_classes_polls` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`author_id` int(11) NOT NULL default '0',
`content_id` int(11) NOT NULL default '0',
`text` text NOT NULL,
PRIMARY KEY (`id`),
KEY `content_id` (`content_id`),
FULLTEXT KEY `search_fields` (`text`)
);
CREATE TABLE IF NOT EXISTS `bx_classes_polls_answers` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`poll_id` int(11) unsigned NOT NULL default '0',
`title` varchar(255) NOT NULL,
`rate` float NOT NULL default '0',
`votes` int(11) NOT NULL default '0',
`order` int(11) NOT NULL default '0',
PRIMARY KEY (`id`),
KEY `poll_id` (`poll_id`),
FULLTEXT KEY `title` (`title`)
);
CREATE TABLE IF NOT EXISTS `bx_classes_polls_answers_votes` (
`object_id` int(11) NOT NULL default '0',
`count` int(11) NOT NULL default '0',
`sum` int(11) NOT NULL default '0',
UNIQUE KEY `object_id` (`object_id`)
);
CREATE TABLE IF NOT EXISTS `bx_classes_polls_answers_votes_track` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`object_id` int(11) NOT NULL default '0',
`author_id` int(11) NOT NULL default '0',
`author_nip` int(11) unsigned NOT NULL default '0',
`value` tinyint(4) NOT NULL default '0',
`date` int(11) NOT NULL default '0',
PRIMARY KEY (`id`),
KEY `vote` (`object_id`, `author_nip`)
);
-- STORAGES & TRANSCODERS
SET @sStorageEngine = (SELECT `value` FROM `sys_options` WHERE `name` = 'sys_storage_default');
INSERT INTO `sys_objects_storage` (`object`, `engine`, `params`, `token_life`, `cache_control`, `levels`, `table_files`, `ext_mode`, `ext_allow`, `ext_deny`, `quota_size`, `current_size`, `quota_number`, `current_number`, `max_file_size`, `ts`) VALUES
('bx_classes_covers', @sStorageEngine, '', 360, 2592000, 3, 'bx_classes_covers', 'allow-deny', 'jpg,jpeg,jpe,gif,png', '', 0, 0, 0, 0, 0, 0),
('bx_classes_photos', @sStorageEngine, '', 360, 2592000, 3, 'bx_classes_photos', 'allow-deny', 'jpg,jpeg,jpe,gif,png', '', 0, 0, 0, 0, 0, 0),
('bx_classes_photos_resized', @sStorageEngine, '', 360, 2592000, 3, 'bx_classes_photos_resized', 'allow-deny', 'jpg,jpeg,jpe,gif,png', '', 0, 0, 0, 0, 0, 0),
('bx_classes_videos', @sStorageEngine, 'a:1:{s:6:"fields";a:1:{s:10:"dimensions";s:17:"getFileDimensions";}}', 360, 2592000, 3, 'bx_classes_videos', 'allow-deny', 'avi,flv,mpg,mpeg,wmv,mp4,m4v,mov,qt,divx,xvid,3gp,3g2,webm,mkv,ogv,ogg,rm,rmvb,asf,drc', '', 0, 0, 0, 0, 0, 0),
('bx_classes_videos_resized', @sStorageEngine, '', 360, 2592000, 3, 'bx_classes_videos_resized', 'allow-deny', 'jpg,jpeg,jpe,gif,png,avi,flv,mpg,mpeg,wmv,mp4,m4v,mov,qt,divx,xvid,3gp,3g2,webm,mkv,ogv,ogg,rm,rmvb,asf,drc', '', 0, 0, 0, 0, 0, 0),
('bx_classes_sounds', @sStorageEngine, '', 360, 2592000, 3, 'bx_classes_sounds', 'allow-deny', 'mp3,m4a,m4b,wma,wav,3gp', '', 0, 0, 0, 0, 0, 0),
('bx_classes_sounds_resized', @sStorageEngine, '', 360, 2592000, 3, 'bx_classes_sounds_resized', 'allow-deny', 'mp3,m4a,m4b,wma,wav,3gp', '', 0, 0, 0, 0, 0, 0),
('bx_classes_files', @sStorageEngine, '', 360, 2592000, 3, 'bx_classes_files', 'deny-allow', '', 'action,apk,app,bat,bin,cmd,com,command,cpl,csh,exe,gadget,inf,ins,inx,ipa,isu,job,jse,ksh,lnk,msc,msi,msp,mst,osx,out,paf,pif,prg,ps1,reg,rgs,run,sct,shb,shs,u3p,vb,vbe,vbs,vbscript,workflow,ws,wsf', 0, 0, 0, 0, 0, 0);
INSERT INTO `sys_objects_transcoder` (`object`, `storage_object`, `source_type`, `source_params`, `private`, `atime_tracking`, `atime_pruning`, `ts`, `override_class_name`, `override_class_file`) VALUES
('bx_classes_preview', 'bx_classes_photos_resized', 'Storage', 'a:1:{s:6:"object";s:17:"bx_classes_covers";}', 'no', '1', '2592000', '0', '', ''),
('bx_classes_gallery', 'bx_classes_photos_resized', 'Storage', 'a:1:{s:6:"object";s:17:"bx_classes_covers";}', 'no', '1', '2592000', '0', '', ''),
('bx_classes_cover', 'bx_classes_photos_resized', 'Storage', 'a:1:{s:6:"object";s:17:"bx_classes_covers";}', 'no', '1', '2592000', '0', '', ''),
('bx_classes_preview_photos', 'bx_classes_photos_resized', 'Storage', 'a:1:{s:6:"object";s:17:"bx_classes_photos";}', 'no', '1', '2592000', '0', '', ''),
('bx_classes_gallery_photos', 'bx_classes_photos_resized', 'Storage', 'a:1:{s:6:"object";s:17:"bx_classes_photos";}', 'no', '1', '2592000', '0', '', ''),
('bx_classes_videos_poster', 'bx_classes_videos_resized', 'Storage', 'a:1:{s:6:"object";s:17:"bx_classes_videos";}', 'no', '0', '0', '0', 'BxDolTranscoderVideo', ''),
('bx_classes_videos_poster_preview', 'bx_classes_videos_resized', 'Storage', 'a:1:{s:6:"object";s:17:"bx_classes_videos";}', 'no', '0', '0', '0', 'BxDolTranscoderVideo', ''),
('bx_classes_videos_mp4', 'bx_classes_videos_resized', 'Storage', 'a:1:{s:6:"object";s:17:"bx_classes_videos";}', 'no', '0', '0', '0', 'BxDolTranscoderVideo', ''),
('bx_classes_videos_mp4_hd', 'bx_classes_videos_resized', 'Storage', 'a:1:{s:6:"object";s:17:"bx_classes_videos";}', 'no', '0', '0', '0', 'BxDolTranscoderVideo', ''),
('bx_classes_sounds_mp3', 'bx_classes_sounds_resized', 'Storage', 'a:1:{s:6:"object";s:17:"bx_classes_sounds";}', 'no', '0', '0', '0', 'BxDolTranscoderAudio', ''),
('bx_classes_preview_files', 'bx_classes_photos_resized', 'Storage', 'a:1:{s:6:"object";s:16:"bx_classes_files";}', 'no', '1', '2592000', '0', '', ''),
('bx_classes_gallery_files', 'bx_classes_photos_resized', 'Storage', 'a:1:{s:6:"object";s:16:"bx_classes_files";}', 'no', '1', '2592000', '0', '', '');
INSERT INTO `sys_transcoder_filters` (`transcoder_object`, `filter`, `filter_params`, `order`) VALUES
('bx_classes_preview', 'Resize', 'a:3:{s:1:"w";s:3:"300";s:1:"h";s:3:"200";s:11:"crop_resize";s:1:"1";}', '0'),
('bx_classes_gallery', 'Resize', 'a:1:{s:1:"w";s:3:"500";}', '0'),
('bx_classes_cover', 'Resize', 'a:1:{s:1:"w";s:4:"2000";}', '0'),
('bx_classes_preview_photos', 'Resize', 'a:3:{s:1:"w";s:3:"300";s:1:"h";s:3:"200";s:11:"crop_resize";s:1:"1";}', '0'),
('bx_classes_gallery_photos', 'Resize', 'a:1:{s:1:"w";s:4:"2000";}', '0'),
('bx_classes_videos_poster_preview', 'Resize', 'a:3:{s:1:"w";s:3:"300";s:1:"h";s:3:"200";s:13:"square_resize";s:1:"1";}', 10),
('bx_classes_videos_poster_preview', 'Poster', 'a:2:{s:1:"h";s:3:"480";s:10:"force_type";s:3:"jpg";}', 0),
('bx_classes_videos_poster', 'Poster', 'a:2:{s:1:"h";s:3:"318";s:10:"force_type";s:3:"jpg";}', 0),
('bx_classes_videos_mp4', 'Mp4', 'a:2:{s:1:"h";s:3:"318";s:10:"force_type";s:3:"mp4";}', 0),
('bx_classes_videos_mp4_hd', 'Mp4', 'a:3:{s:1:"h";s:3:"720";s:13:"video_bitrate";s:4:"1536";s:10:"force_type";s:3:"mp4";}', 0),
('bx_classes_sounds_mp3', 'Mp3', 'a:0:{}', 0),
('bx_classes_preview_files', 'Resize', 'a:3:{s:1:"w";s:3:"300";s:1:"h";s:3:"200";s:11:"crop_resize";s:1:"1";}', '0'),
('bx_classes_gallery_files', 'Resize', 'a:1:{s:1:"w";s:3:"500";}', '0');
-- FORMS: entry (post)
INSERT INTO `sys_objects_form`(`object`, `module`, `title`, `action`, `form_attrs`, `table`, `key`, `uri`, `uri_title`, `submit_name`, `params`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
('bx_classes', 'bx_classes', '_bx_classes_form_entry', '', 'a:1:{s:7:"enctype";s:19:"multipart/form-data";}', 'bx_classes_classes', 'id', '', '', 'a:2:{i:0;s:9:"do_submit";i:1;s:10:"do_publish";}', '', 0, 1, 'BxClssFormEntry', 'modules/boonex/classes/classes/BxClssFormEntry.php');
INSERT INTO `sys_form_displays`(`object`, `display_name`, `module`, `view_mode`, `title`) VALUES
('bx_classes', 'bx_classes_entry_add', 'bx_classes', 0, '_bx_classes_form_entry_display_add'),
('bx_classes', 'bx_classes_entry_delete', 'bx_classes', 0, '_bx_classes_form_entry_display_delete'),
('bx_classes', 'bx_classes_entry_edit', 'bx_classes', 0, '_bx_classes_form_entry_display_edit'),
('bx_classes', 'bx_classes_entry_view', 'bx_classes', 1, '_bx_classes_form_entry_display_view');
INSERT INTO `sys_form_inputs`(`object`, `module`, `name`, `value`, `values`, `checked`, `type`, `caption_system`, `caption`, `info`, `required`, `collapsed`, `html`, `attrs`, `attrs_tr`, `attrs_wrapper`, `checker_func`, `checker_params`, `checker_error`, `db_pass`, `db_params`, `editable`, `deletable`) VALUES
('bx_classes', 'bx_classes', 'allow_view_to', '', '', 0, 'custom', '_bx_classes_form_entry_input_sys_allow_view_to', '_bx_classes_form_entry_input_allow_view_to', '', 1, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
('bx_classes', 'bx_classes', 'delete_confirm', 1, '', 0, 'checkbox', '_bx_classes_form_entry_input_sys_delete_confirm', '_bx_classes_form_entry_input_delete_confirm', '_bx_classes_form_entry_input_delete_confirm_info', 1, 0, 0, '', '', '', 'Avail', '', '_bx_classes_form_entry_input_delete_confirm_error', '', '', 1, 0),
('bx_classes', 'bx_classes', 'do_publish', '_bx_classes_form_entry_input_do_publish', '', 0, 'submit', '_bx_classes_form_entry_input_sys_do_publish', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
('bx_classes', 'bx_classes', 'do_submit', '_bx_classes_form_entry_input_do_submit', '', 0, 'submit', '_bx_classes_form_entry_input_sys_do_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
('bx_classes', 'bx_classes', 'location', '', '', 0, 'location', '_sys_form_input_sys_location', '_sys_form_input_location', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
('bx_classes', 'bx_classes', 'covers', 'a:1:{i:0;s:16:"bx_classes_html5";}', 'a:2:{s:17:"bx_classes_simple";s:26:"_sys_uploader_simple_title";s:16:"bx_classes_html5";s:25:"_sys_uploader_html5_title";}', 0, 'files', '_bx_classes_form_entry_input_sys_covers', '_bx_classes_form_entry_input_covers', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
('bx_classes', 'bx_classes', 'pictures', 'a:1:{i:0;s:23:"bx_classes_photos_html5";}', 'a:2:{s:24:"bx_classes_photos_simple";s:26:"_sys_uploader_simple_title";s:23:"bx_classes_photos_html5";s:25:"_sys_uploader_html5_title";}', 0, 'files', '_bx_classes_form_entry_input_sys_pictures', '_bx_classes_form_entry_input_pictures', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
('bx_classes', 'bx_classes', 'videos', 'a:2:{i:0;s:23:"bx_classes_videos_html5";i:1;s:30:"bx_classes_videos_record_video";}', 'a:3:{s:24:"bx_classes_videos_simple";s:26:"_sys_uploader_simple_title";s:23:"bx_classes_videos_html5";s:25:"_sys_uploader_html5_title";s:30:"bx_classes_videos_record_video";s:32:"_sys_uploader_record_video_title";}', 0, 'files', '_bx_classes_form_entry_input_sys_videos', '_bx_classes_form_entry_input_videos', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
('bx_classes', 'bx_classes', 'sounds', 'a:1:{i:0;s:23:"bx_classes_sounds_html5";}', 'a:2:{s:24:"bx_classes_sounds_simple";s:26:"_sys_uploader_simple_title";s:23:"bx_classes_sounds_html5";s:25:"_sys_uploader_html5_title";}', 0, 'files', '_bx_classes_form_entry_input_sys_sounds', '_bx_classes_form_entry_input_sounds', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
('bx_classes', 'bx_classes', 'files', 'a:1:{i:0;s:22:"bx_classes_files_html5";}', 'a:2:{s:23:"bx_classes_files_simple";s:26:"_sys_uploader_simple_title";s:22:"bx_classes_files_html5";s:25:"_sys_uploader_html5_title";}', 0, 'files', '_bx_classes_form_entry_input_sys_files', '_bx_classes_form_entry_input_files', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
('bx_classes', 'bx_classes', 'polls', '', '', 0, 'custom', '_bx_classes_form_entry_input_sys_polls', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
('bx_classes', 'bx_classes', 'text', '', '', 0, 'textarea', '_bx_classes_form_entry_input_sys_text', '_bx_classes_form_entry_input_text', '', 1, 0, 2, '', '', '', 'Avail', '', '_bx_classes_form_entry_input_text_err', 'XssHtml', '', 1, 0),
('bx_classes', 'bx_classes', 'title', '', '', 0, 'text', '_bx_classes_form_entry_input_sys_title', '_bx_classes_form_entry_input_title', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_classes_form_entry_input_title_err', 'Xss', '', 1, 0),
('bx_classes', 'bx_classes', 'avail', '', '#!bx_classes_avail', 0, 'select', '', '_bx_classes_form_entry_input_avail', '', 1, 0, 0, '', '', '', '', '', '', 'Int', '', 1, 0),
('bx_classes', 'bx_classes', 'cmts', '2', '#!bx_classes_cmts', 0, 'select', '', '_bx_classes_form_entry_input_cmts', '', 1, 0, 0, '', '', '', '', '', '', 'Int', '', 1, 0),
('bx_classes', 'bx_classes', 'completed_when', '', '#!bx_classes_completed_when', 0, 'select', '', '_bx_classes_form_entry_input_completed_when', '', 1, 0, 0, '', '', '', '', '', '', 'Int', '', 1, 0),
('bx_classes', 'bx_classes', 'module_id', '', '', 0, 'select', '', '_bx_classes_form_entry_input_module', '', 1, 0, 0, '', '', '', '', '', '', 'Int', '', 1, 0),
('bx_classes', 'bx_classes', 'added', '', '', 0, 'datetime', '_bx_classes_form_entry_input_sys_date_added', '_bx_classes_form_entry_input_date_added', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
('bx_classes', 'bx_classes', 'changed', '', '', 0, 'datetime', '_bx_classes_form_entry_input_sys_date_changed', '_bx_classes_form_entry_input_date_changed', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
('bx_classes', 'bx_classes', 'start_date', '', '', 0, 'datetime', '', '_bx_classes_form_entry_input_date_start_date', '', 0, 0, 0, '', '', '', '', '', '', 'DateTimeUtc', '', 1, 0),
('bx_classes', 'bx_classes', 'end_date', '', '', 0, 'datetime', '', '_bx_classes_form_entry_input_date_end_date', '', 0, 0, 0, '', '', '', '', '', '', 'DateTimeUtc', '', 1, 0),
('bx_classes', 'bx_classes', 'attachments', '', '', 0, 'custom', '_bx_classes_form_entry_input_sys_attachments', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
('bx_classes', 'bx_classes', 'labels', '', '', 0, 'custom', '_sys_form_input_sys_labels', '_sys_form_input_labels', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
('bx_classes', 'bx_classes', 'anonymous', '', '', 0, 'switcher', '_sys_form_input_sys_anonymous', '_sys_form_input_anonymous', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0);
INSERT INTO `sys_form_display_inputs`(`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
('bx_classes_entry_add', 'covers', 2147483647, 1, 1),
('bx_classes_entry_add', 'module_id', 2147483647, 1, 2),
('bx_classes_entry_add', 'title', 2147483647, 1, 3),
('bx_classes_entry_add', 'text', 2147483647, 1, 4),
('bx_classes_entry_add', 'attachments', 2147483647, 1, 5),
('bx_classes_entry_add', 'pictures', 2147483647, 1, 6),
('bx_classes_entry_add', 'videos', 2147483647, 1, 7),
('bx_classes_entry_add', 'sounds', 2147483647, 1, 8),
('bx_classes_entry_add', 'files', 2147483647, 1, 9),
('bx_classes_entry_add', 'polls', 2147483647, 1, 10),
('bx_classes_entry_add', 'start_date', 2147483647, 1, 11),
('bx_classes_entry_add', 'end_date', 2147483647, 1, 12),
('bx_classes_entry_add', 'completed_when', 2147483647, 1, 13),
('bx_classes_entry_add', 'avail', 2147483647, 1, 14),
('bx_classes_entry_add', 'cmts', 2147483647, 1, 15),
('bx_classes_entry_add', 'allow_view_to', 2147483647, 1, 16),
('bx_classes_entry_add', 'do_publish', 2147483647, 1, 17),
('bx_classes_entry_delete', 'delete_confirm', 2147483647, 1, 1),
('bx_classes_entry_delete', 'do_submit', 2147483647, 1, 2),
('bx_classes_entry_edit', 'covers', 2147483647, 1, 1),
('bx_classes_entry_edit', 'module_id', 2147483647, 1, 2),
('bx_classes_entry_edit', 'title', 2147483647, 1, 3),
('bx_classes_entry_edit', 'text', 2147483647, 1, 4),
('bx_classes_entry_edit', 'attachments', 2147483647, 1, 5),
('bx_classes_entry_edit', 'pictures', 2147483647, 1, 6),
('bx_classes_entry_edit', 'videos', 2147483647, 1, 7),
('bx_classes_entry_edit', 'sounds', 2147483647, 1, 8),
('bx_classes_entry_edit', 'files', 2147483647, 1, 9),
('bx_classes_entry_edit', 'polls', 2147483647, 1, 10),
('bx_classes_entry_edit', 'start_date', 2147483647, 1, 11),
('bx_classes_entry_edit', 'end_date', 2147483647, 1, 12),
('bx_classes_entry_edit', 'completed_when', 2147483647, 1, 13),
('bx_classes_entry_edit', 'avail', 2147483647, 1, 14),
('bx_classes_entry_edit', 'cmts', 2147483647, 1, 15),
('bx_classes_entry_edit', 'allow_view_to', 2147483647, 1, 16),
('bx_classes_entry_edit', 'do_submit', 2147483647, 1, 17),
('bx_classes_entry_view', 'module_id', 2147483647, 1, 1),
('bx_classes_entry_view', 'completed_when', 2147483647, 1, 2),
('bx_classes_entry_view', 'added', 2147483647, 1, 3),
('bx_classes_entry_view', 'changed', 2147483647, 1, 4),
('bx_classes_entry_view', 'start_date', 2147483647, 1, 5),
('bx_classes_entry_view', 'end_date', 2147483647, 1, 6);
-- FORMS: poll
INSERT INTO `sys_objects_form` (`object`, `module`, `title`, `action`, `form_attrs`, `submit_name`, `table`, `key`, `uri`, `uri_title`, `params`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
('bx_classes_poll', 'bx_classes', '_bx_classes_form_poll', '', '', 'do_submit', 'bx_classes_polls', 'id', '', '', 'a:1:{s:14:"checker_helper";s:27:"BxClssFormPollCheckerHelper";}', 0, 1, 'BxClssFormPoll', 'modules/boonex/classes/classes/BxClssFormPoll.php');
INSERT INTO `sys_form_displays` (`display_name`, `module`, `object`, `title`, `view_mode`) VALUES
('bx_classes_poll_add', 'bx_classes', 'bx_classes_poll', '_bx_classes_form_poll_display_add', 0);
INSERT INTO `sys_form_inputs` (`object`, `module`, `name`, `value`, `values`, `checked`, `type`, `caption_system`, `caption`, `info`, `required`, `collapsed`, `html`, `attrs`, `attrs_tr`, `attrs_wrapper`, `checker_func`, `checker_params`, `checker_error`, `db_pass`, `db_params`, `editable`, `deletable`) VALUES
('bx_classes_poll', 'bx_classes', 'text', '', '', 0, 'text', '_bx_classes_form_poll_input_sys_text', '_bx_classes_form_poll_input_text', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_classes_form_poll_input_text_err', 'Xss', '', 1, 0),
('bx_classes_poll', 'bx_classes', 'answers', '', '', 0, 'custom', '_bx_classes_form_poll_input_sys_answers', '_bx_classes_form_poll_input_answers', '', 1, 0, 0, '', '', '', 'AvailAnswers', '', '_bx_classes_form_poll_input_answers_err', '', '', 1, 0),
('bx_classes_poll', 'bx_classes', 'controls', '', 'do_submit,do_cancel', 0, 'input_set', '', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
('bx_classes_poll', 'bx_classes', 'do_submit', '_bx_classes_form_poll_input_do_submit', '', 0, 'submit', '_bx_classes_form_poll_input_sys_do_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
('bx_classes_poll', 'bx_classes', 'do_cancel', '_bx_classes_form_poll_input_do_cancel', '', 0, 'button', '_bx_classes_form_poll_input_do_cancel', '', '', 0, 0, 0, 'a:2:{s:7:"onclick";s:45:"$(''.bx-popup-applied:visible'').dolPopupHide()";s:5:"class";s:22:"bx-def-margin-sec-left";}', '', '', '', '', '', '', '', 0, 0);
INSERT INTO `sys_form_display_inputs` (`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
('bx_classes_poll_add', 'text', 2147483647, 1, 1),
('bx_classes_poll_add', 'answers', 2147483647, 1, 2),
('bx_classes_poll_add', 'controls', 2147483647, 1, 3),
('bx_classes_poll_add', 'do_submit', 2147483647, 1, 4),
('bx_classes_poll_add', 'do_cancel', 2147483647, 1, 5);
-- PRE-VALUES
INSERT INTO `sys_form_pre_lists`(`key`, `title`, `module`, `use_for_sets`) VALUES
('bx_classes_avail', '_bx_classes_pre_lists_availability', 'bx_classes', '0');
INSERT INTO `sys_form_pre_values`(`Key`, `Value`, `Order`, `LKey`, `LKey2`) VALUES
('bx_classes_avail', '1', 1, '_bx_classes_avail_always', ''),
('bx_classes_avail', '2', 2, '_bx_classes_avail_prev_class_completed', ''),
('bx_classes_avail', '3', 3, '_bx_classes_avail_after_start_date', ''),
('bx_classes_avail', '4', 4, '_bx_classes_avail_after_start_date_prev_class_completed', ''),
('bx_classes_avail', '5', 5, '_bx_classes_avail_between_start_end_dates', ''),
('bx_classes_avail', '6', 6, '_bx_classes_avail_between_start_end_dates_prev_completed', '');
INSERT INTO `sys_form_pre_lists`(`key`, `title`, `module`, `use_for_sets`) VALUES
('bx_classes_cmts', '_bx_classes_pre_lists_cmts', 'bx_classes', '0');
INSERT INTO `sys_form_pre_values`(`Key`, `Value`, `Order`, `LKey`, `LKey2`) VALUES
('bx_classes_cmts', '1', 1, '_bx_classes_cmts_disabled', ''),
('bx_classes_cmts', '2', 2, '_bx_classes_cmts_all_shown', '');
INSERT INTO `sys_form_pre_lists`(`key`, `title`, `module`, `use_for_sets`) VALUES
('bx_classes_completed_when', '_bx_classes_pre_lists_completed_when', 'bx_classes', '0');
INSERT INTO `sys_form_pre_values`(`Key`, `Value`, `Order`, `LKey`, `LKey2`) VALUES
('bx_classes_completed_when', '1', 1, '_bx_classes_completed_when_viewed', ''),
('bx_classes_completed_when', '2', 2, '_bx_classes_completed_when_replied', '');
-- COMMENTS
INSERT INTO `sys_objects_cmts` (`Name`, `Module`, `Table`, `CharsPostMin`, `CharsPostMax`, `CharsDisplayMax`, `Html`, `PerView`, `PerViewReplies`, `BrowseType`, `IsBrowseSwitch`, `PostFormPosition`, `NumberOfLevels`, `IsDisplaySwitch`, `IsRatable`, `ViewingThreshold`, `IsOn`, `RootStylePrefix`, `BaseUrl`, `ObjectVote`, `TriggerTable`, `TriggerFieldId`, `TriggerFieldAuthor`, `TriggerFieldTitle`, `TriggerFieldComments`, `ClassName`, `ClassFile`) VALUES
('bx_classes', 'bx_classes', 'bx_classes_cmts', 1, 5000, 1000, 3, 5, 3, 'tail', 1, 'bottom', 1, 1, 1, -3, 1, 'cmt', 'page.php?i=view-class&id={object_id}', '', 'bx_classes_classes', 'id', 'author', 'title', 'comments', '', ''),
('bx_classes_notes', 'bx_classes', 'bx_classes_cmts_notes', 1, 5000, 1000, 0, 5, 3, 'tail', 1, 'bottom', 1, 1, 1, -3, 1, 'cmt', 'page.php?i=view-class&id={object_id}', '', 'bx_classes_classes', 'id', 'author', 'title', '', 'BxTemplCmtsNotes', '');
-- VOTES
INSERT INTO `sys_objects_vote` (`Name`, `TableMain`, `TableTrack`, `PostTimeout`, `MinValue`, `MaxValue`, `IsUndo`, `IsOn`, `TriggerTable`, `TriggerFieldId`, `TriggerFieldAuthor`, `TriggerFieldRate`, `TriggerFieldRateCount`, `ClassName`, `ClassFile`) VALUES
('bx_classes', 'bx_classes_votes', 'bx_classes_votes_track', '604800', '1', '1', '0', '1', 'bx_classes_classes', 'id', 'author', 'rate', 'votes', '', ''),
('bx_classes_reactions', 'bx_classes_reactions', 'bx_classes_reactions_track', '604800', '1', '1', '1', '1', 'bx_classes_classes', 'id', 'author', 'rrate', 'rvotes', 'BxTemplVoteReactions', ''),
('bx_classes_poll_answers', 'bx_classes_polls_answers_votes', 'bx_classes_polls_answers_votes_track', '604800', '1', '1', '0', '1', 'bx_classes_polls_answers', 'id', 'author_id', 'rate', 'votes', 'BxClssVotePollAnswers', 'modules/boonex/classes/classes/BxClssVotePollAnswers.php');
-- SCORES
INSERT INTO `sys_objects_score` (`name`, `module`, `table_main`, `table_track`, `post_timeout`, `is_on`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_score`, `trigger_field_cup`, `trigger_field_cdown`, `class_name`, `class_file`) VALUES
('bx_classes', 'bx_classes', 'bx_classes_scores', 'bx_classes_scores_track', '604800', '0', 'bx_classes_classes', 'id', 'author', 'score', 'sc_up', 'sc_down', '', '');
-- REPORTS
INSERT INTO `sys_objects_report` (`name`, `module`, `table_main`, `table_track`, `is_on`, `base_url`, `object_comment`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES
('bx_classes', 'bx_classes', 'bx_classes_reports', 'bx_classes_reports_track', '1', 'page.php?i=view-class&id={object_id}', 'bx_classes_notes', 'bx_classes_classes', 'id', 'author', 'reports', '', '');
-- 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_classes', 'bx_classes_views_track', '86400', '1', 'bx_classes_classes', 'id', 'author', 'views', '', '');
-- FAFORITES
INSERT INTO `sys_objects_favorite` (`name`, `table_track`, `is_on`, `is_undo`, `is_public`, `base_url`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES
('bx_classes', 'bx_classes_favorites_track', '1', '1', '1', 'page.php?i=view-class&id={object_id}', 'bx_classes_classes', 'id', 'author', 'favorites', '', '');
-- FEATURED
INSERT INTO `sys_objects_feature` (`name`, `module`, `is_on`, `is_undo`, `base_url`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_flag`, `class_name`, `class_file`) VALUES
('bx_classes', 'bx_classes', '1', '1', 'page.php?i=view-class&id={object_id}', 'bx_classes_classes', 'id', 'author', 'featured', '', '');
-- CONTENT INFO
INSERT INTO `sys_objects_content_info` (`name`, `title`, `alert_unit`, `alert_action_add`, `alert_action_update`, `alert_action_delete`, `class_name`, `class_file`) VALUES
('bx_classes', '_bx_classes', 'bx_classes', 'added', 'edited', 'deleted', '', ''),
('bx_classes_cmts', '_bx_classes_cmts', 'bx_classes', 'commentPost', 'commentUpdated', 'commentRemoved', 'BxDolContentInfoCmts', '');
INSERT INTO `sys_content_info_grids` (`object`, `grid_object`, `grid_field_id`, `condition`, `selection`) VALUES
('bx_classes', 'bx_classes_administration', 'id', '', ''),
('bx_classes', 'bx_classes_common', 'id', '', '');
-- SEARCH EXTENDED
INSERT INTO `sys_objects_search_extended` (`object`, `object_content_info`, `module`, `title`, `active`, `class_name`, `class_file`) VALUES
('bx_classes', 'bx_classes', 'bx_classes', '_bx_classes_search_extended', 1, '', ''),
('bx_classes_cmts', 'bx_classes_cmts', 'bx_classes', '_bx_classes_search_extended_cmts', 1, 'BxTemplSearchExtendedCmts', '');
-- STUDIO: page & widget
INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
(3, 'bx_classes', '_bx_classes', '_bx_classes', 'bx_classes@modules/boonex/classes/|std-icon.svg');
SET @iPageId = LAST_INSERT_ID();
SET @iParentPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name` = 'home');
SET @iParentPageOrder = (SELECT MAX(`order`) FROM `sys_std_pages_widgets` WHERE `page_id` = @iParentPageId);
INSERT INTO `sys_std_widgets` (`page_id`, `module`, `type`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`) VALUES
(@iPageId, 'bx_classes', 'content', '{url_studio}module.php?name=bx_classes', '', 'bx_classes@modules/boonex/classes/|std-icon.svg', '_bx_classes', '', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:11:"get_actions";s:6:"params";a:0:{}s:5:"class";s:18:"TemplStudioModules";}');
INSERT INTO `sys_std_pages_widgets` (`page_id`, `widget_id`, `order`) VALUES
(@iParentPageId, LAST_INSERT_ID(), IF(ISNULL(@iParentPageOrder), 1, @iParentPageOrder + 1)); | the_stack |
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for cola_attachment
-- ----------------------------
DROP TABLE IF EXISTS `cola_attachment`;
CREATE TABLE `cola_attachment` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`file_name` varchar(100) CHARACTER SET utf8 DEFAULT NULL COMMENT '文件上传时的名称',
`content_type` varchar(100) CHARACTER SET utf8 DEFAULT NULL COMMENT '文件mime类型',
`attachment_key` varchar(100) CHARACTER SET utf8 DEFAULT NULL COMMENT '文件唯一标识',
`size` bigint(20) DEFAULT NULL COMMENT '文件大小,单位字节',
`create_by` varchar(100) CHARACTER SET utf8 DEFAULT NULL COMMENT '上传人',
`create_time` datetime DEFAULT NULL COMMENT '上传时间',
`biz_id` varchar(100) CHARACTER SET utf8 DEFAULT NULL COMMENT '业务类型',
`biz_code` varchar(100) CHARACTER SET utf8 DEFAULT NULL COMMENT '业务标识',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=44 DEFAULT CHARSET=latin1 COMMENT='附件表';
-- ----------------------------
-- Records of cola_attachment
-- ----------------------------
-- ----------------------------
-- Table structure for cola_audit
-- ----------------------------
DROP TABLE IF EXISTS `cola_audit`;
CREATE TABLE `cola_audit` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '流水号',
`type` varchar(225) COLLATE utf8_bin DEFAULT NULL COMMENT '日志类型:登录日志;系统日志;',
`name` varchar(225) COLLATE utf8_bin DEFAULT NULL COMMENT '业务名称',
`request_url` varchar(225) COLLATE utf8_bin DEFAULT NULL COMMENT '请求地址',
`request_type` varchar(225) COLLATE utf8_bin DEFAULT NULL COMMENT '请求方法类型',
`request_class` varchar(225) COLLATE utf8_bin DEFAULT NULL COMMENT '调用类',
`request_method` varchar(225) COLLATE utf8_bin DEFAULT NULL COMMENT '调用方法',
`request_ip` varchar(225) COLLATE utf8_bin DEFAULT NULL COMMENT '请求IP',
`user_id` bigint(20) DEFAULT NULL COMMENT '创建用户Id',
`user_name` varchar(225) COLLATE utf8_bin DEFAULT NULL COMMENT '创建用户名称',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`time` int(11) DEFAULT NULL COMMENT '消耗时间',
`success` int(11) DEFAULT NULL COMMENT '是否成功',
`exception` varchar(2250) COLLATE utf8_bin DEFAULT NULL COMMENT '异常信息',
`request_parameter` varbinary(2250) DEFAULT NULL COMMENT '调用参数',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=978699 DEFAULT CHARSET=utf8 COLLATE=utf8_bin ROW_FORMAT=DYNAMIC COMMENT='系统日志表';
-- ----------------------------
-- Records of cola_audit
-- ----------------------------
-- ----------------------------
-- Table structure for cola_dict
-- ----------------------------
DROP TABLE IF EXISTS `cola_dict`;
CREATE TABLE `cola_dict` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
`code` varchar(255) COLLATE utf8_bin NOT NULL COMMENT '编号',
`name` varchar(255) CHARACTER SET utf8 NOT NULL COMMENT '名称',
`description` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '提示',
`enable` char(1) COLLATE utf8_bin DEFAULT 'Y',
PRIMARY KEY (`id`),
UNIQUE KEY `INX_DICT_CODE` (`code`) USING HASH
) ENGINE=InnoDB AUTO_INCREMENT=71 DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='字典表';
-- ----------------------------
-- Records of cola_dict
-- ----------------------------
-- ----------------------------
-- Table structure for cola_dict_item
-- ----------------------------
DROP TABLE IF EXISTS `cola_dict_item`;
CREATE TABLE `cola_dict_item` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
`name` varchar(255) COLLATE utf8_bin DEFAULT NULL COMMENT '数据字典项名称',
`value` varchar(255) CHARACTER SET utf8 NOT NULL COMMENT '数据字典值',
`description` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '备注',
`enable` char(1) COLLATE utf8_bin DEFAULT 'Y' COMMENT '是否有效',
`order_no` int(5) DEFAULT NULL COMMENT '排序号',
`code` varchar(255) COLLATE utf8_bin NOT NULL,
`create_by` bigint(20) DEFAULT NULL COMMENT '创建者',
`create_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
`modify_by` bigint(10) DEFAULT NULL COMMENT '修改者',
`modify_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
`modify_ip` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '修改IP',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=116 DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='字典表';
-- ----------------------------
-- Records of cola_dict_item
-- ----------------------------
-- ----------------------------
-- Table structure for cola_sys_authority
-- ----------------------------
DROP TABLE IF EXISTS `cola_sys_authority`;
CREATE TABLE `cola_sys_authority` (
`sys_role_id` bigint(20) NOT NULL COMMENT '角色ID',
`sys_resource_id` bigint(20) NOT NULL COMMENT '资源ID',
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=80 DEFAULT CHARSET=utf8 COLLATE=utf8_bin ROW_FORMAT=DYNAMIC COMMENT='权限-资源角色关联表';
-- ----------------------------
-- Records of cola_sys_authority
-- ----------------------------
INSERT INTO `cola_sys_authority` VALUES ('4', '1', '68');
INSERT INTO `cola_sys_authority` VALUES ('4', '2', '69');
INSERT INTO `cola_sys_authority` VALUES ('4', '3', '70');
INSERT INTO `cola_sys_authority` VALUES ('4', '318', '71');
-- ----------------------------
-- Table structure for cola_sys_authorize
-- ----------------------------
DROP TABLE IF EXISTS `cola_sys_authorize`;
CREATE TABLE `cola_sys_authorize` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`sys_role_id` bigint(20) NOT NULL COMMENT '角色ID',
`authorize_target` bigint(20) DEFAULT NULL COMMENT '授权对象',
`authorize_type` varchar(20) COLLATE utf8_bin DEFAULT NULL COMMENT '授权对象类型',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='授权表(用户与角色对应表)';
-- ----------------------------
-- Records of cola_sys_authorize
-- ----------------------------
INSERT INTO `cola_sys_authorize` VALUES ('5', '4', '127', '0');
-- ----------------------------
-- Table structure for cola_sys_employee
-- ----------------------------
DROP TABLE IF EXISTS `cola_sys_employee`;
CREATE TABLE `cola_sys_employee` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`sys_user_id` bigint(20) NOT NULL COMMENT '用户ID',
`sys_org_id` bigint(50) NOT NULL COMMENT '组织ID',
`create_by` bigint(20) DEFAULT NULL COMMENT '创建人',
`create_date` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
`sys_post_id` bigint(20) DEFAULT NULL COMMENT '岗位ID',
`level` varchar(10) DEFAULT NULL COMMENT '级别',
`idcard` varchar(20) DEFAULT NULL COMMENT '身份证',
`status` varchar(10) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '员工状态:1.在职;-1:离职;',
`picture` varchar(1000) DEFAULT NULL COMMENT '员工照片',
`modify_by` varchar(20) DEFAULT NULL COMMENT '修改人',
`modify_date` datetime DEFAULT NULL COMMENT '修改时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=latin1 COMMENT='员工表(组织与系统用户对应表)';
-- ----------------------------
-- Records of cola_sys_employee
-- ----------------------------
INSERT INTO `cola_sys_employee` VALUES ('24', '127', '1', null, null, '1', null, null, null, null, null, null);
-- ----------------------------
-- Table structure for cola_sys_member
-- ----------------------------
DROP TABLE IF EXISTS `cola_sys_member`;
CREATE TABLE `cola_sys_member` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`sys_user_id` bigint(20) NOT NULL COMMENT '用户表',
`tenant_id` bigint(20) NOT NULL COMMENT '租户表',
`created_by` bigint(20) DEFAULT NULL COMMENT '创建人',
`creation_date` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=latin1 COMMENT='成员表(租户与系统用户对应表)';
-- ----------------------------
-- Records of cola_sys_member
-- ----------------------------
-- ----------------------------
-- Table structure for cola_sys_message
-- ----------------------------
DROP TABLE IF EXISTS `cola_sys_message`;
CREATE TABLE `cola_sys_message` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增主键',
`sys_user_id` bigint(20) NOT NULL COMMENT '用户id',
`title` varchar(50) NOT NULL COMMENT '标题',
`content` varchar(1024) NOT NULL COMMENT '内容',
`email_status` char(1) NOT NULL DEFAULT '0' COMMENT '是否发送邮件:-1不发送 0 待发送,1已发送',
`sms_status` char(1) NOT NULL DEFAULT '0' COMMENT '是否发送短信:-1不发送 0 待发送,1已发送',
`template_code` char(10) DEFAULT NULL COMMENT '短信模板',
`sms_params` varchar(256) DEFAULT NULL COMMENT '短信模板参数',
`read_flag` char(1) NOT NULL DEFAULT 'N' COMMENT '读标志:N未读,Y已读',
`delete_flag` char(1) NOT NULL DEFAULT 'N' COMMENT '删除标志:N未删除,Y已删除',
`extend` varchar(1024) DEFAULT NULL COMMENT '扩展字段',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`create_by` bigint(20) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='站内信表';
-- ----------------------------
-- Records of cola_sys_message
-- ----------------------------
INSERT INTO `cola_sys_message` VALUES ('1', '127', '测试标题', '测试内容', '0', '0', null, null, 'N', 'N', null, '2018-03-16 10:57:18', '127');
INSERT INTO `cola_sys_message` VALUES ('2', '127', '测试标题', '<h1>html内容</h1>', '1', '0', null, null, 'N', 'N', null, '2018-03-16 15:24:50', '127');
-- ----------------------------
-- Table structure for cola_sys_organization
-- ----------------------------
DROP TABLE IF EXISTS `cola_sys_organization`;
CREATE TABLE `cola_sys_organization` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`name` varchar(100) NOT NULL COMMENT '名称',
`description` varchar(2000) DEFAULT NULL COMMENT '描述',
`pid` bigint(20) DEFAULT NULL COMMENT '父节点',
`code` varchar(50) NOT NULL COMMENT '部门编号',
`tenant_id` bigint(20) DEFAULT NULL COMMENT '租户ID',
`deleted` varchar(1) DEFAULT 'N' COMMENT '删除状态: Y-已删除,N-未删除',
`status` varchar(5) DEFAULT '20' COMMENT '状态:10:停用,20:启用',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=229 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='组织架构';
-- ----------------------------
-- Records of cola_sys_organization
-- ----------------------------
INSERT INTO `cola_sys_organization` VALUES ('1', '组织机构', '', null, 'root', null, 'N', '20');
-- ----------------------------
-- Table structure for cola_sys_post
-- ----------------------------
DROP TABLE IF EXISTS `cola_sys_post`;
CREATE TABLE `cola_sys_post` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`name` varchar(50) CHARACTER SET utf8 NOT NULL COMMENT '岗位名称',
`code` varchar(20) COLLATE utf8_bin NOT NULL COMMENT '岗位编码',
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
`description` varchar(2000) COLLATE utf8_bin DEFAULT NULL COMMENT '备注',
`tenant_id` bigint(20) DEFAULT NULL COMMENT '所属租户ID',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE KEY `IDX_ROLE_CODE` (`code`) USING HASH
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8 COLLATE=utf8_bin ROW_FORMAT=DYNAMIC COMMENT='系统岗位表';
-- ----------------------------
-- Records of cola_sys_post
-- ----------------------------
INSERT INTO `cola_sys_post` VALUES ('4', '系统管理员', 'admin', '2017-12-11 00:00:00', '2017-12-11 00:00:00', '', null);
-- ----------------------------
-- Table structure for cola_sys_register
-- ----------------------------
DROP TABLE IF EXISTS `cola_sys_register`;
CREATE TABLE `cola_sys_register` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`register_sys_user_id` bigint(20) DEFAULT NULL COMMENT '注册用户主键',
`recommend_sys_user_id` bigint(20) DEFAULT NULL COMMENT '推荐人主键',
`source_code` varchar(20) DEFAULT NULL COMMENT '注册来源编号',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8 COMMENT='注册信息表';
-- ----------------------------
-- Records of cola_sys_register
-- ----------------------------
-- ----------------------------
-- Table structure for cola_sys_resource
-- ----------------------------
DROP TABLE IF EXISTS `cola_sys_resource`;
CREATE TABLE `cola_sys_resource` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`code` varchar(50) COLLATE utf8_bin NOT NULL COMMENT '权限的标识',
`pid` bigint(20) DEFAULT NULL COMMENT '父id',
`name` varchar(100) CHARACTER SET utf8 NOT NULL COMMENT '权限名称',
`url` varchar(200) CHARACTER SET utf8 DEFAULT NULL COMMENT '权限请求路径',
`icon` varchar(50) CHARACTER SET utf8 DEFAULT NULL COMMENT '图标',
`level` int(11) DEFAULT NULL COMMENT '菜单层级',
`sort` int(11) DEFAULT '0' COMMENT '排序',
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
`status` char(1) COLLATE utf8_bin DEFAULT 'Y' COMMENT '是否可用:Y-可用;N-不可用',
`deleted` char(1) COLLATE utf8_bin DEFAULT 'N' COMMENT '是否删除: Y-已删除; N-未删除',
`load_type` char(1) COLLATE utf8_bin DEFAULT NULL COMMENT '加载类型',
`type` int(11) DEFAULT NULL,
`description` varchar(500) COLLATE utf8_bin DEFAULT NULL,
`portal_url` varchar(200) COLLATE utf8_bin DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `IDX_RESOURCE_CODE` (`code`) USING HASH
) ENGINE=InnoDB AUTO_INCREMENT=342 DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='资源表';
-- ----------------------------
-- Records of cola_sys_resource
-- ----------------------------
INSERT INTO `cola_sys_resource` VALUES ('279', 'dict', '14', '字典管理', '/dict', '', '0', '5', '2017-12-07 09:49:13', '2017-12-07 09:49:13', 'Y', 'N', null, null, null, 'home');
INSERT INTO `cola_sys_resource` VALUES ('318', 'root', null, 'root', 'root', null, null, '0', '2018-03-15 14:08:16', '2018-03-15 14:08:16', 'Y', 'N', null, '0', null, 'home');
INSERT INTO `cola_sys_resource` VALUES ('319', 'authority', '318', '权限管理', null, 'trophy', null, '0', '2018-03-15 14:29:32', '2018-03-15 14:29:32', 'Y', 'N', null, '1', '权限管理', null);
INSERT INTO `cola_sys_resource` VALUES ('320', 'sysSource', '319', '资源管理', '/authority/sysSource', '', null, '0', '2018-03-15 14:30:28', '2018-03-15 14:30:28', 'Y', 'N', null, '2', '', 'authority/sysSource');
INSERT INTO `cola_sys_resource` VALUES ('321', 'role', '319', '角色管理', '/authority/role', '', null, '0', '2018-03-15 14:57:49', '2018-03-15 14:57:49', 'Y', 'N', null, '2', '', 'authority/role');
INSERT INTO `cola_sys_resource` VALUES ('322', 'home', '318', '首页', '/', 'home', null, '0', '2018-03-15 15:10:15', '2018-03-15 15:10:15', 'Y', 'N', null, '2', '', 'home');
INSERT INTO `cola_sys_resource` VALUES ('326', 'roleCU', '319', '编辑查看新增角色', '/authority/roleCU', null, null, '0', '2018-03-15 15:49:55', '2018-03-15 15:49:55', 'Y', 'N', null, '3', '', 'authority/role/roleCU');
INSERT INTO `cola_sys_resource` VALUES ('327', 'company', '318', '企业组织管理', null, 'fork', null, '0', '2018-03-15 16:42:16', '2018-03-15 16:42:16', 'Y', 'N', null, '1', '企业组织管理', null);
INSERT INTO `cola_sys_resource` VALUES ('328', 'organization', '327', '组织管理', '/company/organization', '', null, '0', '2018-03-15 16:42:55', '2018-03-15 16:42:55', 'Y', 'N', null, '2', '', 'company/organization');
INSERT INTO `cola_sys_resource` VALUES ('329', 'organizationCU', '327', '组织增改查', '/company/organization/organizationCU', null, null, '0', '2018-03-15 16:43:56', '2018-03-15 16:43:56', 'Y', 'N', null, '3', '', 'company/organization/organizationCU');
INSERT INTO `cola_sys_resource` VALUES ('331', 'inEm', '319', '内部员工', '/authority/inEm', '', null, '0', '2018-03-19 11:19:26', '2018-03-19 11:19:26', 'Y', 'N', null, '2', '', 'authority/inEmAccount');
INSERT INTO `cola_sys_resource` VALUES ('332', 'inEmRecordCU', '319', '内部员工档案新增编辑', '/inEmRecord/emRecordCU', null, null, '0', '2018-03-22 14:08:14', '2018-03-22 14:08:14', 'Y', 'N', null, '3', '', 'authority/inEmRecord/emRecordCU');
-- ----------------------------
-- Table structure for cola_sys_role
-- ----------------------------
DROP TABLE IF EXISTS `cola_sys_role`;
CREATE TABLE `cola_sys_role` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '租户用户的角色',
`name` varchar(50) CHARACTER SET utf8 NOT NULL COMMENT '角色名称',
`code` varchar(20) COLLATE utf8_bin NOT NULL COMMENT '角色编码',
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
`status` char(1) COLLATE utf8_bin DEFAULT 'Y' COMMENT '状态: Y-激活状态 N-锁定状态',
`deleted` char(1) COLLATE utf8_bin DEFAULT 'N' COMMENT '删除状态: Y-已删除,N-未删除',
`description` varchar(2000) COLLATE utf8_bin DEFAULT NULL COMMENT '备注',
`tenant_id` bigint(20) DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE KEY `IDX_ROLE_CODE` (`code`) USING HASH
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8 COLLATE=utf8_bin ROW_FORMAT=DYNAMIC COMMENT='角色表';
-- ----------------------------
-- Records of cola_sys_role
-- ----------------------------
INSERT INTO `cola_sys_role` VALUES ('4', '系统管理员', 'admin', '2017-12-11 00:00:00', '2017-12-11 00:00:00', 'Y', 'N', '', null);
-- ----------------------------
-- Table structure for cola_sys_social
-- ----------------------------
DROP TABLE IF EXISTS `cola_sys_social`;
CREATE TABLE `cola_sys_social` (
`id` int(20) NOT NULL AUTO_INCREMENT,
`type` varchar(20) NOT NULL COMMENT '接入类型',
`token` varchar(100) NOT NULL COMMENT '接入TOKEN',
`sys_user_id` int(20) NOT NULL COMMENT '关联用户ID',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 COMMENT='社会化接入表';
-- ----------------------------
-- Records of cola_sys_social
-- ----------------------------
-- ----------------------------
-- Table structure for cola_sys_tenant
-- ----------------------------
DROP TABLE IF EXISTS `cola_sys_tenant`;
CREATE TABLE `cola_sys_tenant` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '租户id',
`name` varchar(255) CHARACTER SET utf8 NOT NULL COMMENT '租户名称',
`description` varchar(500) COLLATE utf8_bin DEFAULT NULL COMMENT '简介',
`logo` varchar(500) COLLATE utf8_bin DEFAULT NULL COMMENT 'logo图片地址',
`code` varchar(255) CHARACTER SET utf8 NOT NULL COMMENT '租户编码',
`address` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '地址',
`begin_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '租户生效时间',
`end_time` datetime DEFAULT NULL COMMENT '租户到期时间',
`check_info` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '审核详情',
`check_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '审核通过时间',
`max_user` int(11) DEFAULT NULL COMMENT '最大用户数',
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`status` int(11) DEFAULT '1' COMMENT '状态: 1-启用, 0-禁用',
`tel` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '电话',
`checker_id` bigint(20) DEFAULT NULL COMMENT '审核管理员id',
`creator_id` bigint(20) DEFAULT NULL COMMENT '创建管理员id',
`domain` varchar(255) COLLATE utf8_bin DEFAULT NULL COMMENT '域名',
`url` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '网址',
`deleted` char(1) COLLATE utf8_bin DEFAULT 'N' COMMENT '删除状态: Y-已删除,N-未删除',
`administrator` bigint(20) NOT NULL COMMENT '管理员ID',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=139 DEFAULT CHARSET=utf8 COLLATE=utf8_bin ROW_FORMAT=DYNAMIC COMMENT='租户表';
-- ----------------------------
-- Records of cola_sys_tenant
-- ----------------------------
-- ----------------------------
-- Table structure for cola_sys_user
-- ----------------------------
DROP TABLE IF EXISTS `cola_sys_user`;
CREATE TABLE `cola_sys_user` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`username` varchar(20) CHARACTER SET utf8 DEFAULT NULL COMMENT '登录账号',
`name` varchar(20) CHARACTER SET utf8 DEFAULT NULL COMMENT '名称',
`password` varchar(64) CHARACTER SET utf8 DEFAULT NULL COMMENT '密码',
`salt` varchar(64) CHARACTER SET utf8 DEFAULT NULL COMMENT '密码盐',
`phone_number` varchar(30) CHARACTER SET utf8 DEFAULT NULL COMMENT '电话号码',
`email` varchar(64) CHARACTER SET utf8 DEFAULT NULL COMMENT '电子邮箱',
`status` char(3) CHARACTER SET utf8 DEFAULT '1' COMMENT '状态: 1-可用,0-禁用,-1-锁定',
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
`deleted` char(1) COLLATE utf8_bin DEFAULT 'N' COMMENT '删除状态: Y-已删除,N-未删除',
`avatar` varchar(255) COLLATE utf8_bin DEFAULT NULL COMMENT '头像',
`type` varchar(5) COLLATE utf8_bin DEFAULT NULL COMMENT '用户类型 1-养殖户 2-保险业务员',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE KEY `INX_USER_USERNAME` (`username`) USING HASH
) ENGINE=InnoDB AUTO_INCREMENT=210 DEFAULT CHARSET=utf8 COLLATE=utf8_bin ROW_FORMAT=DYNAMIC COMMENT='用户信息表';
-- ----------------------------
-- Records of cola_sys_user
-- ----------------------------
INSERT INTO `cola_sys_user` VALUES ('127', 'admin', '系统管理员', '$2a$10$VaREiVUrOUBusZrs4rTLm.FvVtO8BLiMbf26zFgK4G8NIbzzV2dCS', '311', '13870931273', '350006811@qq.com', '1', '2017-12-11 06:30:47', '2017-12-11 06:30:47', 'N', 'attachment/image/10f4444833a4c11a456f0ab453482d2a', null); | the_stack |
-- Copyright 2004-2019 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: Alex Nordlund
--
-- with filter condition
create table test(v varchar);
> ok
insert into test values ('1'), ('2'), ('3'), ('4'), ('5'), ('6'), ('7'), ('8'), ('9');
> update count: 9
select array_agg(v order by v asc),
array_agg(v order by v desc) filter (where v >= '4')
from test where v >= '2';
> ARRAY_AGG(V ORDER BY V) ARRAY_AGG(V ORDER BY V DESC) FILTER (WHERE (V >= '4'))
> ------------------------ ------------------------------------------------------
> [2, 3, 4, 5, 6, 7, 8, 9] [9, 8, 7, 6, 5, 4]
> rows: 1
create index test_idx on test(v);
> ok
select ARRAY_AGG(v order by v asc),
ARRAY_AGG(v order by v desc) filter (where v >= '4')
from test where v >= '2';
> ARRAY_AGG(V ORDER BY V) ARRAY_AGG(V ORDER BY V DESC) FILTER (WHERE (V >= '4'))
> ------------------------ ------------------------------------------------------
> [2, 3, 4, 5, 6, 7, 8, 9] [9, 8, 7, 6, 5, 4]
> rows: 1
select ARRAY_AGG(v order by v asc),
ARRAY_AGG(v order by v desc) filter (where v >= '4')
from test;
> ARRAY_AGG(V ORDER BY V) ARRAY_AGG(V ORDER BY V DESC) FILTER (WHERE (V >= '4'))
> --------------------------- ------------------------------------------------------
> [1, 2, 3, 4, 5, 6, 7, 8, 9] [9, 8, 7, 6, 5, 4]
> rows: 1
drop table test;
> ok
create table test (id int auto_increment primary key, v int);
> ok
insert into test(v) values (7), (2), (8), (3), (7), (3), (9), (-1);
> update count: 8
select array_agg(v) from test;
> ARRAY_AGG(V)
> -------------------------
> [7, 2, 8, 3, 7, 3, 9, -1]
> rows: 1
select array_agg(distinct v) from test;
> ARRAY_AGG(DISTINCT V)
> ---------------------
> [-1, 2, 3, 7, 8, 9]
> rows: 1
select array_agg(distinct v order by v desc) from test;
> ARRAY_AGG(DISTINCT V ORDER BY V DESC)
> -------------------------------------
> [9, 8, 7, 3, 2, -1]
> rows: 1
drop table test;
> ok
CREATE TABLE TEST (ID INT PRIMARY KEY, NAME VARCHAR);
> ok
INSERT INTO TEST VALUES (1, 'a'), (2, 'a'), (3, 'b'), (4, 'c'), (5, 'c'), (6, 'c');
> update count: 6
SELECT ARRAY_AGG(ID), NAME FROM TEST;
> exception MUST_GROUP_BY_COLUMN_1
SELECT ARRAY_AGG(ID ORDER BY ID), NAME FROM TEST GROUP BY NAME;
> ARRAY_AGG(ID ORDER BY ID) NAME
> ------------------------- ----
> [1, 2] a
> [3] b
> [4, 5, 6] c
> rows: 3
SELECT ARRAY_AGG(ID ORDER BY ID) OVER (), NAME FROM TEST;
> ARRAY_AGG(ID ORDER BY ID) OVER () NAME
> --------------------------------- ----
> [1, 2, 3, 4, 5, 6] a
> [1, 2, 3, 4, 5, 6] a
> [1, 2, 3, 4, 5, 6] b
> [1, 2, 3, 4, 5, 6] c
> [1, 2, 3, 4, 5, 6] c
> [1, 2, 3, 4, 5, 6] c
> rows: 6
SELECT ARRAY_AGG(ID ORDER BY ID) OVER (PARTITION BY NAME), NAME FROM TEST;
> ARRAY_AGG(ID ORDER BY ID) OVER (PARTITION BY NAME) NAME
> -------------------------------------------------- ----
> [1, 2] a
> [1, 2] a
> [3] b
> [4, 5, 6] c
> [4, 5, 6] c
> [4, 5, 6] c
> rows: 6
SELECT
ARRAY_AGG(ID ORDER BY ID) FILTER (WHERE ID < 3 OR ID > 4) OVER (PARTITION BY NAME) A,
ARRAY_AGG(ID ORDER BY ID) FILTER (WHERE ID < 3 OR ID > 4) OVER (PARTITION BY NAME ORDER BY ID) AO,
ID, NAME FROM TEST ORDER BY ID;
> A AO ID NAME
> ------ ------ -- ----
> [1, 2] [1] 1 a
> [1, 2] [1, 2] 2 a
> null null 3 b
> [5, 6] null 4 c
> [5, 6] [5] 5 c
> [5, 6] [5, 6] 6 c
> rows (ordered): 6
SELECT
ARRAY_AGG(ID ORDER BY ID) FILTER (WHERE ID < 3 OR ID > 4)
OVER (ORDER BY ID ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING) A,
ID FROM TEST ORDER BY ID;
> A ID
> ------ --
> [1, 2] 1
> [1, 2] 2
> [2] 3
> [5] 4
> [5, 6] 5
> [5, 6] 6
> rows (ordered): 6
SELECT ARRAY_AGG(SUM(ID)) OVER () FROM TEST;
> ARRAY_AGG(SUM(ID)) OVER ()
> --------------------------
> [21]
> rows: 1
SELECT ARRAY_AGG(ID ORDER BY ID) OVER() FROM TEST GROUP BY ID ORDER BY ID;
> ARRAY_AGG(ID ORDER BY ID) OVER ()
> ---------------------------------
> [1, 2, 3, 4, 5, 6]
> [1, 2, 3, 4, 5, 6]
> [1, 2, 3, 4, 5, 6]
> [1, 2, 3, 4, 5, 6]
> [1, 2, 3, 4, 5, 6]
> [1, 2, 3, 4, 5, 6]
> rows (ordered): 6
SELECT ARRAY_AGG(NAME) OVER(PARTITION BY NAME) FROM TEST GROUP BY NAME;
> ARRAY_AGG(NAME) OVER (PARTITION BY NAME)
> ----------------------------------------
> [a]
> [b]
> [c]
> rows: 3
SELECT ARRAY_AGG(ARRAY_AGG(ID ORDER BY ID)) OVER (PARTITION BY NAME), NAME FROM TEST GROUP BY NAME;
> ARRAY_AGG(ARRAY_AGG(ID ORDER BY ID)) OVER (PARTITION BY NAME) NAME
> ------------------------------------------------------------- ----
> [[1, 2]] a
> [[3]] b
> [[4, 5, 6]] c
> rows: 3
SELECT ARRAY_AGG(ARRAY_AGG(ID ORDER BY ID)) OVER (PARTITION BY NAME), NAME FROM TEST
WHERE ID <> 5
GROUP BY NAME HAVING ARRAY_AGG(ID ORDER BY ID)[1] > 1
QUALIFY ARRAY_AGG(ARRAY_AGG(ID ORDER BY ID)) OVER (PARTITION BY NAME) <> ARRAY[ARRAY[3]];
> ARRAY_AGG(ARRAY_AGG(ID ORDER BY ID)) OVER (PARTITION BY NAME) NAME
> ------------------------------------------------------------- ----
> [[4, 6]] c
> rows: 1
EXPLAIN
SELECT ARRAY_AGG(ARRAY_AGG(ID ORDER BY ID)) OVER (PARTITION BY NAME), NAME FROM TEST
WHERE ID <> 5
GROUP BY NAME HAVING ARRAY_AGG(ID ORDER BY ID)[1] > 1
QUALIFY ARRAY_AGG(ARRAY_AGG(ID ORDER BY ID)) OVER (PARTITION BY NAME) <> ARRAY[ARRAY[3]];
>> SELECT ARRAY_AGG(ARRAY_AGG("ID" ORDER BY "ID")) OVER (PARTITION BY "NAME"), "NAME" FROM "PUBLIC"."TEST" /* PUBLIC.TEST.tableScan */ WHERE "ID" <> 5 GROUP BY "NAME" HAVING ARRAY_GET(ARRAY_AGG("ID" ORDER BY "ID"), 1) > 1 QUALIFY ARRAY_AGG(ARRAY_AGG("ID" ORDER BY "ID")) OVER (PARTITION BY "NAME") <> ARRAY [ARRAY [3]]
SELECT ARRAY_AGG(ARRAY_AGG(ID ORDER BY ID)) OVER (PARTITION BY NAME), NAME FROM TEST
GROUP BY NAME ORDER BY NAME OFFSET 1 ROW;
> ARRAY_AGG(ARRAY_AGG(ID ORDER BY ID)) OVER (PARTITION BY NAME) NAME
> ------------------------------------------------------------- ----
> [[3]] b
> [[4, 5, 6]] c
> rows (ordered): 2
SELECT ARRAY_AGG(ARRAY_AGG(ID ORDER BY ID)) FILTER (WHERE NAME > 'b') OVER (PARTITION BY NAME), NAME FROM TEST
GROUP BY NAME ORDER BY NAME;
> ARRAY_AGG(ARRAY_AGG(ID ORDER BY ID)) FILTER (WHERE (NAME > 'b')) OVER (PARTITION BY NAME) NAME
> ----------------------------------------------------------------------------------------- ----
> null a
> null b
> [[4, 5, 6]] c
> rows (ordered): 3
SELECT ARRAY_AGG(ARRAY_AGG(ID ORDER BY ID)) FILTER (WHERE NAME > 'c') OVER (PARTITION BY NAME), NAME FROM TEST
GROUP BY NAME ORDER BY NAME;
> ARRAY_AGG(ARRAY_AGG(ID ORDER BY ID)) FILTER (WHERE (NAME > 'c')) OVER (PARTITION BY NAME) NAME
> ----------------------------------------------------------------------------------------- ----
> null a
> null b
> null c
> rows (ordered): 3
SELECT ARRAY_AGG(ARRAY_AGG(ID ORDER BY ID)) FILTER (WHERE NAME > 'b') OVER () FROM TEST GROUP BY NAME ORDER BY NAME;
> ARRAY_AGG(ARRAY_AGG(ID ORDER BY ID)) FILTER (WHERE (NAME > 'b')) OVER ()
> ------------------------------------------------------------------------
> [[4, 5, 6]]
> [[4, 5, 6]]
> [[4, 5, 6]]
> rows (ordered): 3
SELECT ARRAY_AGG(ARRAY_AGG(ID ORDER BY ID)) FILTER (WHERE NAME > 'c') OVER () FROM TEST GROUP BY NAME ORDER BY NAME;
> ARRAY_AGG(ARRAY_AGG(ID ORDER BY ID)) FILTER (WHERE (NAME > 'c')) OVER ()
> ------------------------------------------------------------------------
> null
> null
> null
> rows (ordered): 3
SELECT ARRAY_AGG(ID) OVER() FROM TEST GROUP BY NAME;
> exception MUST_GROUP_BY_COLUMN_1
SELECT ARRAY_AGG(ID) OVER(PARTITION BY NAME ORDER BY ID), NAME FROM TEST;
> ARRAY_AGG(ID) OVER (PARTITION BY NAME ORDER BY ID) NAME
> -------------------------------------------------- ----
> [1, 2] a
> [1] a
> [3] b
> [4, 5, 6] c
> [4, 5] c
> [4] c
> rows: 6
SELECT ARRAY_AGG(ID) OVER(PARTITION BY NAME ORDER BY ID DESC), NAME FROM TEST;
> ARRAY_AGG(ID) OVER (PARTITION BY NAME ORDER BY ID DESC) NAME
> ------------------------------------------------------- ----
> [2, 1] a
> [2] a
> [3] b
> [6, 5, 4] c
> [6, 5] c
> [6] c
> rows: 6
SELECT
ARRAY_AGG(ID ORDER BY ID) OVER(PARTITION BY NAME ORDER BY ID DESC) A,
ARRAY_AGG(ID) OVER(PARTITION BY NAME ORDER BY ID DESC) D,
NAME FROM TEST;
> A D NAME
> --------- --------- ----
> [1, 2] [2, 1] a
> [2] [2] a
> [3] [3] b
> [4, 5, 6] [6, 5, 4] c
> [5, 6] [6, 5] c
> [6] [6] c
> rows: 6
SELECT ARRAY_AGG(SUM(ID)) OVER(ORDER BY ID) FROM TEST GROUP BY ID;
> ARRAY_AGG(SUM(ID)) OVER (ORDER BY ID)
> -------------------------------------
> [1, 2, 3, 4, 5, 6]
> [1, 2, 3, 4, 5]
> [1, 2, 3, 4]
> [1, 2, 3]
> [1, 2]
> [1]
> rows: 6
DROP TABLE TEST;
> ok
CREATE TABLE TEST(ID INT, G INT);
> ok
INSERT INTO TEST VALUES
(1, 1),
(2, 2),
(3, 2),
(4, 2),
(5, 3);
> update count: 5
SELECT
ARRAY_AGG(ID) OVER (ORDER BY G RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) D,
ARRAY_AGG(ID) OVER (ORDER BY G RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING EXCLUDE CURRENT ROW) R,
ARRAY_AGG(ID) OVER (ORDER BY G RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING EXCLUDE GROUP) G,
ARRAY_AGG(ID) OVER (ORDER BY G RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING EXCLUDE TIES) T,
ARRAY_AGG(ID) OVER (ORDER BY G RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING EXCLUDE NO OTHERS) N
FROM TEST;
> D R G T N
> --------------- ------------ ------------ --------------- ---------------
> [1, 2, 3, 4, 5] [1, 2, 3, 4] [1, 2, 3, 4] [1, 2, 3, 4, 5] [1, 2, 3, 4, 5]
> [1, 2, 3, 4, 5] [1, 2, 3, 5] [1, 5] [1, 4, 5] [1, 2, 3, 4, 5]
> [1, 2, 3, 4, 5] [1, 2, 4, 5] [1, 5] [1, 3, 5] [1, 2, 3, 4, 5]
> [1, 2, 3, 4, 5] [1, 3, 4, 5] [1, 5] [1, 2, 5] [1, 2, 3, 4, 5]
> [1, 2, 3, 4, 5] [2, 3, 4, 5] [2, 3, 4, 5] [1, 2, 3, 4, 5] [1, 2, 3, 4, 5]
> rows: 5
DROP TABLE TEST;
> ok
CREATE TABLE TEST(ID INT, VALUE INT);
> ok
INSERT INTO TEST VALUES
(1, 1),
(2, 1),
(3, 5),
(4, 8),
(5, 8),
(6, 8),
(7, 9),
(8, 9);
> update count: 8
SELECT *,
ARRAY_AGG(ID) OVER (ORDER BY VALUE ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING) R_ID,
ARRAY_AGG(VALUE) OVER (ORDER BY VALUE ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING) R_V,
ARRAY_AGG(ID) OVER (ORDER BY VALUE RANGE BETWEEN 1 PRECEDING AND 1 FOLLOWING) V_ID,
ARRAY_AGG(VALUE) OVER (ORDER BY VALUE RANGE BETWEEN 1 PRECEDING AND 1 FOLLOWING) V_V,
ARRAY_AGG(VALUE) OVER (ORDER BY VALUE DESC RANGE BETWEEN 1 PRECEDING AND 1 FOLLOWING) V_V_R,
ARRAY_AGG(ID) OVER (ORDER BY VALUE GROUPS BETWEEN 1 PRECEDING AND 1 FOLLOWING) G_ID,
ARRAY_AGG(VALUE) OVER (ORDER BY VALUE GROUPS BETWEEN 1 PRECEDING AND 1 FOLLOWING) G_V
FROM TEST;
> ID VALUE R_ID R_V V_ID V_V V_V_R G_ID G_V
> -- ----- --------- --------- --------------- --------------- --------------- ------------------ ------------------
> 1 1 [1, 2] [1, 1] [1, 2] [1, 1] [1, 1] [1, 2, 3] [1, 1, 5]
> 2 1 [1, 2, 3] [1, 1, 5] [1, 2] [1, 1] [1, 1] [1, 2, 3] [1, 1, 5]
> 3 5 [2, 3, 4] [1, 5, 8] [3] [5] [5] [1, 2, 3, 4, 5, 6] [1, 1, 5, 8, 8, 8]
> 4 8 [3, 4, 5] [5, 8, 8] [4, 5, 6, 7, 8] [8, 8, 8, 9, 9] [9, 9, 8, 8, 8] [3, 4, 5, 6, 7, 8] [5, 8, 8, 8, 9, 9]
> 5 8 [4, 5, 6] [8, 8, 8] [4, 5, 6, 7, 8] [8, 8, 8, 9, 9] [9, 9, 8, 8, 8] [3, 4, 5, 6, 7, 8] [5, 8, 8, 8, 9, 9]
> 6 8 [5, 6, 7] [8, 8, 9] [4, 5, 6, 7, 8] [8, 8, 8, 9, 9] [9, 9, 8, 8, 8] [3, 4, 5, 6, 7, 8] [5, 8, 8, 8, 9, 9]
> 7 9 [6, 7, 8] [8, 9, 9] [4, 5, 6, 7, 8] [8, 8, 8, 9, 9] [9, 9, 8, 8, 8] [4, 5, 6, 7, 8] [8, 8, 8, 9, 9]
> 8 9 [7, 8] [9, 9] [4, 5, 6, 7, 8] [8, 8, 8, 9, 9] [9, 9, 8, 8, 8] [4, 5, 6, 7, 8] [8, 8, 8, 9, 9]
> rows: 8
SELECT *,
ARRAY_AGG(ID ORDER BY ID) OVER (ORDER BY VALUE RANGE BETWEEN 1 PRECEDING AND UNBOUNDED FOLLOWING) A1,
ARRAY_AGG(ID) OVER (ORDER BY VALUE RANGE BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING) A2
FROM TEST;
> ID VALUE A1 A2
> -- ----- ------------------------ ------------------------
> 1 1 [1, 2, 3, 4, 5, 6, 7, 8] [1, 2]
> 2 1 [1, 2, 3, 4, 5, 6, 7, 8] [1, 2]
> 3 5 [3, 4, 5, 6, 7, 8] [1, 2, 3]
> 4 8 [4, 5, 6, 7, 8] [1, 2, 3, 4, 5, 6, 7, 8]
> 5 8 [4, 5, 6, 7, 8] [1, 2, 3, 4, 5, 6, 7, 8]
> 6 8 [4, 5, 6, 7, 8] [1, 2, 3, 4, 5, 6, 7, 8]
> 7 9 [4, 5, 6, 7, 8] [1, 2, 3, 4, 5, 6, 7, 8]
> 8 9 [4, 5, 6, 7, 8] [1, 2, 3, 4, 5, 6, 7, 8]
> rows: 8
SELECT *, ARRAY_AGG(ID) OVER (ORDER BY VALUE ROWS -1 PRECEDING) FROM TEST;
> exception INVALID_PRECEDING_OR_FOLLOWING_1
SELECT *, ARRAY_AGG(ID) OVER (ORDER BY ID ROWS BETWEEN 2 PRECEDING AND 1 PRECEDING) FROM TEST FETCH FIRST 4 ROWS ONLY;
> ID VALUE ARRAY_AGG(ID) OVER (ORDER BY ID ROWS BETWEEN 2 PRECEDING AND 1 PRECEDING)
> -- ----- -------------------------------------------------------------------------
> 1 1 null
> 2 1 [1]
> 3 5 [1, 2]
> 4 8 [2, 3]
> rows: 4
SELECT *, ARRAY_AGG(ID) OVER (ORDER BY ID ROWS BETWEEN 1 FOLLOWING AND 2 FOLLOWING) FROM TEST OFFSET 4 ROWS;
> ID VALUE ARRAY_AGG(ID) OVER (ORDER BY ID ROWS BETWEEN 1 FOLLOWING AND 2 FOLLOWING)
> -- ----- -------------------------------------------------------------------------
> 5 8 [6, 7]
> 6 8 [7, 8]
> 7 9 [8]
> 8 9 null
> rows: 4
SELECT *, ARRAY_AGG(ID) OVER (ORDER BY ID RANGE BETWEEN 2 PRECEDING AND 1 PRECEDING) FROM TEST FETCH FIRST 4 ROWS ONLY;
> ID VALUE ARRAY_AGG(ID) OVER (ORDER BY ID RANGE BETWEEN 2 PRECEDING AND 1 PRECEDING)
> -- ----- --------------------------------------------------------------------------
> 1 1 null
> 2 1 [1]
> 3 5 [1, 2]
> 4 8 [2, 3]
> rows: 4
SELECT *, ARRAY_AGG(ID) OVER (ORDER BY ID RANGE BETWEEN 1 FOLLOWING AND 2 FOLLOWING) FROM TEST OFFSET 4 ROWS;
> ID VALUE ARRAY_AGG(ID) OVER (ORDER BY ID RANGE BETWEEN 1 FOLLOWING AND 2 FOLLOWING)
> -- ----- --------------------------------------------------------------------------
> 5 8 [6, 7]
> 6 8 [7, 8]
> 7 9 [8]
> 8 9 null
> rows: 4
SELECT *,
ARRAY_AGG(ID) OVER (ORDER BY VALUE GROUPS BETWEEN 0 PRECEDING AND 0 FOLLOWING) N,
ARRAY_AGG(ID) OVER (ORDER BY VALUE GROUPS BETWEEN 0 PRECEDING AND 0 FOLLOWING EXCLUDE TIES) T,
ARRAY_AGG(ID) OVER (ORDER BY VALUE GROUPS BETWEEN 1 PRECEDING AND 0 FOLLOWING EXCLUDE TIES) T1
FROM TEST;
> ID VALUE N T T1
> -- ----- --------- --- ------------
> 1 1 [1, 2] [1] [1]
> 2 1 [1, 2] [2] [2]
> 3 5 [3] [3] [1, 2, 3]
> 4 8 [4, 5, 6] [4] [3, 4]
> 5 8 [4, 5, 6] [5] [3, 5]
> 6 8 [4, 5, 6] [6] [3, 6]
> 7 9 [7, 8] [7] [4, 5, 6, 7]
> 8 9 [7, 8] [8] [4, 5, 6, 8]
> rows: 8
SELECT *,
ARRAY_AGG(ID) OVER (ORDER BY VALUE GROUPS BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING) U_P,
ARRAY_AGG(ID) OVER (ORDER BY VALUE GROUPS BETWEEN 2 PRECEDING AND 1 PRECEDING) P,
ARRAY_AGG(ID) OVER (ORDER BY VALUE GROUPS BETWEEN 1 FOLLOWING AND 2 FOLLOWING) F,
ARRAY_AGG(ID ORDER BY ID) OVER (ORDER BY VALUE GROUPS BETWEEN 1 FOLLOWING AND UNBOUNDED FOLLOWING) U_F
FROM TEST;
> ID VALUE U_P P F U_F
> -- ----- ------------------ ------------ --------------- ------------------
> 1 1 null null [3, 4, 5, 6] [3, 4, 5, 6, 7, 8]
> 2 1 null null [3, 4, 5, 6] [3, 4, 5, 6, 7, 8]
> 3 5 [1, 2] [1, 2] [4, 5, 6, 7, 8] [4, 5, 6, 7, 8]
> 4 8 [1, 2, 3] [1, 2, 3] [7, 8] [7, 8]
> 5 8 [1, 2, 3] [1, 2, 3] [7, 8] [7, 8]
> 6 8 [1, 2, 3] [1, 2, 3] [7, 8] [7, 8]
> 7 9 [1, 2, 3, 4, 5, 6] [3, 4, 5, 6] null null
> 8 9 [1, 2, 3, 4, 5, 6] [3, 4, 5, 6] null null
> rows: 8
SELECT *,
ARRAY_AGG(ID) OVER (ORDER BY VALUE GROUPS BETWEEN 1 PRECEDING AND 0 PRECEDING) P,
ARRAY_AGG(ID) OVER (ORDER BY VALUE GROUPS BETWEEN 0 FOLLOWING AND 1 FOLLOWING) F
FROM TEST;
> ID VALUE P F
> -- ----- --------------- ---------------
> 1 1 [1, 2] [1, 2, 3]
> 2 1 [1, 2] [1, 2, 3]
> 3 5 [1, 2, 3] [3, 4, 5, 6]
> 4 8 [3, 4, 5, 6] [4, 5, 6, 7, 8]
> 5 8 [3, 4, 5, 6] [4, 5, 6, 7, 8]
> 6 8 [3, 4, 5, 6] [4, 5, 6, 7, 8]
> 7 9 [4, 5, 6, 7, 8] [7, 8]
> 8 9 [4, 5, 6, 7, 8] [7, 8]
> rows: 8
SELECT ID, VALUE,
ARRAY_AGG(ID) OVER (ORDER BY VALUE ROWS BETWEEN 2 PRECEDING AND 2 FOLLOWING EXCLUDE GROUP) G,
ARRAY_AGG(ID) OVER (ORDER BY VALUE ROWS BETWEEN 2 PRECEDING AND 2 FOLLOWING EXCLUDE TIES) T
FROM TEST;
> ID VALUE G T
> -- ----- ------------ ---------------
> 1 1 [3] [1, 3]
> 2 1 [3, 4] [2, 3, 4]
> 3 5 [1, 2, 4, 5] [1, 2, 3, 4, 5]
> 4 8 [2, 3] [2, 3, 4]
> 5 8 [3, 7] [3, 5, 7]
> 6 8 [7, 8] [6, 7, 8]
> 7 9 [5, 6] [5, 6, 7]
> 8 9 [6] [6, 8]
> rows: 8
SELECT ID, VALUE, ARRAY_AGG(ID) OVER(ORDER BY VALUE ROWS BETWEEN 1 FOLLOWING AND 2 FOLLOWING EXCLUDE GROUP) G
FROM TEST ORDER BY ID FETCH FIRST 3 ROWS ONLY;
> ID VALUE G
> -- ----- ------
> 1 1 [3]
> 2 1 [3, 4]
> 3 5 [4, 5]
> rows (ordered): 3
SELECT ID, VALUE, ARRAY_AGG(ID) OVER(ORDER BY VALUE ROWS BETWEEN 2 PRECEDING AND 1 PRECEDING EXCLUDE GROUP) G
FROM TEST ORDER BY ID FETCH FIRST 3 ROWS ONLY;
> ID VALUE G
> -- ----- ------
> 1 1 null
> 2 1 null
> 3 5 [1, 2]
> rows (ordered): 3
SELECT ID, VALUE, ARRAY_AGG(ID) OVER (ORDER BY VALUE RANGE BETWEEN 2 PRECEDING AND 1 PRECEDING) A
FROM TEST;
> ID VALUE A
> -- ----- ---------
> 1 1 null
> 2 1 null
> 3 5 null
> 4 8 null
> 5 8 null
> 6 8 null
> 7 9 [4, 5, 6]
> 8 9 [4, 5, 6]
> rows: 8
SELECT ID, VALUE,
ARRAY_AGG(ID) OVER (ORDER BY VALUE ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) CP,
ARRAY_AGG(ID ORDER BY ID) OVER (ORDER BY VALUE ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) CF,
ARRAY_AGG(ID) OVER (ORDER BY VALUE RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) RP,
ARRAY_AGG(ID ORDER BY ID) OVER (ORDER BY VALUE RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) RF,
ARRAY_AGG(ID) OVER (ORDER BY VALUE GROUPS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) GP,
ARRAY_AGG(ID ORDER BY ID) OVER (ORDER BY VALUE GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) GF
FROM TEST;
> ID VALUE CP CF RP RF GP GF
> -- ----- ------------------------ ------------------------ ------------------------ ------------------------ ------------------------ ------------------------
> 1 1 [1] [1, 2, 3, 4, 5, 6, 7, 8] [1, 2] [1, 2, 3, 4, 5, 6, 7, 8] [1, 2] [1, 2, 3, 4, 5, 6, 7, 8]
> 2 1 [1, 2] [2, 3, 4, 5, 6, 7, 8] [1, 2] [1, 2, 3, 4, 5, 6, 7, 8] [1, 2] [1, 2, 3, 4, 5, 6, 7, 8]
> 3 5 [1, 2, 3] [3, 4, 5, 6, 7, 8] [1, 2, 3] [3, 4, 5, 6, 7, 8] [1, 2, 3] [3, 4, 5, 6, 7, 8]
> 4 8 [1, 2, 3, 4] [4, 5, 6, 7, 8] [1, 2, 3, 4, 5, 6] [4, 5, 6, 7, 8] [1, 2, 3, 4, 5, 6] [4, 5, 6, 7, 8]
> 5 8 [1, 2, 3, 4, 5] [5, 6, 7, 8] [1, 2, 3, 4, 5, 6] [4, 5, 6, 7, 8] [1, 2, 3, 4, 5, 6] [4, 5, 6, 7, 8]
> 6 8 [1, 2, 3, 4, 5, 6] [6, 7, 8] [1, 2, 3, 4, 5, 6] [4, 5, 6, 7, 8] [1, 2, 3, 4, 5, 6] [4, 5, 6, 7, 8]
> 7 9 [1, 2, 3, 4, 5, 6, 7] [7, 8] [1, 2, 3, 4, 5, 6, 7, 8] [7, 8] [1, 2, 3, 4, 5, 6, 7, 8] [7, 8]
> 8 9 [1, 2, 3, 4, 5, 6, 7, 8] [8] [1, 2, 3, 4, 5, 6, 7, 8] [7, 8] [1, 2, 3, 4, 5, 6, 7, 8] [7, 8]
> rows: 8
SELECT *, ARRAY_AGG(ID) OVER (ORDER BY ID RANGE BETWEEN CURRENT ROW AND 1 PRECEDING) FROM TEST;
> exception SYNTAX_ERROR_1
DROP TABLE TEST;
> ok
CREATE TABLE TEST (ID INT, VALUE INT);
> ok
INSERT INTO TEST VALUES
(1, 1),
(2, 1),
(3, 2),
(4, 2),
(5, 3),
(6, 3),
(7, 4),
(8, 4);
> update count: 8
SELECT *, ARRAY_AGG(ID) OVER (ORDER BY VALUE RANGE BETWEEN 2 PRECEDING AND 1 PRECEDING) FROM TEST;
> ID VALUE ARRAY_AGG(ID) OVER (ORDER BY VALUE RANGE BETWEEN 2 PRECEDING AND 1 PRECEDING)
> -- ----- -----------------------------------------------------------------------------
> 1 1 null
> 2 1 null
> 3 2 [1, 2]
> 4 2 [1, 2]
> 5 3 [1, 2, 3, 4]
> 6 3 [1, 2, 3, 4]
> 7 4 [3, 4, 5, 6]
> 8 4 [3, 4, 5, 6]
> rows: 8
SELECT *, ARRAY_AGG(ID) OVER (ORDER BY VALUE RANGE BETWEEN 1 FOLLOWING AND 2 FOLLOWING) FROM TEST;
> ID VALUE ARRAY_AGG(ID) OVER (ORDER BY VALUE RANGE BETWEEN 1 FOLLOWING AND 2 FOLLOWING)
> -- ----- -----------------------------------------------------------------------------
> 1 1 [3, 4, 5, 6]
> 2 1 [3, 4, 5, 6]
> 3 2 [5, 6, 7, 8]
> 4 2 [5, 6, 7, 8]
> 5 3 [7, 8]
> 6 3 [7, 8]
> 7 4 null
> 8 4 null
> rows: 8
SELECT ID, VALUE, ARRAY_AGG(ID) OVER (ORDER BY VALUE RANGE BETWEEN 2 PRECEDING AND 1 PRECEDING EXCLUDE CURRENT ROW) A
FROM TEST;
> ID VALUE A
> -- ----- ------------
> 1 1 null
> 2 1 null
> 3 2 [1, 2]
> 4 2 [1, 2]
> 5 3 [1, 2, 3, 4]
> 6 3 [1, 2, 3, 4]
> 7 4 [3, 4, 5, 6]
> 8 4 [3, 4, 5, 6]
> rows: 8
SELECT ID, VALUE, ARRAY_AGG(ID) OVER (ORDER BY VALUE RANGE BETWEEN 1 FOLLOWING AND 1 FOLLOWING EXCLUDE CURRENT ROW) A
FROM TEST;
> ID VALUE A
> -- ----- ------
> 1 1 [3, 4]
> 2 1 [3, 4]
> 3 2 [5, 6]
> 4 2 [5, 6]
> 5 3 [7, 8]
> 6 3 [7, 8]
> 7 4 null
> 8 4 null
> rows: 8
SELECT ID, VALUE,
ARRAY_AGG(ID) OVER (ORDER BY VALUE ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) CP,
ARRAY_AGG(ID ORDER BY ID) OVER (ORDER BY VALUE ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) CF,
ARRAY_AGG(ID) OVER (ORDER BY VALUE RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) RP,
ARRAY_AGG(ID ORDER BY ID) OVER (ORDER BY VALUE RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) RF,
ARRAY_AGG(ID) OVER (ORDER BY VALUE GROUPS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) GP,
ARRAY_AGG(ID ORDER BY ID) OVER (ORDER BY VALUE GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) GF
FROM TEST;
> ID VALUE CP CF RP RF GP GF
> -- ----- ------------------------ ------------------------ ------------------------ ------------------------ ------------------------ ------------------------
> 1 1 [1] [1, 2, 3, 4, 5, 6, 7, 8] [1, 2] [1, 2, 3, 4, 5, 6, 7, 8] [1, 2] [1, 2, 3, 4, 5, 6, 7, 8]
> 2 1 [1, 2] [2, 3, 4, 5, 6, 7, 8] [1, 2] [1, 2, 3, 4, 5, 6, 7, 8] [1, 2] [1, 2, 3, 4, 5, 6, 7, 8]
> 3 2 [1, 2, 3] [3, 4, 5, 6, 7, 8] [1, 2, 3, 4] [3, 4, 5, 6, 7, 8] [1, 2, 3, 4] [3, 4, 5, 6, 7, 8]
> 4 2 [1, 2, 3, 4] [4, 5, 6, 7, 8] [1, 2, 3, 4] [3, 4, 5, 6, 7, 8] [1, 2, 3, 4] [3, 4, 5, 6, 7, 8]
> 5 3 [1, 2, 3, 4, 5] [5, 6, 7, 8] [1, 2, 3, 4, 5, 6] [5, 6, 7, 8] [1, 2, 3, 4, 5, 6] [5, 6, 7, 8]
> 6 3 [1, 2, 3, 4, 5, 6] [6, 7, 8] [1, 2, 3, 4, 5, 6] [5, 6, 7, 8] [1, 2, 3, 4, 5, 6] [5, 6, 7, 8]
> 7 4 [1, 2, 3, 4, 5, 6, 7] [7, 8] [1, 2, 3, 4, 5, 6, 7, 8] [7, 8] [1, 2, 3, 4, 5, 6, 7, 8] [7, 8]
> 8 4 [1, 2, 3, 4, 5, 6, 7, 8] [8] [1, 2, 3, 4, 5, 6, 7, 8] [7, 8] [1, 2, 3, 4, 5, 6, 7, 8] [7, 8]
> rows: 8
SELECT ID, VALUE,
ARRAY_AGG(ID ORDER BY ID) OVER (ORDER BY ID RANGE BETWEEN UNBOUNDED PRECEDING AND VALUE FOLLOWING) RG,
ARRAY_AGG(ID ORDER BY ID) OVER (ORDER BY ID RANGE BETWEEN VALUE PRECEDING AND UNBOUNDED FOLLOWING) RGR,
ARRAY_AGG(ID ORDER BY ID) OVER (ORDER BY ID ROWS BETWEEN UNBOUNDED PRECEDING AND VALUE FOLLOWING) R,
ARRAY_AGG(ID ORDER BY ID) OVER (ORDER BY ID ROWS BETWEEN VALUE PRECEDING AND UNBOUNDED FOLLOWING) RR
FROM TEST;
> ID VALUE RG RGR R RR
> -- ----- ------------------------ ------------------------ ------------------------ ------------------------
> 1 1 [1, 2] [1, 2, 3, 4, 5, 6, 7, 8] [1, 2] [1, 2, 3, 4, 5, 6, 7, 8]
> 2 1 [1, 2, 3] [1, 2, 3, 4, 5, 6, 7, 8] [1, 2, 3] [1, 2, 3, 4, 5, 6, 7, 8]
> 3 2 [1, 2, 3, 4, 5] [1, 2, 3, 4, 5, 6, 7, 8] [1, 2, 3, 4, 5] [1, 2, 3, 4, 5, 6, 7, 8]
> 4 2 [1, 2, 3, 4, 5, 6] [2, 3, 4, 5, 6, 7, 8] [1, 2, 3, 4, 5, 6] [2, 3, 4, 5, 6, 7, 8]
> 5 3 [1, 2, 3, 4, 5, 6, 7, 8] [2, 3, 4, 5, 6, 7, 8] [1, 2, 3, 4, 5, 6, 7, 8] [2, 3, 4, 5, 6, 7, 8]
> 6 3 [1, 2, 3, 4, 5, 6, 7, 8] [3, 4, 5, 6, 7, 8] [1, 2, 3, 4, 5, 6, 7, 8] [3, 4, 5, 6, 7, 8]
> 7 4 [1, 2, 3, 4, 5, 6, 7, 8] [3, 4, 5, 6, 7, 8] [1, 2, 3, 4, 5, 6, 7, 8] [3, 4, 5, 6, 7, 8]
> 8 4 [1, 2, 3, 4, 5, 6, 7, 8] [4, 5, 6, 7, 8] [1, 2, 3, 4, 5, 6, 7, 8] [4, 5, 6, 7, 8]
> rows: 8
SELECT ID, VALUE,
ARRAY_AGG(ID ORDER BY ID) OVER
(PARTITION BY VALUE ORDER BY ID ROWS BETWEEN VALUE / 3 PRECEDING AND VALUE / 3 FOLLOWING) A,
ARRAY_AGG(ID ORDER BY ID) OVER
(PARTITION BY VALUE ORDER BY ID ROWS BETWEEN UNBOUNDED PRECEDING AND VALUE / 3 FOLLOWING) AP,
ARRAY_AGG(ID ORDER BY ID) OVER
(PARTITION BY VALUE ORDER BY ID ROWS BETWEEN VALUE / 3 PRECEDING AND UNBOUNDED FOLLOWING) AF
FROM TEST;
> ID VALUE A AP AF
> -- ----- ------ ------ ------
> 1 1 [1] [1] [1, 2]
> 2 1 [2] [1, 2] [2]
> 3 2 [3] [3] [3, 4]
> 4 2 [4] [3, 4] [4]
> 5 3 [5, 6] [5, 6] [5, 6]
> 6 3 [5, 6] [5, 6] [5, 6]
> 7 4 [7, 8] [7, 8] [7, 8]
> 8 4 [7, 8] [7, 8] [7, 8]
> rows: 8
DROP TABLE TEST;
> ok | the_stack |
;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!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 */;
# Dump of table goadmin_menu
# ------------------------------------------------------------
DROP TABLE IF EXISTS `goadmin_menu`;
CREATE TABLE `goadmin_menu` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`parent_id` int(11) unsigned NOT NULL DEFAULT '0',
`type` tinyint(4) unsigned NOT NULL DEFAULT '0',
`order` int(11) unsigned NOT NULL DEFAULT '0',
`title` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
`icon` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
`uri` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`header` varchar(150) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
LOCK TABLES `goadmin_menu` WRITE;
/*!40000 ALTER TABLE `goadmin_menu` DISABLE KEYS */;
INSERT INTO `goadmin_menu` (`id`, `parent_id`, `type`, `order`, `title`, `icon`, `uri`, `header`, `created_at`, `updated_at`)
VALUES
(1,0,1,2,'Admin','fa-tasks','',NULL,'2019-09-10 00:00:00','2019-09-10 00:00:00'),
(2,1,1,2,'Users','fa-users','/info/manager',NULL,'2019-09-10 00:00:00','2019-09-10 00:00:00'),
(3,1,1,3,'Roles','fa-user','/info/roles',NULL,'2019-09-10 00:00:00','2019-09-10 00:00:00'),
(4,1,1,4,'Permission','fa-ban','/info/permission',NULL,'2019-09-10 00:00:00','2019-09-10 00:00:00'),
(5,1,1,5,'Menu','fa-bars','/menu',NULL,'2019-09-10 00:00:00','2019-09-10 00:00:00'),
(6,1,1,6,'Operation log','fa-history','/info/op',NULL,'2019-09-10 00:00:00','2019-09-10 00:00:00'),
(7,0,1,1,'Dashboard','fa-bar-chart','/',NULL,'2019-09-10 00:00:00','2019-09-10 00:00:00');
/*!40000 ALTER TABLE `goadmin_menu` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table goadmin_operation_log
# ------------------------------------------------------------
DROP TABLE IF EXISTS `goadmin_operation_log`;
CREATE TABLE `goadmin_operation_log` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`user_id` int(11) unsigned NOT NULL,
`path` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`method` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,
`ip` varchar(15) COLLATE utf8mb4_unicode_ci NOT NULL,
`input` text COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `admin_operation_log_user_id_index` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
# Dump of table goadmin_permissions
# ------------------------------------------------------------
DROP TABLE IF EXISTS `goadmin_permissions`;
CREATE TABLE `goadmin_permissions` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
`slug` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
`http_method` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`http_path` text COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `admin_permissions_name_unique` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
LOCK TABLES `goadmin_permissions` WRITE;
/*!40000 ALTER TABLE `goadmin_permissions` DISABLE KEYS */;
INSERT INTO `goadmin_permissions` (`id`, `name`, `slug`, `http_method`, `http_path`, `created_at`, `updated_at`)
VALUES
(1,'All permission','*','','*','2019-09-10 00:00:00','2019-09-10 00:00:00'),
(2,'Dashboard','dashboard','GET,PUT,POST,DELETE','/','2019-09-10 00:00:00','2019-09-10 00:00:00');
/*!40000 ALTER TABLE `goadmin_permissions` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table goadmin_role_menu
# ------------------------------------------------------------
DROP TABLE IF EXISTS `goadmin_role_menu`;
CREATE TABLE `goadmin_role_menu` (
`role_id` int(11) unsigned NOT NULL,
`menu_id` int(11) unsigned NOT NULL,
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
KEY `admin_role_menu_role_id_menu_id_index` (`role_id`,`menu_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
LOCK TABLES `goadmin_role_menu` WRITE;
/*!40000 ALTER TABLE `goadmin_role_menu` DISABLE KEYS */;
INSERT INTO `goadmin_role_menu` (`role_id`, `menu_id`, `created_at`, `updated_at`)
VALUES
(1,1,'2019-09-10 00:00:00','2019-09-10 00:00:00'),
(1,7,'2019-09-10 00:00:00','2019-09-10 00:00:00'),
(2,7,'2019-09-10 00:00:00','2019-09-10 00:00:00'),
(1,8,'2019-09-11 10:20:55','2019-09-11 10:20:55'),
(2,8,'2019-09-11 10:20:55','2019-09-11 10:20:55');
/*!40000 ALTER TABLE `goadmin_role_menu` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table goadmin_role_permissions
# ------------------------------------------------------------
DROP TABLE IF EXISTS `goadmin_role_permissions`;
CREATE TABLE `goadmin_role_permissions` (
`role_id` int(11) unsigned NOT NULL,
`permission_id` int(11) unsigned NOT NULL,
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
UNIQUE KEY `admin_role_permissions` (`role_id`,`permission_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
LOCK TABLES `goadmin_role_permissions` WRITE;
/*!40000 ALTER TABLE `goadmin_role_permissions` DISABLE KEYS */;
INSERT INTO `goadmin_role_permissions` (`role_id`, `permission_id`, `created_at`, `updated_at`)
VALUES
(1,1,'2019-09-10 00:00:00','2019-09-10 00:00:00'),
(1,2,'2019-09-10 00:00:00','2019-09-10 00:00:00'),
(2,2,'2019-09-10 00:00:00','2019-09-10 00:00:00');
/*!40000 ALTER TABLE `goadmin_role_permissions` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table goadmin_role_users
# ------------------------------------------------------------
DROP TABLE IF EXISTS `goadmin_role_users`;
CREATE TABLE `goadmin_role_users` (
`role_id` int(11) unsigned NOT NULL,
`user_id` int(11) unsigned NOT NULL,
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
UNIQUE KEY `admin_user_roles` (`role_id`,`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
LOCK TABLES `goadmin_role_users` WRITE;
/*!40000 ALTER TABLE `goadmin_role_users` DISABLE KEYS */;
INSERT INTO `goadmin_role_users` (`role_id`, `user_id`, `created_at`, `updated_at`)
VALUES
(1,1,'2019-09-10 00:00:00','2019-09-10 00:00:00'),
(2,2,'2019-09-10 00:00:00','2019-09-10 00:00:00');
/*!40000 ALTER TABLE `goadmin_role_users` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table goadmin_roles
# ------------------------------------------------------------
DROP TABLE IF EXISTS `goadmin_roles`;
CREATE TABLE `goadmin_roles` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
`slug` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `admin_roles_name_unique` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
LOCK TABLES `goadmin_roles` WRITE;
/*!40000 ALTER TABLE `goadmin_roles` DISABLE KEYS */;
INSERT INTO `goadmin_roles` (`id`, `name`, `slug`, `created_at`, `updated_at`)
VALUES
(1,'Administrator','administrator','2019-09-10 00:00:00','2019-09-10 00:00:00'),
(2,'Operator','operator','2019-09-10 00:00:00','2019-09-10 00:00:00');
/*!40000 ALTER TABLE `goadmin_roles` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table goadmin_session
# ------------------------------------------------------------
DROP TABLE IF EXISTS `goadmin_session`;
CREATE TABLE `goadmin_session` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`sid` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`values` varchar(3000) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
# Dump of table goadmin_user_permissions
# ------------------------------------------------------------
DROP TABLE IF EXISTS `goadmin_user_permissions`;
CREATE TABLE `goadmin_user_permissions` (
`user_id` int(11) unsigned NOT NULL,
`permission_id` int(11) unsigned NOT NULL,
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
UNIQUE KEY `admin_user_permissions` (`user_id`,`permission_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
LOCK TABLES `goadmin_user_permissions` WRITE;
/*!40000 ALTER TABLE `goadmin_user_permissions` DISABLE KEYS */;
INSERT INTO `goadmin_user_permissions` (`user_id`, `permission_id`, `created_at`, `updated_at`)
VALUES
(1,1,'2019-09-10 00:00:00','2019-09-10 00:00:00'),
(2,2,'2019-09-10 00:00:00','2019-09-10 00:00:00');
/*!40000 ALTER TABLE `goadmin_user_permissions` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table goadmin_users
# ------------------------------------------------------------
DROP TABLE IF EXISTS `goadmin_users`;
CREATE TABLE `goadmin_users` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`username` varchar(190) COLLATE utf8mb4_unicode_ci NOT NULL,
`password` varchar(80) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`avatar` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `admin_users_username_unique` (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
LOCK TABLES `goadmin_users` WRITE;
/*!40000 ALTER TABLE `goadmin_users` DISABLE KEYS */;
INSERT INTO `goadmin_users` (`id`, `username`, `password`, `name`, `avatar`, `remember_token`, `created_at`, `updated_at`)
VALUES
(1,'admin','$2a$10$U3F/NSaf2kaVbyXTBp7ppOn0jZFyRqXRnYXB.AMioCjXl3Ciaj4oy','admin','','tlNcBVK9AvfYH7WEnwB1RKvocJu8FfRy4um3DJtwdHuJy0dwFsLOgAc0xUfh','2019-09-10 00:00:00','2019-09-10 00:00:00'),
(2,'operator','$2a$10$rVqkOzHjN2MdlEprRflb1eGP0oZXuSrbJLOmJagFsCd81YZm0bsh.','Operator','',NULL,'2019-09-10 00:00:00','2019-09-10 00:00:00');
/*!40000 ALTER TABLE `goadmin_users` ENABLE KEYS */;
UNLOCK TABLES;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_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 */; | the_stack |
CREATE DATABASE IF NOT EXISTS FINGERPRINT;
USE FINGERPRINT;
DROP TABLE IF EXISTS TITELNUMMERTRACK_ID;
CREATE TABLE TITELNUMMERTRACK_ID (
TITELNUMMERTRACK_ID INT NOT NULL AUTO_INCREMENT,
GEWIJZIGD TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
TITELNUMMERTRACK VARCHAR(20) NOT NULL,
CATALOGUSCODE VARCHAR(12) NOT NULL DEFAULT 'POP',
UNIFORMETITELLINK VARCHAR(12) NOT NULL DEFAULT '',
DATUMRELEASE DATETIME NOT NULL,
AUDIOSOURCE VARCHAR(12) NOT NULL,
LOKATIE VARCHAR(256) NOT NULL DEFAULT '',
DURATIONINMS BIGINT NOT NULL DEFAULT -1,
PRIMARY KEY (TITELNUMMERTRACK_ID),
UNIQUE KEY DK1_TITELNUMMERTRACK_ID (TITELNUMMERTRACK),
KEY DK2_TITELNUMMERTRACK_ID (UNIFORMETITELLINK)
) ENGINE=INNODB DEFAULT CHARSET=UTF8;
DROP TABLE IF EXISTS FINGERID;
CREATE TABLE FINGERID (
TITELNUMMERTRACK_ID INT(11) NOT NULL ,
GEWIJZIGD TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
DATUMTOEGEVOEGD DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
SIGNATURE LONGBLOB NOT NULL,
PRIMARY KEY (TITELNUMMERTRACK_ID),
KEY DK1_FINGERID (DATUMTOEGEVOEGD)
) ENGINE=INNODB DEFAULT CHARSET=UTF8;
DROP TABLE IF EXISTS SUBFINGERID;
CREATE TABLE SUBFINGERID (
TITELNUMMERTRACK_ID INT NOT NULL,
GEWIJZIGD TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
DATUMTOEGEVOEGD DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
SIGNATURE LONGBLOB NOT NULL,
PRIMARY KEY (TITELNUMMERTRACK_ID),
KEY DK1_SUBFINGERID (DATUMTOEGEVOEGD)
) ENGINE=INNODB DEFAULT CHARSET=UTF8;
DROP TABLE IF EXISTS RADIOCHANNEL;
CREATE TABLE RADIOCHANNEL (
RADIOCHANNEL_ID INT NOT NULL AUTO_INCREMENT,
RADIONAME VARCHAR(50) NOT NULL,
NAMECODE VARCHAR(40) NOT NULL,
URL VARCHAR(127) NOT NULL,
PRIMARY KEY (RADIOCHANNEL_ID)
) ENGINE=INNODB DEFAULT CHARSET=UTF8;
INSERT INTO RADIOCHANNEL (RADIONAME, NAMECODE, URL) VALUES('SkyRadio', 'SKYRADIO', 'http://www.skyradio.nl/player/skyradio.pls');
INSERT INTO RADIOCHANNEL (RADIONAME, NAMECODE, URL) VALUES('Sky Radio 00''s Hits', 'SKY00', 'http://www.skyradio.nl/player/skyradio-00s-hits.pls');
INSERT INTO RADIOCHANNEL (RADIONAME, NAMECODE, URL) VALUES('Sky Radio Hits', 'SKYHITS', 'http://www.skyradio.nl/player/skyradio-hits.pls');
INSERT INTO RADIOCHANNEL (RADIONAME, NAMECODE, URL) VALUES('Sky Radio Lounge', 'SKYLOUNGE', 'http://www.skyradio.nl/player/skyradio-lounge.pls');
INSERT INTO RADIOCHANNEL (RADIONAME, NAMECODE, URL) VALUES('Sky Radio Lovesongs', 'SKYLOVE', 'http://www.skyradio.nl/player/skyradio-lovesongs.pls');
INSERT INTO RADIOCHANNEL (RADIONAME, NAMECODE, URL) VALUES('Sky Radio 90s', 'SKY90', 'http://www.skyradio.nl/player/skyradio-90s.pls');
INSERT INTO RADIOCHANNEL (RADIONAME, NAMECODE, URL) VALUES('Sky Radio Christmas', 'SKYCHR', 'http://www.skyradio.nl/player/skyradio-christmas.pls');
INSERT INTO RADIOCHANNEL (RADIONAME, NAMECODE, URL) VALUES('3FM', '3FM', 'http://icecast.omroep.nl/3fm-bb-mp3');
INSERT INTO RADIOCHANNEL (RADIONAME, NAMECODE, URL) VALUES('Radio 538', 'RADIO538', 'http://vip-icecast.538.lw.triple-it.nl/RADIO538_MP3.m3u');
INSERT INTO RADIOCHANNEL (RADIONAME, NAMECODE, URL) VALUES('Radio 4', 'RADIO4', 'http://icecast.omroep.nl/radio4-bb-mp3');
INSERT INTO RADIOCHANNEL (RADIONAME, NAMECODE, URL) VALUES('Classic FM', 'CLASSICFM', 'http://www.classicfm.nl/player/classicfm.asx');
INSERT INTO RADIOCHANNEL (RADIONAME, NAMECODE, URL) VALUES('Radio Veronica', 'VERONICA', 'http://www.radioveronica.nl/radioveronicaplayer/radioveronica.asx');
INSERT INTO RADIOCHANNEL (RADIONAME, NAMECODE, URL) VALUES('Slam FM', 'SLAMFM', 'http://vip-icecast.538.lw.triple-it.nl/SLAMFM_MP3.m3u');
INSERT INTO RADIOCHANNEL (RADIONAME, NAMECODE, URL) VALUES('Q-music', 'QMUSIC', 'http://icecast-qmusic.cdp.triple-it.nl/Qmusic_nl_nonstop_96.mp3.m3u');
INSERT INTO RADIOCHANNEL (RADIONAME, NAMECODE, URL) VALUES('Q-music Foute Uur Non-Stop', 'QMUSICFOUT', 'http://icecast-qmusic.cdp.triple-it.nl/Qmusic_nl_fouteuur_96.mp3.m3u');
INSERT INTO RADIOCHANNEL (RADIONAME, NAMECODE, URL) VALUES('100% NL', '100NL', 'http://www.100p.nl/media/audio/100pnl.pls');
INSERT INTO RADIOCHANNEL (RADIONAME, NAMECODE, URL) VALUES('Juize', 'JUIZE', 'http://vip-icecast.538.lw.triple-it.nl/JUIZE_MP3.m3u');
INSERT INTO RADIOCHANNEL (RADIONAME, NAMECODE, URL) VALUES('FunX', 'FUNX', 'http://icecast.omroep.nl/funx-bb-mp3.m3u');
INSERT INTO RADIOCHANNEL (RADIONAME, NAMECODE, URL) VALUES('Arrow Caz', 'ARROWCAZ', 'http://www.arrow.nl/streams/Caz128kmp3.pls');
INSERT INTO RADIOCHANNEL (RADIONAME, NAMECODE, URL) VALUES('Arrow Classic Rock', 'ARROWCROCK', 'http://www.garnierstreamingmedia.com/asx/streamerswitch.asp?stream=205');
INSERT INTO RADIOCHANNEL (RADIONAME, NAMECODE, URL) VALUES('Radio 2', 'RADIO2', 'http://icecast.omroep.nl/radio2-bb-mp3');
INSERT INTO RADIOCHANNEL (RADIONAME, NAMECODE, URL) VALUES('Radio 10', 'RADIO10', 'http://stream.radio10.nl/radio10.m3u');
INSERT INTO RADIOCHANNEL (RADIONAME, NAMECODE, URL) VALUES('Radio 1', 'RADIO1', 'http://icecast.omroep.nl/radio1-bb-mp3.m3u');
INSERT INTO RADIOCHANNEL (RADIONAME, NAMECODE, URL) VALUES('Radio Decibel', 'RADIODEC', 'http://www.decibel.nl/live/decibel.pls');
INSERT INTO RADIOCHANNEL (RADIONAME, NAMECODE, URL) VALUES('Sublime FM', 'SUBLIMEFM', 'http://82.201.47.68/SublimeFM2.m3u');
INSERT INTO RADIOCHANNEL (RADIONAME, NAMECODE, URL) VALUES('FreshFM', 'FRESHFM', 'http://streams.fresh.fm:8100/listen.pls');
INSERT INTO RADIOCHANNEL (RADIONAME, NAMECODE, URL) VALUES('WILD FM', 'WILDFM', 'http://www.listenlive.eu/wildfm.m3u');
INSERT INTO RADIOCHANNEL (RADIONAME, NAMECODE, URL) VALUES('Concertzender', 'CONCERTZENDER', 'https://www.concertzender.nl/streams/live');
INSERT INTO RADIOCHANNEL (RADIONAME, NAMECODE, URL) VALUES('Sublime', 'SUBLIME', 'http://stream.sublimefm.nl/SublimeFM_mp3');
INSERT INTO RADIOCHANNEL (RADIONAME, NAMECODE, URL) VALUES('KX Radio', 'KXRADIO', 'http://icecast.omroep.nl/3fm-serioustalent-mp3');
INSERT INTO RADIOCHANNEL (RADIONAME, NAMECODE, URL) VALUES('Studio Brussel', 'STUDIOBRUSSEL', 'http://mp3.streampower.be/stubru-high.mp3');
-- ------------------------------------------------------------------------------------------
-- Needed SP's
-- ------------------------------------------------------------------------------------------
DELIMITER $$
DROP PROCEDURE IF EXISTS RADIOCHANNEL_S$$
CREATE PROCEDURE RADIOCHANNEL_S (
IN parNAMECODE VARCHAR(40)
)
exit_proc:BEGIN
SELECT *
FROM RADIOCHANNEL
WHERE NAMECODE = parNAMECODE;
END$$
DELIMITER ;
DELIMITER $$
DROP PROCEDURE IF EXISTS DELETEFINGERINDEX$$
CREATE PROCEDURE DELETEFINGERINDEX (
IN parDATEGEWIJZIGD DATE,
IN parMAX_TITELNUMMERTRACK_ID INT
)
exit_proc:BEGIN
SELECT *
FROM TITELNUMMERTRACK_ID
WHERE TITELNUMMERTRACK_ID <= parMAX_TITELNUMMERTRACK_ID
AND GEWIJZIGD > (parDATEGEWIJZIGD + INTERVAL 1 DAY)
ORDER BY GEWIJZIGD;
END$$
DELIMITER ;
DELIMITER $$
DROP PROCEDURE IF EXISTS DELETESUBFINGERINDEX$$
CREATE PROCEDURE DELETESUBFINGERINDEX (
IN parDATEGEWIJZIGD DATE,
IN parMAX_TITELNUMMERTRACK_ID INT
)
exit_proc:BEGIN
SELECT *
FROM TITELNUMMERTRACK_ID
WHERE TITELNUMMERTRACK_ID <= parMAX_TITELNUMMERTRACK_ID
AND GEWIJZIGD > (parDATEGEWIJZIGD + INTERVAL 1 DAY)
ORDER BY GEWIJZIGD;
END$$
DELIMITER ;
DELIMITER $$
DROP PROCEDURE IF EXISTS FINGERID_D$$
CREATE PROCEDURE FINGERID_D (
IN parTITELNUMMERTRACK VARCHAR(20)
)
exit_proc:BEGIN
-- YN 2015-08-18
DECLARE _TITELNUMMERTRACK_ID INT;
SET _TITELNUMMERTRACK_ID = NULL;
SELECT TITELNUMMERTRACK_ID
INTO _TITELNUMMERTRACK_ID
FROM TITELNUMMERTRACK_ID
WHERE TITELNUMMERTRACK = parTITELNUMMERTRACK;
IF _TITELNUMMERTRACK_ID IS NOT NULL THEN
DELETE FROM FINGERID WHERE TITELNUMMERTRACK_ID = _TITELNUMMERTRACK_ID;
END IF;
END$$
DELIMITER ;
DELIMITER $$
DROP PROCEDURE IF EXISTS FINGERID_IU$$
CREATE PROCEDURE FINGERID_IU (
IN parTITELNUMMERTRACK VARCHAR(20),
IN parCATALOGUSCODE VARCHAR(12),
IN parDATUMRELEASE DATETIME,
IN parUNIFORMETITELLINK VARCHAR(12),
IN parAUDIOSOURCE VARCHAR(12),
IN parDURATIONINMS BIGINT,
IN parLOKATIE VARCHAR(256),
IN parSIGNATURE LONGBLOB
)
exit_proc:BEGIN
-- YN 2015-08-21
-- FINGERID is een ACOUSTID fingerprint van de gehele track
--
DECLARE _TITELNUMMERTRACK_ID INT;
SET _TITELNUMMERTRACK_ID = NULL;
SELECT TITELNUMMERTRACK_ID
INTO _TITELNUMMERTRACK_ID
FROM TITELNUMMERTRACK_ID
WHERE TITELNUMMERTRACK = parTITELNUMMERTRACK;
IF _TITELNUMMERTRACK_ID IS NULL THEN
INSERT INTO TITELNUMMERTRACK_ID (
TITELNUMMERTRACK,
CATALOGUSCODE,
UNIFORMETITELLINK,
DATUMRELEASE,
AUDIOSOURCE,
LOKATIE,
DURATIONINMS)
VALUES(parTITELNUMMERTRACK,
parCATALOGUSCODE,
parUNIFORMETITELLINK,
parDATUMRELEASE,
parAUDIOSOURCE,
parLOKATIE,
parDURATIONINMS);
SET _TITELNUMMERTRACK_ID = LAST_INSERT_ID();
ELSE
UPDATE TITELNUMMERTRACK_ID
SET CATALOGUSCODE = IFNULL(parCATALOGUSCODE, CATALOGUSCODE),
UNIFORMETITELLINK = IFNULL(parUNIFORMETITELLINK, UNIFORMETITELLINK),
DATUMRELEASE = IFNULL(parDATUMRELEASE, DATUMRELEASE),
AUDIOSOURCE = IFNULL(parAUDIOSOURCE, AUDIOSOURCE),
LOKATIE = IFNULL(parLOKATIE, LOKATIE),
DURATIONINMS = IFNULL(parDURATIONINMS, DURATIONINMS)
WHERE TITELNUMMERTRACK_ID = _TITELNUMMERTRACK_ID;
END IF;
DELETE FROM FINGERID
WHERE TITELNUMMERTRACK_ID = _TITELNUMMERTRACK_ID;
INSERT INTO FINGERID (
TITELNUMMERTRACK_ID,
SIGNATURE)
VALUES(_TITELNUMMERTRACK_ID,
parSIGNATURE);
SELECT _TITELNUMMERTRACK_ID AS TITELNUMMERTRACK_ID;
END$$
DELIMITER ;
DELIMITER $$
DROP PROCEDURE IF EXISTS SUBFINGERID_D$$
CREATE PROCEDURE SUBFINGERID_D (
IN parTITELNUMMERTRACK VARCHAR(20)
)
exit_proc:BEGIN
-- YN 2015-08-18
DECLARE _TITELNUMMERTRACK_ID INT;
SET _TITELNUMMERTRACK_ID = NULL;
SELECT TITELNUMMERTRACK_ID
INTO _TITELNUMMERTRACK_ID
FROM TITELNUMMERTRACK_ID
WHERE TITELNUMMERTRACK = parTITELNUMMERTRACK;
IF _TITELNUMMERTRACK_ID IS NOT NULL THEN
DELETE FROM SUBFINGERID WHERE TITELNUMMERTRACK_ID = _TITELNUMMERTRACK_ID;
END IF;
END$$
DELIMITER ;
DELIMITER $$
DROP PROCEDURE IF EXISTS SUBFINGERID_IU$$
CREATE PROCEDURE SUBFINGERID_IU (
IN parTITELNUMMERTRACK VARCHAR(20),
IN parCATALOGUSCODE VARCHAR(12),
IN parDATUMRELEASE DATETIME,
IN parUNIFORMETITELLINK VARCHAR(12),
IN parAUDIOSOURCE VARCHAR(12),
IN parDURATIONINMS BIGINT,
IN parLOKATIE VARCHAR(256),
IN parSIGNATURE LONGBLOB
)
exit_proc:BEGIN
-- YN 2015-08-21
--
DECLARE _TITELNUMMERTRACK_ID INT;
SET _TITELNUMMERTRACK_ID = NULL;
SELECT TITELNUMMERTRACK_ID
INTO _TITELNUMMERTRACK_ID
FROM TITELNUMMERTRACK_ID
WHERE TITELNUMMERTRACK = parTITELNUMMERTRACK;
IF _TITELNUMMERTRACK_ID IS NULL THEN
INSERT INTO TITELNUMMERTRACK_ID (
TITELNUMMERTRACK,
CATALOGUSCODE,
UNIFORMETITELLINK,
DATUMRELEASE,
AUDIOSOURCE,
LOKATIE,
DURATIONINMS)
VALUES(parTITELNUMMERTRACK,
parCATALOGUSCODE,
parUNIFORMETITELLINK,
parDATUMRELEASE,
parAUDIOSOURCE,
parLOKATIE,
parDURATIONINMS);
SET _TITELNUMMERTRACK_ID = LAST_INSERT_ID();
ELSE
UPDATE TITELNUMMERTRACK_ID
SET CATALOGUSCODE = IFNULL(parCATALOGUSCODE, CATALOGUSCODE),
UNIFORMETITELLINK = IFNULL(parUNIFORMETITELLINK, UNIFORMETITELLINK),
DATUMRELEASE = IFNULL(parDATUMRELEASE, DATUMRELEASE),
AUDIOSOURCE = IFNULL(parAUDIOSOURCE, AUDIOSOURCE),
LOKATIE = IFNULL(parLOKATIE, LOKATIE),
DURATIONINMS = IFNULL(parDURATIONINMS, DURATIONINMS)
WHERE TITELNUMMERTRACK_ID = _TITELNUMMERTRACK_ID;
END IF;
DELETE FROM SUBFINGERID
WHERE TITELNUMMERTRACK_ID = _TITELNUMMERTRACK_ID;
INSERT INTO SUBFINGERID (
TITELNUMMERTRACK_ID,
SIGNATURE)
VALUES(_TITELNUMMERTRACK_ID,
parSIGNATURE);
SELECT _TITELNUMMERTRACK_ID AS TITELNUMMERTRACK_ID;
END$$
DELIMITER ;
DELIMITER $$
DROP PROCEDURE IF EXISTS TITELNUMMERTRACK_S$$
CREATE PROCEDURE TITELNUMMERTRACK_S (
IN parTITELNUMMERTRACK_ID BIGINT
)
exit_proc:BEGIN
-- YN 2015-08-18
SELECT *
FROM TITELNUMMERTRACK_ID
WHERE TITELNUMMERTRACK_ID = parTITELNUMMERTRACK_ID;
END$$
DELIMITER ;
DELIMITER $$
DROP PROCEDURE IF EXISTS TITELNUMMERTRACK_S2$$
CREATE PROCEDURE TITELNUMMERTRACK_S2 (
IN parTITELNUMMERTRACK VARCHAR(20)
)
exit_proc:BEGIN
-- YN 2015-08-18
SELECT *
FROM TITELNUMMERTRACK_ID
WHERE TITELNUMMERTRACK = parTITELNUMMERTRACK;
END$$
DELIMITER ;
DELIMITER $$
DROP PROCEDURE IF EXISTS `UPDATEDFINGERINDEX`$$
CREATE PROCEDURE UPDATEDFINGERINDEX (
IN parDATEGEWIJZIGD DATE
)
exit_proc:BEGIN
SELECT *
FROM TITELNUMMERTRACK_ID
WHERE GEWIJZIGD > (parDATEGEWIJZIGD + INTERVAL 1 DAY)
ORDER BY GEWIJZIGD;
END$$
DELIMITER ;
DELIMITER $$
DROP PROCEDURE IF EXISTS UPDATEDSUBFINGERINDEX$$
CREATE PROCEDURE UPDATEDSUBFINGERINDEX (
IN parDATEGEWIJZIGD DATE
)
exit_proc:BEGIN
SELECT *
FROM TITELNUMMERTRACK_ID
WHERE GEWIJZIGD > (parDATEGEWIJZIGD + INTERVAL 1 DAY)
ORDER BY GEWIJZIGD;
END$$
DELIMITER ; | the_stack |
-- northwind database creation using reqular (unquoted) names
-- Database using normal naming is required for test D13_ExecuteQueryObjectProperty
--####################################################################
--## create tables
--####################################################################
CREATE TABLE Region (
RegionID SERIAL NOT NULL,
RegionDescription VARCHAR(50) NOT NULL,
PRIMARY KEY(RegionID)
);
CREATE TABLE Territories (
TerritoryID VARCHAR(20) NOT NULL,
TerritoryDescription VARCHAR(50) NOT NULL,
RegionID INTEGER NOT NULL,
PRIMARY KEY(TerritoryID),
CONSTRAINT FK_Terr_Region FOREIGN KEY (RegionID) REFERENCES Region(RegionID)
);
--####################################################################
CREATE TABLE Categories (
CategoryID SERIAL NOT NULL,
CategoryName VARCHAR(15) NOT NULL,
Description TEXT NULL,
Picture BYTEA NULL,
PRIMARY KEY(CategoryID)
);
CREATE TABLE Suppliers (
SupplierID SERIAL NOT NULL,
CompanyName VARCHAR(40) NOT NULL DEFAULT '',
ContactName VARCHAR(30) NULL,
ContactTitle VARCHAR(30) NULL,
Address VARCHAR(60) NULL,
City VARCHAR(15) NULL,
Region VARCHAR(15) NULL,
PostalCode VARCHAR(10) NULL,
Country VARCHAR(15) NULL,
Phone VARCHAR(24) NULL,
Fax VARCHAR(24) NULL,
PRIMARY KEY(SupplierID)
);
--####################################################################
CREATE TABLE Products (
ProductID SERIAL NOT NULL,
ProductName VARCHAR(40) NOT NULL DEFAULT '',
SupplierID INTEGER NULL,
CategoryID INTEGER NULL,
QuantityPerUnit VARCHAR(20) NULL,
UnitPrice DECIMAL NULL,
UnitsInStock SMALLINT NULL,
UnitsOnOrder SMALLINT NULL,
ReorderLevel SMALLINT NULL,
Discontinued BIT NOT NULL,
PRIMARY KEY(ProductID),
CONSTRAINT FK_prod_catg FOREIGN KEY (CategoryID) REFERENCES Categories(CategoryID),
CONSTRAINT FK_prod_supp FOREIGN KEY (SupplierID) REFERENCES Suppliers(SupplierID)
);
CREATE TABLE Customers (
CustomerID VARCHAR(5) NOT NULL,
CompanyName VARCHAR(40) NOT NULL,
ContactName VARCHAR(30) NOT NULL ,
ContactTitle VARCHAR(30) NULL,
Address VARCHAR(60) NULL,
City VARCHAR(15) NULL,
Region VARCHAR(15) NULL,
PostalCode VARCHAR(10) NULL,
Country VARCHAR(15) NULL,
Phone VARCHAR(24) NULL,
Fax VARCHAR(24) NULL,
PRIMARY KEY(CustomerID)
);
--####################################################################
CREATE TABLE Shippers (
ShipperID SERIAL NOT NULL,
CompanyName VARCHAR(40) NOT NULL,
Phone VARCHAR(24) NULL,
PRIMARY KEY(ShipperID)
);
--####################################################################
CREATE TABLE Employees (
EmployeeID SERIAL NOT NULL,
LastName VARCHAR(20) NOT NULL,
FirstName VARCHAR(10) NOT NULL,
Title VARCHAR(30) NULL,
BirthDate DATE NULL,
HireDate TIMESTAMP NULL,
Address VARCHAR(60) NULL,
City VARCHAR(15) NULL,
Region VARCHAR(15) NULL,
PostalCode VARCHAR(10) NULL,
Country VARCHAR(15) NULL,
HomePhone VARCHAR(24) NULL,
Photo BYTEA NULL,
Notes TEXT NULL,
ReportsTo INTEGER NULL,
CONSTRAINT FK_Emp_ReportsToEmp FOREIGN KEY (ReportsTo) REFERENCES Employees(EmployeeID),
PRIMARY KEY(EmployeeID)
);
--####################################################################
CREATE TABLE EmployeeTerritories (
EmployeeID INTEGER NOT NULL REFERENCES Employees(EmployeeID),
TerritoryID VARCHAR(20) NOT NULL REFERENCES Territories(TerritoryID),
PRIMARY KEY(EmployeeID,TerritoryID)
);
CREATE TABLE Orders (
OrderID SERIAL NOT NULL,
CustomerID VARCHAR(5) NOT NULL,
EmployeeID INTEGER NULL,
OrderDate TIMESTAMP NULL,
RequiredDate TIMESTAMP NULL,
ShippedDate TIMESTAMP NULL,
ShipVia INT NULL,
Freight DECIMAL NULL,
ShipName VARCHAR(40) NULL,
ShipAddress VARCHAR(60) NULL,
ShipCity VARCHAR(15) NULL,
ShipRegion VARCHAR(15) NULL,
ShipPostalCode VARCHAR(10) NULL,
ShipCountry VARCHAR(15) NULL,
PRIMARY KEY(OrderID),
CONSTRAINT fk_order_customer FOREIGN KEY (CustomerID) REFERENCES Customers(CustomerID),
CONSTRAINT fk_order_product FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID)
);
CREATE TABLE OrderDetails (
OrderID INT NOT NULL REFERENCES Orders(OrderID),
ProductID INT NOT NULL REFERENCES Products(ProductID),
UnitPrice decimal,
Quantity INT,
Discount float,
PRIMARY KEY (OrderID,ProductID)
);
--####################################################################
--## populate tables with seed data
--####################################################################
truncate table Categories CASCADE;
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 Region (RegionDescription) VALUES ('North America');
INSERT INTO Region (RegionDescription) VALUES ('Europe');
INSERT INTO Territories (TerritoryID,TerritoryDescription, RegionID) VALUES ('US.Northwest', 'Northwest', 1);
truncate table Orders CASCADE; -- must be truncated before Customer
truncate table Customers CASCADE;
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,City, Phone)
values ('WARTH', 'Wartian Herkku','Pirkko Koskitalo','Accounting Manager','Finland','90110','Oulu','981-443655');
--truncate table Orders; -- must be truncated before Products
truncate table Products CASCADE;
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 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 Employees (LastName,FirstName,Title,BirthDate,HireDate,Address,City,ReportsTo)
VALUES ('Fuller','Andrew','Vice President, Sales','19540101','19890101', '908 W. Capital Way','Tacoma',NULL);
insert INTO Employees (LastName,FirstName,Title,BirthDate,HireDate,Address,City,ReportsTo)
VALUES ('Davolio','Nancy','Sales Representative','19640101','19940101','507 - 20th Ave. E. Apt. 2A','Seattle',1);
insert INTO Employees (LastName,FirstName,Title,BirthDate,HireDate,Address,City,ReportsTo)
VALUES ('Builder','Bob','Handyman','19640101','19940101','666 dark street','Seattle',2);
insert into EmployeeTerritories (EmployeeID,TerritoryID)
values (2,'US.Northwest');
--####################################################################
truncate table Orders CASCADE;
insert INTO Orders (CustomerID, EmployeeID, OrderDate, Freight)
Values ('AIRBU', 1, now(), 21.3);
insert INTO Orders (CustomerID, EmployeeID, OrderDate, Freight)
Values ('BT___', 1, now(), 11.1);
insert INTO Orders (CustomerID, EmployeeID, OrderDate, Freight)
Values ('BT___', 1, now(), 11.5);
insert INTO Orders (CustomerID, EmployeeID, OrderDate, Freight)
Values ('UKMOD', 1, now(), 32.5);
INSERT INTO OrderDetails (OrderID, ProductID, UnitPrice, Quantity, Discount)
VALUES (1,2, 33, 5, 11);
CREATE FUNCTION hello0() RETURNS text AS $$
BEGIN RETURN 'hello0'; END;
$$ LANGUAGE plpgsql;
-- contatenates strings. test case: select hello2('aa','bb')
CREATE OR REPLACE FUNCTION hello1(name text) RETURNS text AS $$
BEGIN RETURN 'hello,' || name || '!'; END;
$$ LANGUAGE plpgsql;
CREATE OR REPLACE FUNCTION hello2(name text, unused text) RETURNS text AS $$
BEGIN RETURN 'hello,' || name || '!'; SELECT * FROM customer; END;
$$ LANGUAGE plpgsql;
-- count orders for given CustomerID. test case: select getOrderCount(1)
CREATE OR REPLACE FUNCTION getOrderCount(custId VARCHAR) RETURNS INT AS $$
DECLARE
count1 INTEGER;
BEGIN
SELECT COUNT(*) INTO count1 FROM Orders WHERE CustomerID=custId;
RETURN count1;
END;
$$ LANGUAGE plpgsql;
COMMIT; | the_stack |
use lockhashrepro
go
create or ALTER procedure [dbo].[interop_1] as begin exec dbo.native_1 end
GO
CREATE OR ALTER procedure [dbo].[native_1]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_1 to nonadmin; GRANT EXECUTE ON native_1 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_2] as begin exec dbo.native_2 end
GO
CREATE OR ALTER procedure [dbo].[native_2]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_2 to nonadmin; GRANT EXECUTE ON native_2 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_3] as begin exec dbo.native_3 end
GO
CREATE OR ALTER procedure [dbo].[native_3]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_3 to nonadmin; GRANT EXECUTE ON native_3 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_4] as begin exec dbo.native_4 end
GO
CREATE OR ALTER procedure [dbo].[native_4]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_4 to nonadmin; GRANT EXECUTE ON native_4 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_5] as begin exec dbo.native_5 end
GO
CREATE OR ALTER procedure [dbo].[native_5]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_5 to nonadmin; GRANT EXECUTE ON native_5 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_6] as begin exec dbo.native_6 end
GO
CREATE OR ALTER procedure [dbo].[native_6]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_6 to nonadmin; GRANT EXECUTE ON native_6 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_7] as begin exec dbo.native_7 end
GO
CREATE OR ALTER procedure [dbo].[native_7]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_7 to nonadmin; GRANT EXECUTE ON native_7 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_8] as begin exec dbo.native_8 end
GO
CREATE OR ALTER procedure [dbo].[native_8]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_8 to nonadmin; GRANT EXECUTE ON native_8 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_9] as begin exec dbo.native_9 end
GO
CREATE OR ALTER procedure [dbo].[native_9]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_9 to nonadmin; GRANT EXECUTE ON native_9 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_10] as begin exec dbo.native_10 end
GO
CREATE OR ALTER procedure [dbo].[native_10]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_10 to nonadmin; GRANT EXECUTE ON native_10 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_11] as begin exec dbo.native_11 end
GO
CREATE OR ALTER procedure [dbo].[native_11]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_11 to nonadmin; GRANT EXECUTE ON native_11 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_12] as begin exec dbo.native_12 end
GO
CREATE OR ALTER procedure [dbo].[native_12]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_12 to nonadmin; GRANT EXECUTE ON native_12 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_13] as begin exec dbo.native_13 end
GO
CREATE OR ALTER procedure [dbo].[native_13]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_13 to nonadmin; GRANT EXECUTE ON native_13 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_14] as begin exec dbo.native_14 end
GO
CREATE OR ALTER procedure [dbo].[native_14]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_14 to nonadmin; GRANT EXECUTE ON native_14 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_15] as begin exec dbo.native_15 end
GO
CREATE OR ALTER procedure [dbo].[native_15]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_15 to nonadmin; GRANT EXECUTE ON native_15 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_16] as begin exec dbo.native_16 end
GO
CREATE OR ALTER procedure [dbo].[native_16]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_16 to nonadmin; GRANT EXECUTE ON native_16 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_17] as begin exec dbo.native_17 end
GO
CREATE OR ALTER procedure [dbo].[native_17]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_17 to nonadmin; GRANT EXECUTE ON native_17 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_18] as begin exec dbo.native_18 end
GO
CREATE OR ALTER procedure [dbo].[native_18]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_18 to nonadmin; GRANT EXECUTE ON native_18 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_19] as begin exec dbo.native_19 end
GO
CREATE OR ALTER procedure [dbo].[native_19]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_19 to nonadmin; GRANT EXECUTE ON native_19 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_20] as begin exec dbo.native_20 end
GO
CREATE OR ALTER procedure [dbo].[native_20]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_20 to nonadmin; GRANT EXECUTE ON native_20 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_21] as begin exec dbo.native_21 end
GO
CREATE OR ALTER procedure [dbo].[native_21]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_21 to nonadmin; GRANT EXECUTE ON native_21 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_22] as begin exec dbo.native_22 end
GO
CREATE OR ALTER procedure [dbo].[native_22]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_22 to nonadmin; GRANT EXECUTE ON native_22 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_23] as begin exec dbo.native_23 end
GO
CREATE OR ALTER procedure [dbo].[native_23]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_23 to nonadmin; GRANT EXECUTE ON native_23 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_24] as begin exec dbo.native_24 end
GO
CREATE OR ALTER procedure [dbo].[native_24]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_24 to nonadmin; GRANT EXECUTE ON native_24 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_25] as begin exec dbo.native_25 end
GO
CREATE OR ALTER procedure [dbo].[native_25]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_25 to nonadmin; GRANT EXECUTE ON native_25 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_26] as begin exec dbo.native_26 end
GO
CREATE OR ALTER procedure [dbo].[native_26]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_26 to nonadmin; GRANT EXECUTE ON native_26 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_27] as begin exec dbo.native_27 end
GO
CREATE OR ALTER procedure [dbo].[native_27]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_27 to nonadmin; GRANT EXECUTE ON native_27 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_28] as begin exec dbo.native_28 end
GO
CREATE OR ALTER procedure [dbo].[native_28]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_28 to nonadmin; GRANT EXECUTE ON native_28 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_29] as begin exec dbo.native_29 end
GO
CREATE OR ALTER procedure [dbo].[native_29]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_29 to nonadmin; GRANT EXECUTE ON native_29 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_30] as begin exec dbo.native_30 end
GO
CREATE OR ALTER procedure [dbo].[native_30]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_30 to nonadmin; GRANT EXECUTE ON native_30 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_31] as begin exec dbo.native_31 end
GO
CREATE OR ALTER procedure [dbo].[native_31]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_31 to nonadmin; GRANT EXECUTE ON native_31 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_32] as begin exec dbo.native_32 end
GO
CREATE OR ALTER procedure [dbo].[native_32]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_32 to nonadmin; GRANT EXECUTE ON native_32 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_33] as begin exec dbo.native_33 end
GO
CREATE OR ALTER procedure [dbo].[native_33]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_33 to nonadmin; GRANT EXECUTE ON native_33 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_34] as begin exec dbo.native_34 end
GO
CREATE OR ALTER procedure [dbo].[native_34]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_34 to nonadmin; GRANT EXECUTE ON native_34 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_35] as begin exec dbo.native_35 end
GO
CREATE OR ALTER procedure [dbo].[native_35]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_35 to nonadmin; GRANT EXECUTE ON native_35 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_36] as begin exec dbo.native_36 end
GO
CREATE OR ALTER procedure [dbo].[native_36]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_36 to nonadmin; GRANT EXECUTE ON native_36 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_37] as begin exec dbo.native_37 end
GO
CREATE OR ALTER procedure [dbo].[native_37]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_37 to nonadmin; GRANT EXECUTE ON native_37 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_38] as begin exec dbo.native_38 end
GO
CREATE OR ALTER procedure [dbo].[native_38]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_38 to nonadmin; GRANT EXECUTE ON native_38 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_39] as begin exec dbo.native_39 end
GO
CREATE OR ALTER procedure [dbo].[native_39]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_39 to nonadmin; GRANT EXECUTE ON native_39 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_40] as begin exec dbo.native_40 end
GO
CREATE OR ALTER procedure [dbo].[native_40]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_40 to nonadmin; GRANT EXECUTE ON native_40 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_41] as begin exec dbo.native_41 end
GO
CREATE OR ALTER procedure [dbo].[native_41]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_41 to nonadmin; GRANT EXECUTE ON native_41 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_42] as begin exec dbo.native_42 end
GO
CREATE OR ALTER procedure [dbo].[native_42]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_42 to nonadmin; GRANT EXECUTE ON native_42 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_43] as begin exec dbo.native_43 end
GO
CREATE OR ALTER procedure [dbo].[native_43]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_43 to nonadmin; GRANT EXECUTE ON native_43 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_44] as begin exec dbo.native_44 end
GO
CREATE OR ALTER procedure [dbo].[native_44]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_44 to nonadmin; GRANT EXECUTE ON native_44 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_45] as begin exec dbo.native_45 end
GO
CREATE OR ALTER procedure [dbo].[native_45]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_45 to nonadmin; GRANT EXECUTE ON native_45 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_46] as begin exec dbo.native_46 end
GO
CREATE OR ALTER procedure [dbo].[native_46]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_46 to nonadmin; GRANT EXECUTE ON native_46 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_47] as begin exec dbo.native_47 end
GO
CREATE OR ALTER procedure [dbo].[native_47]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_47 to nonadmin; GRANT EXECUTE ON native_47 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_48] as begin exec dbo.native_48 end
GO
CREATE OR ALTER procedure [dbo].[native_48]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_48 to nonadmin; GRANT EXECUTE ON native_48 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_49] as begin exec dbo.native_49 end
GO
CREATE OR ALTER procedure [dbo].[native_49]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_49 to nonadmin; GRANT EXECUTE ON native_49 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_50] as begin exec dbo.native_50 end
GO
CREATE OR ALTER procedure [dbo].[native_50]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_50 to nonadmin; GRANT EXECUTE ON native_50 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_51] as begin exec dbo.native_51 end
GO
CREATE OR ALTER procedure [dbo].[native_51]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_51 to nonadmin; GRANT EXECUTE ON native_51 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_52] as begin exec dbo.native_52 end
GO
CREATE OR ALTER procedure [dbo].[native_52]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_52 to nonadmin; GRANT EXECUTE ON native_52 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_53] as begin exec dbo.native_53 end
GO
CREATE OR ALTER procedure [dbo].[native_53]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_53 to nonadmin; GRANT EXECUTE ON native_53 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_54] as begin exec dbo.native_54 end
GO
CREATE OR ALTER procedure [dbo].[native_54]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_54 to nonadmin; GRANT EXECUTE ON native_54 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_55] as begin exec dbo.native_55 end
GO
CREATE OR ALTER procedure [dbo].[native_55]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_55 to nonadmin; GRANT EXECUTE ON native_55 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_56] as begin exec dbo.native_56 end
GO
CREATE OR ALTER procedure [dbo].[native_56]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_56 to nonadmin; GRANT EXECUTE ON native_56 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_57] as begin exec dbo.native_57 end
GO
CREATE OR ALTER procedure [dbo].[native_57]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_57 to nonadmin; GRANT EXECUTE ON native_57 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_58] as begin exec dbo.native_58 end
GO
CREATE OR ALTER procedure [dbo].[native_58]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_58 to nonadmin; GRANT EXECUTE ON native_58 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_59] as begin exec dbo.native_59 end
GO
CREATE OR ALTER procedure [dbo].[native_59]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_59 to nonadmin; GRANT EXECUTE ON native_59 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_60] as begin exec dbo.native_60 end
GO
CREATE OR ALTER procedure [dbo].[native_60]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_60 to nonadmin; GRANT EXECUTE ON native_60 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_61] as begin exec dbo.native_61 end
GO
CREATE OR ALTER procedure [dbo].[native_61]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_61 to nonadmin; GRANT EXECUTE ON native_61 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_62] as begin exec dbo.native_62 end
GO
CREATE OR ALTER procedure [dbo].[native_62]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_62 to nonadmin; GRANT EXECUTE ON native_62 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_63] as begin exec dbo.native_63 end
GO
CREATE OR ALTER procedure [dbo].[native_63]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_63 to nonadmin; GRANT EXECUTE ON native_63 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_64] as begin exec dbo.native_64 end
GO
CREATE OR ALTER procedure [dbo].[native_64]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_64 to nonadmin; GRANT EXECUTE ON native_64 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_65] as begin exec dbo.native_65 end
GO
CREATE OR ALTER procedure [dbo].[native_65]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_65 to nonadmin; GRANT EXECUTE ON native_65 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_66] as begin exec dbo.native_66 end
GO
CREATE OR ALTER procedure [dbo].[native_66]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_66 to nonadmin; GRANT EXECUTE ON native_66 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_67] as begin exec dbo.native_67 end
GO
CREATE OR ALTER procedure [dbo].[native_67]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_67 to nonadmin; GRANT EXECUTE ON native_67 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_68] as begin exec dbo.native_68 end
GO
CREATE OR ALTER procedure [dbo].[native_68]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_68 to nonadmin; GRANT EXECUTE ON native_68 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_69] as begin exec dbo.native_69 end
GO
CREATE OR ALTER procedure [dbo].[native_69]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_69 to nonadmin; GRANT EXECUTE ON native_69 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_70] as begin exec dbo.native_70 end
GO
CREATE OR ALTER procedure [dbo].[native_70]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_70 to nonadmin; GRANT EXECUTE ON native_70 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_71] as begin exec dbo.native_71 end
GO
CREATE OR ALTER procedure [dbo].[native_71]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_71 to nonadmin; GRANT EXECUTE ON native_71 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_72] as begin exec dbo.native_72 end
GO
CREATE OR ALTER procedure [dbo].[native_72]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_72 to nonadmin; GRANT EXECUTE ON native_72 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_73] as begin exec dbo.native_73 end
GO
CREATE OR ALTER procedure [dbo].[native_73]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_73 to nonadmin; GRANT EXECUTE ON native_73 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_74] as begin exec dbo.native_74 end
GO
CREATE OR ALTER procedure [dbo].[native_74]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_74 to nonadmin; GRANT EXECUTE ON native_74 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_75] as begin exec dbo.native_75 end
GO
CREATE OR ALTER procedure [dbo].[native_75]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_75 to nonadmin; GRANT EXECUTE ON native_75 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_76] as begin exec dbo.native_76 end
GO
CREATE OR ALTER procedure [dbo].[native_76]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_76 to nonadmin; GRANT EXECUTE ON native_76 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_77] as begin exec dbo.native_77 end
GO
CREATE OR ALTER procedure [dbo].[native_77]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_77 to nonadmin; GRANT EXECUTE ON native_77 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_78] as begin exec dbo.native_78 end
GO
CREATE OR ALTER procedure [dbo].[native_78]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_78 to nonadmin; GRANT EXECUTE ON native_78 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_79] as begin exec dbo.native_79 end
GO
CREATE OR ALTER procedure [dbo].[native_79]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_79 to nonadmin; GRANT EXECUTE ON native_79 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_80] as begin exec dbo.native_80 end
GO
CREATE OR ALTER procedure [dbo].[native_80]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_80 to nonadmin; GRANT EXECUTE ON native_80 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_81] as begin exec dbo.native_81 end
GO
CREATE OR ALTER procedure [dbo].[native_81]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_81 to nonadmin; GRANT EXECUTE ON native_81 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_82] as begin exec dbo.native_82 end
GO
CREATE OR ALTER procedure [dbo].[native_82]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_82 to nonadmin; GRANT EXECUTE ON native_82 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_83] as begin exec dbo.native_83 end
GO
CREATE OR ALTER procedure [dbo].[native_83]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_83 to nonadmin; GRANT EXECUTE ON native_83 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_84] as begin exec dbo.native_84 end
GO
CREATE OR ALTER procedure [dbo].[native_84]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_84 to nonadmin; GRANT EXECUTE ON native_84 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_85] as begin exec dbo.native_85 end
GO
CREATE OR ALTER procedure [dbo].[native_85]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_85 to nonadmin; GRANT EXECUTE ON native_85 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_86] as begin exec dbo.native_86 end
GO
CREATE OR ALTER procedure [dbo].[native_86]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_86 to nonadmin; GRANT EXECUTE ON native_86 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_87] as begin exec dbo.native_87 end
GO
CREATE OR ALTER procedure [dbo].[native_87]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_87 to nonadmin; GRANT EXECUTE ON native_87 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_88] as begin exec dbo.native_88 end
GO
CREATE OR ALTER procedure [dbo].[native_88]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_88 to nonadmin; GRANT EXECUTE ON native_88 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_89] as begin exec dbo.native_89 end
GO
CREATE OR ALTER procedure [dbo].[native_89]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_89 to nonadmin; GRANT EXECUTE ON native_89 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_90] as begin exec dbo.native_90 end
GO
CREATE OR ALTER procedure [dbo].[native_90]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_90 to nonadmin; GRANT EXECUTE ON native_90 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_91] as begin exec dbo.native_91 end
GO
CREATE OR ALTER procedure [dbo].[native_91]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_91 to nonadmin; GRANT EXECUTE ON native_91 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_92] as begin exec dbo.native_92 end
GO
CREATE OR ALTER procedure [dbo].[native_92]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_92 to nonadmin; GRANT EXECUTE ON native_92 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_93] as begin exec dbo.native_93 end
GO
CREATE OR ALTER procedure [dbo].[native_93]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_93 to nonadmin; GRANT EXECUTE ON native_93 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_94] as begin exec dbo.native_94 end
GO
CREATE OR ALTER procedure [dbo].[native_94]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_94 to nonadmin; GRANT EXECUTE ON native_94 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_95] as begin exec dbo.native_95 end
GO
CREATE OR ALTER procedure [dbo].[native_95]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_95 to nonadmin; GRANT EXECUTE ON native_95 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_96] as begin exec dbo.native_96 end
GO
CREATE OR ALTER procedure [dbo].[native_96]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_96 to nonadmin; GRANT EXECUTE ON native_96 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_97] as begin exec dbo.native_97 end
GO
CREATE OR ALTER procedure [dbo].[native_97]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_97 to nonadmin; GRANT EXECUTE ON native_97 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_98] as begin exec dbo.native_98 end
GO
CREATE OR ALTER procedure [dbo].[native_98]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_98 to nonadmin; GRANT EXECUTE ON native_98 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_99] as begin exec dbo.native_99 end
GO
CREATE OR ALTER procedure [dbo].[native_99]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_99 to nonadmin; GRANT EXECUTE ON native_99 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_100] as begin exec dbo.native_100 end
GO
CREATE OR ALTER procedure [dbo].[native_100]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_100 to nonadmin; GRANT EXECUTE ON native_100 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_101] as begin exec dbo.native_101 end
GO
CREATE OR ALTER procedure [dbo].[native_101]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_101 to nonadmin; GRANT EXECUTE ON native_101 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_102] as begin exec dbo.native_102 end
GO
CREATE OR ALTER procedure [dbo].[native_102]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_102 to nonadmin; GRANT EXECUTE ON native_102 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_103] as begin exec dbo.native_103 end
GO
CREATE OR ALTER procedure [dbo].[native_103]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_103 to nonadmin; GRANT EXECUTE ON native_103 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_104] as begin exec dbo.native_104 end
GO
CREATE OR ALTER procedure [dbo].[native_104]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_104 to nonadmin; GRANT EXECUTE ON native_104 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_105] as begin exec dbo.native_105 end
GO
CREATE OR ALTER procedure [dbo].[native_105]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_105 to nonadmin; GRANT EXECUTE ON native_105 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_106] as begin exec dbo.native_106 end
GO
CREATE OR ALTER procedure [dbo].[native_106]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_106 to nonadmin; GRANT EXECUTE ON native_106 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_107] as begin exec dbo.native_107 end
GO
CREATE OR ALTER procedure [dbo].[native_107]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_107 to nonadmin; GRANT EXECUTE ON native_107 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_108] as begin exec dbo.native_108 end
GO
CREATE OR ALTER procedure [dbo].[native_108]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_108 to nonadmin; GRANT EXECUTE ON native_108 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_109] as begin exec dbo.native_109 end
GO
CREATE OR ALTER procedure [dbo].[native_109]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_109 to nonadmin; GRANT EXECUTE ON native_109 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_110] as begin exec dbo.native_110 end
GO
CREATE OR ALTER procedure [dbo].[native_110]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_110 to nonadmin; GRANT EXECUTE ON native_110 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_111] as begin exec dbo.native_111 end
GO
CREATE OR ALTER procedure [dbo].[native_111]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_111 to nonadmin; GRANT EXECUTE ON native_111 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_112] as begin exec dbo.native_112 end
GO
CREATE OR ALTER procedure [dbo].[native_112]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_112 to nonadmin; GRANT EXECUTE ON native_112 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_113] as begin exec dbo.native_113 end
GO
CREATE OR ALTER procedure [dbo].[native_113]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_113 to nonadmin; GRANT EXECUTE ON native_113 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_114] as begin exec dbo.native_114 end
GO
CREATE OR ALTER procedure [dbo].[native_114]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_114 to nonadmin; GRANT EXECUTE ON native_114 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_115] as begin exec dbo.native_115 end
GO
CREATE OR ALTER procedure [dbo].[native_115]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_115 to nonadmin; GRANT EXECUTE ON native_115 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_116] as begin exec dbo.native_116 end
GO
CREATE OR ALTER procedure [dbo].[native_116]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_116 to nonadmin; GRANT EXECUTE ON native_116 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_117] as begin exec dbo.native_117 end
GO
CREATE OR ALTER procedure [dbo].[native_117]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_117 to nonadmin; GRANT EXECUTE ON native_117 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_118] as begin exec dbo.native_118 end
GO
CREATE OR ALTER procedure [dbo].[native_118]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_118 to nonadmin; GRANT EXECUTE ON native_118 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_119] as begin exec dbo.native_119 end
GO
CREATE OR ALTER procedure [dbo].[native_119]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_119 to nonadmin; GRANT EXECUTE ON native_119 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_120] as begin exec dbo.native_120 end
GO
CREATE OR ALTER procedure [dbo].[native_120]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_120 to nonadmin; GRANT EXECUTE ON native_120 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_121] as begin exec dbo.native_121 end
GO
CREATE OR ALTER procedure [dbo].[native_121]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_121 to nonadmin; GRANT EXECUTE ON native_121 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_122] as begin exec dbo.native_122 end
GO
CREATE OR ALTER procedure [dbo].[native_122]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_122 to nonadmin; GRANT EXECUTE ON native_122 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_123] as begin exec dbo.native_123 end
GO
CREATE OR ALTER procedure [dbo].[native_123]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_123 to nonadmin; GRANT EXECUTE ON native_123 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_124] as begin exec dbo.native_124 end
GO
CREATE OR ALTER procedure [dbo].[native_124]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_124 to nonadmin; GRANT EXECUTE ON native_124 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_125] as begin exec dbo.native_125 end
GO
CREATE OR ALTER procedure [dbo].[native_125]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_125 to nonadmin; GRANT EXECUTE ON native_125 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_126] as begin exec dbo.native_126 end
GO
CREATE OR ALTER procedure [dbo].[native_126]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_126 to nonadmin; GRANT EXECUTE ON native_126 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_127] as begin exec dbo.native_127 end
GO
CREATE OR ALTER procedure [dbo].[native_127]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_127 to nonadmin; GRANT EXECUTE ON native_127 to nonadmin;
GO
create or ALTER procedure [dbo].[interop_128] as begin exec dbo.native_128 end
GO
CREATE OR ALTER procedure [dbo].[native_128]
with native_compilation, schemabinding, execute as owner
as
begin atomic
with (transaction isolation level=snapshot, language=N'us_english')
declare @i bigint
insert dbo.memopt default values
select @i = scope_identity()
delete dbo.memopt where id = @i
end
GO
GRANT EXECUTE ON interop_128 to nonadmin; GRANT EXECUTE ON native_128 to nonadmin;
GO
/*
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.
This sample code is not supported under any Microsoft standard support program or service.
The entire risk arising out of the use or performance of the sample scripts and documentation remains with you.
In no event shall Microsoft, its authors, or anyone else involved in the creation, production, or delivery of the scripts
be liable for any damages whatsoever (including, without limitation, damages for loss of business profits,
business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability
to use the sample scripts or documentation, even if Microsoft has been advised of the possibility of such damages.
*/ | the_stack |
-- MySQL dump 10.13 Distrib 8.0.26, for Linux (x86_64)
--
-- Host: localhost Database: mysql_innodb_cluster_metadata
-- ------------------------------------------------------
-- Server version 8.0.26-commercial
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!50503 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Current Database: `mysql_innodb_cluster_metadata`
--
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysql_innodb_cluster_metadata` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;
USE `mysql_innodb_cluster_metadata`;
--
-- Table structure for table `async_cluster_members`
--
DROP TABLE IF EXISTS `async_cluster_members`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `async_cluster_members` (
`cluster_id` char(36) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL,
`view_id` int unsigned NOT NULL,
`instance_id` int unsigned NOT NULL,
`master_instance_id` int unsigned DEFAULT NULL,
`primary_master` tinyint(1) NOT NULL,
`attributes` json NOT NULL,
PRIMARY KEY (`cluster_id`,`view_id`,`instance_id`),
KEY `view_id` (`view_id`),
KEY `instance_id` (`instance_id`),
CONSTRAINT `async_cluster_members_ibfk_1` FOREIGN KEY (`cluster_id`, `view_id`) REFERENCES `async_cluster_views` (`cluster_id`, `view_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `async_cluster_members`
--
LOCK TABLES `async_cluster_members` WRITE;
/*!40000 ALTER TABLE `async_cluster_members` DISABLE KEYS */;
/*!40000 ALTER TABLE `async_cluster_members` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `async_cluster_views`
--
DROP TABLE IF EXISTS `async_cluster_views`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `async_cluster_views` (
`cluster_id` char(36) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL,
`view_id` int unsigned NOT NULL,
`topology_type` enum('SINGLE-PRIMARY-TREE') DEFAULT NULL,
`view_change_reason` varchar(32) NOT NULL,
`view_change_time` timestamp(6) NOT NULL,
`view_change_info` json NOT NULL,
`attributes` json NOT NULL,
PRIMARY KEY (`cluster_id`,`view_id`),
KEY `view_id` (`view_id`),
CONSTRAINT `async_cluster_views_ibfk_1` FOREIGN KEY (`cluster_id`) REFERENCES `clusters` (`cluster_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `async_cluster_views`
--
LOCK TABLES `async_cluster_views` WRITE;
/*!40000 ALTER TABLE `async_cluster_views` DISABLE KEYS */;
/*!40000 ALTER TABLE `async_cluster_views` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `clusters`
--
DROP TABLE IF EXISTS `clusters`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `clusters` (
`cluster_id` char(36) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL,
`cluster_name` varchar(40) NOT NULL,
`description` text,
`options` json DEFAULT NULL,
`attributes` json DEFAULT NULL,
`cluster_type` enum('gr','ar') NOT NULL,
`primary_mode` enum('pm','mm') NOT NULL DEFAULT 'pm',
`router_options` json DEFAULT NULL,
PRIMARY KEY (`cluster_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `clusters`
--
LOCK TABLES `clusters` WRITE;
/*!40000 ALTER TABLE `clusters` DISABLE KEYS */;
INSERT INTO `clusters` VALUES ('__cluster_id__','sample','Default Cluster',NULL,'{\"adopted\": 0, \"default\": true, \"opt_gtidSetIsComplete\": false, \"opt_manualStartOnBoot\": false, \"group_replication_group_name\": \"__replication_group_uuid__\"}','gr','pm',NULL);
/*!40000 ALTER TABLE `clusters` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `instances`
--
DROP TABLE IF EXISTS `instances`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `instances` (
`instance_id` int unsigned NOT NULL AUTO_INCREMENT,
`cluster_id` char(36) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL,
`address` varchar(265) CHARACTER SET ascii COLLATE ascii_general_ci DEFAULT NULL,
`mysql_server_uuid` char(36) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL,
`instance_name` varchar(265) NOT NULL,
`addresses` json NOT NULL,
`attributes` json DEFAULT NULL,
`description` text,
PRIMARY KEY (`instance_id`,`cluster_id`),
KEY `cluster_id` (`cluster_id`),
CONSTRAINT `instances_ibfk_1` FOREIGN KEY (`cluster_id`) REFERENCES `clusters` (`cluster_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `instances`
--
LOCK TABLES `instances` WRITE;
/*!40000 ALTER TABLE `instances` DISABLE KEYS */;
INSERT INTO `instances` VALUES __instances__;
/*!40000 ALTER TABLE `instances` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `router_rest_accounts`
--
DROP TABLE IF EXISTS `router_rest_accounts`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `router_rest_accounts` (
`cluster_id` char(36) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL,
`user` varchar(256) NOT NULL,
`authentication_method` varchar(64) NOT NULL DEFAULT 'modular_crypt_format',
`authentication_string` text CHARACTER SET ascii COLLATE ascii_general_ci,
`description` varchar(255) DEFAULT NULL,
`privileges` json DEFAULT NULL,
`attributes` json DEFAULT NULL,
PRIMARY KEY (`cluster_id`,`user`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `router_rest_accounts`
--
LOCK TABLES `router_rest_accounts` WRITE;
/*!40000 ALTER TABLE `router_rest_accounts` DISABLE KEYS */;
/*!40000 ALTER TABLE `router_rest_accounts` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `routers`
--
DROP TABLE IF EXISTS `routers`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `routers` (
`router_id` int unsigned NOT NULL AUTO_INCREMENT,
`router_name` varchar(265) NOT NULL,
`product_name` varchar(128) NOT NULL,
`address` varchar(256) CHARACTER SET ascii COLLATE ascii_general_ci DEFAULT NULL,
`version` varchar(12) DEFAULT NULL,
`last_check_in` timestamp NULL DEFAULT NULL,
`attributes` json DEFAULT NULL,
`cluster_id` char(36) CHARACTER SET ascii COLLATE ascii_general_ci DEFAULT NULL,
`options` json DEFAULT NULL,
PRIMARY KEY (`router_id`),
UNIQUE KEY `address` (`address`,`router_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `routers`
--
LOCK TABLES `routers` WRITE;
/*!40000 ALTER TABLE `routers` DISABLE KEYS */;
/*!40000 ALTER TABLE `routers` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Temporary view structure for view `schema_version`
--
DROP TABLE IF EXISTS `schema_version`;
/*!50001 DROP VIEW IF EXISTS `schema_version`*/;
SET @saved_cs_client = @@character_set_client;
/*!50503 SET character_set_client = utf8mb4 */;
/*!50001 CREATE VIEW `schema_version` AS SELECT
1 AS `major`,
1 AS `minor`,
1 AS `patch`*/;
SET character_set_client = @saved_cs_client;
--
-- Temporary view structure for view `v2_ar_clusters`
--
DROP TABLE IF EXISTS `v2_ar_clusters`;
/*!50001 DROP VIEW IF EXISTS `v2_ar_clusters`*/;
SET @saved_cs_client = @@character_set_client;
/*!50503 SET character_set_client = utf8mb4 */;
/*!50001 CREATE VIEW `v2_ar_clusters` AS SELECT
1 AS `view_id`,
1 AS `cluster_type`,
1 AS `primary_mode`,
1 AS `async_topology_type`,
1 AS `cluster_id`,
1 AS `cluster_name`,
1 AS `attributes`,
1 AS `options`,
1 AS `router_options`,
1 AS `description`*/;
SET character_set_client = @saved_cs_client;
--
-- Temporary view structure for view `v2_ar_members`
--
DROP TABLE IF EXISTS `v2_ar_members`;
/*!50001 DROP VIEW IF EXISTS `v2_ar_members`*/;
SET @saved_cs_client = @@character_set_client;
/*!50503 SET character_set_client = utf8mb4 */;
/*!50001 CREATE VIEW `v2_ar_members` AS SELECT
1 AS `view_id`,
1 AS `cluster_id`,
1 AS `instance_id`,
1 AS `label`,
1 AS `member_id`,
1 AS `member_role`,
1 AS `master_instance_id`,
1 AS `master_member_id`*/;
SET character_set_client = @saved_cs_client;
--
-- Temporary view structure for view `v2_clusters`
--
DROP TABLE IF EXISTS `v2_clusters`;
/*!50001 DROP VIEW IF EXISTS `v2_clusters`*/;
SET @saved_cs_client = @@character_set_client;
/*!50503 SET character_set_client = utf8mb4 */;
/*!50001 CREATE VIEW `v2_clusters` AS SELECT
1 AS `cluster_type`,
1 AS `primary_mode`,
1 AS `cluster_id`,
1 AS `cluster_name`,
1 AS `router_options`*/;
SET character_set_client = @saved_cs_client;
--
-- Temporary view structure for view `v2_gr_clusters`
--
DROP TABLE IF EXISTS `v2_gr_clusters`;
/*!50001 DROP VIEW IF EXISTS `v2_gr_clusters`*/;
SET @saved_cs_client = @@character_set_client;
/*!50503 SET character_set_client = utf8mb4 */;
/*!50001 CREATE VIEW `v2_gr_clusters` AS SELECT
1 AS `cluster_type`,
1 AS `primary_mode`,
1 AS `cluster_id`,
1 AS `cluster_name`,
1 AS `group_name`,
1 AS `attributes`,
1 AS `options`,
1 AS `router_options`,
1 AS `description`,
1 AS `replicated_cluster_id`*/;
SET character_set_client = @saved_cs_client;
--
-- Temporary view structure for view `v2_instances`
--
DROP TABLE IF EXISTS `v2_instances`;
/*!50001 DROP VIEW IF EXISTS `v2_instances`*/;
SET @saved_cs_client = @@character_set_client;
/*!50503 SET character_set_client = utf8mb4 */;
/*!50001 CREATE VIEW `v2_instances` AS SELECT
1 AS `instance_id`,
1 AS `cluster_id`,
1 AS `label`,
1 AS `mysql_server_uuid`,
1 AS `address`,
1 AS `endpoint`,
1 AS `xendpoint`,
1 AS `attributes`*/;
SET character_set_client = @saved_cs_client;
--
-- Temporary view structure for view `v2_router_rest_accounts`
--
DROP TABLE IF EXISTS `v2_router_rest_accounts`;
/*!50001 DROP VIEW IF EXISTS `v2_router_rest_accounts`*/;
SET @saved_cs_client = @@character_set_client;
/*!50503 SET character_set_client = utf8mb4 */;
/*!50001 CREATE VIEW `v2_router_rest_accounts` AS SELECT
1 AS `cluster_id`,
1 AS `user`,
1 AS `authentication_method`,
1 AS `authentication_string`,
1 AS `description`,
1 AS `privileges`,
1 AS `attributes`*/;
SET character_set_client = @saved_cs_client;
--
-- Temporary view structure for view `v2_routers`
--
DROP TABLE IF EXISTS `v2_routers`;
/*!50001 DROP VIEW IF EXISTS `v2_routers`*/;
SET @saved_cs_client = @@character_set_client;
/*!50503 SET character_set_client = utf8mb4 */;
/*!50001 CREATE VIEW `v2_routers` AS SELECT
1 AS `router_id`,
1 AS `cluster_id`,
1 AS `router_name`,
1 AS `product_name`,
1 AS `address`,
1 AS `version`,
1 AS `last_check_in`,
1 AS `attributes`,
1 AS `options`*/;
SET character_set_client = @saved_cs_client;
--
-- Temporary view structure for view `v2_this_instance`
--
DROP TABLE IF EXISTS `v2_this_instance`;
/*!50001 DROP VIEW IF EXISTS `v2_this_instance`*/;
SET @saved_cs_client = @@character_set_client;
/*!50503 SET character_set_client = utf8mb4 */;
/*!50001 CREATE VIEW `v2_this_instance` AS SELECT
1 AS `cluster_id`,
1 AS `instance_id`,
1 AS `cluster_name`,
1 AS `cluster_type`*/;
SET character_set_client = @saved_cs_client;
--
-- Current Database: `mysql_innodb_cluster_metadata`
--
USE `mysql_innodb_cluster_metadata`;
--
-- Final view structure for view `schema_version`
--
/*!50001 DROP VIEW IF EXISTS `schema_version`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
/*!50001 SET @saved_col_connection = @@collation_connection */;
/*!50001 SET character_set_client = utf8mb4 */;
/*!50001 SET character_set_results = utf8mb4 */;
/*!50001 SET collation_connection = utf8mb4_0900_ai_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `schema_version` (`major`,`minor`,`patch`) AS select 2 AS `2`,0 AS `0`,0 AS `0` */;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
--
-- Final view structure for view `v2_ar_clusters`
--
/*!50001 DROP VIEW IF EXISTS `v2_ar_clusters`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
/*!50001 SET @saved_col_connection = @@collation_connection */;
/*!50001 SET character_set_client = utf8mb4 */;
/*!50001 SET character_set_results = utf8mb4 */;
/*!50001 SET collation_connection = utf8mb4_0900_ai_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `v2_ar_clusters` AS select `acv`.`view_id` AS `view_id`,`c`.`cluster_type` AS `cluster_type`,`c`.`primary_mode` AS `primary_mode`,`acv`.`topology_type` AS `async_topology_type`,`c`.`cluster_id` AS `cluster_id`,`c`.`cluster_name` AS `cluster_name`,`c`.`attributes` AS `attributes`,`c`.`options` AS `options`,`c`.`router_options` AS `router_options`,`c`.`description` AS `description` from (`clusters` `c` join `async_cluster_views` `acv` on((`c`.`cluster_id` = `acv`.`cluster_id`))) where ((`acv`.`view_id` = (select max(`async_cluster_views`.`view_id`) from `async_cluster_views` where (`c`.`cluster_id` = `async_cluster_views`.`cluster_id`))) and (`c`.`cluster_type` = 'ar')) */;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
--
-- Final view structure for view `v2_ar_members`
--
/*!50001 DROP VIEW IF EXISTS `v2_ar_members`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
/*!50001 SET @saved_col_connection = @@collation_connection */;
/*!50001 SET character_set_client = utf8mb4 */;
/*!50001 SET character_set_results = utf8mb4 */;
/*!50001 SET collation_connection = utf8mb4_0900_ai_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `v2_ar_members` AS select `acm`.`view_id` AS `view_id`,`i`.`cluster_id` AS `cluster_id`,`i`.`instance_id` AS `instance_id`,`i`.`instance_name` AS `label`,`i`.`mysql_server_uuid` AS `member_id`,if(`acm`.`primary_master`,'PRIMARY','SECONDARY') AS `member_role`,`acm`.`master_instance_id` AS `master_instance_id`,`mi`.`mysql_server_uuid` AS `master_member_id` from ((`instances` `i` left join `async_cluster_members` `acm` on(((`acm`.`cluster_id` = `i`.`cluster_id`) and (`acm`.`instance_id` = `i`.`instance_id`)))) left join `instances` `mi` on((`mi`.`instance_id` = `acm`.`master_instance_id`))) where (`acm`.`view_id` = (select max(`async_cluster_views`.`view_id`) from `async_cluster_views` where (`i`.`cluster_id` = `async_cluster_views`.`cluster_id`))) */;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
--
-- Final view structure for view `v2_clusters`
--
/*!50001 DROP VIEW IF EXISTS `v2_clusters`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
/*!50001 SET @saved_col_connection = @@collation_connection */;
/*!50001 SET character_set_client = utf8mb4 */;
/*!50001 SET character_set_results = utf8mb4 */;
/*!50001 SET collation_connection = utf8mb4_0900_ai_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `v2_clusters` AS select `c`.`cluster_type` AS `cluster_type`,`c`.`primary_mode` AS `primary_mode`,`c`.`cluster_id` AS `cluster_id`,`c`.`cluster_name` AS `cluster_name`,`c`.`router_options` AS `router_options` from `clusters` `c` */;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
--
-- Final view structure for view `v2_gr_clusters`
--
/*!50001 DROP VIEW IF EXISTS `v2_gr_clusters`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
/*!50001 SET @saved_col_connection = @@collation_connection */;
/*!50001 SET character_set_client = utf8mb4 */;
/*!50001 SET character_set_results = utf8mb4 */;
/*!50001 SET collation_connection = utf8mb4_0900_ai_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `v2_gr_clusters` AS select `c`.`cluster_type` AS `cluster_type`,`c`.`primary_mode` AS `primary_mode`,`c`.`cluster_id` AS `cluster_id`,`c`.`cluster_name` AS `cluster_name`,json_unquote(json_extract(`c`.`attributes`,'$.group_replication_group_name')) AS `group_name`,`c`.`attributes` AS `attributes`,`c`.`options` AS `options`,`c`.`router_options` AS `router_options`,`c`.`description` AS `description`,NULL AS `replicated_cluster_id` from `clusters` `c` where (`c`.`cluster_type` = 'gr') */;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
--
-- Final view structure for view `v2_instances`
--
/*!50001 DROP VIEW IF EXISTS `v2_instances`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
/*!50001 SET @saved_col_connection = @@collation_connection */;
/*!50001 SET character_set_client = utf8mb4 */;
/*!50001 SET character_set_results = utf8mb4 */;
/*!50001 SET collation_connection = utf8mb4_0900_ai_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `v2_instances` AS select `i`.`instance_id` AS `instance_id`,`i`.`cluster_id` AS `cluster_id`,`i`.`instance_name` AS `label`,`i`.`mysql_server_uuid` AS `mysql_server_uuid`,`i`.`address` AS `address`,json_unquote(json_extract(`i`.`addresses`,'$.mysqlClassic')) AS `endpoint`,json_unquote(json_extract(`i`.`addresses`,'$.mysqlX')) AS `xendpoint`,`i`.`attributes` AS `attributes` from `instances` `i` */;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
--
-- Final view structure for view `v2_router_rest_accounts`
--
/*!50001 DROP VIEW IF EXISTS `v2_router_rest_accounts`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
/*!50001 SET @saved_col_connection = @@collation_connection */;
/*!50001 SET character_set_client = utf8mb4 */;
/*!50001 SET character_set_results = utf8mb4 */;
/*!50001 SET collation_connection = utf8mb4_0900_ai_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `v2_router_rest_accounts` AS select `a`.`cluster_id` AS `cluster_id`,`a`.`user` AS `user`,`a`.`authentication_method` AS `authentication_method`,`a`.`authentication_string` AS `authentication_string`,`a`.`description` AS `description`,`a`.`privileges` AS `privileges`,`a`.`attributes` AS `attributes` from `router_rest_accounts` `a` */;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
--
-- Final view structure for view `v2_routers`
--
/*!50001 DROP VIEW IF EXISTS `v2_routers`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
/*!50001 SET @saved_col_connection = @@collation_connection */;
/*!50001 SET character_set_client = utf8mb4 */;
/*!50001 SET character_set_results = utf8mb4 */;
/*!50001 SET collation_connection = utf8mb4_0900_ai_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `v2_routers` AS select `r`.`router_id` AS `router_id`,`r`.`cluster_id` AS `cluster_id`,`r`.`router_name` AS `router_name`,`r`.`product_name` AS `product_name`,`r`.`address` AS `address`,`r`.`version` AS `version`,`r`.`last_check_in` AS `last_check_in`,`r`.`attributes` AS `attributes`,`r`.`options` AS `options` from `routers` `r` */;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
--
-- Final view structure for view `v2_this_instance`
--
/*!50001 DROP VIEW IF EXISTS `v2_this_instance`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
/*!50001 SET @saved_col_connection = @@collation_connection */;
/*!50001 SET character_set_client = utf8mb4 */;
/*!50001 SET character_set_results = utf8mb4 */;
/*!50001 SET collation_connection = utf8mb4_0900_ai_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `v2_this_instance` AS select `i`.`cluster_id` AS `cluster_id`,`i`.`instance_id` AS `instance_id`,`c`.`cluster_name` AS `cluster_name`,`c`.`cluster_type` AS `cluster_type` from (`v2_instances` `i` join `clusters` `c` on((`i`.`cluster_id` = `c`.`cluster_id`))) where (`i`.`mysql_server_uuid` = (select convert(`performance_schema`.`global_variables`.`VARIABLE_VALUE` using ascii) from `performance_schema`.`global_variables` where (`performance_schema`.`global_variables`.`VARIABLE_NAME` = 'server_uuid'))) */;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
/*!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 2021-07-01 15:26:05 | the_stack |
--
--prepared execute bypass
--
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';
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);
prepare p11 as insert into test_bypass_sq1 values($1,$2,$3);
prepare p12 as insert into test_bypass_sq1(col1,col2) values ($1,$2);
--bypass
explain execute p11(0,0,'test_insert');
execute p11(0,0,'test_insert');
execute p11(1,1,'test_insert');
execute p11(-1,-1,'test_insert2');
execute p11(2,2,'test_insert2');
execute p11(3,3,'test_insert3');
execute p11(0,0,'test_insert3');
explain execute p12(1,1);
execute p12(1,1);
execute p12(2,2);
execute p12(0,0);
execute p11(null,null,null);
--bypass
prepare p13 as select * from test_bypass_sq1 where col1=$1 and col2=$2;
explain execute p13(0,0);
execute p13(0,0);
prepare p13 as select col1,col2 from test_bypass_sq1 where col1=$1 and col2=$2;
--bypass through index only scan
explain execute p13(0,0);
execute p13(0,0);
set enable_indexonlyscan=off;
execute p13(0,0);
reset enable_indexonlyscan;
--not bypass (distribute key)
--prepare p14 as update test_bypass_sq1 set col1=col1+$4,col2=$5,col3=$3 where col1=$1 and col2=$2;
--execute p14 (0,0,'test_update',3,-1);
--bypass
prepare p15 as update test_bypass_sq1 set col2=col2+$4,col3=$3 where col1=$1 and col2=$2;
execute p15 (0,0,'test_update',-1);
--bypass
prepare p16 as update test_bypass_sq1 set col2=mod($1,$2) where col1=$3 and col2=$4;
execute p16(5,3,1,1);
--bypass / set enable_bitmapscan=off;
prepare p101 as update test_bypass_sq1 set col2=$1,col3=$2 where col1=$3 ;
execute p101 (111,'test_update2',-1);
prepare p102 as select * from test_bypass_sq1 where col1=$1;
execute p102 (1);
prepare p1011 as insert into test_bypass_sq1 values(-3,-3,'test_pbe');
prepare p1013 as update test_bypass_sq1 set col2=10 where col1=-3;
prepare p1012 as select * from test_bypass_sq1 where col1=-3;
prepare p1014 as select * from test_bypass_sq1 where col1=-3 for update;
prepare p1015 as delete from test_bypass_sq1 where col1=-3;
explain execute p1011;
execute p1011;
explain execute p1012;
execute p1012;
explain execute p1013;
execute p1013;
explain execute p1014;
execute p1014;
--bypass through index only scan
prepare p10141 as select col1,col2 from test_bypass_sq1 where col1=-3 for update;
execute p10141;
execute p1015;
prepare p1020 as select * from test_bypass_sq1 where col1>0 order by col1 limit 1;
execute p1020;
prepare p1021 as select * from test_bypass_sq1 where col1=$1 limit 1;
execute p1021(1);
--bypass through index only scan
prepare p10200 as select col1,col2 from test_bypass_sq1 where col1>0 order by col1 limit 1;
explain execute p10200;
execute p10200;
prepare p10211 as select col1,col2 from test_bypass_sq1 where col1=$1 limit 1;
explain execute p10211(1);
execute p10211(1);
prepare p10212 as select col1,col2 from test_bypass_sq1 where col1=$1 offset 1;
explain execute p10212(1);
execute p10212(1);
prepare p10213 as select col1,col2 from test_bypass_sq1 where col1=$1 limit 1 offset null;
explain execute p10213(1);
execute p10213(1);
prepare p10214 as select col1,col2 from test_bypass_sq1 where col1=$1 limit null offset null;
explain execute p10214(1);
execute p10214(1);
--not bypass
prepare p1022 as select * from test_bypass_sq1 where col1=$1 limit $2;
explain execute p1022(0,3);
explain execute p1022(0,null);
prepare p1023 as select * from test_bypass_sq1 where col1=$1 limit $2 offset $3;
explain execute p1023(0,3,2);
--bypass
prepare p1024 as select * from test_bypass_sq1 where col1=0 order by col1 for update limit 1;
prepare p1025 as select * from test_bypass_sq1 where col1=$1 for update limit 1;
execute p1024;
execute p1025(1);
--not bypass
prepare p1026 as select * from test_bypass_sq1 where col1=$1 for update limit $2;
prepare p1027 as select * from test_bypass_sq1 where col1=$1 for update limit $2 offset $3;
explain execute p1026(0,3);
execute p1026(0,3);
explain execute p1027(0,3,2);
execute p1027(0,3,2);
--bypass
prepare p103 as select col1,col2 from test_bypass_sq1 where col2=$1 order by col1;
execute p103 (2);
prepare p104 as select * from test_bypass_sq1 where col1=$1 order by col1;
execute p104 (3);
prepare p105 as select col1,col2 from test_bypass_sq1 where col2<$1 order by col1;
execute p105 (5);
prepare p1051 as select col1,col2 from test_bypass_sq1 where col2<$1 order by col1 limit 3;
execute p1051(5);
prepare p1052 as select col1,col2 from test_bypass_sq1 where col1=$1 order by col1 for update limit 2;
execute p1052(2);
prepare p106 as select col1,col2 from test_bypass_sq1 where col1>$1 and col2>$2 order by col1;
explain execute p106 (0,1);
execute p106 (0,1);
prepare p1061 as select col1,col2 from test_bypass_sq1 where col1 is not null and col2 is not null order by col1;
explain execute p1061;
execute p1061;
prepare p1062 as select col1,col2 from test_bypass_sq1 where col1 is not null and col2 < $1 order by col1;
execute p1062 (3);
--bypass through index only scan
prepare p10601 as select col1,col2 from test_bypass_sq1 where col1>$1 and col2>$2 order by col1;
execute p10601 (0,1);
--bypass
prepare p17 as select * from test_bypass_sq1 where col1=$1 and col2=$2 for update;
execute p17 (3,3);
--bypass (?)
prepare p18 as update test_bypass_sq1 set col2=$1*$2 where col1=$3 and col2=$4;
explain execute p18(3,7,3,3);
execute p18(3,7,3,3);
prepare p181 as update test_bypass_sq1 set col2= $1 where col1 is null;
explain execute p181(111);
execute p181(111);
--bypass
prepare p19 as delete from test_bypass_sq1 where col1=$1 and col2=$2;
execute p19 (0,-1);
execute p11(null,null,'test_null');
prepare p191 as select * from test_bypass_sq1 where col1 is null and col2 is null;
prepare p192 as delete from test_bypass_sq1 where col1 is null and col2 is null;
execute p191;
execute p192;
--bypass (order by is supported when ordered col is in index)
prepare p111 as select col1,col2 from test_bypass_sq1 order by col1 desc;
execute p111;
prepare p112 as select col1,col2 from test_bypass_sq1 order by col1;
execute p112;
--bypass through index only scan
prepare p11301 as select col1,col2 from test_bypass_sq1 where col1 = $1 order by col1,col2 desc;
explain execute p11301 (2);
prepare p11401 as select col1,col2 from test_bypass_sq1 where col1 = $1 order by col1,col2;
explain execute p11401 (2);
set enable_indexonlyscan=off;
explain execute p11301 (2);
explain execute p11401 (2);
reset enable_indexonlyscan;
--not bypass
prepare p115 as select * from test_bypass_sq1 order by col2 desc;
explain execute p115;
prepare p116 as select * from test_bypass_sq1 order by col2;
explain execute p116;
-- bypass
prepare p117 as select col1, col2 from test_bypass_sq1 where true order by col1;
prepare p118 as select col2, col1 from test_bypass_sq1 order by col1;
prepare p119 as select col1, col2 from test_bypass_sq1 order by col1 desc;
execute p117;
execute p118;
execute p119;
prepare p120 as insert into test_bypass_sq1 select * from test_bypass_sq1 where col1>$1;
execute p120 (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
prepare p21 as insert into test_bypass_sq2(col1) values ($1);
execute p21(0);
--error
execute p21(null);
--bypass
prepare p22 as insert into test_bypass_sq2(col1,col2) values ($1,$2);
explain execute p22(1,null);
execute p22(1,null);
execute p22(3,3);
execute p22(-1,-1);
execute p22(1,1);
execute p22(2,2);
execute p22(3,3);
--bypass
prepare p24 as update test_bypass_sq2 set col2 = col2+$1 where col1 = $2;
execute p24(1,0);
prepare p25 as select * from test_bypass_sq2 where col1 = $1;
execute p25(0);
--bypass
prepare p26 as select * from test_bypass_sq2 where col1 >= $1 order by col1;
execute p26 (0);
prepare p261 as select * from test_bypass_sq2 where col1 >= $1 order by col1 limit 1;
execute p261 (0);
prepare p262 as select * from test_bypass_sq2 where col1 = $1 order by col1 for update limit 2;
explain execute p262 (0);
execute p262 (0);
--bypass through index only scan
prepare p26101 as select col1 from test_bypass_sq2 where col1 >= $1 order by col1 limit 2;
execute p26101 (0);
--not bypass
prepare p201 as select * from test_bypass_sq2 where col2 = $1;
explain execute p201 (0);
explain execute p201 (null);
prepare p202 as select * from test_bypass_sq2 where col1 = $1 and col2 = $2;
explain execute p202 (0,0);
--not bypass
prepare p203 as select t1.col3, t2.col2 from test_bypass_sq1 as t1 join test_bypass_sq2 as t2 on t1.col1=t2.col1;
explain execute p203;
prepare p204 as select count(*),col1 from test_bypass_sq1 group by col1;
explain execute p204;
--bypass (order by is supported when ordered col is in index)
prepare p211 as select col1,col2 from test_bypass_sq1 order by col1 desc;
execute p211;
prepare p212 as select col1,col2 from test_bypass_sq1 order by col1;
execute p212;
--not bypass
prepare p213 as select * from test_bypass_sq2 order by col1,col2;
explain execute p213;
--bypass
prepare p27 as select * from test_bypass_sq2 where col1 = $1 limit 1;
execute p27(0);
execute p27(1);
prepare p270 as select * from test_bypass_sq2 where col1 = $1 for update limit 1;
execute p270(0);
execute p270(1);
prepare p271 as select * from test_bypass_sq2 where col1 > $1 order by col1 limit 2 offset 1;
execute p271(0);
prepare p2710 as select * from test_bypass_sq2 where col1 > $1 for update limit 2 offset 1;
explain execute p2710(0);
--not bypass
prepare p272 as select * from test_bypass_sq2 where col1 = $1 limit $2;
explain execute p272(0,3);
prepare p2720 as select * from test_bypass_sq2 where col1 = $1 for update limit $2;
explain execute p2720(0,3);
prepare p273 as select * from test_bypass_sq2 where col1 = $1 limit -1;
explain execute p273(0);
--bypass
prepare p2730 as select * from test_bypass_sq2 where col1 = $1 for update limit -1;
explain execute p2730(0);
prepare p274 as select * from test_bypass_sq2 where col1 = $1 limit 0;
execute p274(0);
prepare p2740 as select * from test_bypass_sq2 where col1 = $1 for update limit 0;
execute p2740(0);
prepare p275 as select * from test_bypass_sq2 where col1 is not null;
explain execute p275;
--
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
prepare p31 as insert into test_bypass_sq3(col2,col3) values ($1,$2);
--wrong input
execute p31(1,default);
--bypass
execute p31(3,null);
prepare p32 as insert into test_bypass_sq3 values($1,$2,$3);
execute p32(2,3,null);
execute p32 (3,3,null);
execute p32 (null,3,null);
--bypass(?)
execute p32 (-1,-1,current_timestamp);
--bypass
prepare p33 as select * from test_bypass_sq3 where col1 >= $1 order by col1;
execute p33(1);
execute p33(2);
prepare p34 as select col2 from test_bypass_sq3 where col1 = $1 for update;
prepare p35 as update test_bypass_sq3 set col2 = col2*3 where col1 = $1;
execute p34(2);
execute p35(2);
execute p34(1);
execute p35(1);
--not bypass
prepare p36 as select * from test_bypass_sq3 where col2 > 0;
explain execute p36(3);
--bypass
prepare p37 as select * from test_bypass_sq3 where col1 is null;
execute p37;
--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);
prepare p40 as insert into test_bypass_sq4 values ($1,$2,$3);
execute p40 (11,21,31);
execute p40 (11,22,32);
execute p40 (12,23,32);
execute p40 (12,23,33);
execute p40 (13,24,33);
execute p40 (13,24,34);
execute p40 (14,25,34);
execute p40 (14,25,35);
execute p40 (55,55,55);
execute p40 (55,55,null);
execute p40 (55,null,55);
execute p40 (55,null,null);
explain execute p40 (null,null,null);
execute p40 (null,null,null);
prepare p401 as select col3, col1, col2 from test_bypass_sq4 where col2 >$1 order by 1,3;
execute p401 (22);
prepare p402 as select * from test_bypass_sq4 where col2 =$1 and col3= $2 order by col2;
execute p402(22,32);
prepare p403 as select col3,col2,col3 from test_bypass_sq4 where col3 >= $1 and col2 >= $2 order by col3,col2;
execute p403 (33,22);
prepare p404 as select col2,col3,col2 from test_bypass_sq4 where col3 >= $1 and col2 >= $2 order by col3,col2;
execute p404 (34,22);
prepare p405 as select col3,col2,col3 from test_bypass_sq4 where col3 >= $1 and col2 >= $2 order by col3 for update;
execute p406 (33,22);
prepare p406 as select col2,col3,col2 from test_bypass_sq4 where col3 >= $1 and col2 >= $2 order by col3,col2 for update;
execute p406 (34,22);
prepare p407 as select col2,col3,col2 from test_bypass_sq4 where col3 is null and col2 is null order by col3,col2;
execute p407;
prepare p408 as select col2,col3 from test_bypass_sq4 where col3 is null and col2 is not null;
execute p408;
prepare p409 as select col2,col3 from test_bypass_sq4 where col3 is not null order by col3 desc,col2 desc;
execute p409;
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
prepare p601 as insert into test_bypass_sq6 values ($1,ROW($2, $3),$4);
explain execute p601 (1,1,'Simon1'::text,'test'::text);
-- just insert
reset opfusion_debug_mode;
execute p601 (1,1,'Simon1'::text,'test'::text);
set opfusion_debug_mode = 'error';
--bypass
prepare p602 as select * from test_bypass_sq6 where col1 is not null;
execute p602;
prepare p603 as select * from test_bypass_sq6 where col3 =$1 for update;
execute p603 ('test'::text);
prepare p604 as update test_bypass_sq6 set col3= $1 where col1 = $2;
execute p604 ('test_2'::text,1);
prepare p605 as select col1 from test_bypass_sq6;
execute p605;
prepare p606 as select col3 from test_bypass_sq6 order by col1,col3;
execute p606;
prepare p607 as select col1, col3 from test_bypass_sq6 where true;
execute p607;
prepare p608 as update test_bypass_sq6 set col2=$1 where col1 = $2;
execute p608(ROW(2,'Ruby2'::text),1);
--notbypass
prepare p6071 as select * from test_bypass_sq6 where true;
explain execute p6071;
prepare p609 as update test_bypass_sq6 set col2=ROW($1,$2) where col1 = $3;
explain execute p609 (3,'Ruby3'::text,1);
--bypass
prepare p6091 as delete from test_bypass_sq6 where col1 = $1;
execute p6091(1);
reset enable_seqscan;
reset enable_bitmapscan;
reset opfusion_debug_mode;
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_sq6;
drop type complextype; | the_stack |
--
-- STORED PROCEDURE
-- BulkReindexResources_2
--
-- DESCRIPTION
-- Updates the search indices of a batch of resources
--
-- PARAMETERS
-- @resourcesToReindex
-- * The type IDs, IDs, eTags and hashes of the resources to reindex
-- @resourceWriteClaims
-- * Claims on the principal that performed the write
-- @compartmentAssignments
-- * Compartments that the resource is part of
-- @referenceSearchParams
-- * Extracted reference search params
-- @tokenSearchParams
-- * Extracted token search params
-- @tokenTextSearchParams
-- * The text representation of extracted token search params
-- @stringSearchParams
-- * Extracted string search params
-- @numberSearchParams
-- * Extracted number search params
-- @quantitySearchParams
-- * Extracted quantity search params
-- @uriSearchParams
-- * Extracted URI search params
-- @dateTimeSearchParms
-- * Extracted datetime search params
-- @referenceTokenCompositeSearchParams
-- * Extracted reference$token search params
-- @tokenTokenCompositeSearchParams
-- * Extracted token$token tokensearch params
-- @tokenDateTimeCompositeSearchParams
-- * Extracted token$datetime search params
-- @tokenQuantityCompositeSearchParams
-- * Extracted token$quantity search params
-- @tokenStringCompositeSearchParams
-- * Extracted token$string search params
-- @tokenNumberNumberCompositeSearchParams
-- * Extracted token$number$number search params
--
-- RETURN VALUE
-- The number of resources that failed to reindex due to versioning conflicts.
--
CREATE PROCEDURE dbo.BulkReindexResources_2
@resourcesToReindex dbo.BulkReindexResourceTableType_1 READONLY,
@resourceWriteClaims dbo.BulkResourceWriteClaimTableType_1 READONLY,
@compartmentAssignments dbo.BulkCompartmentAssignmentTableType_1 READONLY,
@referenceSearchParams dbo.BulkReferenceSearchParamTableType_1 READONLY,
@tokenSearchParams dbo.BulkTokenSearchParamTableType_1 READONLY,
@tokenTextSearchParams dbo.BulkTokenTextTableType_1 READONLY,
@stringSearchParams dbo.BulkStringSearchParamTableType_2 READONLY,
@numberSearchParams dbo.BulkNumberSearchParamTableType_1 READONLY,
@quantitySearchParams dbo.BulkQuantitySearchParamTableType_1 READONLY,
@uriSearchParams dbo.BulkUriSearchParamTableType_1 READONLY,
@dateTimeSearchParms dbo.BulkDateTimeSearchParamTableType_2 READONLY,
@referenceTokenCompositeSearchParams dbo.BulkReferenceTokenCompositeSearchParamTableType_1 READONLY,
@tokenTokenCompositeSearchParams dbo.BulkTokenTokenCompositeSearchParamTableType_1 READONLY,
@tokenDateTimeCompositeSearchParams dbo.BulkTokenDateTimeCompositeSearchParamTableType_1 READONLY,
@tokenQuantityCompositeSearchParams dbo.BulkTokenQuantityCompositeSearchParamTableType_1 READONLY,
@tokenStringCompositeSearchParams dbo.BulkTokenStringCompositeSearchParamTableType_1 READONLY,
@tokenNumberNumberCompositeSearchParams dbo.BulkTokenNumberNumberCompositeSearchParamTableType_1 READONLY
AS
SET NOCOUNT ON;
SET XACT_ABORT ON;
BEGIN TRANSACTION;
DECLARE @computedValues TABLE (
Offset INT NOT NULL,
ResourceTypeId SMALLINT NOT NULL,
VersionProvided BIGINT NULL,
SearchParamHash VARCHAR (64) NOT NULL,
ResourceSurrogateId BIGINT NULL,
VersionInDatabase BIGINT NULL);
INSERT INTO @computedValues
SELECT resourceToReindex.Offset,
resourceToReindex.ResourceTypeId,
resourceToReindex.ETag,
resourceToReindex.SearchParamHash,
resourceInDB.ResourceSurrogateId,
resourceInDB.Version
FROM @resourcesToReindex AS resourceToReindex
LEFT OUTER JOIN
dbo.Resource AS resourceInDB WITH (UPDLOCK, INDEX (IX_Resource_ResourceTypeId_ResourceId))
ON resourceInDB.ResourceTypeId = resourceToReindex.ResourceTypeId
AND resourceInDB.ResourceId = resourceToReindex.ResourceId
AND resourceInDB.IsHistory = 0;
DECLARE @versionDiff AS INT;
SET @versionDiff = (SELECT COUNT(*)
FROM @computedValues
WHERE VersionProvided IS NOT NULL
AND VersionProvided <> VersionInDatabase);
IF (@versionDiff > 0)
BEGIN
-- Don't reindex resources that have outdated versions
DELETE @computedValues
WHERE VersionProvided IS NOT NULL
AND VersionProvided <> VersionInDatabase;
END
-- Update the search parameter hash value in the main resource table
UPDATE resourceInDB
SET resourceInDB.SearchParamHash = resourceToReindex.SearchParamHash
FROM @computedValues AS resourceToReindex
INNER JOIN
dbo.Resource AS resourceInDB
ON resourceInDB.ResourceTypeId = resourceToReindex.ResourceTypeId
AND resourceInDB.ResourceSurrogateId = resourceToReindex.ResourceSurrogateId;
-- First, delete all the indices of the resources to reindex.
DELETE searchIndex
FROM dbo.ResourceWriteClaim AS searchIndex
INNER JOIN
@computedValues AS resourceToReindex
ON searchIndex.ResourceSurrogateId = resourceToReindex.ResourceSurrogateId;
DELETE searchIndex
FROM dbo.CompartmentAssignment AS searchIndex
INNER JOIN
@computedValues AS resourceToReindex
ON searchIndex.ResourceTypeId = resourceToReindex.ResourceTypeId
AND searchIndex.ResourceSurrogateId = resourceToReindex.ResourceSurrogateId;
DELETE searchIndex
FROM dbo.ReferenceSearchParam AS searchIndex
INNER JOIN
@computedValues AS resourceToReindex
ON searchIndex.ResourceTypeId = resourceToReindex.ResourceTypeId
AND searchIndex.ResourceSurrogateId = resourceToReindex.ResourceSurrogateId;
DELETE searchIndex
FROM dbo.TokenSearchParam AS searchIndex
INNER JOIN
@computedValues AS resourceToReindex
ON searchIndex.ResourceTypeId = resourceToReindex.ResourceTypeId
AND searchIndex.ResourceSurrogateId = resourceToReindex.ResourceSurrogateId;
DELETE searchIndex
FROM dbo.TokenText AS searchIndex
INNER JOIN
@computedValues AS resourceToReindex
ON searchIndex.ResourceTypeId = resourceToReindex.ResourceTypeId
AND searchIndex.ResourceSurrogateId = resourceToReindex.ResourceSurrogateId;
DELETE searchIndex
FROM dbo.StringSearchParam AS searchIndex
INNER JOIN
@computedValues AS resourceToReindex
ON searchIndex.ResourceTypeId = resourceToReindex.ResourceTypeId
AND searchIndex.ResourceSurrogateId = resourceToReindex.ResourceSurrogateId;
DELETE searchIndex
FROM dbo.UriSearchParam AS searchIndex
INNER JOIN
@computedValues AS resourceToReindex
ON searchIndex.ResourceTypeId = resourceToReindex.ResourceTypeId
AND searchIndex.ResourceSurrogateId = resourceToReindex.ResourceSurrogateId;
DELETE searchIndex
FROM dbo.NumberSearchParam AS searchIndex
INNER JOIN
@computedValues AS resourceToReindex
ON searchIndex.ResourceTypeId = resourceToReindex.ResourceTypeId
AND searchIndex.ResourceSurrogateId = resourceToReindex.ResourceSurrogateId;
DELETE searchIndex
FROM dbo.QuantitySearchParam AS searchIndex
INNER JOIN
@computedValues AS resourceToReindex
ON searchIndex.ResourceTypeId = resourceToReindex.ResourceTypeId
AND searchIndex.ResourceSurrogateId = resourceToReindex.ResourceSurrogateId;
DELETE searchIndex
FROM dbo.DateTimeSearchParam AS searchIndex
INNER JOIN
@computedValues AS resourceToReindex
ON searchIndex.ResourceTypeId = resourceToReindex.ResourceTypeId
AND searchIndex.ResourceSurrogateId = resourceToReindex.ResourceSurrogateId;
DELETE searchIndex
FROM dbo.ReferenceTokenCompositeSearchParam AS searchIndex
INNER JOIN
@computedValues AS resourceToReindex
ON searchIndex.ResourceTypeId = resourceToReindex.ResourceTypeId
AND searchIndex.ResourceSurrogateId = resourceToReindex.ResourceSurrogateId;
DELETE searchIndex
FROM dbo.TokenTokenCompositeSearchParam AS searchIndex
INNER JOIN
@computedValues AS resourceToReindex
ON searchIndex.ResourceTypeId = resourceToReindex.ResourceTypeId
AND searchIndex.ResourceSurrogateId = resourceToReindex.ResourceSurrogateId;
DELETE searchIndex
FROM dbo.TokenDateTimeCompositeSearchParam AS searchIndex
INNER JOIN
@computedValues AS resourceToReindex
ON searchIndex.ResourceTypeId = resourceToReindex.ResourceTypeId
AND searchIndex.ResourceSurrogateId = resourceToReindex.ResourceSurrogateId;
DELETE searchIndex
FROM dbo.TokenQuantityCompositeSearchParam AS searchIndex
INNER JOIN
@computedValues AS resourceToReindex
ON searchIndex.ResourceTypeId = resourceToReindex.ResourceTypeId
AND searchIndex.ResourceSurrogateId = resourceToReindex.ResourceSurrogateId;
DELETE searchIndex
FROM dbo.TokenStringCompositeSearchParam AS searchIndex
INNER JOIN
@computedValues AS resourceToReindex
ON searchIndex.ResourceTypeId = resourceToReindex.ResourceTypeId
AND searchIndex.ResourceSurrogateId = resourceToReindex.ResourceSurrogateId;
DELETE searchIndex
FROM dbo.TokenNumberNumberCompositeSearchParam AS searchIndex
INNER JOIN
@computedValues AS resourceToReindex
ON searchIndex.ResourceTypeId = resourceToReindex.ResourceTypeId
AND searchIndex.ResourceSurrogateId = resourceToReindex.ResourceSurrogateId;
-- Next, insert all the new indices.
INSERT INTO dbo.ResourceWriteClaim (ResourceSurrogateId, ClaimTypeId, ClaimValue)
SELECT DISTINCT resourceToReindex.ResourceSurrogateId,
searchIndex.ClaimTypeId,
searchIndex.ClaimValue
FROM @resourceWriteClaims AS searchIndex
INNER JOIN
@computedValues AS resourceToReindex
ON searchIndex.Offset = resourceToReindex.Offset;
INSERT INTO dbo.CompartmentAssignment (ResourceTypeId, ResourceSurrogateId, CompartmentTypeId, ReferenceResourceId, IsHistory)
SELECT DISTINCT resourceToReindex.ResourceTypeId,
resourceToReindex.ResourceSurrogateId,
searchIndex.CompartmentTypeId,
searchIndex.ReferenceResourceId,
0
FROM @compartmentAssignments AS searchIndex
INNER JOIN
@computedValues AS resourceToReindex
ON searchIndex.Offset = resourceToReindex.Offset;
INSERT INTO dbo.ReferenceSearchParam (ResourceTypeId, ResourceSurrogateId, SearchParamId, BaseUri, ReferenceResourceTypeId, ReferenceResourceId, ReferenceResourceVersion, IsHistory)
SELECT DISTINCT resourceToReindex.ResourceTypeId,
resourceToReindex.ResourceSurrogateId,
searchIndex.SearchParamId,
searchIndex.BaseUri,
searchIndex.ReferenceResourceTypeId,
searchIndex.ReferenceResourceId,
searchIndex.ReferenceResourceVersion,
0
FROM @referenceSearchParams AS searchIndex
INNER JOIN
@computedValues AS resourceToReindex
ON searchIndex.Offset = resourceToReindex.Offset;
INSERT INTO dbo.TokenSearchParam (ResourceTypeId, ResourceSurrogateId, SearchParamId, SystemId, Code, IsHistory)
SELECT DISTINCT resourceToReindex.ResourceTypeId,
resourceToReindex.ResourceSurrogateId,
searchIndex.SearchParamId,
searchIndex.SystemId,
searchIndex.Code,
0
FROM @tokenSearchParams AS searchIndex
INNER JOIN
@computedValues AS resourceToReindex
ON searchIndex.Offset = resourceToReindex.Offset;
INSERT INTO dbo.TokenText (ResourceTypeId, ResourceSurrogateId, SearchParamId, Text, IsHistory)
SELECT DISTINCT resourceToReindex.ResourceTypeId,
resourceToReindex.ResourceSurrogateId,
searchIndex.SearchParamId,
searchIndex.Text,
0
FROM @tokenTextSearchParams AS searchIndex
INNER JOIN
@computedValues AS resourceToReindex
ON searchIndex.Offset = resourceToReindex.Offset;
INSERT INTO dbo.StringSearchParam (ResourceTypeId, ResourceSurrogateId, SearchParamId, Text, TextOverflow, IsHistory, IsMin, IsMax)
SELECT DISTINCT resourceToReindex.ResourceTypeId,
resourceToReindex.ResourceSurrogateId,
searchIndex.SearchParamId,
searchIndex.Text,
searchIndex.TextOverflow,
0,
searchIndex.IsMin,
searchIndex.IsMax
FROM @stringSearchParams AS searchIndex
INNER JOIN
@computedValues AS resourceToReindex
ON searchIndex.Offset = resourceToReindex.Offset;
INSERT INTO dbo.UriSearchParam (ResourceTypeId, ResourceSurrogateId, SearchParamId, Uri, IsHistory)
SELECT DISTINCT resourceToReindex.ResourceTypeId,
resourceToReindex.ResourceSurrogateId,
searchIndex.SearchParamId,
searchIndex.Uri,
0
FROM @uriSearchParams AS searchIndex
INNER JOIN
@computedValues AS resourceToReindex
ON searchIndex.Offset = resourceToReindex.Offset;
INSERT INTO dbo.NumberSearchParam (ResourceTypeId, ResourceSurrogateId, SearchParamId, SingleValue, LowValue, HighValue, IsHistory)
SELECT DISTINCT resourceToReindex.ResourceTypeId,
resourceToReindex.ResourceSurrogateId,
searchIndex.SearchParamId,
searchIndex.SingleValue,
searchIndex.LowValue,
searchIndex.HighValue,
0
FROM @numberSearchParams AS searchIndex
INNER JOIN
@computedValues AS resourceToReindex
ON searchIndex.Offset = resourceToReindex.Offset;
INSERT INTO dbo.QuantitySearchParam (ResourceTypeId, ResourceSurrogateId, SearchParamId, SystemId, QuantityCodeId, SingleValue, LowValue, HighValue, IsHistory)
SELECT DISTINCT resourceToReindex.ResourceTypeId,
resourceToReindex.ResourceSurrogateId,
searchIndex.SearchParamId,
searchIndex.SystemId,
searchIndex.QuantityCodeId,
searchIndex.SingleValue,
searchIndex.LowValue,
searchIndex.HighValue,
0
FROM @quantitySearchParams AS searchIndex
INNER JOIN
@computedValues AS resourceToReindex
ON searchIndex.Offset = resourceToReindex.Offset;
INSERT INTO dbo.DateTimeSearchParam (ResourceTypeId, ResourceSurrogateId, SearchParamId, StartDateTime, EndDateTime, IsLongerThanADay, IsHistory, IsMin, IsMax)
SELECT DISTINCT resourceToReindex.ResourceTypeId,
resourceToReindex.ResourceSurrogateId,
searchIndex.SearchParamId,
searchIndex.StartDateTime,
searchIndex.EndDateTime,
searchIndex.IsLongerThanADay,
0,
searchIndex.IsMin,
searchIndex.IsMax
FROM @dateTimeSearchParms AS searchIndex
INNER JOIN
@computedValues AS resourceToReindex
ON searchIndex.Offset = resourceToReindex.Offset;
INSERT INTO dbo.ReferenceTokenCompositeSearchParam (ResourceTypeId, ResourceSurrogateId, SearchParamId, BaseUri1, ReferenceResourceTypeId1, ReferenceResourceId1, ReferenceResourceVersion1, SystemId2, Code2, IsHistory)
SELECT DISTINCT resourceToReindex.ResourceTypeId,
resourceToReindex.ResourceSurrogateId,
searchIndex.SearchParamId,
searchIndex.BaseUri1,
searchIndex.ReferenceResourceTypeId1,
searchIndex.ReferenceResourceId1,
searchIndex.ReferenceResourceVersion1,
searchIndex.SystemId2,
searchIndex.Code2,
0
FROM @referenceTokenCompositeSearchParams AS searchIndex
INNER JOIN
@computedValues AS resourceToReindex
ON searchIndex.Offset = resourceToReindex.Offset;
INSERT INTO dbo.TokenTokenCompositeSearchParam (ResourceTypeId, ResourceSurrogateId, SearchParamId, SystemId1, Code1, SystemId2, Code2, IsHistory)
SELECT DISTINCT resourceToReindex.ResourceTypeId,
resourceToReindex.ResourceSurrogateId,
searchIndex.SearchParamId,
searchIndex.SystemId1,
searchIndex.Code1,
searchIndex.SystemId2,
searchIndex.Code2,
0
FROM @tokenTokenCompositeSearchParams AS searchIndex
INNER JOIN
@computedValues AS resourceToReindex
ON searchIndex.Offset = resourceToReindex.Offset;
INSERT INTO dbo.TokenDateTimeCompositeSearchParam (ResourceTypeId, ResourceSurrogateId, SearchParamId, SystemId1, Code1, StartDateTime2, EndDateTime2, IsLongerThanADay2, IsHistory)
SELECT DISTINCT resourceToReindex.ResourceTypeId,
resourceToReindex.ResourceSurrogateId,
searchIndex.SearchParamId,
searchIndex.SystemId1,
searchIndex.Code1,
searchIndex.StartDateTime2,
searchIndex.EndDateTime2,
searchIndex.IsLongerThanADay2,
0
FROM @tokenDateTimeCompositeSearchParams AS searchIndex
INNER JOIN
@computedValues AS resourceToReindex
ON searchIndex.Offset = resourceToReindex.Offset;
INSERT INTO dbo.TokenQuantityCompositeSearchParam (ResourceTypeId, ResourceSurrogateId, SearchParamId, SystemId1, Code1, SingleValue2, SystemId2, QuantityCodeId2, LowValue2, HighValue2, IsHistory)
SELECT DISTINCT resourceToReindex.ResourceTypeId,
resourceToReindex.ResourceSurrogateId,
searchIndex.SearchParamId,
searchIndex.SystemId1,
searchIndex.Code1,
searchIndex.SingleValue2,
searchIndex.SystemId2,
searchIndex.QuantityCodeId2,
searchIndex.LowValue2,
searchIndex.HighValue2,
0
FROM @tokenQuantityCompositeSearchParams AS searchIndex
INNER JOIN
@computedValues AS resourceToReindex
ON searchIndex.Offset = resourceToReindex.Offset;
INSERT INTO dbo.TokenStringCompositeSearchParam (ResourceTypeId, ResourceSurrogateId, SearchParamId, SystemId1, Code1, Text2, TextOverflow2, IsHistory)
SELECT DISTINCT resourceToReindex.ResourceTypeId,
resourceToReindex.ResourceSurrogateId,
searchIndex.SearchParamId,
searchIndex.SystemId1,
searchIndex.Code1,
searchIndex.Text2,
searchIndex.TextOverflow2,
0
FROM @tokenStringCompositeSearchParams AS searchIndex
INNER JOIN
@computedValues AS resourceToReindex
ON searchIndex.Offset = resourceToReindex.Offset;
INSERT INTO dbo.TokenNumberNumberCompositeSearchParam (ResourceTypeId, ResourceSurrogateId, SearchParamId, SystemId1, Code1, SingleValue2, LowValue2, HighValue2, SingleValue3, LowValue3, HighValue3, HasRange, IsHistory)
SELECT DISTINCT resourceToReindex.ResourceTypeId,
resourceToReindex.ResourceSurrogateId,
searchIndex.SearchParamId,
searchIndex.SystemId1,
searchIndex.Code1,
searchIndex.SingleValue2,
searchIndex.LowValue2,
searchIndex.HighValue2,
searchIndex.SingleValue3,
searchIndex.LowValue3,
searchIndex.HighValue3,
searchIndex.HasRange,
0
FROM @tokenNumberNumberCompositeSearchParams AS searchIndex
INNER JOIN
@computedValues AS resourceToReindex
ON searchIndex.Offset = resourceToReindex.Offset;
SELECT @versionDiff;
COMMIT TRANSACTION;
GO | the_stack |
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Applications](
[ApplicationName] [nvarchar](235) NOT NULL,
[ApplicationId] [uniqueidentifier] NOT NULL,
[Description] [nvarchar](256) NULL,
PRIMARY KEY CLUSTERED
(
[ApplicationId] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
GO
/****** Object: Table [dbo].[BugNet_ApplicationLog] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[BugNet_ApplicationLog](
[Id] [int] IDENTITY(1,1) NOT NULL,
[Date] [datetime] NOT NULL,
[Thread] [varchar](255) NOT NULL,
[Level] [varchar](50) NOT NULL,
[Logger] [varchar](255) NOT NULL,
[User] [nvarchar](50) NOT NULL,
[Message] [varchar](4000) NOT NULL,
[Exception] [varchar](2000) NULL,
CONSTRAINT [PK_BugNet_ApplicationLog] PRIMARY KEY CLUSTERED
(
[Id] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
GO
/****** Object: Table [dbo].[BugNet_DefaultValues] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[BugNet_DefaultValues](
[ProjectId] [int] NOT NULL,
[DefaultType] [int] NULL,
[StatusId] [int] NULL,
[IssueOwnerUserId] [uniqueidentifier] NULL,
[IssuePriorityId] [int] NULL,
[IssueAffectedMilestoneId] [int] NULL,
[IssueAssignedUserId] [uniqueidentifier] NULL,
[IssueVisibility] [int] NULL,
[IssueCategoryId] [int] NULL,
[IssueDueDate] [int] NULL,
[IssueProgress] [int] NULL,
[IssueMilestoneId] [int] NULL,
[IssueEstimation] [decimal](5, 2) NULL,
[IssueResolutionId] [int] NULL,
[OwnedByNotify] [bit] NULL,
[AssignedToNotify] [bit] NULL,
CONSTRAINT [PK_BugNet_DefaultValues] PRIMARY KEY CLUSTERED
(
[ProjectId] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
GO
/****** Object: Table [dbo].[BugNet_DefaultValuesVisibility] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[BugNet_DefaultValuesVisibility](
[ProjectId] [int] NOT NULL,
[StatusVisibility] [bit] NOT NULL,
[OwnedByVisibility] [bit] NOT NULL,
[PriorityVisibility] [bit] NOT NULL,
[AssignedToVisibility] [bit] NOT NULL,
[PrivateVisibility] [bit] NOT NULL,
[CategoryVisibility] [bit] NOT NULL,
[DueDateVisibility] [bit] NOT NULL,
[TypeVisibility] [bit] NOT NULL,
[PercentCompleteVisibility] [bit] NOT NULL,
[MilestoneVisibility] [bit] NOT NULL,
[EstimationVisibility] [bit] NOT NULL,
[ResolutionVisibility] [bit] NOT NULL,
[AffectedMilestoneVisibility] [bit] NOT NULL,
[StatusEditVisibility] [bit] NOT NULL,
[OwnedByEditVisibility] [bit] NOT NULL,
[PriorityEditVisibility] [bit] NOT NULL,
[AssignedToEditVisibility] [bit] NOT NULL,
[PrivateEditVisibility] [bit] NOT NULL,
[CategoryEditVisibility] [bit] NOT NULL,
[DueDateEditVisibility] [bit] NOT NULL,
[TypeEditVisibility] [bit] NOT NULL,
[PercentCompleteEditVisibility] [bit] NOT NULL,
[MilestoneEditVisibility] [bit] NOT NULL,
[EstimationEditVisibility] [bit] NOT NULL,
[ResolutionEditVisibility] [bit] NOT NULL,
[AffectedMilestoneEditVisibility] [bit] NOT NULL,
CONSTRAINT [PK_Bugnet_DefaultValuesVisibility] PRIMARY KEY CLUSTERED
(
[ProjectId] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
GO
/****** Object: Table [dbo].[BugNet_HostSettings] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[BugNet_HostSettings](
[SettingName] [nvarchar](50) NOT NULL,
[SettingValue] [nvarchar](max) NULL,
CONSTRAINT [PK_BugNet_HostSettings] PRIMARY KEY CLUSTERED
(
[SettingName] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
GO
/****** Object: Table [dbo].[BugNet_IssueAttachments] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[BugNet_IssueAttachments](
[IssueAttachmentId] [int] IDENTITY(1,1) NOT NULL,
[IssueId] [int] NOT NULL,
[FileName] [nvarchar](250) NOT NULL,
[Description] [nvarchar](80) NOT NULL,
[FileSize] [int] NOT NULL,
[ContentType] [nvarchar](50) NOT NULL,
[DateCreated] [datetime] NOT NULL,
[UserId] [uniqueidentifier] NOT NULL,
[Attachment] [varbinary](max) NULL,
CONSTRAINT [PK_BugNet_IssueAttachments] PRIMARY KEY CLUSTERED
(
[IssueAttachmentId] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
GO
/****** Object: Table [dbo].[BugNet_IssueComments] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[BugNet_IssueComments](
[IssueCommentId] [int] IDENTITY(1,1) NOT NULL,
[IssueId] [int] NOT NULL,
[DateCreated] [datetime] NOT NULL,
[Comment] [nvarchar](max) NOT NULL,
[UserId] [uniqueidentifier] NOT NULL,
CONSTRAINT [PK_BugNet_IssueComments] PRIMARY KEY CLUSTERED
(
[IssueCommentId] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
GO
/****** Object: Table [dbo].[BugNet_IssueHistory] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[BugNet_IssueHistory](
[IssueHistoryId] [int] IDENTITY(1,1) NOT NULL,
[IssueId] [int] NOT NULL,
[FieldChanged] [nvarchar](50) NOT NULL,
[OldValue] [nvarchar](50) NOT NULL,
[NewValue] [nvarchar](50) NOT NULL,
[DateCreated] [datetime] NOT NULL,
[UserId] [uniqueidentifier] NOT NULL,
CONSTRAINT [PK_BugNet_IssueHistory] PRIMARY KEY CLUSTERED
(
[IssueHistoryId] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
GO
/****** Object: Table [dbo].[BugNet_IssueNotifications] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[BugNet_IssueNotifications](
[IssueNotificationId] [int] IDENTITY(1,1) NOT NULL,
[IssueId] [int] NOT NULL,
[UserId] [uniqueidentifier] NOT NULL,
CONSTRAINT [PK_BugNet_IssueNotifications] PRIMARY KEY CLUSTERED
(
[IssueNotificationId] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
GO
/****** Object: Table [dbo].[BugNet_IssueRevisions] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[BugNet_IssueRevisions](
[IssueRevisionId] [int] IDENTITY(1,1) NOT NULL,
[Revision] [int] NOT NULL,
[IssueId] [int] NOT NULL,
[Repository] [nvarchar](400) NOT NULL,
[RevisionAuthor] [nvarchar](100) NOT NULL,
[RevisionDate] [nvarchar](100) NOT NULL,
[RevisionMessage] [nvarchar](max) NOT NULL,
[DateCreated] [datetime] NOT NULL,
[Branch] [nvarchar](255) NULL,
[Changeset] [nvarchar](100) NULL,
CONSTRAINT [PK_BugNet_IssueRevisions] PRIMARY KEY CLUSTERED
(
[IssueRevisionId] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
GO
/****** Object: Table [dbo].[BugNet_Issues] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[BugNet_Issues](
[IssueId] [int] IDENTITY(1,1) NOT NULL,
[IssueTitle] [nvarchar](500) NOT NULL,
[IssueDescription] [nvarchar](max) NOT NULL,
[IssueStatusId] [int] NULL,
[IssuePriorityId] [int] NULL,
[IssueTypeId] [int] NULL,
[IssueCategoryId] [int] NULL,
[ProjectId] [int] NOT NULL,
[IssueAffectedMilestoneId] [int] NULL,
[IssueResolutionId] [int] NULL,
[IssueCreatorUserId] [uniqueidentifier] NOT NULL,
[IssueAssignedUserId] [uniqueidentifier] NULL,
[IssueOwnerUserId] [uniqueidentifier] NULL,
[IssueDueDate] [datetime] NULL,
[IssueMilestoneId] [int] NULL,
[IssueVisibility] [int] NOT NULL,
[IssueEstimation] [decimal](5, 2) NOT NULL,
[IssueProgress] [int] NOT NULL,
[DateCreated] [datetime] NOT NULL,
[LastUpdate] [datetime] NOT NULL,
[LastUpdateUserId] [uniqueidentifier] NOT NULL,
[Disabled] [bit] NOT NULL,
CONSTRAINT [PK_BugNet_Issues] PRIMARY KEY CLUSTERED
(
[IssueId] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
GO
/****** Object: Table [dbo].[BugNet_IssueVotes] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[BugNet_IssueVotes](
[IssueVoteId] [int] IDENTITY(1,1) NOT NULL,
[IssueId] [int] NOT NULL,
[UserId] [uniqueidentifier] NOT NULL,
[DateCreated] [datetime] NOT NULL,
CONSTRAINT [PK_BugNet_IssueVotes] PRIMARY KEY CLUSTERED
(
[IssueVoteId] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
GO
/****** Object: Table [dbo].[BugNet_IssueWorkReports] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[BugNet_IssueWorkReports](
[IssueWorkReportId] [int] IDENTITY(1,1) NOT NULL,
[IssueId] [int] NOT NULL,
[WorkDate] [datetime] NOT NULL,
[Duration] [decimal](4, 2) NOT NULL,
[IssueCommentId] [int] NOT NULL,
[UserId] [uniqueidentifier] NOT NULL,
CONSTRAINT [PK_BugNet_IssueWorkReports] PRIMARY KEY CLUSTERED
(
[IssueWorkReportId] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
GO
/****** Object: Table [dbo].[BugNet_Languages] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[BugNet_Languages](
[LanguageId] [int] IDENTITY(1,1) NOT NULL,
[CultureCode] [nvarchar](50) NOT NULL,
[CultureName] [nvarchar](200) NOT NULL,
[FallbackCulture] [nvarchar](50) NULL,
CONSTRAINT [PK_BugNet_Languages] PRIMARY KEY CLUSTERED
(
[LanguageId] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
GO
/****** Object: Table [dbo].[BugNet_Permissions] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[BugNet_Permissions](
[PermissionId] [int] NOT NULL,
[PermissionKey] [nvarchar](50) NOT NULL,
[PermissionName] [nvarchar](50) NOT NULL,
CONSTRAINT [PK_BugNet_Permissions] PRIMARY KEY CLUSTERED
(
[PermissionId] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
GO
/****** Object: Table [dbo].[BugNet_ProjectCategories] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[BugNet_ProjectCategories](
[CategoryId] [int] IDENTITY(1,1) NOT NULL,
[CategoryName] [nvarchar](100) NOT NULL,
[ProjectId] [int] NOT NULL,
[ParentCategoryId] [int] NOT NULL,
[Disabled] [bit] NOT NULL,
CONSTRAINT [PK_BugNet_ProjectCategories] PRIMARY KEY CLUSTERED
(
[CategoryId] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
GO
/****** Object: Table [dbo].[BugNet_ProjectCustomFields] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[BugNet_ProjectCustomFields](
[CustomFieldId] [int] IDENTITY(1,1) NOT NULL,
[ProjectId] [int] NOT NULL,
[CustomFieldName] [nvarchar](50) NOT NULL,
[CustomFieldRequired] [bit] NOT NULL,
[CustomFieldDataType] [int] NOT NULL,
[CustomFieldTypeId] [int] NOT NULL,
CONSTRAINT [PK_BugNet_ProjectCustomFields] PRIMARY KEY CLUSTERED
(
[CustomFieldId] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
GO
/****** Object: Table [dbo].[BugNet_ProjectCustomFieldSelections] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[BugNet_ProjectCustomFieldSelections](
[CustomFieldSelectionId] [int] IDENTITY(1,1) NOT NULL,
[CustomFieldId] [int] NOT NULL,
[CustomFieldSelectionValue] [nvarchar](255) NOT NULL,
[CustomFieldSelectionName] [nvarchar](255) NOT NULL,
[CustomFieldSelectionSortOrder] [int] NOT NULL,
CONSTRAINT [PK_BugNet_ProjectCustomFieldSelections] PRIMARY KEY CLUSTERED
(
[CustomFieldSelectionId] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
GO
/****** Object: Table [dbo].[BugNet_ProjectCustomFieldTypes] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[BugNet_ProjectCustomFieldTypes](
[CustomFieldTypeId] [int] IDENTITY(1,1) NOT NULL,
[CustomFieldTypeName] [nvarchar](50) NOT NULL,
CONSTRAINT [PK_BugNet_ProjectCustomFieldTypes] PRIMARY KEY CLUSTERED
(
[CustomFieldTypeId] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
GO
/****** Object: Table [dbo].[BugNet_ProjectCustomFieldValues] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[BugNet_ProjectCustomFieldValues](
[CustomFieldValueId] [int] IDENTITY(1,1) NOT NULL,
[IssueId] [int] NOT NULL,
[CustomFieldId] [int] NOT NULL,
[CustomFieldValue] [nvarchar](max) NOT NULL,
CONSTRAINT [PK_BugNet_ProjectCustomFieldValues] PRIMARY KEY CLUSTERED
(
[CustomFieldValueId] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
GO
/****** Object: Table [dbo].[BugNet_ProjectIssueTypes] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[BugNet_ProjectIssueTypes](
[IssueTypeId] [int] IDENTITY(1,1) NOT NULL,
[ProjectId] [int] NOT NULL,
[IssueTypeName] [nvarchar](50) NOT NULL,
[IssueTypeImageUrl] [nvarchar](50) NOT NULL,
[SortOrder] [int] NOT NULL,
CONSTRAINT [PK_BugNet_ProjectIssueTypes] PRIMARY KEY CLUSTERED
(
[IssueTypeId] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
GO
/****** Object: Table [dbo].[BugNet_ProjectMailBoxes] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[BugNet_ProjectMailBoxes](
[ProjectMailboxId] [int] IDENTITY(1,1) NOT NULL,
[MailBox] [nvarchar](100) NOT NULL,
[ProjectId] [int] NOT NULL,
[AssignToUserId] [uniqueidentifier] NULL,
[IssueTypeId] [int] NULL,
[CategoryId] [int] NULL,
CONSTRAINT [PK_BugNet_ProjectMailBoxes] PRIMARY KEY CLUSTERED
(
[ProjectMailboxId] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
GO
/****** Object: Table [dbo].[BugNet_ProjectMilestones] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[BugNet_ProjectMilestones](
[MilestoneId] [int] IDENTITY(1,1) NOT NULL,
[ProjectId] [int] NOT NULL,
[MilestoneName] [nvarchar](50) NOT NULL,
[MilestoneImageUrl] [nvarchar](50) NOT NULL,
[SortOrder] [int] NOT NULL,
[DateCreated] [datetime] NOT NULL,
[MilestoneDueDate] [datetime] NULL,
[MilestoneReleaseDate] [datetime] NULL,
[MilestoneNotes] [nvarchar](max) NULL,
[MilestoneCompleted] [bit] NOT NULL,
CONSTRAINT [PK_BugNet_ProjectMilestones] PRIMARY KEY CLUSTERED
(
[MilestoneId] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
GO
/****** Object: Table [dbo].[BugNet_ProjectNotifications] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[BugNet_ProjectNotifications](
[ProjectNotificationId] [int] IDENTITY(1,1) NOT NULL,
[ProjectId] [int] NOT NULL,
[UserId] [uniqueidentifier] NOT NULL,
CONSTRAINT [PK_BugNet_ProjectNotifications] PRIMARY KEY CLUSTERED
(
[ProjectNotificationId] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
GO
/****** Object: Table [dbo].[BugNet_ProjectPriorities] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[BugNet_ProjectPriorities](
[PriorityId] [int] IDENTITY(1,1) NOT NULL,
[ProjectId] [int] NOT NULL,
[PriorityName] [nvarchar](50) NOT NULL,
[PriorityImageUrl] [nvarchar](50) NOT NULL,
[SortOrder] [int] NOT NULL,
CONSTRAINT [PK_BugNet_ProjectPriorities] PRIMARY KEY CLUSTERED
(
[PriorityId] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
GO
/****** Object: Table [dbo].[BugNet_ProjectResolutions] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[BugNet_ProjectResolutions](
[ResolutionId] [int] IDENTITY(1,1) NOT NULL,
[ProjectId] [int] NOT NULL,
[ResolutionName] [nvarchar](50) NOT NULL,
[ResolutionImageUrl] [nvarchar](50) NOT NULL,
[SortOrder] [int] NOT NULL,
CONSTRAINT [PK_BugNet_ProjectResolutions] PRIMARY KEY CLUSTERED
(
[ResolutionId] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
GO
/****** Object: Table [dbo].[BugNet_Projects] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[BugNet_Projects](
[ProjectId] [int] IDENTITY(1,1) NOT NULL,
[ProjectName] [nvarchar](50) NOT NULL,
[ProjectCode] [nvarchar](50) NOT NULL,
[ProjectDescription] [nvarchar](max) NOT NULL,
[AttachmentUploadPath] [nvarchar](256) NOT NULL,
[DateCreated] [datetime] NOT NULL,
[ProjectDisabled] [bit] NOT NULL,
[ProjectAccessType] [int] NOT NULL,
[ProjectManagerUserId] [uniqueidentifier] NOT NULL,
[ProjectCreatorUserId] [uniqueidentifier] NOT NULL,
[AllowAttachments] [bit] NOT NULL,
[AttachmentStorageType] [int] NULL,
[SvnRepositoryUrl] [nvarchar](255) NULL,
[AllowIssueVoting] [bit] NOT NULL,
[ProjectImageFileContent] [varbinary](max) NULL,
[ProjectImageFileName] [nvarchar](150) NULL,
[ProjectImageContentType] [nvarchar](50) NULL,
[ProjectImageFileSize] [bigint] NULL,
CONSTRAINT [PK_BugNet_Projects] PRIMARY KEY CLUSTERED
(
[ProjectId] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
GO
/****** Object: Table [dbo].[BugNet_ProjectStatus] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[BugNet_ProjectStatus](
[StatusId] [int] IDENTITY(1,1) NOT NULL,
[ProjectId] [int] NOT NULL,
[StatusName] [nvarchar](50) NOT NULL,
[StatusImageUrl] [nvarchar](50) NOT NULL,
[SortOrder] [int] NOT NULL,
[IsClosedState] [bit] NOT NULL,
CONSTRAINT [PK_BugNet_ProjectStatus] PRIMARY KEY CLUSTERED
(
[StatusId] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
GO
/****** Object: Table [dbo].[BugNet_Queries] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[BugNet_Queries](
[QueryId] [int] IDENTITY(1,1) NOT NULL,
[UserId] [uniqueidentifier] NOT NULL,
[ProjectId] [int] NOT NULL,
[QueryName] [nvarchar](255) NOT NULL,
[IsPublic] [bit] NOT NULL,
CONSTRAINT [PK_BugNet_Queries] PRIMARY KEY CLUSTERED
(
[QueryId] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
GO
/****** Object: Table [dbo].[BugNet_QueryClauses] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[BugNet_QueryClauses](
[QueryClauseId] [int] IDENTITY(1,1) NOT NULL,
[QueryId] [int] NOT NULL,
[BooleanOperator] [nvarchar](50) NOT NULL,
[FieldName] [nvarchar](50) NOT NULL,
[ComparisonOperator] [nvarchar](50) NOT NULL,
[FieldValue] [nvarchar](50) NOT NULL,
[DataType] [int] NOT NULL,
[CustomFieldId] [int] NULL,
CONSTRAINT [PK_BugNet_QueryClauses] PRIMARY KEY CLUSTERED
(
[QueryClauseId] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
GO
/****** Object: Table [dbo].[BugNet_RelatedIssues] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[BugNet_RelatedIssues](
[PrimaryIssueId] [int] NOT NULL,
[SecondaryIssueId] [int] NOT NULL,
[RelationType] [int] NOT NULL,
CONSTRAINT [PK_BugNet_RelatedIssues] PRIMARY KEY CLUSTERED
(
[PrimaryIssueId] ASC,
[SecondaryIssueId] ASC,
[RelationType] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
GO
/****** Object: Table [dbo].[BugNet_RequiredFieldList] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[BugNet_RequiredFieldList](
[RequiredFieldId] [int] NOT NULL,
[FieldName] [nvarchar](50) NOT NULL,
[FieldValue] [nvarchar](50) NOT NULL,
CONSTRAINT [PK_BugNet_RequiredFieldList] PRIMARY KEY CLUSTERED
(
[RequiredFieldId] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
GO
/****** Object: Table [dbo].[BugNet_RolePermissions] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[BugNet_RolePermissions](
[PermissionId] [int] NOT NULL,
[RoleId] [int] NOT NULL,
CONSTRAINT [PK_BugNet_RolePermissions] PRIMARY KEY CLUSTERED
(
[RoleId] ASC,
[PermissionId] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
GO
/****** Object: Table [dbo].[BugNet_Roles] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[BugNet_Roles](
[RoleId] [int] IDENTITY(1,1) NOT NULL,
[ProjectId] [int] NULL,
[RoleName] [nvarchar](256) NOT NULL,
[RoleDescription] [nvarchar](256) NOT NULL,
[AutoAssign] [bit] NOT NULL,
CONSTRAINT [PK_BugNet_Roles] PRIMARY KEY CLUSTERED
(
[RoleId] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
GO
/****** Object: Table [dbo].[BugNet_UserProfiles] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[BugNet_UserProfiles](
[UserName] [nvarchar](50) NOT NULL,
[FirstName] [nvarchar](100) NULL,
[LastName] [nvarchar](100) NULL,
[DisplayName] [nvarchar](100) NULL,
[IssuesPageSize] [int] NULL,
[PreferredLocale] [nvarchar](50) NULL,
[LastUpdate] [datetime] NOT NULL,
[SelectedIssueColumns] [nvarchar](50) NULL,
[ReceiveEmailNotifications] [bit] NOT NULL CONSTRAINT [DF_BugNet_UserProfiles_RecieveEmailNotifications] DEFAULT ((1)),
[PasswordVerificationToken] [nvarchar](128) NULL,
[PasswordVerificationTokenExpirationDate] [datetime] NULL,
CONSTRAINT [PK_BugNet_UserProfiles] PRIMARY KEY CLUSTERED
(
[UserName] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
GO
/****** Object: Table [dbo].[BugNet_UserProjects] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[BugNet_UserProjects](
[UserId] [uniqueidentifier] NOT NULL,
[ProjectId] [int] NOT NULL,
[UserProjectId] [int] IDENTITY(1,1) NOT NULL,
[DateCreated] [datetime] NOT NULL,
[SelectedIssueColumns] [nvarchar](255) NULL,
CONSTRAINT [PK_BugNet_UserProjects] PRIMARY KEY CLUSTERED
(
[UserId] ASC,
[ProjectId] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
GO
/****** Object: Table [dbo].[BugNet_UserRoles] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[BugNet_UserRoles](
[UserId] [uniqueidentifier] NOT NULL,
[RoleId] [int] NOT NULL,
CONSTRAINT [PK_BugNet_UserRoles] PRIMARY KEY CLUSTERED
(
[UserId] ASC,
[RoleId] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
GO
/****** Object: Table [dbo].[Memberships] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Memberships](
[ApplicationId] [uniqueidentifier] NOT NULL,
[UserId] [uniqueidentifier] NOT NULL,
[Password] [nvarchar](128) NOT NULL,
[PasswordFormat] [int] NOT NULL,
[PasswordSalt] [nvarchar](128) NOT NULL,
[Email] [nvarchar](256) NULL,
[PasswordQuestion] [nvarchar](256) NULL,
[PasswordAnswer] [nvarchar](128) NULL,
[IsApproved] [bit] NOT NULL,
[IsLockedOut] [bit] NOT NULL,
[CreateDate] [datetime] NOT NULL,
[LastLoginDate] [datetime] NOT NULL,
[LastPasswordChangedDate] [datetime] NOT NULL,
[LastLockoutDate] [datetime] NOT NULL,
[FailedPasswordAttemptCount] [int] NOT NULL,
[FailedPasswordAttemptWindowStart] [datetime] NOT NULL,
[FailedPasswordAnswerAttemptCount] [int] NOT NULL,
[FailedPasswordAnswerAttemptWindowsStart] [datetime] NOT NULL,
[Comment] [nvarchar](256) NULL,
PRIMARY KEY CLUSTERED
(
[UserId] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
GO
/****** Object: Table [dbo].[Profiles] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Profiles](
[UserId] [uniqueidentifier] NOT NULL,
[PropertyNames] [nvarchar](4000) NOT NULL,
[PropertyValueStrings] [nvarchar](4000) NOT NULL,
[PropertyValueBinary] [image] NOT NULL,
[LastUpdatedDate] [datetime] NOT NULL,
PRIMARY KEY CLUSTERED
(
[UserId] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
GO
/****** Object: Table [dbo].[Roles] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Roles](
[ApplicationId] [uniqueidentifier] NOT NULL,
[RoleId] [uniqueidentifier] NOT NULL,
[RoleName] [nvarchar](256) NOT NULL,
[Description] [nvarchar](256) NULL,
PRIMARY KEY CLUSTERED
(
[RoleId] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
GO
/****** Object: Table [dbo].[Users] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Users](
[ApplicationId] [uniqueidentifier] NOT NULL,
[UserId] [uniqueidentifier] NOT NULL,
[UserName] [nvarchar](50) NOT NULL,
[IsAnonymous] [bit] NOT NULL,
[LastActivityDate] [datetime] NOT NULL,
PRIMARY KEY CLUSTERED
(
[UserId] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
GO
/****** Object: Table [dbo].[UsersInRoles] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[UsersInRoles](
[UserId] [uniqueidentifier] NOT NULL,
[RoleId] [uniqueidentifier] NOT NULL,
PRIMARY KEY CLUSTERED
(
[UserId] ASC,
[RoleId] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
GO
/****** Object: Table [dbo].[UsersOpenAuthAccounts] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[UsersOpenAuthAccounts](
[ApplicationName] [nvarchar](128) NOT NULL,
[ProviderName] [nvarchar](128) NOT NULL,
[ProviderUserId] [nvarchar](128) NOT NULL,
[ProviderUserName] [nvarchar](max) NOT NULL,
[MembershipUserName] [nvarchar](128) NOT NULL,
[LastUsedUtc] [datetime] NULL,
PRIMARY KEY CLUSTERED
(
[ApplicationName] ASC,
[ProviderName] ASC,
[ProviderUserId] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
GO
/****** Object: Table [dbo].[UsersOpenAuthData] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[UsersOpenAuthData](
[ApplicationName] [nvarchar](128) NOT NULL,
[MembershipUserName] [nvarchar](128) NOT NULL,
[HasLocalPassword] [bit] NOT NULL,
PRIMARY KEY CLUSTERED
(
[ApplicationName] ASC,
[MembershipUserName] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
GO
/****** Object: View [dbo].[BugNet_IssuesView] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE 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(dbo.BugNet_ProjectStatus.SortOrder, 0) AS StatusSortOrder, ISNULL(dbo.BugNet_ProjectPriorities.SortOrder, 0)
AS PrioritySortOrder, ISNULL(dbo.BugNet_ProjectIssueTypes.SortOrder, 0) AS IssueTypeSortOrder, ISNULL(dbo.BugNet_ProjectMilestones.SortOrder, 0) AS MilestoneSortOrder,
ISNULL(AffectedMilestone.SortOrder, 0) AS AffectedMilestoneSortOrder, ISNULL(dbo.BugNet_ProjectResolutions.SortOrder, 0) AS ResolutionSortOrder, 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.Users AS AssignedUsers ON dbo.BugNet_Issues.IssueAssignedUserId = AssignedUsers.UserId LEFT OUTER JOIN
dbo.Users AS LastUpdateUsers ON dbo.BugNet_Issues.LastUpdateUserId = LastUpdateUsers.UserId LEFT OUTER JOIN
dbo.Users AS CreatorUsers ON dbo.BugNet_Issues.IssueCreatorUserId = CreatorUsers.UserId LEFT OUTER JOIN
dbo.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: View [dbo].[BugNet_UserView] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[BugNet_UserView]
AS
SELECT dbo.Users.UserId, dbo.BugNet_UserProfiles.FirstName, dbo.BugNet_UserProfiles.LastName, dbo.BugNet_UserProfiles.DisplayName,
dbo.Users.UserName, dbo.Memberships.Email,
dbo.Memberships.IsApproved, dbo.Memberships.IsLockedOut, dbo.Users.IsAnonymous,
dbo.Users.LastActivityDate, dbo.BugNet_UserProfiles.IssuesPageSize, dbo.BugNet_UserProfiles.PreferredLocale
FROM dbo.Users INNER JOIN
dbo.Memberships ON dbo.Users.UserId = dbo.Memberships.UserId INNER JOIN
dbo.BugNet_UserProfiles ON dbo.Users.UserName = dbo.BugNet_UserProfiles.UserName
GROUP BY dbo.Users.UserId, dbo.Users.UserName, dbo.Memberships.Email, dbo.Memberships.IsApproved, dbo.Memberships.IsLockedOut, dbo.Users.IsAnonymous,
dbo.Users.LastActivityDate, dbo.BugNet_UserProfiles.FirstName, dbo.BugNet_UserProfiles.LastName, dbo.BugNet_UserProfiles.DisplayName,
dbo.BugNet_UserProfiles.IssuesPageSize, dbo.BugNet_UserProfiles.PreferredLocale
GO
/****** Object: View [dbo].[BugNet_IssueAssignedToCountView] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[BugNet_IssueAssignedToCountView]
AS
SELECT dbo.BugNet_IssuesView.ProjectId, ISNULL(dbo.BugNet_IssuesView.IssueAssignedUserId, '00000000-0000-0000-0000-000000000000') AS AssignedUserId,
dbo.BugNet_IssuesView.AssignedDisplayName AS AssignedName, '' AS AssignedImageUrl, CASE WHEN dbo.BugNet_IssuesView.IssueAssignedUserId IS NULL
THEN 999 ELSE 0 END AS SortOrder, COUNT(DISTINCT dbo.BugNet_IssuesView.IssueId) AS Number
FROM dbo.BugNet_IssuesView LEFT OUTER JOIN
dbo.BugNet_UserView ON dbo.BugNet_IssuesView.IssueAssignedUserId = dbo.BugNet_UserView.UserId
WHERE (dbo.BugNet_IssuesView.IsClosed = 0) AND (dbo.BugNet_IssuesView.Disabled = 0)
GROUP BY dbo.BugNet_IssuesView.ProjectId, dbo.BugNet_IssuesView.AssignedDisplayName, CASE WHEN dbo.BugNet_IssuesView.IssueAssignedUserId IS NULL
THEN 999 ELSE 0 END, ISNULL(dbo.BugNet_IssuesView.IssueAssignedUserId, '00000000-0000-0000-0000-000000000000')
GO
/****** Object: View [dbo].[BugNet_IssueCommentsView] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[BugNet_IssueCommentsView]
AS
SELECT dbo.BugNet_IssueComments.IssueCommentId, dbo.BugNet_IssueComments.IssueId, dbo.BugNet_IssuesView.ProjectId, dbo.BugNet_IssueComments.Comment,
dbo.BugNet_IssueComments.DateCreated, dbo.BugNet_UserView.UserId AS CreatorUserId, dbo.BugNet_UserView.DisplayName AS CreatorDisplayName,
dbo.BugNet_UserView.UserName AS CreatorUserName, dbo.BugNet_IssuesView.Disabled AS IssueDisabled, dbo.BugNet_IssuesView.IsClosed AS IssueIsClosed,
dbo.BugNet_IssuesView.IssueVisibility, dbo.BugNet_IssuesView.ProjectCode, dbo.BugNet_IssuesView.ProjectName, dbo.BugNet_IssuesView.ProjectDisabled
FROM dbo.BugNet_IssuesView INNER JOIN
dbo.BugNet_IssueComments ON dbo.BugNet_IssuesView.IssueId = dbo.BugNet_IssueComments.IssueId INNER JOIN
dbo.BugNet_UserView ON dbo.BugNet_IssueComments.UserId = dbo.BugNet_UserView.UserId
GO
/****** Object: View [dbo].[BugNet_DefaultValView] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[BugNet_DefaultValView]
AS
SELECT dbo.BugNet_DefaultValues.DefaultType, dbo.BugNet_DefaultValues.StatusId, dbo.BugNet_DefaultValues.IssueOwnerUserId,
dbo.BugNet_DefaultValues.IssuePriorityId, dbo.BugNet_DefaultValues.IssueAffectedMilestoneId, dbo.BugNet_DefaultValues.ProjectId,
ISNULL(OwnerUsers.UserName, N'none') AS OwnerUserName, ISNULL(OwnerUsersProfile.DisplayName, N'none') AS OwnerDisplayName,
ISNULL(AssignedUsers.UserName, N'none') AS AssignedUserName, ISNULL(AssignedUsersProfile.DisplayName, N'none') AS AssignedDisplayName,
dbo.BugNet_DefaultValues.IssueAssignedUserId, dbo.BugNet_DefaultValues.IssueCategoryId, dbo.BugNet_DefaultValues.IssueVisibility,
dbo.BugNet_DefaultValues.IssueDueDate, dbo.BugNet_DefaultValues.IssueProgress, dbo.BugNet_DefaultValues.IssueMilestoneId,
dbo.BugNet_DefaultValues.IssueEstimation, dbo.BugNet_DefaultValues.IssueResolutionId, dbo.BugNet_DefaultValuesVisibility.StatusVisibility,
dbo.BugNet_DefaultValuesVisibility.PriorityVisibility, dbo.BugNet_DefaultValuesVisibility.OwnedByVisibility,
dbo.BugNet_DefaultValuesVisibility.AssignedToVisibility, dbo.BugNet_DefaultValuesVisibility.PrivateVisibility,
dbo.BugNet_DefaultValuesVisibility.CategoryVisibility, dbo.BugNet_DefaultValuesVisibility.DueDateVisibility,
dbo.BugNet_DefaultValuesVisibility.TypeVisibility, dbo.BugNet_DefaultValuesVisibility.PercentCompleteVisibility,
dbo.BugNet_DefaultValuesVisibility.MilestoneVisibility, dbo.BugNet_DefaultValuesVisibility.ResolutionVisibility,
dbo.BugNet_DefaultValuesVisibility.EstimationVisibility, dbo.BugNet_DefaultValuesVisibility.AffectedMilestoneVisibility,
dbo.BugNet_DefaultValues.OwnedByNotify, dbo.BugNet_DefaultValues.AssignedToNotify,
dbo.BugNet_DefaultValuesVisibility.StatusEditVisibility,
dbo.BugNet_DefaultValuesVisibility.PriorityEditVisibility, dbo.BugNet_DefaultValuesVisibility.OwnedByEditVisibility,
dbo.BugNet_DefaultValuesVisibility.AssignedToEditVisibility, dbo.BugNet_DefaultValuesVisibility.PrivateEditVisibility,
dbo.BugNet_DefaultValuesVisibility.CategoryEditVisibility, dbo.BugNet_DefaultValuesVisibility.DueDateEditVisibility,
dbo.BugNet_DefaultValuesVisibility.TypeEditVisibility, dbo.BugNet_DefaultValuesVisibility.PercentCompleteEditVisibility,
dbo.BugNet_DefaultValuesVisibility.MilestoneEditVisibility, dbo.BugNet_DefaultValuesVisibility.ResolutionEditVisibility,
dbo.BugNet_DefaultValuesVisibility.EstimationEditVisibility, dbo.BugNet_DefaultValuesVisibility.AffectedMilestoneEditVisibility
FROM dbo.BugNet_DefaultValues LEFT OUTER JOIN
dbo.Users AS OwnerUsers ON dbo.BugNet_DefaultValues.IssueOwnerUserId = OwnerUsers.UserId LEFT OUTER JOIN
dbo.Users AS AssignedUsers ON dbo.BugNet_DefaultValues.IssueAssignedUserId = AssignedUsers.UserId 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_DefaultValuesVisibility ON dbo.BugNet_DefaultValues.ProjectId = dbo.BugNet_DefaultValuesVisibility.ProjectId
GO
/****** Object: View [dbo].[BugNet_GetIssuesByProjectIdAndCustomFieldView] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[BugNet_GetIssuesByProjectIdAndCustomFieldView]
AS
SELECT
dbo.BugNet_Issues.IssueId,
dbo.BugNet_Issues.Disabled,
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.IssueAffectedMilestoneId,
dbo.BugNet_Issues.IssueOwnerUserId,
dbo.BugNet_Issues.IssueDueDate,
dbo.BugNet_Issues.IssueMilestoneId,
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'none') AS PriorityName,
ISNULL(dbo.BugNet_ProjectIssueTypes.IssueTypeName,N'none') AS IssueTypeName,
ISNULL(dbo.BugNet_ProjectCategories.CategoryName, N'none') AS CategoryName,
ISNULL(dbo.BugNet_ProjectStatus.StatusName, N'none') AS StatusName ,
ISNULL(dbo.BugNet_ProjectMilestones.MilestoneName, N'none') AS MilestoneName,
ISNULL(AffectedMilestone.MilestoneName, N'none') AS AffectedMilestoneName,
ISNULL(dbo.BugNet_ProjectResolutions.ResolutionName, 'none') AS ResolutionName,
LastUpdateUsers.UserName AS LastUpdateUserName,
ISNULL(AssignedUsers.UserName, N'none') AS AssignedUserName,
ISNULL(AssignedUsersProfile.DisplayName, N'none') AS AssignedDisplayName,
CreatorUsers.UserName AS CreatorUserName,
ISNULL(CreatorUsersProfile.DisplayName, N'none') AS CreatorDisplayName,
ISNULL(OwnerUsers.UserName, 'none') AS OwnerUserName,
ISNULL(OwnerUsersProfile.DisplayName, N'none') AS OwnerDisplayName,
ISNULL(LastUpdateUsersProfile.DisplayName, 'none') 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_ProjectCustomFields.CustomFieldName,
dbo.BugNet_ProjectCustomFieldValues.CustomFieldValue,
dbo.BugNet_Issues.IssueProgress,
dbo.BugNet_ProjectMilestones.MilestoneDueDate,
dbo.BugNet_Projects.ProjectDisabled,
CAST(COALESCE (dbo.BugNet_ProjectStatus.IsClosedState, 0) AS BIT) AS IsClosed
FROM
dbo.BugNet_ProjectCustomFields
INNER JOIN
dbo.BugNet_ProjectCustomFieldValues ON dbo.BugNet_ProjectCustomFields.CustomFieldId = dbo.BugNet_ProjectCustomFieldValues.CustomFieldId
RIGHT OUTER JOIN
dbo.BugNet_Issues ON dbo.BugNet_ProjectCustomFieldValues.IssueId = dbo.BugNet_Issues.IssueId
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.Users AS AssignedUsers ON dbo.BugNet_Issues.IssueAssignedUserId = AssignedUsers.UserId
LEFT OUTER JOIN
dbo.Users AS LastUpdateUsers ON dbo.BugNet_Issues.LastUpdateUserId = LastUpdateUsers.UserId
LEFT OUTER JOIN
dbo.Users AS CreatorUsers ON dbo.BugNet_Issues.IssueCreatorUserId = CreatorUsers.UserId
LEFT OUTER JOIN
dbo.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: View [dbo].[BugNet_ProjectsView] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[BugNet_ProjectsView]
AS
SELECT TOP (100) PERCENT dbo.BugNet_Projects.ProjectId, dbo.BugNet_Projects.ProjectName, dbo.BugNet_Projects.ProjectCode, dbo.BugNet_Projects.ProjectDescription,
dbo.BugNet_Projects.AttachmentUploadPath, dbo.BugNet_Projects.ProjectManagerUserId, dbo.BugNet_Projects.ProjectCreatorUserId,
dbo.BugNet_Projects.DateCreated, dbo.BugNet_Projects.ProjectDisabled, dbo.BugNet_Projects.ProjectAccessType, Managers.UserName AS ManagerUserName,
ISNULL(ManagerUsersProfile.DisplayName, N'none') AS ManagerDisplayName, Creators.UserName AS CreatorUserName, ISNULL(CreatorUsersProfile.DisplayName,
N'none') AS CreatorDisplayName, dbo.BugNet_Projects.AllowAttachments, dbo.BugNet_Projects.AttachmentStorageType, dbo.BugNet_Projects.SvnRepositoryUrl,
dbo.BugNet_Projects.AllowIssueVoting
FROM dbo.BugNet_Projects INNER JOIN
dbo.Users AS Managers ON Managers.UserId = dbo.BugNet_Projects.ProjectManagerUserId INNER JOIN
dbo.Users AS Creators ON Creators.UserId = dbo.BugNet_Projects.ProjectCreatorUserId LEFT OUTER JOIN
dbo.BugNet_UserProfiles AS CreatorUsersProfile ON Creators.UserName = CreatorUsersProfile.UserName LEFT OUTER JOIN
dbo.BugNet_UserProfiles AS ManagerUsersProfile ON Managers.UserName = ManagerUsersProfile.UserName
ORDER BY dbo.BugNet_Projects.ProjectName
GO
SET ANSI_PADDING ON
GO
/****** Object: Index [IX_BugNet_IssueAttachments_DateCreated_IssueId] Script Date: 11/2/2014 3:54:01 PM ******/
CREATE NONCLUSTERED INDEX [IX_BugNet_IssueAttachments_DateCreated_IssueId] ON [dbo].[BugNet_IssueAttachments]
(
[DateCreated] DESC,
[IssueId] ASC
)
INCLUDE ( [IssueAttachmentId],
[FileName],
[Description],
[FileSize],
[ContentType],
[UserId],
[Attachment]) WITH (STATISTICS_NORECOMPUTE = OFF, DROP_EXISTING = OFF, ONLINE = OFF)
GO
SET ANSI_PADDING ON
GO
/****** Object: Index [IX_BugNet_IssueComments_IssueId_UserId_DateCreated] Script Date: 11/2/2014 3:54:01 PM ******/
CREATE NONCLUSTERED INDEX [IX_BugNet_IssueComments_IssueId_UserId_DateCreated] ON [dbo].[BugNet_IssueComments]
(
[IssueId] ASC,
[UserId] ASC,
[DateCreated] ASC
)
INCLUDE ( [IssueCommentId],
[Comment]) WITH (STATISTICS_NORECOMPUTE = OFF, DROP_EXISTING = OFF, ONLINE = OFF)
GO
SET ANSI_PADDING ON
GO
/****** Object: Index [IX_BugNet_IssueHistory_IssueId_UserId_DateCreated] Script Date: 11/2/2014 3:54:01 PM ******/
CREATE NONCLUSTERED INDEX [IX_BugNet_IssueHistory_IssueId_UserId_DateCreated] ON [dbo].[BugNet_IssueHistory]
(
[IssueId] ASC,
[UserId] ASC,
[DateCreated] ASC
)
INCLUDE ( [IssueHistoryId],
[FieldChanged],
[OldValue],
[NewValue]) WITH (STATISTICS_NORECOMPUTE = OFF, DROP_EXISTING = OFF, ONLINE = OFF)
GO
/****** Object: Index [IX_BugNet_Issues_IssueCategoryId_ProjectId_Disabled_IssueStatusId] Script Date: 11/2/2014 3:54:01 PM ******/
CREATE NONCLUSTERED INDEX [IX_BugNet_Issues_IssueCategoryId_ProjectId_Disabled_IssueStatusId] ON [dbo].[BugNet_Issues]
(
[IssueCategoryId] ASC,
[ProjectId] ASC,
[Disabled] ASC,
[IssueStatusId] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, DROP_EXISTING = OFF, ONLINE = OFF)
GO
/****** Object: Index [IX_BugNet_Issues_IssueId_ProjectId_Disabled] Script Date: 11/2/2014 3:54:01 PM ******/
CREATE NONCLUSTERED INDEX [IX_BugNet_Issues_IssueId_ProjectId_Disabled] ON [dbo].[BugNet_Issues]
(
[IssueId] DESC,
[ProjectId] ASC,
[Disabled] ASC
)
INCLUDE ( [IssueStatusId]) WITH (STATISTICS_NORECOMPUTE = OFF, DROP_EXISTING = OFF, ONLINE = OFF)
GO
SET ANSI_PADDING ON
GO
/****** Object: Index [IX_BugNet_Issues_K12_K22_K1_K15_K9_K8_K6_K5_K7_K4_K10_K21_K11_K13_2_3_14_16_17_18_19_20] Script Date: 11/2/2014 3:54:01 PM ******/
CREATE NONCLUSTERED INDEX [IX_BugNet_Issues_K12_K22_K1_K15_K9_K8_K6_K5_K7_K4_K10_K21_K11_K13_2_3_14_16_17_18_19_20] ON [dbo].[BugNet_Issues]
(
[IssueAssignedUserId] ASC,
[Disabled] ASC,
[IssueId] ASC,
[IssueMilestoneId] ASC,
[IssueAffectedMilestoneId] ASC,
[ProjectId] ASC,
[IssueTypeId] ASC,
[IssuePriorityId] ASC,
[IssueCategoryId] ASC,
[IssueStatusId] ASC,
[IssueResolutionId] ASC,
[LastUpdateUserId] ASC,
[IssueCreatorUserId] ASC,
[IssueOwnerUserId] ASC
)
INCLUDE ( [IssueTitle],
[IssueDescription],
[IssueDueDate],
[IssueVisibility],
[IssueEstimation],
[IssueProgress],
[DateCreated],
[LastUpdate]) WITH (STATISTICS_NORECOMPUTE = OFF, DROP_EXISTING = OFF, ONLINE = OFF)
GO
SET ANSI_PADDING ON
GO
/****** Object: Index [IX_BugNet_Issues_K8_K22_K1_K13_K11_K21_K12_K10_K15_K9_K4_K7_K5_K6_2_3_14_16_17_18_19_20] Script Date: 11/2/2014 3:54:01 PM ******/
CREATE NONCLUSTERED INDEX [IX_BugNet_Issues_K8_K22_K1_K13_K11_K21_K12_K10_K15_K9_K4_K7_K5_K6_2_3_14_16_17_18_19_20] ON [dbo].[BugNet_Issues]
(
[ProjectId] ASC,
[Disabled] ASC,
[IssueId] ASC,
[IssueOwnerUserId] ASC,
[IssueCreatorUserId] ASC,
[LastUpdateUserId] ASC,
[IssueAssignedUserId] ASC,
[IssueResolutionId] ASC,
[IssueMilestoneId] ASC,
[IssueAffectedMilestoneId] ASC,
[IssueStatusId] ASC,
[IssueCategoryId] ASC,
[IssuePriorityId] ASC,
[IssueTypeId] ASC
)
INCLUDE ( [IssueTitle],
[IssueDescription],
[IssueDueDate],
[IssueVisibility],
[IssueEstimation],
[IssueProgress],
[DateCreated],
[LastUpdate]) WITH (STATISTICS_NORECOMPUTE = OFF, DROP_EXISTING = OFF, ONLINE = OFF)
GO
SET ANSI_PADDING ON
GO
/****** Object: Index [IDX_UserName] Script Date: 11/2/2014 3:54:01 PM ******/
CREATE NONCLUSTERED INDEX [IDX_UserName] ON [dbo].[Users]
(
[UserName] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, DROP_EXISTING = OFF, ONLINE = OFF)
GO
ALTER TABLE [dbo].[BugNet_DefaultValues] ADD CONSTRAINT [DF_BugNet_DefaultValues_OwnedByNotify] DEFAULT ((1)) FOR [OwnedByNotify]
GO
ALTER TABLE [dbo].[BugNet_DefaultValues] ADD CONSTRAINT [DF_BugNet_DefaultValues_AssignedTo] DEFAULT ((1)) FOR [AssignedToNotify]
GO
ALTER TABLE [dbo].[BugNet_DefaultValuesVisibility] ADD CONSTRAINT [DF_Bugnet_DefaultValuesVisibility_StatusVisibility] DEFAULT ((1)) FOR [StatusVisibility]
GO
ALTER TABLE [dbo].[BugNet_DefaultValuesVisibility] ADD CONSTRAINT [DF_Bugnet_DefaultValuesVisibility_OwnedByVisibility] DEFAULT ((1)) FOR [OwnedByVisibility]
GO
ALTER TABLE [dbo].[BugNet_DefaultValuesVisibility] ADD CONSTRAINT [DF_Bugnet_DefaultValuesVisibility_PriorityVisibility] DEFAULT ((1)) FOR [PriorityVisibility]
GO
ALTER TABLE [dbo].[BugNet_DefaultValuesVisibility] ADD CONSTRAINT [DF_Bugnet_DefaultValuesVisibility_AssignedToVisibility] DEFAULT ((1)) FOR [AssignedToVisibility]
GO
ALTER TABLE [dbo].[BugNet_DefaultValuesVisibility] ADD CONSTRAINT [DF_Bugnet_DefaultValuesVisibility_PrivateVisibility] DEFAULT ((1)) FOR [PrivateVisibility]
GO
ALTER TABLE [dbo].[BugNet_DefaultValuesVisibility] ADD CONSTRAINT [DF_Bugnet_DefaultValuesVisibility_CategoryVisibility] DEFAULT ((1)) FOR [CategoryVisibility]
GO
ALTER TABLE [dbo].[BugNet_DefaultValuesVisibility] ADD CONSTRAINT [DF_Bugnet_DefaultValuesVisibility_DueDateVisibility] DEFAULT ((1)) FOR [DueDateVisibility]
GO
ALTER TABLE [dbo].[BugNet_DefaultValuesVisibility] ADD CONSTRAINT [DF_Bugnet_DefaultValuesVisibility_TypeVisibility] DEFAULT ((1)) FOR [TypeVisibility]
GO
ALTER TABLE [dbo].[BugNet_DefaultValuesVisibility] ADD CONSTRAINT [DF_Bugnet_DefaultValuesVisibility_PercentCompleteVisibility] DEFAULT ((1)) FOR [PercentCompleteVisibility]
GO
ALTER TABLE [dbo].[BugNet_DefaultValuesVisibility] ADD CONSTRAINT [DF_Bugnet_DefaultValuesVisibility_MilestoneVisibility] DEFAULT ((1)) FOR [MilestoneVisibility]
GO
ALTER TABLE [dbo].[BugNet_DefaultValuesVisibility] ADD CONSTRAINT [DF_Bugnet_DefaultValuesVisibility_EstimationVisibility] DEFAULT ((1)) FOR [EstimationVisibility]
GO
ALTER TABLE [dbo].[BugNet_DefaultValuesVisibility] ADD CONSTRAINT [DF_Bugnet_DefaultValuesVisibility_ResolutionVisibility] DEFAULT ((1)) FOR [ResolutionVisibility]
GO
ALTER TABLE [dbo].[BugNet_DefaultValuesVisibility] ADD CONSTRAINT [DF_Bugnet_DefaultValuesVisibility_AffectedMilestoneVisibility] DEFAULT ((1)) FOR [AffectedMilestoneVisibility]
GO
ALTER TABLE [dbo].[BugNet_DefaultValuesVisibility] ADD CONSTRAINT [DF_Bugnet_DefaultValuesVisibility_StatusEditVisibility] DEFAULT ((1)) FOR [StatusEditVisibility]
GO
ALTER TABLE [dbo].[BugNet_DefaultValuesVisibility] ADD CONSTRAINT [DF_Bugnet_DefaultValuesVisibility_OwnedByEditVisibility] DEFAULT ((1)) FOR [OwnedByEditVisibility]
GO
ALTER TABLE [dbo].[BugNet_DefaultValuesVisibility] ADD CONSTRAINT [DF_Bugnet_DefaultValuesVisibility_PriorityEditVisibility] DEFAULT ((1)) FOR [PriorityEditVisibility]
GO
ALTER TABLE [dbo].[BugNet_DefaultValuesVisibility] ADD CONSTRAINT [DF_Bugnet_DefaultValuesVisibility_AssignedToEditVisibility] DEFAULT ((1)) FOR [AssignedToEditVisibility]
GO
ALTER TABLE [dbo].[BugNet_DefaultValuesVisibility] ADD CONSTRAINT [DF_Bugnet_DefaultValuesVisibility_PrivateEditVisibility] DEFAULT ((1)) FOR [PrivateEditVisibility]
GO
ALTER TABLE [dbo].[BugNet_DefaultValuesVisibility] ADD CONSTRAINT [DF_Bugnet_DefaultValuesVisibility_CategoryEditVisibility] DEFAULT ((1)) FOR [CategoryEditVisibility]
GO
ALTER TABLE [dbo].[BugNet_DefaultValuesVisibility] ADD CONSTRAINT [DF_Bugnet_DefaultValuesVisibility_DueDateEditVisibility] DEFAULT ((1)) FOR [DueDateEditVisibility]
GO
ALTER TABLE [dbo].[BugNet_DefaultValuesVisibility] ADD CONSTRAINT [DF_Bugnet_DefaultValuesVisibility_TypeEditVisibility] DEFAULT ((1)) FOR [TypeEditVisibility]
GO
ALTER TABLE [dbo].[BugNet_DefaultValuesVisibility] ADD CONSTRAINT [DF_Bugnet_DefaultValuesVisibility_PercentCompleteEditVisibility] DEFAULT ((1)) FOR [PercentCompleteEditVisibility]
GO
ALTER TABLE [dbo].[BugNet_DefaultValuesVisibility] ADD CONSTRAINT [DF_Bugnet_DefaultValuesVisibility_MilestoneEditVisibility] DEFAULT ((1)) FOR [MilestoneEditVisibility]
GO
ALTER TABLE [dbo].[BugNet_DefaultValuesVisibility] ADD CONSTRAINT [DF_Bugnet_DefaultValuesVisibility_EstimationEditVisibility] DEFAULT ((1)) FOR [EstimationEditVisibility]
GO
ALTER TABLE [dbo].[BugNet_DefaultValuesVisibility] ADD CONSTRAINT [DF_Bugnet_DefaultValuesVisibility_ResolutionEditVisibility] DEFAULT ((1)) FOR [ResolutionEditVisibility]
GO
ALTER TABLE [dbo].[BugNet_DefaultValuesVisibility] ADD CONSTRAINT [DF_Bugnet_DefaultValuesVisibility_AffectedMilestoneEditVisibility] DEFAULT ((1)) FOR [AffectedMilestoneEditVisibility]
GO
ALTER TABLE [dbo].[BugNet_IssueAttachments] ADD CONSTRAINT [DF_BugNet_IssueAttachments_DateCreated] DEFAULT (getdate()) FOR [DateCreated]
GO
ALTER TABLE [dbo].[BugNet_IssueComments] ADD CONSTRAINT [DF_BugNet_IssueComments_DateCreated] DEFAULT (getdate()) FOR [DateCreated]
GO
ALTER TABLE [dbo].[BugNet_IssueHistory] ADD CONSTRAINT [DF_BugNet_IssueHistory_DateCreated] DEFAULT (getdate()) FOR [DateCreated]
GO
ALTER TABLE [dbo].[BugNet_Issues] ADD CONSTRAINT [DF_BugNet_Issues_DueDate] DEFAULT ('1/1/1900 12:00:00 AM') FOR [IssueDueDate]
GO
ALTER TABLE [dbo].[BugNet_Issues] ADD CONSTRAINT [DF_BugNet_Issues_Estimation] DEFAULT ((0)) FOR [IssueEstimation]
GO
ALTER TABLE [dbo].[BugNet_Issues] ADD CONSTRAINT [DF_BugNet_Issues_IssueProgress] DEFAULT ((0)) FOR [IssueProgress]
GO
ALTER TABLE [dbo].[BugNet_Issues] ADD CONSTRAINT [DF_BugNet_Issues_DateCreated] DEFAULT (getdate()) FOR [DateCreated]
GO
ALTER TABLE [dbo].[BugNet_Issues] ADD CONSTRAINT [DF_BugNet_Issues_Disabled] DEFAULT ((0)) FOR [Disabled]
GO
ALTER TABLE [dbo].[BugNet_ProjectCategories] ADD CONSTRAINT [DF_BugNet_ProjectCategories_ParentCategoryId] DEFAULT ((0)) FOR [ParentCategoryId]
GO
ALTER TABLE [dbo].[BugNet_ProjectCategories] ADD CONSTRAINT [DF_BugNet_ProjectCategories_Disabled] DEFAULT ((0)) FOR [Disabled]
GO
ALTER TABLE [dbo].[BugNet_ProjectCustomFieldSelections] ADD CONSTRAINT [DF_BugNet_ProjectCustomFieldSelections_CustomFieldSelectionSortOrder] DEFAULT ((0)) FOR [CustomFieldSelectionSortOrder]
GO
ALTER TABLE [dbo].[BugNet_ProjectMilestones] ADD CONSTRAINT [DF_BugNet_ProjectMilestones_CreateDate] DEFAULT (getdate()) FOR [DateCreated]
GO
ALTER TABLE [dbo].[BugNet_ProjectMilestones] ADD CONSTRAINT [DF_BugNet_ProjectMilestones_Completed] DEFAULT ((0)) FOR [MilestoneCompleted]
GO
ALTER TABLE [dbo].[BugNet_Projects] ADD CONSTRAINT [DF_BugNet_Projects_DateCreated] DEFAULT (getdate()) FOR [DateCreated]
GO
ALTER TABLE [dbo].[BugNet_Projects] ADD CONSTRAINT [DF_BugNet_Projects_Active] DEFAULT ((0)) FOR [ProjectDisabled]
GO
ALTER TABLE [dbo].[BugNet_Projects] ADD CONSTRAINT [DF_BugNet_Projects_AllowAttachments] DEFAULT ((1)) FOR [AllowAttachments]
GO
ALTER TABLE [dbo].[BugNet_Projects] ADD CONSTRAINT [DF_BugNet_Projects_AllowIssueVoting] DEFAULT ((1)) FOR [AllowIssueVoting]
GO
ALTER TABLE [dbo].[BugNet_Queries] ADD CONSTRAINT [DF_BugNet_Queries_IsPublic] DEFAULT ((0)) FOR [IsPublic]
GO
ALTER TABLE [dbo].[BugNet_UserProjects] ADD CONSTRAINT [DF__BugNet_Us__Selec__7E42ABEE] DEFAULT ((0)) FOR [SelectedIssueColumns]
GO
ALTER TABLE [dbo].[BugNet_DefaultValues] WITH CHECK ADD CONSTRAINT [FK_BugNet_DefaultValues_BugNet_Projects] FOREIGN KEY([ProjectId])
REFERENCES [dbo].[BugNet_Projects] ([ProjectId])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[BugNet_DefaultValues] CHECK CONSTRAINT [FK_BugNet_DefaultValues_BugNet_Projects]
GO
ALTER TABLE [dbo].[BugNet_DefaultValues] WITH NOCHECK ADD CONSTRAINT [FK_BugNet_DefaultValues_Users] FOREIGN KEY([IssueOwnerUserId])
REFERENCES [dbo].[Users] ([UserId])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[BugNet_DefaultValues] CHECK CONSTRAINT [FK_BugNet_DefaultValues_Users]
GO
ALTER TABLE [dbo].[BugNet_DefaultValues] WITH NOCHECK ADD CONSTRAINT [FK_BugNet_DefaultValues_Users1] FOREIGN KEY([IssueAssignedUserId])
REFERENCES [dbo].[Users] ([UserId])
GO
ALTER TABLE [dbo].[BugNet_DefaultValues] CHECK CONSTRAINT [FK_BugNet_DefaultValues_Users1]
GO
ALTER TABLE [dbo].[BugNet_IssueAttachments] WITH CHECK ADD CONSTRAINT [FK_BugNet_IssueAttachments_BugNet_Issues] FOREIGN KEY([IssueId])
REFERENCES [dbo].[BugNet_Issues] ([IssueId])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[BugNet_IssueAttachments] CHECK CONSTRAINT [FK_BugNet_IssueAttachments_BugNet_Issues]
GO
ALTER TABLE [dbo].[BugNet_IssueAttachments] WITH NOCHECK ADD CONSTRAINT [FK_BugNet_IssueAttachments_Users] FOREIGN KEY([UserId])
REFERENCES [dbo].[Users] ([UserId])
GO
ALTER TABLE [dbo].[BugNet_IssueAttachments] CHECK CONSTRAINT [FK_BugNet_IssueAttachments_Users]
GO
ALTER TABLE [dbo].[BugNet_IssueComments] WITH CHECK ADD CONSTRAINT [FK_BugNet_IssueComments_BugNet_Issues] FOREIGN KEY([IssueId])
REFERENCES [dbo].[BugNet_Issues] ([IssueId])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[BugNet_IssueComments] CHECK CONSTRAINT [FK_BugNet_IssueComments_BugNet_Issues]
GO
ALTER TABLE [dbo].[BugNet_IssueComments] WITH NOCHECK ADD CONSTRAINT [FK_BugNet_IssueComments_Users] FOREIGN KEY([UserId])
REFERENCES [dbo].[Users] ([UserId])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[BugNet_IssueComments] CHECK CONSTRAINT [FK_BugNet_IssueComments_Users]
GO
ALTER TABLE [dbo].[BugNet_IssueHistory] WITH CHECK ADD CONSTRAINT [FK_BugNet_IssueHistory_BugNet_Issues] FOREIGN KEY([IssueId])
REFERENCES [dbo].[BugNet_Issues] ([IssueId])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[BugNet_IssueHistory] CHECK CONSTRAINT [FK_BugNet_IssueHistory_BugNet_Issues]
GO
ALTER TABLE [dbo].[BugNet_IssueHistory] WITH NOCHECK ADD CONSTRAINT [FK_BugNet_IssueHistory_Users] FOREIGN KEY([UserId])
REFERENCES [dbo].[Users] ([UserId])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[BugNet_IssueHistory] CHECK CONSTRAINT [FK_BugNet_IssueHistory_Users]
GO
ALTER TABLE [dbo].[BugNet_IssueNotifications] WITH CHECK ADD CONSTRAINT [FK_BugNet_IssueNotifications_BugNet_Issues] FOREIGN KEY([IssueId])
REFERENCES [dbo].[BugNet_Issues] ([IssueId])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[BugNet_IssueNotifications] CHECK CONSTRAINT [FK_BugNet_IssueNotifications_BugNet_Issues]
GO
ALTER TABLE [dbo].[BugNet_IssueNotifications] WITH NOCHECK ADD CONSTRAINT [FK_BugNet_IssueNotifications_Users] FOREIGN KEY([UserId])
REFERENCES [dbo].[Users] ([UserId])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[BugNet_IssueNotifications] CHECK CONSTRAINT [FK_BugNet_IssueNotifications_Users]
GO
ALTER TABLE [dbo].[BugNet_IssueRevisions] WITH CHECK ADD CONSTRAINT [FK_BugNet_IssueRevisions_BugNet_Issues] FOREIGN KEY([IssueId])
REFERENCES [dbo].[BugNet_Issues] ([IssueId])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[BugNet_IssueRevisions] CHECK CONSTRAINT [FK_BugNet_IssueRevisions_BugNet_Issues]
GO
ALTER TABLE [dbo].[BugNet_Issues] WITH CHECK ADD CONSTRAINT [FK_BugNet_Issues_BugNet_ProjectCategories] FOREIGN KEY([IssueCategoryId])
REFERENCES [dbo].[BugNet_ProjectCategories] ([CategoryId])
GO
ALTER TABLE [dbo].[BugNet_Issues] CHECK CONSTRAINT [FK_BugNet_Issues_BugNet_ProjectCategories]
GO
ALTER TABLE [dbo].[BugNet_Issues] WITH CHECK ADD CONSTRAINT [FK_BugNet_Issues_BugNet_ProjectIssueTypes] FOREIGN KEY([IssueTypeId])
REFERENCES [dbo].[BugNet_ProjectIssueTypes] ([IssueTypeId])
GO
ALTER TABLE [dbo].[BugNet_Issues] CHECK CONSTRAINT [FK_BugNet_Issues_BugNet_ProjectIssueTypes]
GO
ALTER TABLE [dbo].[BugNet_Issues] WITH CHECK ADD CONSTRAINT [FK_BugNet_Issues_BugNet_ProjectMilestones] FOREIGN KEY([IssueMilestoneId])
REFERENCES [dbo].[BugNet_ProjectMilestones] ([MilestoneId])
GO
ALTER TABLE [dbo].[BugNet_Issues] CHECK CONSTRAINT [FK_BugNet_Issues_BugNet_ProjectMilestones]
GO
ALTER TABLE [dbo].[BugNet_Issues] WITH CHECK ADD CONSTRAINT [FK_BugNet_Issues_BugNet_ProjectMilestones1] FOREIGN KEY([IssueAffectedMilestoneId])
REFERENCES [dbo].[BugNet_ProjectMilestones] ([MilestoneId])
GO
ALTER TABLE [dbo].[BugNet_Issues] CHECK CONSTRAINT [FK_BugNet_Issues_BugNet_ProjectMilestones1]
GO
ALTER TABLE [dbo].[BugNet_Issues] WITH CHECK ADD CONSTRAINT [FK_BugNet_Issues_BugNet_ProjectPriorities] FOREIGN KEY([IssuePriorityId])
REFERENCES [dbo].[BugNet_ProjectPriorities] ([PriorityId])
GO
ALTER TABLE [dbo].[BugNet_Issues] CHECK CONSTRAINT [FK_BugNet_Issues_BugNet_ProjectPriorities]
GO
ALTER TABLE [dbo].[BugNet_Issues] WITH CHECK ADD CONSTRAINT [FK_BugNet_Issues_BugNet_ProjectResolutions] FOREIGN KEY([IssueResolutionId])
REFERENCES [dbo].[BugNet_ProjectResolutions] ([ResolutionId])
GO
ALTER TABLE [dbo].[BugNet_Issues] CHECK CONSTRAINT [FK_BugNet_Issues_BugNet_ProjectResolutions]
GO
ALTER TABLE [dbo].[BugNet_Issues] WITH NOCHECK ADD CONSTRAINT [FK_BugNet_Issues_BugNet_Projects] FOREIGN KEY([ProjectId])
REFERENCES [dbo].[BugNet_Projects] ([ProjectId])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[BugNet_Issues] CHECK CONSTRAINT [FK_BugNet_Issues_BugNet_Projects]
GO
ALTER TABLE [dbo].[BugNet_Issues] WITH CHECK ADD CONSTRAINT [FK_BugNet_Issues_BugNet_ProjectStatus] FOREIGN KEY([IssueStatusId])
REFERENCES [dbo].[BugNet_ProjectStatus] ([StatusId])
GO
ALTER TABLE [dbo].[BugNet_Issues] CHECK CONSTRAINT [FK_BugNet_Issues_BugNet_ProjectStatus]
GO
ALTER TABLE [dbo].[BugNet_Issues] WITH NOCHECK ADD CONSTRAINT [FK_BugNet_Issues_Users] FOREIGN KEY([IssueAssignedUserId])
REFERENCES [dbo].[Users] ([UserId])
GO
ALTER TABLE [dbo].[BugNet_Issues] CHECK CONSTRAINT [FK_BugNet_Issues_Users]
GO
ALTER TABLE [dbo].[BugNet_Issues] WITH NOCHECK ADD CONSTRAINT [FK_BugNet_Issues_Users1] FOREIGN KEY([IssueOwnerUserId])
REFERENCES [dbo].[Users] ([UserId])
GO
ALTER TABLE [dbo].[BugNet_Issues] CHECK CONSTRAINT [FK_BugNet_Issues_Users1]
GO
ALTER TABLE [dbo].[BugNet_Issues] WITH NOCHECK ADD CONSTRAINT [FK_BugNet_Issues_Users2] FOREIGN KEY([LastUpdateUserId])
REFERENCES [dbo].[Users] ([UserId])
GO
ALTER TABLE [dbo].[BugNet_Issues] CHECK CONSTRAINT [FK_BugNet_Issues_Users2]
GO
ALTER TABLE [dbo].[BugNet_Issues] WITH NOCHECK ADD CONSTRAINT [FK_BugNet_Issues_Users3] FOREIGN KEY([IssueCreatorUserId])
REFERENCES [dbo].[Users] ([UserId])
GO
ALTER TABLE [dbo].[BugNet_Issues] CHECK CONSTRAINT [FK_BugNet_Issues_Users3]
GO
ALTER TABLE [dbo].[BugNet_IssueVotes] WITH CHECK ADD CONSTRAINT [FK_BugNet_IssueVotes_BugNet_Issues] FOREIGN KEY([IssueId])
REFERENCES [dbo].[BugNet_Issues] ([IssueId])
GO
ALTER TABLE [dbo].[BugNet_IssueVotes] CHECK CONSTRAINT [FK_BugNet_IssueVotes_BugNet_Issues]
GO
ALTER TABLE [dbo].[BugNet_IssueVotes] WITH NOCHECK ADD CONSTRAINT [FK_BugNet_IssueVotes_Users] FOREIGN KEY([UserId])
REFERENCES [dbo].[Users] ([UserId])
GO
ALTER TABLE [dbo].[BugNet_IssueVotes] CHECK CONSTRAINT [FK_BugNet_IssueVotes_Users]
GO
ALTER TABLE [dbo].[BugNet_IssueWorkReports] WITH CHECK ADD CONSTRAINT [FK_BugNet_IssueWorkReports_BugNet_Issues] FOREIGN KEY([IssueId])
REFERENCES [dbo].[BugNet_Issues] ([IssueId])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[BugNet_IssueWorkReports] CHECK CONSTRAINT [FK_BugNet_IssueWorkReports_BugNet_Issues]
GO
ALTER TABLE [dbo].[BugNet_IssueWorkReports] WITH NOCHECK ADD CONSTRAINT [FK_BugNet_IssueWorkReports_Users] FOREIGN KEY([UserId])
REFERENCES [dbo].[Users] ([UserId])
GO
ALTER TABLE [dbo].[BugNet_IssueWorkReports] CHECK CONSTRAINT [FK_BugNet_IssueWorkReports_Users]
GO
ALTER TABLE [dbo].[BugNet_ProjectCategories] WITH CHECK ADD CONSTRAINT [FK_BugNet_ProjectCategories_BugNet_Projects] FOREIGN KEY([ProjectId])
REFERENCES [dbo].[BugNet_Projects] ([ProjectId])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[BugNet_ProjectCategories] CHECK CONSTRAINT [FK_BugNet_ProjectCategories_BugNet_Projects]
GO
ALTER TABLE [dbo].[BugNet_ProjectCustomFields] WITH CHECK ADD CONSTRAINT [FK_BugNet_ProjectCustomFields_BugNet_ProjectCustomFieldType] FOREIGN KEY([CustomFieldTypeId])
REFERENCES [dbo].[BugNet_ProjectCustomFieldTypes] ([CustomFieldTypeId])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[BugNet_ProjectCustomFields] CHECK CONSTRAINT [FK_BugNet_ProjectCustomFields_BugNet_ProjectCustomFieldType]
GO
ALTER TABLE [dbo].[BugNet_ProjectCustomFields] WITH CHECK ADD CONSTRAINT [FK_BugNet_ProjectCustomFields_BugNet_Projects] FOREIGN KEY([ProjectId])
REFERENCES [dbo].[BugNet_Projects] ([ProjectId])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[BugNet_ProjectCustomFields] CHECK CONSTRAINT [FK_BugNet_ProjectCustomFields_BugNet_Projects]
GO
ALTER TABLE [dbo].[BugNet_ProjectCustomFieldSelections] WITH CHECK ADD CONSTRAINT [FK_BugNet_ProjectCustomFieldSelections_BugNet_ProjectCustomFields] FOREIGN KEY([CustomFieldId])
REFERENCES [dbo].[BugNet_ProjectCustomFields] ([CustomFieldId])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[BugNet_ProjectCustomFieldSelections] CHECK CONSTRAINT [FK_BugNet_ProjectCustomFieldSelections_BugNet_ProjectCustomFields]
GO
ALTER TABLE [dbo].[BugNet_ProjectCustomFieldValues] WITH CHECK ADD CONSTRAINT [FK_BugNet_ProjectCustomFieldValues_BugNet_Issues] FOREIGN KEY([IssueId])
REFERENCES [dbo].[BugNet_Issues] ([IssueId])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[BugNet_ProjectCustomFieldValues] CHECK CONSTRAINT [FK_BugNet_ProjectCustomFieldValues_BugNet_Issues]
GO
ALTER TABLE [dbo].[BugNet_ProjectCustomFieldValues] WITH CHECK ADD CONSTRAINT [FK_BugNet_ProjectCustomFieldValues_BugNet_ProjectCustomFields] FOREIGN KEY([CustomFieldId])
REFERENCES [dbo].[BugNet_ProjectCustomFields] ([CustomFieldId])
GO
ALTER TABLE [dbo].[BugNet_ProjectCustomFieldValues] CHECK CONSTRAINT [FK_BugNet_ProjectCustomFieldValues_BugNet_ProjectCustomFields]
GO
ALTER TABLE [dbo].[BugNet_ProjectIssueTypes] WITH CHECK ADD CONSTRAINT [FK_BugNet_ProjectIssueTypes_BugNet_Projects] FOREIGN KEY([ProjectId])
REFERENCES [dbo].[BugNet_Projects] ([ProjectId])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[BugNet_ProjectIssueTypes] CHECK CONSTRAINT [FK_BugNet_ProjectIssueTypes_BugNet_Projects]
GO
ALTER TABLE [dbo].[BugNet_ProjectMailBoxes] WITH CHECK ADD CONSTRAINT [FK_BugNet_ProjectMailBoxes_BugNet_ProjectIssueTypes] FOREIGN KEY([IssueTypeId])
REFERENCES [dbo].[BugNet_ProjectIssueTypes] ([IssueTypeId])
GO
ALTER TABLE [dbo].[BugNet_ProjectMailBoxes] CHECK CONSTRAINT [FK_BugNet_ProjectMailBoxes_BugNet_ProjectIssueTypes]
GO
ALTER TABLE [dbo].[BugNet_ProjectMailBoxes] WITH NOCHECK ADD CONSTRAINT [FK_BugNet_ProjectMailBoxes_BugNet_Projects] FOREIGN KEY([ProjectId])
REFERENCES [dbo].[BugNet_Projects] ([ProjectId])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[BugNet_ProjectMailBoxes] CHECK CONSTRAINT [FK_BugNet_ProjectMailBoxes_BugNet_Projects]
GO
ALTER TABLE [dbo].[BugNet_ProjectMailBoxes] WITH CHECK ADD CONSTRAINT [FK_BugNet_ProjectMailBoxes_BugNet_ProjectCategories] FOREIGN KEY([CategoryId])
REFERENCES [dbo].[BugNet_ProjectCategories] ([CategoryId])
GO
ALTER TABLE [dbo].[BugNet_ProjectMailBoxes] CHECK CONSTRAINT [FK_BugNet_ProjectMailBoxes_BugNet_ProjectCategories]
GO
ALTER TABLE [dbo].[BugNet_ProjectMailBoxes] WITH NOCHECK ADD CONSTRAINT [FK_BugNet_ProjectMailBoxes_Users] FOREIGN KEY([AssignToUserId])
REFERENCES [dbo].[Users] ([UserId])
GO
ALTER TABLE [dbo].[BugNet_ProjectMailBoxes] CHECK CONSTRAINT [FK_BugNet_ProjectMailBoxes_Users]
GO
ALTER TABLE [dbo].[BugNet_ProjectMilestones] WITH CHECK ADD CONSTRAINT [FK_BugNet_ProjectMilestones_BugNet_Projects] FOREIGN KEY([ProjectId])
REFERENCES [dbo].[BugNet_Projects] ([ProjectId])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[BugNet_ProjectMilestones] CHECK CONSTRAINT [FK_BugNet_ProjectMilestones_BugNet_Projects]
GO
ALTER TABLE [dbo].[BugNet_ProjectNotifications] WITH CHECK ADD CONSTRAINT [FK_BugNet_ProjectNotifications_BugNet_Projects] FOREIGN KEY([ProjectId])
REFERENCES [dbo].[BugNet_Projects] ([ProjectId])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[BugNet_ProjectNotifications] CHECK CONSTRAINT [FK_BugNet_ProjectNotifications_BugNet_Projects]
GO
ALTER TABLE [dbo].[BugNet_ProjectNotifications] WITH NOCHECK ADD CONSTRAINT [FK_BugNet_ProjectNotifications_Users] FOREIGN KEY([UserId])
REFERENCES [dbo].[Users] ([UserId])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[BugNet_ProjectNotifications] CHECK CONSTRAINT [FK_BugNet_ProjectNotifications_Users]
GO
ALTER TABLE [dbo].[BugNet_ProjectPriorities] WITH CHECK ADD CONSTRAINT [FK_BugNet_ProjectPriorities_BugNet_Projects] FOREIGN KEY([ProjectId])
REFERENCES [dbo].[BugNet_Projects] ([ProjectId])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[BugNet_ProjectPriorities] CHECK CONSTRAINT [FK_BugNet_ProjectPriorities_BugNet_Projects]
GO
ALTER TABLE [dbo].[BugNet_ProjectResolutions] WITH CHECK ADD CONSTRAINT [FK_BugNet_ProjectResolutions_BugNet_Projects] FOREIGN KEY([ProjectId])
REFERENCES [dbo].[BugNet_Projects] ([ProjectId])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[BugNet_ProjectResolutions] CHECK CONSTRAINT [FK_BugNet_ProjectResolutions_BugNet_Projects]
GO
ALTER TABLE [dbo].[BugNet_Projects] WITH NOCHECK ADD CONSTRAINT [FK_BugNet_Projects_Users] FOREIGN KEY([ProjectCreatorUserId])
REFERENCES [dbo].[Users] ([UserId])
GO
ALTER TABLE [dbo].[BugNet_Projects] CHECK CONSTRAINT [FK_BugNet_Projects_Users]
GO
ALTER TABLE [dbo].[BugNet_Projects] WITH NOCHECK ADD CONSTRAINT [FK_BugNet_Projects_Users1] FOREIGN KEY([ProjectManagerUserId])
REFERENCES [dbo].[Users] ([UserId])
GO
ALTER TABLE [dbo].[BugNet_Projects] CHECK CONSTRAINT [FK_BugNet_Projects_Users1]
GO
ALTER TABLE [dbo].[BugNet_ProjectStatus] WITH CHECK ADD CONSTRAINT [FK_BugNet_ProjectStatus_BugNet_Projects] FOREIGN KEY([ProjectId])
REFERENCES [dbo].[BugNet_Projects] ([ProjectId])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[BugNet_ProjectStatus] CHECK CONSTRAINT [FK_BugNet_ProjectStatus_BugNet_Projects]
GO
ALTER TABLE [dbo].[BugNet_Queries] WITH CHECK ADD CONSTRAINT [FK_BugNet_Queries_BugNet_Projects] FOREIGN KEY([ProjectId])
REFERENCES [dbo].[BugNet_Projects] ([ProjectId])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[BugNet_Queries] CHECK CONSTRAINT [FK_BugNet_Queries_BugNet_Projects]
GO
ALTER TABLE [dbo].[BugNet_Queries] WITH NOCHECK ADD CONSTRAINT [FK_BugNet_Queries_Users] FOREIGN KEY([UserId])
REFERENCES [dbo].[Users] ([UserId])
GO
ALTER TABLE [dbo].[BugNet_Queries] CHECK CONSTRAINT [FK_BugNet_Queries_Users]
GO
ALTER TABLE [dbo].[BugNet_QueryClauses] WITH CHECK ADD CONSTRAINT [FK_BugNet_QueryClauses_BugNet_Queries] FOREIGN KEY([QueryId])
REFERENCES [dbo].[BugNet_Queries] ([QueryId])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[BugNet_QueryClauses] CHECK CONSTRAINT [FK_BugNet_QueryClauses_BugNet_Queries]
GO
ALTER TABLE [dbo].[BugNet_RelatedIssues] WITH CHECK ADD CONSTRAINT [FK_BugNet_RelatedIssues_BugNet_Issues] FOREIGN KEY([PrimaryIssueId])
REFERENCES [dbo].[BugNet_Issues] ([IssueId])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[BugNet_RelatedIssues] CHECK CONSTRAINT [FK_BugNet_RelatedIssues_BugNet_Issues]
GO
ALTER TABLE [dbo].[BugNet_RelatedIssues] WITH CHECK ADD CONSTRAINT [FK_BugNet_RelatedIssues_BugNet_Issues1] FOREIGN KEY([SecondaryIssueId])
REFERENCES [dbo].[BugNet_Issues] ([IssueId])
GO
ALTER TABLE [dbo].[BugNet_RelatedIssues] CHECK CONSTRAINT [FK_BugNet_RelatedIssues_BugNet_Issues1]
GO
ALTER TABLE [dbo].[BugNet_RolePermissions] WITH NOCHECK ADD CONSTRAINT [FK_BugNet_RolePermissions_BugNet_Permissions] FOREIGN KEY([PermissionId])
REFERENCES [dbo].[BugNet_Permissions] ([PermissionId])
GO
ALTER TABLE [dbo].[BugNet_RolePermissions] CHECK CONSTRAINT [FK_BugNet_RolePermissions_BugNet_Permissions]
GO
ALTER TABLE [dbo].[BugNet_RolePermissions] WITH CHECK ADD CONSTRAINT [FK_BugNet_RolePermissions_BugNet_Roles] FOREIGN KEY([RoleId])
REFERENCES [dbo].[BugNet_Roles] ([RoleId])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[BugNet_RolePermissions] CHECK CONSTRAINT [FK_BugNet_RolePermissions_BugNet_Roles]
GO
ALTER TABLE [dbo].[BugNet_Roles] WITH CHECK ADD CONSTRAINT [FK_BugNet_Roles_BugNet_Projects] FOREIGN KEY([ProjectId])
REFERENCES [dbo].[BugNet_Projects] ([ProjectId])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[BugNet_Roles] CHECK CONSTRAINT [FK_BugNet_Roles_BugNet_Projects]
GO
ALTER TABLE [dbo].[BugNet_UserProjects] WITH CHECK ADD CONSTRAINT [FK_BugNet_UserProjects_BugNet_Projects] FOREIGN KEY([ProjectId])
REFERENCES [dbo].[BugNet_Projects] ([ProjectId])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[BugNet_UserProjects] CHECK CONSTRAINT [FK_BugNet_UserProjects_BugNet_Projects]
GO
ALTER TABLE [dbo].[BugNet_UserProjects] WITH NOCHECK ADD CONSTRAINT [FK_BugNet_UserProjects_Users] FOREIGN KEY([UserId])
REFERENCES [dbo].[Users] ([UserId])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[BugNet_UserProjects] CHECK CONSTRAINT [FK_BugNet_UserProjects_Users]
GO
ALTER TABLE [dbo].[BugNet_UserRoles] WITH CHECK ADD CONSTRAINT [FK_BugNet_UserRoles_BugNet_Roles] FOREIGN KEY([RoleId])
REFERENCES [dbo].[BugNet_Roles] ([RoleId])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[BugNet_UserRoles] CHECK CONSTRAINT [FK_BugNet_UserRoles_BugNet_Roles]
GO
ALTER TABLE [dbo].[BugNet_UserRoles] WITH NOCHECK ADD CONSTRAINT [FK_BugNet_UserRoles_Users] FOREIGN KEY([UserId])
REFERENCES [dbo].[Users] ([UserId])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[BugNet_UserRoles] CHECK CONSTRAINT [FK_BugNet_UserRoles_Users]
GO
ALTER TABLE [dbo].[Memberships] WITH CHECK ADD CONSTRAINT [MembershipApplication] FOREIGN KEY([ApplicationId])
REFERENCES [dbo].[Applications] ([ApplicationId])
GO
ALTER TABLE [dbo].[Memberships] CHECK CONSTRAINT [MembershipApplication]
GO
ALTER TABLE [dbo].[Memberships] WITH CHECK ADD CONSTRAINT [MembershipUser] FOREIGN KEY([UserId])
REFERENCES [dbo].[Users] ([UserId])
GO
ALTER TABLE [dbo].[Memberships] CHECK CONSTRAINT [MembershipUser]
GO
ALTER TABLE [dbo].[Profiles] WITH CHECK ADD CONSTRAINT [UserProfile] FOREIGN KEY([UserId])
REFERENCES [dbo].[Users] ([UserId])
GO
ALTER TABLE [dbo].[Profiles] CHECK CONSTRAINT [UserProfile]
GO
ALTER TABLE [dbo].[Roles] WITH CHECK ADD CONSTRAINT [RoleApplication] FOREIGN KEY([ApplicationId])
REFERENCES [dbo].[Applications] ([ApplicationId])
GO
ALTER TABLE [dbo].[Roles] CHECK CONSTRAINT [RoleApplication]
GO
ALTER TABLE [dbo].[Users] WITH CHECK ADD CONSTRAINT [UserApplication] FOREIGN KEY([ApplicationId])
REFERENCES [dbo].[Applications] ([ApplicationId])
GO
ALTER TABLE [dbo].[Users] CHECK CONSTRAINT [UserApplication]
GO
ALTER TABLE [dbo].[UsersInRoles] WITH CHECK ADD CONSTRAINT [UsersInRoleRole] FOREIGN KEY([RoleId])
REFERENCES [dbo].[Roles] ([RoleId])
GO
ALTER TABLE [dbo].[UsersInRoles] CHECK CONSTRAINT [UsersInRoleRole]
GO
ALTER TABLE [dbo].[UsersInRoles] WITH CHECK ADD CONSTRAINT [UsersInRoleUser] FOREIGN KEY([UserId])
REFERENCES [dbo].[Users] ([UserId])
GO
ALTER TABLE [dbo].[UsersInRoles] CHECK CONSTRAINT [UsersInRoleUser]
GO
ALTER TABLE [dbo].[UsersOpenAuthAccounts] WITH CHECK ADD CONSTRAINT [OpenAuthUserData_Accounts] FOREIGN KEY([ApplicationName], [MembershipUserName])
REFERENCES [dbo].[UsersOpenAuthData] ([ApplicationName], [MembershipUserName])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[UsersOpenAuthAccounts] CHECK CONSTRAINT [OpenAuthUserData_Accounts]
GO
/****** Object: StoredProcedure [dbo].[BugNet_ApplicationLog_ClearLog] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ApplicationLog_ClearLog]
AS
DELETE FROM BugNet_ApplicationLog
GO
/****** Object: StoredProcedure [dbo].[BugNet_ApplicationLog_GetLog] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ApplicationLog_GetLog]
@FilterType nvarchar(50) = NULL
AS
SELECT L.* FROM BugNet_ApplicationLog L
WHERE
((@FilterType IS NULL) OR (Level = @FilterType))
ORDER BY L.Date DESC
GO
/****** Object: StoredProcedure [dbo].[BugNet_DefaultValues_GetByProjectId] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_DefaultValues_GetByProjectId]
@ProjectId int
As
SELECT * FROM BugNet_DefaultValView
WHERE
ProjectId= @ProjectId
GO
/****** Object: StoredProcedure [dbo].[BugNet_DefaultValues_Set] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_DefaultValues_Set]
@Type nvarchar(50),
@ProjectId Int,
@StatusId Int,
@IssueOwnerUserName NVarChar(255),
@IssuePriorityId Int,
@IssueAssignedUserName NVarChar(255),
@IssueVisibility int,
@IssueCategoryId Int,
@IssueAffectedMilestoneId Int,
@IssueDueDate int,
@IssueProgress Int,
@IssueMilestoneId Int,
@IssueEstimation decimal(5,2),
@IssueResolutionId Int,
@StatusVisibility Bit,
@OwnedByVisibility Bit,
@PriorityVisibility Bit,
@AssignedToVisibility Bit,
@PrivateVisibility Bit,
@CategoryVisibility Bit,
@DueDateVisibility Bit,
@TypeVisibility Bit,
@PercentCompleteVisibility Bit,
@MilestoneVisibility Bit,
@EstimationVisibility Bit,
@ResolutionVisibility Bit,
@AffectedMilestoneVisibility Bit,
@StatusEditVisibility Bit,
@OwnedByEditVisibility Bit,
@PriorityEditVisibility Bit,
@AssignedToEditVisibility Bit,
@PrivateEditVisibility Bit,
@CategoryEditVisibility Bit,
@DueDateEditVisibility Bit,
@TypeEditVisibility Bit,
@PercentCompleteEditVisibility Bit,
@MilestoneEditVisibility Bit,
@EstimationEditVisibility Bit,
@ResolutionEditVisibility Bit,
@AffectedMilestoneEditVisibility Bit,
@OwnedByNotify Bit,
@AssignedToNotify Bit
AS
DECLARE @IssueAssignedUserId UNIQUEIDENTIFIER
DECLARE @IssueOwnerUserId UNIQUEIDENTIFIER
SELECT @IssueOwnerUserId = UserId FROM Users WHERE UserName = @IssueOwnerUserName
SELECT @IssueAssignedUserId = UserId FROM Users WHERE UserName = @IssueAssignedUserName
BEGIN
BEGIN TRAN
DECLARE @defVisExists int
SELECT @defVisExists = COUNT(*)
FROM BugNet_DefaultValuesVisibility
WHERE BugNet_DefaultValuesVisibility.ProjectId = @ProjectId
IF(@defVisExists>0)
BEGIN
UPDATE BugNet_DefaultValuesVisibility
SET
StatusVisibility = @StatusVisibility,
OwnedByVisibility = @OwnedByVisibility,
PriorityVisibility = @PriorityVisibility,
AssignedToVisibility = @AssignedToVisibility,
PrivateVisibility= @PrivateVisibility,
CategoryVisibility= @CategoryVisibility,
DueDateVisibility= @DueDateVisibility,
TypeVisibility = @TypeVisibility,
PercentCompleteVisibility = @PercentCompleteVisibility,
MilestoneVisibility = @MilestoneVisibility,
EstimationVisibility = @EstimationVisibility,
ResolutionVisibility = @ResolutionVisibility,
AffectedMilestoneVisibility = @AffectedMilestoneVisibility,
StatusEditVisibility = @StatusEditVisibility,
OwnedByEditVisibility = @OwnedByEditVisibility,
PriorityEditVisibility = @PriorityEditVisibility,
AssignedToEditVisibility = @AssignedToEditVisibility,
PrivateEditVisibility= @PrivateEditVisibility,
CategoryEditVisibility= @CategoryEditVisibility,
DueDateEditVisibility= @DueDateEditVisibility,
TypeEditVisibility = @TypeEditVisibility,
PercentCompleteEditVisibility = @PercentCompleteEditVisibility,
MilestoneEditVisibility = @MilestoneEditVisibility,
EstimationEditVisibility = @EstimationEditVisibility,
ResolutionEditVisibility = @ResolutionEditVisibility,
AffectedMilestoneEditVisibility = @AffectedMilestoneEditVisibility
WHERE ProjectId = @ProjectId
END
ELSE
BEGIN
INSERT INTO BugNet_DefaultValuesVisibility
VALUES
(
@ProjectId ,
@StatusVisibility ,
@OwnedByVisibility ,
@PriorityVisibility ,
@AssignedToVisibility ,
@PrivateVisibility ,
@CategoryVisibility ,
@DueDateVisibility ,
@TypeVisibility ,
@PercentCompleteVisibility,
@MilestoneVisibility ,
@EstimationVisibility ,
@ResolutionVisibility ,
@AffectedMilestoneVisibility,
@StatusEditVisibility ,
@OwnedByEditVisibility ,
@PriorityEditVisibility ,
@AssignedToEditVisibility ,
@PrivateEditVisibility ,
@CategoryEditVisibility ,
@DueDateEditVisibility ,
@TypeEditVisibility ,
@PercentCompleteEditVisibility,
@MilestoneEditVisibility ,
@EstimationEditVisibility ,
@ResolutionEditVisibility ,
@AffectedMilestoneEditVisibility
)
END
DECLARE @defExists int
SELECT @defExists = COUNT(*)
FROM BugNet_DefaultValues
WHERE BugNet_DefaultValues.ProjectId = @ProjectId
IF (@defExists > 0)
BEGIN
UPDATE BugNet_DefaultValues
SET DefaultType = @Type,
StatusId = @StatusId,
IssueOwnerUserId = @IssueOwnerUserId,
IssuePriorityId = @IssuePriorityId,
IssueAffectedMilestoneId = @IssueAffectedMilestoneId,
IssueAssignedUserId = @IssueAssignedUserId,
IssueVisibility = @IssueVisibility,
IssueCategoryId = @IssueCategoryId,
IssueDueDate = @IssueDueDate,
IssueProgress = @IssueProgress,
IssueMilestoneId = @IssueMilestoneId,
IssueEstimation = @IssueEstimation,
IssueResolutionId = @IssueResolutionId,
OwnedByNotify = @OwnedByNotify,
AssignedToNotify = @AssignedToNotify
WHERE ProjectId = @ProjectId
END
ELSE
BEGIN
INSERT INTO BugNet_DefaultValues
VALUES (
@ProjectId,
@Type,
@StatusId,
@IssueOwnerUserId,
@IssuePriorityId,
@IssueAffectedMilestoneId,
@IssueAssignedUserId,
@IssueVisibility,
@IssueCategoryId,
@IssueDueDate,
@IssueProgress,
@IssueMilestoneId,
@IssueEstimation,
@IssueResolutionId,
@OwnedByNotify,
@AssignedToNotify
)
END
COMMIT TRAN
END
GO
/****** Object: StoredProcedure [dbo].[BugNet_GetProjectSelectedColumnsWithUserIdAndProjectId] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_GetProjectSelectedColumnsWithUserIdAndProjectId]
@UserName nvarchar(255),
@ProjectId int,
@ReturnValue nvarchar(255) OUT
AS
DECLARE
@UserId UNIQUEIDENTIFIER
SELECT @UserId = UserId FROM Users WHERE UserName = @UserName
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
SET @ReturnValue = (SELECT [SelectedIssueColumns] FROM BugNet_UserProjects WHERE UserId = @UserId AND ProjectId = @ProjectId);
END
GO
/****** Object: StoredProcedure [dbo].[BugNet_HostSetting_GetHostSettings] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_HostSetting_GetHostSettings] AS
SELECT SettingName, SettingValue FROM BugNet_HostSettings
GO
/****** Object: StoredProcedure [dbo].[BugNet_HostSetting_UpdateHostSetting] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_HostSetting_UpdateHostSetting]
@SettingName nvarchar(50),
@SettingValue nvarchar(2000)
AS
UPDATE BugNet_HostSettings SET
SettingName = @SettingName,
SettingValue = @SettingValue
WHERE
SettingName = @SettingName
GO
/****** Object: StoredProcedure [dbo].[BugNet_Issue_CreateNewIssue] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_Issue_CreateNewIssue]
@IssueTitle nvarchar(500),
@IssueDescription nvarchar(max),
@ProjectId Int,
@IssueCategoryId Int,
@IssueStatusId Int,
@IssuePriorityId Int,
@IssueMilestoneId Int,
@IssueAffectedMilestoneId Int,
@IssueTypeId Int,
@IssueResolutionId Int,
@IssueAssignedUserName NVarChar(255),
@IssueCreatorUserName NVarChar(255),
@IssueOwnerUserName NVarChar(255),
@IssueDueDate datetime,
@IssueVisibility int,
@IssueEstimation decimal(5,2),
@IssueProgress int
AS
DECLARE @IssueAssignedUserId UNIQUEIDENTIFIER
DECLARE @IssueCreatorUserId UNIQUEIDENTIFIER
DECLARE @IssueOwnerUserId UNIQUEIDENTIFIER
SELECT @IssueAssignedUserId = UserId FROM Users WHERE UserName = @IssueAssignedUserName
SELECT @IssueCreatorUserId = UserId FROM Users WHERE UserName = @IssueCreatorUserName
SELECT @IssueOwnerUserId = UserId FROM Users WHERE UserName = @IssueOwnerUserName
INSERT BugNet_Issues
(
IssueTitle,
IssueDescription,
IssueCreatorUserId,
DateCreated,
IssueStatusId,
IssuePriorityId,
IssueTypeId,
IssueCategoryId,
IssueAssignedUserId,
ProjectId,
IssueResolutionId,
IssueMilestoneId,
IssueAffectedMilestoneId,
LastUpdateUserId,
LastUpdate,
IssueDueDate,
IssueVisibility,
IssueEstimation,
IssueProgress,
IssueOwnerUserId
)
VALUES
(
@IssueTitle,
@IssueDescription,
@IssueCreatorUserId,
GetDate(),
@IssueStatusId,
@IssuePriorityId,
@IssueTypeId,
@IssueCategoryId,
@IssueAssignedUserId,
@ProjectId,
@IssueResolutionId,
@IssueMilestoneId,
@IssueAffectedMilestoneId,
@IssueCreatorUserId,
GetDate(),
@IssueDueDate,
@IssueVisibility,
@IssueEstimation,
@IssueProgress,
@IssueOwnerUserId
)
RETURN scope_identity()
GO
/****** Object: StoredProcedure [dbo].[BugNet_Issue_Delete] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_Issue_Delete]
@IssueId Int
AS
UPDATE BugNet_Issues SET
Disabled = 1
WHERE
IssueId = @IssueId
GO
/****** Object: StoredProcedure [dbo].[BugNet_Issue_GetIssueById] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_Issue_GetIssueById]
@IssueId Int
AS
SELECT
*
FROM
BugNet_IssuesView
WHERE
IssueId = @IssueId
GO
/****** Object: StoredProcedure [dbo].[BugNet_Issue_GetIssueCategoryCountByProject] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_Issue_GetIssueCategoryCountByProject]
@ProjectId int,
@CategoryId int = NULL
AS
SELECT
COUNT(IssueId)
FROM
BugNet_IssuesView
WHERE
ProjectId = @ProjectId
AND
(
(@CategoryId IS NULL AND IssueCategoryId IS NULL) OR
(IssueCategoryId = @CategoryId)
)
AND [Disabled] = 0
AND IsClosed = 0
GO
/****** Object: StoredProcedure [dbo].[BugNet_Issue_GetIssueMilestoneCountByProject] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_Issue_GetIssueMilestoneCountByProject]
@ProjectId int
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
SELECT v.MilestoneName, COUNT(nt.IssueMilestoneId) AS 'Number', v.MilestoneId, v.MilestoneImageUrl
FROM BugNet_ProjectMilestones v
LEFT OUTER JOIN
(SELECT IssueMilestoneId
FROM
BugNet_IssuesView
WHERE
BugNet_IssuesView.Disabled = 0
AND BugNet_IssuesView.IsClosed = 0) nt
ON
v.MilestoneId = nt.IssueMilestoneId
WHERE
(v.ProjectId = @ProjectId) AND v.MilestoneCompleted = 0
GROUP BY
v.MilestoneName, v.MilestoneId,v.SortOrder, v.MilestoneImageUrl
ORDER BY
v.SortOrder ASC
END
GO
/****** Object: StoredProcedure [dbo].[BugNet_Issue_GetIssuePriorityCountByProject] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_Issue_GetIssuePriorityCountByProject]
@ProjectId int
AS
SELECT
p.PriorityName,COUNT(nt.IssuePriorityId) AS 'Number', p.PriorityId, p.PriorityImageUrl
FROM
BugNet_ProjectPriorities p
LEFT OUTER JOIN
(SELECT
IssuePriorityId, ProjectId
FROM
BugNet_IssuesView
WHERE
BugNet_IssuesView.Disabled = 0
AND BugNet_IssuesView.IsClosed = 0) nt
ON
p.PriorityId = nt.IssuePriorityId AND nt.ProjectId = @ProjectId
WHERE
p.ProjectId = @ProjectId
GROUP BY
p.PriorityName, p.PriorityId, p.PriorityImageUrl, p.SortOrder
ORDER BY p.SortOrder
GO
/****** Object: StoredProcedure [dbo].[BugNet_Issue_GetIssuesByAssignedUserName] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_Issue_GetIssuesByAssignedUserName]
@ProjectId Int,
@UserName NVarChar(255)
AS
DECLARE @UserId UniqueIdentifier
SELECT @UserId = UserId FROM Users WHERE UserName = @UserName
SELECT
*
FROM
BugNet_IssuesView
WHERE
ProjectId = @ProjectId
AND Disabled = 0
AND IssueAssignedUserId = @UserId
ORDER BY
IssueId Desc
GO
/****** Object: StoredProcedure [dbo].[BugNet_Issue_GetIssuesByCreatorUserName] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_Issue_GetIssuesByCreatorUserName]
@ProjectId Int,
@UserName NVarChar(255)
AS
DECLARE @CreatorId UniqueIdentifier
SELECT @CreatorId = UserId FROM Users WHERE UserName = @UserName
SELECT
*
FROM
BugNet_IssuesView
WHERE
ProjectId = @ProjectId
AND Disabled = 0
AND IssueCreatorUserId = @CreatorId
ORDER BY
IssueId Desc
GO
/****** Object: StoredProcedure [dbo].[BugNet_Issue_GetIssuesByOwnerUserName] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_Issue_GetIssuesByOwnerUserName]
@ProjectId Int,
@UserName NVarChar(255)
AS
DECLARE @UserId UniqueIdentifier
SELECT @UserId = UserId FROM Users WHERE UserName = @UserName
SELECT
*
FROM
BugNet_IssuesView
WHERE
ProjectId = @ProjectId
AND Disabled = 0
AND IssueOwnerUserId = @UserId
ORDER BY
IssueId Desc
GO
/****** Object: StoredProcedure [dbo].[BugNet_Issue_GetIssuesByProjectId] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_Issue_GetIssuesByProjectId]
@ProjectId int
As
SELECT * FROM BugNet_IssuesView
WHERE
ProjectId = @ProjectId
AND Disabled = 0
Order By IssuePriorityId, IssueStatusId ASC
GO
/****** Object: StoredProcedure [dbo].[BugNet_Issue_GetIssuesByRelevancy] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_Issue_GetIssuesByRelevancy]
@ProjectId int,
@UserName NVarChar(255)
AS
DECLARE @UserId UniqueIdentifier
SELECT @UserId = UserId FROM Users WHERE UserName = @UserName
SELECT
*
FROM
BugNet_IssuesView
WHERE
ProjectId = @ProjectId
AND Disabled = 0
AND (IssueCreatorUserId = @UserId OR IssueAssignedUserId = @UserId OR IssueOwnerUserId = @UserId)
ORDER BY
IssueId Desc
GO
/****** Object: StoredProcedure [dbo].[BugNet_Issue_GetIssueStatusCountByProject] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_Issue_GetIssueStatusCountByProject]
@ProjectId int
AS
SELECT
s.StatusName,COUNT(nt.IssueStatusId) as 'Number', s.StatusId, s.StatusImageUrl
FROM
BugNet_ProjectStatus s
LEFT OUTER JOIN
(SELECT
IssueStatusId, ProjectId
FROM
BugNet_IssuesView
WHERE
BugNet_IssuesView.Disabled = 0
AND IssueStatusId IN (SELECT StatusId FROM BugNet_ProjectStatus WHERE ProjectId = @ProjectId)) nt
ON
s.StatusId = nt.IssueStatusId AND nt.ProjectId = @ProjectId
WHERE
s.ProjectId = @ProjectId
GROUP BY
s.StatusName, s.StatusId, s.StatusImageUrl, s.SortOrder
ORDER BY s.SortOrder
GO
/****** Object: StoredProcedure [dbo].[BugNet_Issue_GetIssueTypeCountByProject] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_Issue_GetIssueTypeCountByProject]
@ProjectId int
AS
SELECT
t.IssueTypeName, COUNT(nt.IssueTypeId) AS 'Number', t.IssueTypeId, t.IssueTypeImageUrl
FROM
BugNet_ProjectIssueTypes t
LEFT OUTER JOIN
(SELECT
IssueTypeId, ProjectId
FROM
BugNet_IssuesView
WHERE
BugNet_IssuesView.Disabled = 0
AND BugNet_IssuesView.IsClosed = 0) nt
ON
t.IssueTypeId = nt.IssueTypeId AND nt.ProjectId = @ProjectId
WHERE
t.ProjectId = @ProjectId
GROUP BY
t.IssueTypeName, t.IssueTypeId, t.IssueTypeImageUrl, t.SortOrder
ORDER BY
t.SortOrder
GO
/****** Object: StoredProcedure [dbo].[BugNet_Issue_GetIssueUnassignedCountByProject] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_Issue_GetIssueUnassignedCountByProject]
@ProjectId int
AS
SELECT
COUNT(IssueId) AS 'Number'
FROM
BugNet_Issues
WHERE
(IssueAssignedUserId IS NULL)
AND (ProjectId = @ProjectId)
AND Disabled = 0
AND IssueStatusId IN(SELECT StatusId FROM BugNet_ProjectStatus WHERE IsClosedState = 0 AND ProjectId = @ProjectId)
GO
/****** Object: StoredProcedure [dbo].[BugNet_Issue_GetIssueUnscheduledMilestoneCountByProject] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_Issue_GetIssueUnscheduledMilestoneCountByProject]
@ProjectId int
AS
SELECT
COUNT(IssueId) AS 'Number'
FROM
BugNet_Issues
WHERE
(IssueMilestoneId IS NULL)
AND (ProjectId = @ProjectId)
AND Disabled = 0
AND IssueStatusId IN(SELECT StatusId FROM BugNet_ProjectStatus WHERE IsClosedState = 0 AND ProjectId = @ProjectId)
GO
/****** Object: StoredProcedure [dbo].[BugNet_Issue_GetIssueUserCountByProject] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_Issue_GetIssueUserCountByProject]
@ProjectId int
AS
SELECT
AssignedName,
Number,
AssignedUserId,
AssignedImageUrl
FROM BugNet_IssueAssignedToCountView
WHERE ProjectId = @ProjectId
ORDER BY SortOrder, AssignedName
GO
/****** Object: StoredProcedure [dbo].[BugNet_Issue_GetMonitoredIssuesByUserName] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_Issue_GetMonitoredIssuesByUserName]
@UserName NVARCHAR(255),
@ExcludeClosedStatus BIT
AS
SET NOCOUNT ON
DECLARE @NotificationUserId UNIQUEIDENTIFIER
EXEC dbo.BugNet_User_GetUserIdByUserName @UserName = @UserName, @UserId = @NotificationUserId OUTPUT
SELECT
iv.*,
bin.UserId AS NotificationUserId,
uv.UserName AS NotificationUserName,
uv.DisplayName AS NotificationDisplayName
FROM BugNet_IssuesView iv
INNER JOIN BugNet_IssueNotifications bin ON iv.IssueId = bin.IssueId
INNER JOIN BugNet_UserView uv ON bin.UserId = uv.UserId
WHERE bin.UserId = @NotificationUserId
AND iv.[Disabled] = 0
AND iv.ProjectDisabled = 0
AND ((@ExcludeClosedStatus = 0) OR (iv.IsClosed = 0))
GO
/****** Object: StoredProcedure [dbo].[BugNet_Issue_GetOpenIssues] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_Issue_GetOpenIssues]
@ProjectId Int
AS
SELECT
*
FROM
BugNet_IssuesView
WHERE
ProjectId = @ProjectId
AND Disabled = 0
AND IssueStatusId IN(SELECT StatusId FROM BugNet_ProjectStatus WHERE IsClosedState = 0 AND ProjectId = @ProjectId)
ORDER BY
IssueId Desc
GO
/****** Object: StoredProcedure [dbo].[BugNet_Issue_UpdateIssue] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_Issue_UpdateIssue]
@IssueId Int,
@IssueTitle nvarchar(500),
@IssueDescription nvarchar(max),
@ProjectId Int,
@IssueCategoryId Int,
@IssueStatusId Int,
@IssuePriorityId Int,
@IssueMilestoneId Int,
@IssueAffectedMilestoneId Int,
@IssueTypeId Int,
@IssueResolutionId Int,
@IssueAssignedUserName NVarChar(255),
@IssueCreatorUserName NVarChar(255),
@IssueOwnerUserName NVarChar(255),
@LastUpdateUserName NVarChar(255),
@IssueDueDate datetime,
@IssueVisibility int,
@IssueEstimation decimal(5,2),
@IssueProgress int
AS
DECLARE @IssueAssignedUserId UNIQUEIDENTIFIER
DECLARE @IssueCreatorUserId UNIQUEIDENTIFIER
DECLARE @IssueOwnerUserId UNIQUEIDENTIFIER
DECLARE @LastUpdateUserId UNIQUEIDENTIFIER
SELECT @IssueAssignedUserId = UserId FROM Users WHERE UserName = @IssueAssignedUserName
SELECT @IssueCreatorUserId = UserId FROM Users WHERE UserName = @IssueCreatorUserName
SELECT @IssueOwnerUserId = UserId FROM Users WHERE UserName = @IssueOwnerUserName
SELECT @LastUpdateUserId = UserId FROM Users WHERE UserName = @LastUpdateUserName
BEGIN TRAN
UPDATE BugNet_Issues SET
IssueTitle = @IssueTitle,
IssueCategoryId = @IssueCategoryId,
ProjectId = @ProjectId,
IssueStatusId = @IssueStatusId,
IssuePriorityId = @IssuePriorityId,
IssueMilestoneId = @IssueMilestoneId,
IssueAffectedMilestoneId = @IssueAffectedMilestoneId,
IssueAssignedUserId = @IssueAssignedUserId,
IssueOwnerUserId = @IssueOwnerUserId,
IssueTypeId = @IssueTypeId,
IssueResolutionId = @IssueResolutionId,
IssueDueDate = @IssueDueDate,
IssueVisibility = @IssueVisibility,
IssueEstimation = @IssueEstimation,
IssueProgress = @IssueProgress,
IssueDescription = @IssueDescription,
LastUpdateUserId = @LastUpdateUserId,
LastUpdate = GetDate()
WHERE
IssueId = @IssueId
/*EXEC BugNet_IssueHistory_CreateNewHistory @IssueId, @IssueCreatorId*/
COMMIT TRAN
GO
/****** Object: StoredProcedure [dbo].[BugNet_Issue_UpdateLastUpdated] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_Issue_UpdateLastUpdated]
@IssueId Int,
@LastUpdateUserName NVARCHAR(255)
AS
SET NOCOUNT ON
DECLARE @LastUpdateUserId UNIQUEIDENTIFIER
SELECT @LastUpdateUserId = UserId FROM Users WHERE UserName = @LastUpdateUserName
BEGIN TRAN
UPDATE BugNet_Issues SET
LastUpdateUserId = @LastUpdateUserId,
LastUpdate = GetDate()
WHERE
IssueId = @IssueId
COMMIT TRAN
GO
/****** Object: StoredProcedure [dbo].[BugNet_IssueAttachment_CreateNewIssueAttachment] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_IssueAttachment_CreateNewIssueAttachment]
@IssueId int,
@FileName nvarchar(250),
@FileSize Int,
@ContentType nvarchar(50),
@CreatorUserName nvarchar(255),
@Description nvarchar(80),
@Attachment Image
AS
-- Get Uploaded UserID
DECLARE @UserId UniqueIdentifier
SELECT @UserId = UserId FROM Users WHERE UserName = @CreatorUserName
INSERT BugNet_IssueAttachments
(
IssueId,
FileName,
Description,
FileSize,
ContentType,
DateCreated,
UserId,
Attachment
)
VALUES
(
@IssueId,
@FileName,
@Description,
@FileSize,
@ContentType,
GetDate(),
@UserId,
@Attachment
)
RETURN scope_identity()
GO
/****** Object: StoredProcedure [dbo].[BugNet_IssueAttachment_DeleteIssueAttachment] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_IssueAttachment_DeleteIssueAttachment]
@IssueAttachmentId INT
AS
DELETE
FROM
BugNet_IssueAttachments
WHERE
IssueAttachmentId = @IssueAttachmentId
GO
/****** Object: StoredProcedure [dbo].[BugNet_IssueAttachment_GetIssueAttachmentById] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_IssueAttachment_GetIssueAttachmentById]
@IssueAttachmentId INT
AS
SELECT
IssueAttachmentId,
IssueId,
FileSize,
Description,
Attachment,
ContentType,
U.UserName CreatorUserName,
IsNull(DisplayName,'') CreatorDisplayName,
FileName,
DateCreated
FROM
BugNet_IssueAttachments
INNER JOIN Users U ON BugNet_IssueAttachments.UserId = U.UserId
LEFT OUTER JOIN BugNet_UserProfiles ON U.UserName = BugNet_UserProfiles.UserName
WHERE
IssueAttachmentId = @IssueAttachmentId
GO
/****** Object: StoredProcedure [dbo].[BugNet_IssueAttachment_GetIssueAttachmentsByIssueId] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_IssueAttachment_GetIssueAttachmentsByIssueId]
@IssueId Int
AS
SELECT
IssueAttachmentId,
IssueId,
FileSize,
Description,
Attachment,
ContentType,
U.UserName CreatorUserName,
IsNull(DisplayName,'') CreatorDisplayName,
FileName,
DateCreated
FROM
BugNet_IssueAttachments
INNER JOIN Users U ON BugNet_IssueAttachments.UserId = U.UserId
LEFT OUTER JOIN BugNet_UserProfiles ON U.UserName = BugNet_UserProfiles.UserName
WHERE
IssueId = @IssueId
ORDER BY
DateCreated DESC
GO
/****** Object: StoredProcedure [dbo].[BugNet_IssueAttachment_ValidateDownload] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_IssueAttachment_ValidateDownload]
@IssueAttachmentId INT,
@RequestingUser VARCHAR(75) = NULL
AS
SET NOCOUNT ON
DECLARE
@HasPermission BIT,
@HasProjectAccess BIT,
@ProjectAdminId INT,
@ProjectId INT,
@IssueId INT,
@IssueVisibility INT,
@ProjectAdminString VARCHAR(25),
@ProjectAccessType INT,
@ReturnValue INT,
@AnonymousAccess BIT,
@AttachmentExists BIT,
@RequestingUserID UNIQUEIDENTIFIER
EXEC dbo.BugNet_User_GetUserIdByUserName @UserName = @RequestingUser, @UserId = @RequestingUserID OUTPUT
SET @ProjectAdminString = 'project administrators'
/* see if the attachment exists */
SET @AttachmentExists =
(
SELECT COUNT(*) FROM BugNet_IssueAttachments WHERE IssueAttachmentId = @IssueAttachmentId
)
/*
if the attachment does not exist then exit
return not found status
*/
IF (@AttachmentExists = 0)
BEGIN
RAISERROR (N'BNCode:100 The requested attachment does not exist.', 17, 1);
RETURN 0;
END
/* get the anon setting for the site */
SET @AnonymousAccess =
(
SELECT
CASE LOWER(SUBSTRING(SettingValue, 1, 1))
WHEN '1' THEN 1
WHEN 't' THEN 1
ELSE 0
END
FROM BugNet_HostSettings
WHERE LOWER(SettingName) = 'anonymousaccess'
)
/*
if the requesting user is anon and anon access is disabled exit
and return login status
*/
IF (@RequestingUserId IS NULL AND @AnonymousAccess = 0)
BEGIN
RAISERROR (N'BNCode:200 User is required to login before download.', 17, 1);
RETURN 0;
END
SELECT
@ProjectId = i.ProjectId,
@IssueId = i.IssueId,
@IssueVisibility = i.IssueVisibility,
@ProjectAccessType = p.ProjectAccessType
FROM BugNet_IssuesView i
INNER JOIN BugNet_IssueAttachments ia ON i.IssueId = ia.IssueId
INNER JOIN BugNet_Projects p ON i.ProjectId = p.ProjectId
WHERE ia.IssueAttachmentId = @IssueAttachmentId
AND (i.[Disabled] = 0 AND p.ProjectDisabled = 0)
/*
if the issue or project are disabled then exit
return not found status
*/
IF (@IssueId IS NULL OR @ProjectId IS NULL)
BEGIN
RAISERROR (N'BNCode:300 Either the Project or the Issue for this attachment are disabled.', 17, 1);
RETURN 0;
END
/* does the requesting user have elevated permissions? */
SET @HasPermission =
(
SELECT COUNT(*)
FROM BugNet_UserRoles ur
INNER JOIN BugNet_Roles r ON ur.RoleId = r.RoleId
WHERE (r.ProjectId = @ProjectId OR r.ProjectId IS NULL)
AND (LOWER(r.RoleName) = @ProjectAdminString OR r.RoleId = 1)
AND ur.UserId = @RequestingUserId
)
/* does the requesting user have access to the project? */
SET @HasProjectAccess =
(
SELECT COUNT(*)
FROM BugNet_UserProjects
WHERE UserId = @RequestingUserId
AND ProjectId = @ProjectId
)
/* if the project is private / requesting user does not have project access exit / elevated permissions */
/* user has no access */
IF (@ProjectAccessType = 2 AND (@HasProjectAccess = 0 AND @HasPermission = 0))
BEGIN
RAISERROR (N'BNCode:400 Sorry you do not have access to this attachment.', 17, 1);
RETURN 0;
END
/*
SELECT
@HasPermission AS '@HasPermission',
@HasProjectAccess AS '@HasProjectAccess',
@ProjectAdminId AS '@ProjectAdminId',
@ProjectId AS '@ProjectId',
@IssueId AS '@IssueId',
@IssueVisibility AS '@IssueVisibility',
@ProjectAdminString AS '@ProjectAdminString',
@ProjectAccessType AS '@ProjectAccessType',
@AnonymousAccess AS '@AnonymousAccess',
@AttachmentExists AS '@AttachmentExists' ,
@RequestingUserID AS '@RequestingUserID'
*/
/* try and get the attachment id */
SELECT @ReturnValue = ia.IssueAttachmentId
FROM BugNet_IssuesView i
INNER JOIN BugNet_IssueAttachments ia ON i.IssueId = ia.IssueId
INNER JOIN BugNet_Projects p ON i.ProjectId = p.ProjectId
WHERE ia.IssueAttachmentId = @IssueAttachmentId
AND (
(@HasPermission = 1) OR -- requesting user has elevated permissions
(@IssueVisibility = 0 AND @AnonymousAccess = 1) OR -- issue is visible and anon access is on
(
(@IssueVisibility = 1) AND -- issue is private
(
(UPPER(i.IssueCreatorUserId) = UPPER(@RequestingUserId)) OR -- requesting user is issue creator
(UPPER(i.IssueAssignedUserId) = UPPER(@RequestingUserId) AND @AnonymousAccess = 0) -- requesting user is assigned to issue and anon access is off
) OR
(@IssueVisibility = 0) -- issue is visible show it
)
)
AND (i.[Disabled] = 0 AND p.ProjectDisabled = 0)
/* user still has no access */
IF (@ReturnValue IS NULL)
BEGIN
RAISERROR (N'BNCode:400 Sorry you do not have access to this attachment.', 17, 1);
RETURN 0;
END
RETURN @ReturnValue;
GO
/****** Object: StoredProcedure [dbo].[BugNet_IssueComment_CreateNewIssueComment] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_IssueComment_CreateNewIssueComment]
@IssueId int,
@CreatorUserName NVarChar(255),
@Comment ntext
AS
-- Get Last Update UserID
DECLARE @UserId uniqueidentifier
SELECT @UserId = UserId FROM Users WHERE UserName = @CreatorUserName
INSERT BugNet_IssueComments
(
IssueId,
UserId,
DateCreated,
Comment
)
VALUES
(
@IssueId,
@UserId,
GetDate(),
@Comment
)
/* Update the LastUpdate fields of this bug*/
UPDATE BugNet_Issues SET LastUpdate = GetDate(),LastUpdateUserId = @UserId WHERE IssueId = @IssueId
RETURN scope_identity()
GO
/****** Object: StoredProcedure [dbo].[BugNet_IssueComment_DeleteIssueComment] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[BugNet_IssueComment_DeleteIssueComment]
@IssueCommentId Int
AS
DELETE
BugNet_IssueComments
WHERE
IssueCommentId = @IssueCommentId
GO
/****** Object: StoredProcedure [dbo].[BugNet_IssueComment_GetIssueCommentById] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_IssueComment_GetIssueCommentById]
@IssueCommentId INT
AS
SELECT
IssueCommentId,
IssueId,
Comment,
U.UserId CreatorUserId,
U.UserName CreatorUserName,
IsNull(DisplayName,'') CreatorDisplayName,
DateCreated
FROM
BugNet_IssueComments
INNER JOIN Users U ON BugNet_IssueComments.UserId = U.UserId
LEFT OUTER JOIN BugNet_UserProfiles ON U.UserName = BugNet_UserProfiles.UserName
WHERE
IssueCommentId = @IssueCommentId
GO
/****** Object: StoredProcedure [dbo].[BugNet_IssueComment_GetIssueCommentsByIssueId] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_IssueComment_GetIssueCommentsByIssueId]
@IssueId Int
AS
SELECT
IssueCommentId,
IssueId,
Comment,
U.UserId CreatorUserId,
U.UserName CreatorUserName,
IsNull(DisplayName,'') CreatorDisplayName,
DateCreated
FROM
BugNet_IssueComments
INNER JOIN Users U ON BugNet_IssueComments.UserId = U.UserId
LEFT OUTER JOIN BugNet_UserProfiles ON U.UserName = BugNet_UserProfiles.UserName
WHERE
IssueId = @IssueId
ORDER BY
DateCreated DESC
GO
/****** Object: StoredProcedure [dbo].[BugNet_IssueComment_UpdateIssueComment] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_IssueComment_UpdateIssueComment]
@IssueCommentId int,
@IssueId int,
@CreatorUserName nvarchar(255),
@Comment ntext
AS
DECLARE @UserId uniqueidentifier
SELECT @UserId = UserId FROM Users WHERE UserName = @CreatorUserName
UPDATE BugNet_IssueComments SET
IssueId = @IssueId,
UserId = @UserId,
Comment = @Comment
WHERE IssueCommentId= @IssueCommentId
GO
/****** Object: StoredProcedure [dbo].[BugNet_IssueHistory_CreateNewIssueHistory] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_IssueHistory_CreateNewIssueHistory]
@IssueId int,
@CreatedUserName nvarchar(255),
@FieldChanged nvarchar(50),
@OldValue nvarchar(50),
@NewValue nvarchar(50)
AS
DECLARE @UserId UniqueIdentifier
SELECT @UserId = UserId FROM Users WHERE UserName = @CreatedUserName
INSERT BugNet_IssueHistory
(
IssueId,
UserId,
FieldChanged,
OldValue,
NewValue,
DateCreated
)
VALUES
(
@IssueId,
@UserId,
@FieldChanged,
@OldValue,
@NewValue,
GetDate()
)
RETURN scope_identity()
GO
/****** Object: StoredProcedure [dbo].[BugNet_IssueHistory_GetIssueHistoryByIssueId] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_IssueHistory_GetIssueHistoryByIssueId]
@IssueId int
AS
SELECT
IssueHistoryId,
IssueId,
U.UserName CreatorUserName,
IsNull(DisplayName,'') CreatorDisplayName,
FieldChanged,
OldValue,
NewValue,
DateCreated
FROM
BugNet_IssueHistory
INNER JOIN Users U ON BugNet_IssueHistory.UserId = U.UserId
LEFT OUTER JOIN BugNet_UserProfiles ON U.UserName = BugNet_UserProfiles.UserName
WHERE
IssueId = @IssueId
ORDER BY
DateCreated DESC
GO
/****** Object: StoredProcedure [dbo].[BugNet_IssueNotification_CreateNewIssueNotification] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_IssueNotification_CreateNewIssueNotification]
@IssueId Int,
@NotificationUserName NVarChar(255)
AS
DECLARE @UserId UniqueIdentifier
SELECT @UserId = UserId FROM Users WHERE UserName = @NotificationUserName
IF (NOT EXISTS(SELECT IssueNotificationId FROM BugNet_IssueNotifications WHERE UserId = @UserId AND IssueId = @IssueId) AND @UserId IS NOT NULL)
BEGIN
INSERT BugNet_IssueNotifications
(
IssueId,
UserId
)
VALUES
(
@IssueId,
@UserId
)
RETURN scope_identity()
END
GO
/****** Object: StoredProcedure [dbo].[BugNet_IssueNotification_DeleteIssueNotification] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_IssueNotification_DeleteIssueNotification]
@IssueId Int,
@UserName NVarChar(255)
AS
DECLARE @UserId uniqueidentifier
SELECT @UserId = UserId FROM Users WHERE UserName = @UserName
DELETE
BugNet_IssueNotifications
WHERE
IssueId = @IssueId
AND UserId = @UserId
GO
/****** Object: StoredProcedure [dbo].[BugNet_IssueNotification_GetIssueNotificationsByIssueId] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_IssueNotification_GetIssueNotificationsByIssueId]
@IssueId Int
AS
SET NOCOUNT ON
DECLARE @DefaultCulture NVARCHAR(50)
SET @DefaultCulture = (SELECT ISNULL(SettingValue, 'en-US') FROM BugNet_HostSettings WHERE SettingName = 'ApplicationDefaultLanguage')
DECLARE @tmpTable TABLE (IssueNotificationId int, IssueId int,NotificationUserId uniqueidentifier, NotificationUserName nvarchar(50), NotificationDisplayName nvarchar(50), NotificationEmail nvarchar(50), NotificationCulture NVARCHAR(50))
INSERT @tmpTable
SELECT
IssueNotificationId,
IssueId,
U.UserId NotificationUserId,
U.UserName NotificationUserName,
IsNull(DisplayName,'') NotificationDisplayName,
M.Email NotificationEmail,
ISNULL(UP.PreferredLocale, @DefaultCulture) AS NotificationCulture
FROM
BugNet_IssueNotifications
INNER JOIN Users U ON BugNet_IssueNotifications.UserId = U.UserId
INNER JOIN Memberships M ON BugNet_IssueNotifications.UserId = M.UserId
LEFT OUTER JOIN BugNet_UserProfiles UP ON U.UserName = UP.UserName
WHERE
IssueId = @IssueId
ORDER BY
DisplayName
-- get all people on the project who want to be notified
INSERT @tmpTable
SELECT
ProjectNotificationId,
IssueId = @IssueId,
u.UserId NotificationUserId,
u.UserName NotificationUserName,
IsNull(DisplayName,'') NotificationDisplayName,
m.Email NotificationEmail,
ISNULL(UP.PreferredLocale, @DefaultCulture) AS NotificationCulture
FROM
BugNet_ProjectNotifications p,
BugNet_Issues i,
Users u,
Memberships m ,
BugNet_UserProfiles up
WHERE
IssueId = @IssueId
AND p.ProjectId = i.ProjectId
AND u.UserId = p.UserId
AND u.UserId = m.UserId
AND u.UserName = up.UserName
SELECT DISTINCT IssueId,NotificationUserId, NotificationUserName, NotificationDisplayName, NotificationEmail, NotificationCulture FROM @tmpTable ORDER BY NotificationDisplayName
GO
/****** Object: StoredProcedure [dbo].[BugNet_IssueRevision_CreateNewIssueRevision] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE 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
IF (NOT EXISTS(SELECT IssueRevisionId FROM BugNet_IssueRevisions WHERE IssueId = @IssueId AND Revision = @Revision
AND RevisionDate = @RevisionDate AND Repository = @Repository AND RevisionAuthor = @RevisionAuthor))
BEGIN
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()
END
GO
/****** Object: StoredProcedure [dbo].[BugNet_IssueRevision_DeleteIssueRevisions] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_IssueRevision_DeleteIssueRevisions]
@IssueRevisionId Int
AS
DELETE FROM
BugNet_IssueRevisions
WHERE
IssueRevisionId = @IssueRevisionId
GO
/****** Object: StoredProcedure [dbo].[BugNet_IssueRevision_GetIssueRevisionsByIssueId] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_IssueRevision_GetIssueRevisionsByIssueId]
@IssueId Int
AS
SELECT
*
FROM
BugNet_IssueRevisions
WHERE
IssueId = @IssueId
GO
/****** Object: StoredProcedure [dbo].[BugNet_IssueVote_CreateNewIssueVote] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_IssueVote_CreateNewIssueVote]
@IssueId Int,
@VoteUserName NVarChar(255)
AS
DECLARE @UserId UniqueIdentifier
SELECT @UserId = UserId FROM Users WHERE UserName = @VoteUserName
IF NOT EXISTS( SELECT IssueVoteId FROM BugNet_IssueVotes WHERE UserId = @UserId AND IssueId = @IssueId)
BEGIN
INSERT BugNet_IssueVotes
(
IssueId,
UserId,
DateCreated
)
VALUES
(
@IssueId,
@UserId,
GETDATE()
)
RETURN scope_identity()
END
GO
/****** Object: StoredProcedure [dbo].[BugNet_IssueVote_HasUserVoted] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_IssueVote_HasUserVoted]
@IssueId Int,
@VoteUserName NVarChar(255)
AS
DECLARE @UserId UniqueIdentifier
SELECT @UserId = UserId FROM Users WHERE UserName = @VoteUserName
BEGIN
IF EXISTS(SELECT IssueVoteId FROM BugNet_IssueVotes WHERE UserId = @UserId AND IssueId = @IssueId)
RETURN(1)
ELSE
RETURN(0)
END
GO
/****** Object: StoredProcedure [dbo].[BugNet_IssueWorkReport_CreateNewIssueWorkReport] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_IssueWorkReport_CreateNewIssueWorkReport]
@IssueId int,
@CreatorUserName nvarchar(255),
@WorkDate datetime ,
@Duration decimal(4,2),
@IssueCommentId int
AS
-- Get Last Update UserID
DECLARE @CreatorUserId uniqueidentifier
SELECT @CreatorUserId = UserId FROM Users WHERE UserName = @CreatorUserName
INSERT BugNet_IssueWorkReports
(
IssueId,
UserId,
WorkDate,
Duration,
IssueCommentId
)
VALUES
(
@IssueId,
@CreatorUserId,
@WorkDate,
@Duration,
@IssueCommentId
)
RETURN scope_identity()
GO
/****** Object: StoredProcedure [dbo].[BugNet_IssueWorkReport_DeleteIssueWorkReport] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_IssueWorkReport_DeleteIssueWorkReport]
@IssueWorkReportId int
AS
DELETE
BugNet_IssueWorkReports
WHERE
IssueWorkReportId = @IssueWorkReportId
GO
/****** Object: StoredProcedure [dbo].[BugNet_IssueWorkReport_GetIssueWorkReportsByIssueId] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_IssueWorkReport_GetIssueWorkReportsByIssueId]
@IssueId INT
AS
SELECT
IssueWorkReportId,
BugNet_IssueWorkReports.IssueId,
WorkDate,
Duration,
BugNet_IssueWorkReports.IssueCommentId,
BugNet_IssueWorkReports.UserId CreatorUserId,
U.UserName CreatorUserName,
IsNull(DisplayName,'') CreatorDisplayName,
ISNULL(BugNet_IssueComments.Comment, '') Comment
FROM
BugNet_IssueWorkReports
INNER JOIN Users U ON BugNet_IssueWorkReports.UserId = U.UserId
LEFT OUTER JOIN BugNet_UserProfiles ON U.UserName = BugNet_UserProfiles.UserName
LEFT OUTER JOIN BugNet_IssueComments ON BugNet_IssueComments.IssueCommentId = BugNet_IssueWorkReports.IssueCommentId
WHERE
BugNet_IssueWorkReports.IssueId = @IssueId
ORDER BY WorkDate DESC
GO
/****** Object: StoredProcedure [dbo].[BugNet_Languages_GetInstalledLanguages] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_Languages_GetInstalledLanguages]
AS
BEGIN
SET NOCOUNT ON;
SELECT DISTINCT cultureCode FROM BugNet_Languages
END
GO
/****** Object: StoredProcedure [dbo].[BugNet_Permission_AddRolePermission] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_Permission_AddRolePermission]
@PermissionId int,
@RoleId int
AS
IF NOT EXISTS (SELECT PermissionId FROM BugNet_RolePermissions WHERE PermissionId = @PermissionId AND RoleId = @RoleId)
BEGIN
INSERT BugNet_RolePermissions
(
PermissionId,
RoleId
)
VALUES
(
@PermissionId,
@RoleId
)
END
GO
/****** Object: StoredProcedure [dbo].[BugNet_Permission_DeleteRolePermission] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_Permission_DeleteRolePermission]
@PermissionId Int,
@RoleId Int
AS
DELETE
BugNet_RolePermissions
WHERE
PermissionId = @PermissionId
AND RoleId = @RoleId
GO
/****** Object: StoredProcedure [dbo].[BugNet_Permission_GetAllPermissions] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[BugNet_Permission_GetAllPermissions] AS
SELECT PermissionId, PermissionKey, PermissionName FROM BugNet_Permissions
GO
/****** Object: StoredProcedure [dbo].[BugNet_Permission_GetPermissionsByRole] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_Permission_GetPermissionsByRole]
@RoleId int
AS
SELECT BugNet_Permissions.PermissionId, PermissionKey, PermissionName FROM BugNet_Permissions
INNER JOIN BugNet_RolePermissions on BugNet_RolePermissions.PermissionId = BugNet_Permissions.PermissionId
WHERE RoleId = @RoleId
GO
/****** Object: StoredProcedure [dbo].[BugNet_Permission_GetRolePermission] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_Permission_GetRolePermission] AS
SELECT R.RoleId, R.ProjectId,P.PermissionId,P.PermissionKey,R.RoleName, P.PermissionName
FROM BugNet_RolePermissions RP
JOIN
BugNet_Permissions P ON RP.PermissionId = P.PermissionId
JOIN
BugNet_Roles R ON RP.RoleId = R.RoleId
GO
/****** Object: StoredProcedure [dbo].[BugNet_Project_AddUserToProject] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_Project_AddUserToProject]
@UserName nvarchar(255),
@ProjectId int
AS
DECLARE @UserId UNIQUEIDENTIFIER
SELECT @UserId = UserId FROM Users WHERE UserName = @UserName
IF NOT EXISTS (SELECT UserId FROM BugNet_UserProjects WHERE UserId = @UserId AND ProjectId = @ProjectId)
BEGIN
INSERT BugNet_UserProjects
(
UserId,
ProjectId,
DateCreated
)
VALUES
(
@UserId,
@ProjectId,
getdate()
)
END
GO
/****** Object: StoredProcedure [dbo].[BugNet_Project_CloneProject] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE 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,
CategoryId
)
SELECT
Mailbox,
@NewProjectId,
AssignToUserId,
IssueTypeId,
CategoryId
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 AND Disabled = 0
ORDER BY CategoryId
CREATE TABLE #NewCategories
(
NewRowNumber INT IDENTITY,
NewCategoryId INT,
)
INSERT #NewCategories
(
NewCategoryId
)
SELECT
CategoryId
FROM
BugNet_ProjectCategories
WHERE
ProjectId = @NewProjectId AND Disabled = 0
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_Project_CreateNewProject] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_Project_CreateNewProject]
@ProjectName nvarchar(50),
@ProjectCode nvarchar(50),
@ProjectDescription nvarchar(1000),
@ProjectManagerUserName nvarchar(255),
@AttachmentUploadPath nvarchar(80),
@ProjectAccessType int,
@ProjectCreatorUserName nvarchar(255),
@AllowAttachments int,
@AttachmentStorageType int,
@SvnRepositoryUrl nvarchar(255),
@AllowIssueVoting bit,
@ProjectImageFileContent varbinary(max),
@ProjectImageFileName nvarchar(150),
@ProjectImageContentType nvarchar(50),
@ProjectImageFileSize bigint
AS
IF NOT EXISTS( SELECT ProjectId,ProjectCode FROM BugNet_Projects WHERE LOWER(ProjectName) = LOWER(@ProjectName) OR LOWER(ProjectCode) = LOWER(@ProjectCode) )
BEGIN
DECLARE @ProjectManagerUserId UNIQUEIDENTIFIER
DECLARE @ProjectCreatorUserId UNIQUEIDENTIFIER
SELECT @ProjectManagerUserId = UserId FROM Users WHERE UserName = @ProjectManagerUserName
SELECT @ProjectCreatorUserId = UserId FROM Users WHERE UserName = @ProjectCreatorUserName
INSERT BugNet_Projects
(
ProjectName,
ProjectCode,
ProjectDescription,
AttachmentUploadPath,
ProjectManagerUserId,
DateCreated,
ProjectCreatorUserId,
ProjectAccessType,
AllowAttachments,
AttachmentStorageType,
SvnRepositoryUrl,
AllowIssueVoting,
ProjectImageFileContent,
ProjectImageFileName,
ProjectImageContentType,
ProjectImageFileSize
)
VALUES
(
@ProjectName,
@ProjectCode,
@ProjectDescription,
@AttachmentUploadPath,
@ProjectManagerUserId ,
GetDate(),
@ProjectCreatorUserId,
@ProjectAccessType,
@AllowAttachments,
@AttachmentStorageType,
@SvnRepositoryUrl,
@AllowIssueVoting,
@ProjectImageFileContent,
@ProjectImageFileName,
@ProjectImageContentType,
@ProjectImageFileSize
)
RETURN scope_identity()
END
ELSE
RETURN 0
GO
/****** Object: StoredProcedure [dbo].[BugNet_Project_DeleteProject] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_Project_DeleteProject]
@ProjectIdToDelete int
AS
--Delete these first
DELETE FROM BugNet_IssueVotes WHERE BugNet_IssueVotes.IssueId in (SELECT B.IssueId FROM BugNet_Issues B WHERE B.ProjectId = @ProjectIdToDelete)
DELETE FROM BugNet_Issues WHERE ProjectId = @ProjectIdToDelete
--Now Delete everything that was attached to a project and an issue
DELETE FROM BugNet_Issues WHERE BugNet_Issues.IssueCategoryId in (SELECT B.CategoryId FROM BugNet_ProjectCategories B WHERE B.ProjectId = @ProjectIdToDelete)
DELETE FROM BugNet_ProjectCategories WHERE ProjectId = @ProjectIdToDelete
DELETE FROM BugNet_ProjectStatus WHERE ProjectId = @ProjectIdToDelete
DELETE FROM BugNet_ProjectMilestones WHERE ProjectId = @ProjectIdToDelete
DELETE FROM BugNet_UserProjects WHERE ProjectId = @ProjectIdToDelete
DELETE FROM BugNet_ProjectMailBoxes WHERE ProjectId = @ProjectIdToDelete
DELETE FROM BugNet_ProjectIssueTypes WHERE ProjectId = @ProjectIdToDelete
DELETE FROM BugNet_ProjectResolutions WHERE ProjectId = @ProjectIdToDelete
DELETE FROM BugNet_ProjectPriorities WHERE ProjectId = @ProjectIdToDelete
--now delete everything attached to the project
DELETE FROM BugNet_ProjectCustomFieldValues WHERE BugNet_ProjectCustomFieldValues.CustomFieldId in (SELECT B.CustomFieldId FROM BugNet_ProjectCustomFields B WHERE B.ProjectId = @ProjectIdToDelete)
DELETE FROM BugNet_ProjectCustomFields WHERE ProjectId = @ProjectIdToDelete
DELETE FROM BugNet_Roles WHERE ProjectId = @ProjectIdToDelete
DELETE FROM BugNet_Queries WHERE ProjectId = @ProjectIdToDelete
DELETE FROM BugNet_ProjectNotifications WHERE ProjectId = @ProjectIdToDelete
--now delete the project
DELETE FROM BugNet_Projects WHERE ProjectId = @ProjectIdToDelete
GO
/****** Object: StoredProcedure [dbo].[BugNet_Project_GetAllProjects] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_Project_GetAllProjects]
@ActiveOnly BIT = NULL
AS
SELECT
ProjectId,
ProjectName,
ProjectCode,
ProjectDescription,
AttachmentUploadPath,
ProjectManagerUserId,
ProjectCreatorUserId,
DateCreated,
ProjectDisabled,
ProjectAccessType,
ManagerUserName,
ManagerDisplayName,
CreatorUserName,
CreatorDisplayName,
AllowAttachments,
AllowAttachments,
AttachmentStorageType,
SvnRepositoryUrl,
AllowIssueVoting
FROM
BugNet_ProjectsView
WHERE (@ActiveOnly IS NULL OR (ProjectDisabled = ~@ActiveOnly))
GO
/****** Object: StoredProcedure [dbo].[BugNet_Project_GetMemberRolesByProjectId] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_Project_GetMemberRolesByProjectId]
@ProjectId Int
AS
SELECT ISNULL(UsersProfile.DisplayName, Users.UserName) as DisplayName, BugNet_Roles.RoleName
FROM
Users INNER JOIN
BugNet_UserProjects ON Users.UserId = BugNet_UserProjects.UserId INNER JOIN
BugNet_UserRoles ON Users.UserId = BugNet_UserRoles.UserId INNER JOIN
BugNet_Roles ON BugNet_UserRoles.RoleId = BugNet_Roles.RoleId LEFT OUTER JOIN
BugNet_UserProfiles AS UsersProfile ON Users.UserName = UsersProfile.UserName
WHERE
BugNet_UserProjects.ProjectId = @ProjectId
ORDER BY DisplayName, RoleName ASC
GO
/****** Object: StoredProcedure [dbo].[BugNet_Project_GetProjectByCode] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_Project_GetProjectByCode]
@ProjectCode nvarchar(50)
AS
SELECT * FROM BugNet_ProjectsView WHERE ProjectCode = @ProjectCode
GO
/****** Object: StoredProcedure [dbo].[BugNet_Project_GetProjectById] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_Project_GetProjectById]
@ProjectId INT
AS
SELECT * FROM BugNet_ProjectsView WHERE ProjectId = @ProjectId
GO
/****** Object: StoredProcedure [dbo].[BugNet_Project_GetProjectMembers] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_Project_GetProjectMembers]
@ProjectId Int
AS
SELECT UserName
FROM
Users
LEFT OUTER JOIN
BugNet_UserProjects
ON
Users.UserId = BugNet_UserProjects.UserId
WHERE
BugNet_UserProjects.ProjectId = @ProjectId
ORDER BY UserName ASC
GO
/****** Object: StoredProcedure [dbo].[BugNet_Project_GetProjectsByMemberUsername] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_Project_GetProjectsByMemberUsername]
@UserName nvarchar(255),
@ActiveOnly bit
AS
DECLARE @Disabled bit
SET @Disabled = 1
DECLARE @UserId UNIQUEIDENTIFIER
SELECT @UserId = UserId FROM Users WHERE UserName = @UserName
IF @ActiveOnly = 1
BEGIN
SET @Disabled = 0
END
SELECT DISTINCT
[BugNet_ProjectsView].ProjectId,
ProjectName,
ProjectCode,
ProjectDescription,
AttachmentUploadPath,
ProjectManagerUserId,
ProjectCreatorUserId,
[BugNet_ProjectsView].DateCreated,
ProjectDisabled,
ProjectAccessType,
ManagerUserName,
ManagerDisplayName,
CreatorUserName,
CreatorDisplayName,
AllowAttachments,
AllowAttachments,
AttachmentStorageType,
SvnRepositoryUrl,
AllowIssueVoting
FROM [BugNet_ProjectsView]
Left JOIN BugNet_UserProjects UP ON UP.ProjectId = [BugNet_ProjectsView].ProjectId
WHERE
(ProjectAccessType = 1 AND ProjectDisabled = @Disabled) OR
(ProjectAccessType = 2 AND ProjectDisabled = @Disabled AND (UP.UserId = @UserId or ProjectManagerUserId=@UserId ))
ORDER BY ProjectName ASC
GO
/****** Object: StoredProcedure [dbo].[BugNet_Project_GetPublicProjects] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_Project_GetPublicProjects]
AS
SELECT * FROM
BugNet_ProjectsView
WHERE
ProjectAccessType = 1 AND ProjectDisabled = 0
ORDER BY ProjectName ASC
GO
/****** Object: StoredProcedure [dbo].[BugNet_Project_GetRoadMapProgress] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_Project_GetRoadMapProgress]
@ProjectId int,
@MilestoneId int
AS
SELECT (SELECT COUNT(*) FROM BugNet_IssuesView
WHERE
ProjectId = @ProjectId
AND BugNet_IssuesView.Disabled = 0
AND IssueMilestoneId = @MilestoneId
AND IssueStatusId IN (SELECT StatusId FROM BugNet_ProjectStatus WHERE IsClosedState = 1 AND ProjectId = @ProjectId)) As ClosedCount ,
(SELECT COUNT(*) FROM BugNet_IssuesView WHERE BugNet_IssuesView.Disabled = 0 AND ProjectId = @ProjectId AND IssueMilestoneId = @MilestoneId) As TotalCount
GO
/****** Object: StoredProcedure [dbo].[BugNet_Project_IsUserProjectMember] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_Project_IsUserProjectMember]
@UserName nvarchar(255),
@ProjectId int
AS
DECLARE @UserId UNIQUEIDENTIFIER
SELECT @UserId = UserId FROM Users WHERE UserName = @UserName
IF EXISTS( SELECT UserId FROM BugNet_UserProjects WHERE UserId = @UserId AND ProjectId = @ProjectId)
RETURN 0
ELSE
RETURN -1
GO
/****** Object: StoredProcedure [dbo].[BugNet_Project_RemoveUserFromProject] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_Project_RemoveUserFromProject]
@UserName nvarchar(255),
@ProjectId Int
AS
DECLARE @UserId UNIQUEIDENTIFIER
SELECT @UserId = UserId FROM Users WHERE UserName = @UserName
DELETE
BugNet_UserProjects
WHERE
UserId = @UserId AND ProjectId = @ProjectId
GO
/****** Object: StoredProcedure [dbo].[BugNet_Project_UpdateProject] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_Project_UpdateProject]
@ProjectId int,
@ProjectName nvarchar(50),
@ProjectCode nvarchar(50),
@ProjectDescription nvarchar(1000),
@ProjectManagerUserName nvarchar(255),
@AttachmentUploadPath nvarchar(80),
@ProjectAccessType int,
@ProjectDisabled int,
@AllowAttachments bit,
@AttachmentStorageType int,
@SvnRepositoryUrl nvarchar(255),
@AllowIssueVoting bit,
@ProjectImageFileContent varbinary(max),
@ProjectImageFileName nvarchar(150),
@ProjectImageContentType nvarchar(50),
@ProjectImageFileSize bigint
AS
DECLARE @ProjectManagerUserId UNIQUEIDENTIFIER
SELECT @ProjectManagerUserId = UserId FROM Users WHERE UserName = @ProjectManagerUserName
IF @ProjectImageFileContent IS NULL
UPDATE BugNet_Projects SET
ProjectName = @ProjectName,
ProjectCode = @ProjectCode,
ProjectDescription = @ProjectDescription,
ProjectManagerUserId = @ProjectManagerUserId,
AttachmentUploadPath = @AttachmentUploadPath,
ProjectAccessType = @ProjectAccessType,
ProjectDisabled = @ProjectDisabled,
AllowAttachments = @AllowAttachments,
AttachmentStorageType = @AttachmentStorageType,
SvnRepositoryUrl = @SvnRepositoryUrl,
AllowIssueVoting = @AllowIssueVoting
WHERE
ProjectId = @ProjectId
ELSE
UPDATE BugNet_Projects SET
ProjectName = @ProjectName,
ProjectCode = @ProjectCode,
ProjectDescription = @ProjectDescription,
ProjectManagerUserId = @ProjectManagerUserId,
AttachmentUploadPath = @AttachmentUploadPath,
ProjectAccessType = @ProjectAccessType,
ProjectDisabled = @ProjectDisabled,
AllowAttachments = @AllowAttachments,
AttachmentStorageType = @AttachmentStorageType,
SvnRepositoryUrl = @SvnRepositoryUrl,
ProjectImageFileContent = @ProjectImageFileContent,
ProjectImageFileName = @ProjectImageFileName,
ProjectImageContentType = @ProjectImageContentType,
ProjectImageFileSize = @ProjectImageFileSize,
AllowIssueVoting = @AllowIssueVoting
WHERE
ProjectId = @ProjectId
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectCategories_CreateNewCategory] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectCategories_CreateNewCategory]
@ProjectId int,
@CategoryName nvarchar(100),
@ParentCategoryId int
AS
IF NOT EXISTS(SELECT CategoryId FROM BugNet_ProjectCategories WHERE LOWER(CategoryName)= LOWER(@CategoryName) AND ProjectId = @ProjectId)
BEGIN
INSERT BugNet_ProjectCategories
(
ProjectId,
CategoryName,
ParentCategoryId
)
VALUES
(
@ProjectId,
@CategoryName,
@ParentCategoryId
)
RETURN SCOPE_IDENTITY()
END
RETURN -1
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectCategories_DeleteCategory] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectCategories_DeleteCategory]
@CategoryId Int
AS
UPDATE BugNet_ProjectCategories SET
[Disabled] = 1
WHERE
CategoryId = @CategoryId
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectCategories_GetCategoriesByProjectId] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectCategories_GetCategoriesByProjectId]
@ProjectId int
AS
SELECT
CategoryId,
ProjectId,
CategoryName,
ParentCategoryId,
(SELECT COUNT(*) FROM BugNet_ProjectCategories WHERE ParentCategoryId = c.CategoryId) ChildCount,
(SELECT COUNT(*) FROM BugNet_IssuesView where IssueCategoryId = c.CategoryId AND c.ProjectId = @ProjectId AND [Disabled] = 0 AND IsClosed = 0) AS IssueCount,
[Disabled]
FROM BugNet_ProjectCategories c
WHERE ProjectId = @ProjectId
AND [Disabled] = 0
ORDER BY CategoryName
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectCategories_GetCategoryById] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectCategories_GetCategoryById]
@CategoryId int
AS
SELECT
CategoryId,
ProjectId,
CategoryName,
ParentCategoryId,
(SELECT COUNT(*) FROM BugNet_ProjectCategories WHERE ParentCategoryId = c.CategoryId) ChildCount,
(SELECT COUNT(*) FROM BugNet_IssuesView where IssueCategoryId = c.CategoryId AND [Disabled] = 0 AND IsClosed = 0) AS IssueCount,
[Disabled]
FROM BugNet_ProjectCategories c
WHERE CategoryId = @CategoryId
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectCategories_GetChildCategoriesByCategoryId] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectCategories_GetChildCategoriesByCategoryId]
@CategoryId int
AS
SELECT
CategoryId,
ProjectId,
CategoryName,
ParentCategoryId,
(SELECT COUNT(*) FROM BugNet_ProjectCategories WHERE ParentCategoryId = c.CategoryId) ChildCount,
(SELECT COUNT(*) FROM BugNet_IssuesView where IssueCategoryId = c.CategoryId AND [Disabled] = 0 AND IsClosed = 0) AS IssueCount,
[Disabled]
FROM BugNet_ProjectCategories c
WHERE c.ParentCategoryId = @CategoryId
AND [Disabled] = 0
ORDER BY CategoryName
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectCategories_GetRootCategoriesByProjectId] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectCategories_GetRootCategoriesByProjectId]
@ProjectId int
AS
SELECT
CategoryId,
ProjectId,
CategoryName,
ParentCategoryId,
(SELECT COUNT(*) FROM BugNet_ProjectCategories WHERE ParentCategoryId = c.CategoryId) ChildCount,
(SELECT COUNT(*) FROM BugNet_IssuesView where IssueCategoryId = c.CategoryId AND c.ProjectId = @ProjectId AND [Disabled] = 0 AND IsClosed = 0) AS IssueCount,
[Disabled]
FROM BugNet_ProjectCategories c
WHERE ProjectId = @ProjectId
AND c.ParentCategoryId = 0
AND [Disabled] = 0
ORDER BY CategoryName
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectCategories_UpdateCategory] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectCategories_UpdateCategory]
@CategoryId int,
@ProjectId int,
@CategoryName nvarchar(100),
@ParentCategoryId int
AS
UPDATE BugNet_ProjectCategories SET
ProjectId = @ProjectId,
CategoryName = @CategoryName,
ParentCategoryId = @ParentCategoryId
WHERE CategoryId = @CategoryId
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectCustomField_CreateNewCustomField] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectCustomField_CreateNewCustomField]
@ProjectId Int,
@CustomFieldName NVarChar(50),
@CustomFieldDataType Int,
@CustomFieldRequired Bit,
@CustomFieldTypeId int
AS
IF NOT EXISTS(SELECT CustomFieldId FROM BugNet_ProjectCustomFields WHERE ProjectId = @ProjectId AND LOWER(CustomFieldName) = LOWER(@CustomFieldName) )
BEGIN
INSERT BugNet_ProjectCustomFields
(
ProjectId,
CustomFieldName,
CustomFieldDataType,
CustomFieldRequired,
CustomFieldTypeId
)
VALUES
(
@ProjectId,
@CustomFieldName,
@CustomFieldDataType,
@CustomFieldRequired,
@CustomFieldTypeId
)
RETURN scope_identity()
END
RETURN 0
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectCustomField_DeleteCustomField] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectCustomField_DeleteCustomField]
@CustomFieldIdToDelete INT
AS
SET XACT_ABORT ON
BEGIN TRAN
DELETE
FROM BugNet_QueryClauses
WHERE CustomFieldId = @CustomFieldIdToDelete
DELETE
FROM BugNet_ProjectCustomFieldValues
WHERE CustomFieldId = @CustomFieldIdToDelete
DELETE
FROM BugNet_ProjectCustomFields
WHERE CustomFieldId = @CustomFieldIdToDelete
COMMIT
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectCustomField_GetCustomFieldById] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectCustomField_GetCustomFieldById]
@CustomFieldId Int
AS
SELECT
Fields.ProjectId,
Fields.CustomFieldId,
Fields.CustomFieldName,
Fields.CustomFieldDataType,
Fields.CustomFieldRequired,
'' CustomFieldValue,
Fields.CustomFieldTypeId
FROM
BugNet_ProjectCustomFields Fields
WHERE
Fields.CustomFieldId = @CustomFieldId
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectCustomField_GetCustomFieldsByIssueId] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectCustomField_GetCustomFieldsByIssueId]
@IssueId Int
AS
DECLARE @ProjectId Int
SELECT @ProjectId = ProjectId FROM BugNet_Issues WHERE IssueId = @IssueId
SELECT
Fields.ProjectId,
Fields.CustomFieldId,
Fields.CustomFieldName,
Fields.CustomFieldDataType,
Fields.CustomFieldRequired,
ISNULL(CustomFieldValue,'') CustomFieldValue,
Fields.CustomFieldTypeId
FROM
BugNet_ProjectCustomFields Fields
LEFT OUTER JOIN BugNet_ProjectCustomFieldValues FieldValues ON (Fields.CustomFieldId = FieldValues.CustomFieldId AND FieldValues.IssueId = @IssueId)
WHERE
Fields.ProjectId = @ProjectId
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectCustomField_GetCustomFieldsByProjectId] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectCustomField_GetCustomFieldsByProjectId]
@ProjectId Int
AS
SELECT
ProjectId,
CustomFieldId,
CustomFieldName,
CustomFieldDataType,
CustomFieldRequired,
'' CustomFieldValue,
CustomFieldTypeId
FROM
BugNet_ProjectCustomFields
WHERE
ProjectId = @ProjectId
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectCustomField_SaveCustomFieldValue] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectCustomField_SaveCustomFieldValue]
@IssueId Int,
@CustomFieldId Int,
@CustomFieldValue NVarChar(MAX)
AS
UPDATE
BugNet_ProjectCustomFieldValues
SET
CustomFieldValue = @CustomFieldValue
WHERE
IssueId = @IssueId
AND CustomFieldId = @CustomFieldId
IF @@ROWCOUNT = 0
INSERT BugNet_ProjectCustomFieldValues
(
IssueId,
CustomFieldId,
CustomFieldValue
)
VALUES
(
@IssueId,
@CustomFieldId,
@CustomFieldValue
)
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectCustomField_UpdateCustomField] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectCustomField_UpdateCustomField]
@CustomFieldId Int,
@ProjectId Int,
@CustomFieldName NVarChar(50),
@CustomFieldDataType Int,
@CustomFieldRequired Bit,
@CustomFieldTypeId int
AS
UPDATE
BugNet_ProjectCustomFields
SET
ProjectId = @ProjectId,
CustomFieldName = @CustomFieldName,
CustomFieldDataType = @CustomFieldDataType,
CustomFieldRequired = @CustomFieldRequired,
CustomFieldTypeId = @CustomFieldTypeId
WHERE
CustomFieldId = @CustomFieldId
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectCustomFieldSelection_CreateNewCustomFieldSelection] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectCustomFieldSelection_CreateNewCustomFieldSelection]
@CustomFieldId INT,
@CustomFieldSelectionValue NVARCHAR(255),
@CustomFieldSelectionName NVARCHAR(255)
AS
DECLARE @CustomFieldSelectionSortOrder int
SELECT @CustomFieldSelectionSortOrder = ISNULL(MAX(CustomFieldSelectionSortOrder),0) + 1 FROM BugNet_ProjectCustomFieldSelections
IF NOT EXISTS(SELECT CustomFieldSelectionId FROM BugNet_ProjectCustomFieldSelections WHERE CustomFieldId = @CustomFieldId AND LOWER(CustomFieldSelectionName) = LOWER(@CustomFieldSelectionName) )
BEGIN
INSERT BugNet_ProjectCustomFieldSelections
(
CustomFieldId,
CustomFieldSelectionValue,
CustomFieldSelectionName,
CustomFieldSelectionSortOrder
)
VALUES
(
@CustomFieldId,
@CustomFieldSelectionValue,
@CustomFieldSelectionName,
@CustomFieldSelectionSortOrder
)
RETURN scope_identity()
END
RETURN 0
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectCustomFieldSelection_DeleteCustomFieldSelection] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectCustomFieldSelection_DeleteCustomFieldSelection]
@CustomFieldSelectionIdToDelete INT
AS
SET XACT_ABORT ON
DECLARE
@CustomFieldId INT
SET @CustomFieldId = (SELECT TOP 1 CustomFieldId
FROM BugNet_ProjectCustomFieldSelections
WHERE CustomFieldSelectionId = @CustomFieldSelectionIdToDelete)
BEGIN TRAN
UPDATE BugNet_ProjectCustomFieldValues
SET CustomFieldValue = NULL
WHERE CustomFieldId = @CustomFieldId
DELETE
FROM BugNet_ProjectCustomFieldSelections
WHERE CustomFieldSelectionId = @CustomFieldSelectionIdToDelete
COMMIT TRAN
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectCustomFieldSelection_GetCustomFieldSelectionById] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectCustomFieldSelection_GetCustomFieldSelectionById]
@CustomFieldSelectionId Int
AS
SELECT
CustomFieldSelectionId,
CustomFieldId,
CustomFieldSelectionName,
rtrim(CustomFieldSelectionValue) CustomFieldSelectionValue,
CustomFieldSelectionSortOrder
FROM
BugNet_ProjectCustomFieldSelections
WHERE
CustomFieldSelectionId = @CustomFieldSelectionId
ORDER BY CustomFieldSelectionSortOrder
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectCustomFieldSelection_GetCustomFieldSelectionsByCustomFieldId] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectCustomFieldSelection_GetCustomFieldSelectionsByCustomFieldId]
@CustomFieldId Int
AS
SELECT
CustomFieldSelectionId,
CustomFieldId,
CustomFieldSelectionName,
rtrim(CustomFieldSelectionValue) CustomFieldSelectionValue,
CustomFieldSelectionSortOrder
FROM
BugNet_ProjectCustomFieldSelections
WHERE
CustomFieldId = @CustomFieldId
ORDER BY CustomFieldSelectionSortOrder
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectCustomFieldSelection_Update] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectCustomFieldSelection_Update]
@CustomFieldSelectionId INT,
@CustomFieldId INT,
@CustomFieldSelectionName NVARCHAR(255),
@CustomFieldSelectionValue NVARCHAR(255),
@CustomFieldSelectionSortOrder INT
AS
SET XACT_ABORT ON
SET NOCOUNT ON
DECLARE
@OldSortOrder INT,
@OldCustomFieldSelectionId INT,
@OldSelectionValue NVARCHAR(255)
SELECT TOP 1
@OldSortOrder = CustomFieldSelectionSortOrder,
@OldSelectionValue = CustomFieldSelectionValue
FROM BugNet_ProjectCustomFieldSelections
WHERE CustomFieldSelectionId = @CustomFieldSelectionId
SET @OldCustomFieldSelectionId = (SELECT TOP 1 CustomFieldSelectionId FROM BugNet_ProjectCustomFieldSelections WHERE CustomFieldSelectionSortOrder = @CustomFieldSelectionSortOrder AND CustomFieldId = @CustomFieldId)
UPDATE
BugNet_ProjectCustomFieldSelections
SET
CustomFieldId = @CustomFieldId,
CustomFieldSelectionName = @CustomFieldSelectionName,
CustomFieldSelectionValue = @CustomFieldSelectionValue,
CustomFieldSelectionSortOrder = @CustomFieldSelectionSortOrder
WHERE
CustomFieldSelectionId = @CustomFieldSelectionId
UPDATE BugNet_ProjectCustomFieldSelections
SET CustomFieldSelectionSortOrder = @OldSortOrder
WHERE CustomFieldSelectionId = @OldCustomFieldSelectionId
/*
this will not work very well with regards to case sensitivity so
we only will care if the value is somehow different than the original
*/
IF (@OldSelectionValue != @CustomFieldSelectionValue)
BEGIN
UPDATE BugNet_ProjectCustomFieldValues
SET CustomFieldValue = @CustomFieldSelectionValue
WHERE CustomFieldId = @CustomFieldId AND CustomFieldValue = @OldSelectionValue
END
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectIssueTypes_CanDeleteIssueType] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectIssueTypes_CanDeleteIssueType]
@IssueTypeId INT
AS
SET NOCOUNT ON
DECLARE
@ProjectId INT,
@Count INT
SET @ProjectId = (SELECT ProjectId FROM BugNet_ProjectIssueTypes WHERE IssueTypeId = @IssueTypeId)
SET @Count =
(
SELECT COUNT(*)
FROM BugNet_Issues
WHERE (IssueTypeId = @IssueTypeId)
AND ProjectId = @ProjectId
)
IF(@Count = 0)
RETURN 1
ELSE
RETURN 0
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectIssueTypes_CreateNewIssueType] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectIssueTypes_CreateNewIssueType]
@ProjectId INT,
@IssueTypeName NVARCHAR(50),
@IssueTypeImageUrl NVarChar(50)
AS
IF NOT EXISTS(SELECT IssueTypeId FROM BugNet_ProjectIssueTypes WHERE LOWER(IssueTypeName)= LOWER(@IssueTypeName) AND ProjectId = @ProjectId)
BEGIN
DECLARE @SortOrder int
SELECT @SortOrder = ISNULL(MAX(SortOrder + 1),1) FROM BugNet_ProjectIssueTypes WHERE ProjectId = @ProjectId
INSERT BugNet_ProjectIssueTypes
(
ProjectId,
IssueTypeName,
IssueTypeImageUrl ,
SortOrder
) VALUES (
@ProjectId,
@IssueTypeName,
@IssueTypeImageUrl,
@SortOrder
)
RETURN scope_identity()
END
RETURN -1
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectIssueTypes_DeleteIssueType] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectIssueTypes_DeleteIssueType]
@IssueTypeIdToDelete INT
AS
DELETE
BugNet_ProjectIssueTypes
WHERE
IssueTypeId = @IssueTypeIdToDelete
IF @@ROWCOUNT > 0
RETURN 0
ELSE
RETURN 1
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectIssueTypes_GetIssueTypeById] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectIssueTypes_GetIssueTypeById]
@IssueTypeId INT
AS
SELECT
IssueTypeId,
ProjectId,
IssueTypeName,
IssueTypeImageUrl,
SortOrder
FROM
BugNet_ProjectIssueTypes
WHERE
IssueTypeId = @IssueTypeId
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectIssueTypes_GetIssueTypesByProjectId] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectIssueTypes_GetIssueTypesByProjectId]
@ProjectId int
AS
SELECT
IssueTypeId,
ProjectId,
IssueTypeName,
SortOrder,
IssueTypeImageUrl
FROM
BugNet_ProjectIssueTypes
WHERE
ProjectId = @ProjectId
ORDER BY SortOrder
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectIssueTypes_UpdateIssueType] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectIssueTypes_UpdateIssueType]
@ProjectId int,
@IssueTypeId int,
@IssueTypeName NVARCHAR(50),
@IssueTypeImageUrl NVARCHAR(255),
@SortOrder int
AS
DECLARE @OldSortOrder int
DECLARE @OldIssueTypeId int
SELECT @OldSortOrder = SortOrder FROM BugNet_ProjectIssueTypes WHERE IssueTypeId = @IssueTypeId
SELECT @OldIssueTypeId = IssueTypeId FROM BugNet_ProjectIssueTypes WHERE SortOrder = @SortOrder AND ProjectId = @ProjectId
UPDATE BugNet_ProjectIssueTypes SET
ProjectId = @ProjectId,
IssueTypeName = @IssueTypeName,
IssueTypeImageUrl = @IssueTypeImageUrl,
SortOrder = @SortOrder
WHERE IssueTypeId = @IssueTypeId
UPDATE BugNet_ProjectIssueTypes SET
SortOrder = @OldSortOrder
WHERE IssueTypeId = @OldIssueTypeId
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectMailbox_CreateProjectMailbox] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectMailbox_CreateProjectMailbox]
@MailBox nvarchar (100),
@ProjectId int,
@AssignToUserName nvarchar(255),
@IssueTypeId int,
@CategoryId int
AS
DECLARE @AssignToUserId UNIQUEIDENTIFIER
SELECT @AssignToUserId = UserId FROM Users WHERE UserName = @AssignToUserName
INSERT BugNet_ProjectMailBoxes
(
MailBox,
ProjectId,
AssignToUserId,
IssueTypeId,
CategoryId
)
VALUES
(
@MailBox,
@ProjectId,
@AssignToUserId,
@IssueTypeId,
@CategoryId
)
RETURN scope_identity()
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectMailbox_DeleteProjectMailbox] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectMailbox_DeleteProjectMailbox]
@ProjectMailboxId int
AS
DELETE
BugNet_ProjectMailBoxes
WHERE
ProjectMailboxId = @ProjectMailboxId
IF @@ROWCOUNT > 0
RETURN 0
ELSE
RETURN 1
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectMailbox_GetMailboxById] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectMailbox_GetMailboxById]
@ProjectMailboxId int
AS
SET NOCOUNT ON
SELECT
BugNet_ProjectMailboxes.*,
u.UserName AssignToUserName,
p.DisplayName AssignToDisplayName,
BugNet_ProjectIssueTypes.IssueTypeName,
BugNet_ProjectCategories.CategoryName
FROM
BugNet_ProjectMailBoxes
INNER JOIN Users u ON u.UserId = AssignToUserId
INNER JOIN BugNet_UserProfiles p ON u.UserName = p.UserName
INNER JOIN BugNet_ProjectIssueTypes ON BugNet_ProjectIssueTypes.IssueTypeId = BugNet_ProjectMailboxes.IssueTypeId
LEFT JOIN BugNet_ProjectCategories ON BugNet_ProjectCategories.CategoryId = BugNet_ProjectMailboxes.CategoryId
WHERE
BugNet_ProjectMailBoxes.ProjectMailboxId = @ProjectMailboxId
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectMailbox_GetMailboxByProjectId] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectMailbox_GetMailboxByProjectId]
@ProjectId int
AS
SET NOCOUNT ON
SELECT
BugNet_ProjectMailboxes.*,
u.UserName AssignToUserName,
p.DisplayName AssignToDisplayName,
pit.IssueTypeName,
pct.CategoryName
FROM
BugNet_ProjectMailBoxes
INNER JOIN Users u ON u.UserId = AssignToUserId
INNER JOIN BugNet_UserProfiles p ON u.UserName = p.UserName
INNER JOIN BugNet_ProjectIssueTypes pit ON pit.IssueTypeId = BugNet_ProjectMailboxes.IssueTypeId
LEFT JOIN BugNet_ProjectCategories pct ON pct.CategoryId = BugNet_ProjectMailboxes.CategoryId
WHERE
BugNet_ProjectMailBoxes.ProjectId = @ProjectId
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectMailbox_GetProjectByMailbox] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectMailbox_GetProjectByMailbox]
@mailbox nvarchar(100)
AS
SET NOCOUNT ON
SELECT
BugNet_ProjectMailboxes.*,
u.UserName AssignToUserName,
p.DisplayName AssignToDisplayName,
pit.IssueTypeName,
pct.CategoryName
FROM
BugNet_ProjectMailBoxes
INNER JOIN Users u ON u.UserId = AssignToUserId
INNER JOIN BugNet_UserProfiles p ON u.UserName = p.UserName
INNER JOIN BugNet_ProjectIssueTypes pit ON pit.IssueTypeId = BugNet_ProjectMailboxes.IssueTypeId
LEFT JOIN BugNet_ProjectCategories pct ON pct.CategoryId = BugNet_ProjectMailboxes.CategoryId
WHERE
BugNet_ProjectMailBoxes.MailBox = @mailbox
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectMailbox_UpdateProjectMailbox] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectMailbox_UpdateProjectMailbox]
@ProjectMailboxId int,
@MailBoxEmailAddress nvarchar (100),
@ProjectId int,
@AssignToUserName nvarchar(255),
@IssueTypeId int,
@CategoryId int
AS
DECLARE @AssignToUserId UNIQUEIDENTIFIER
SELECT @AssignToUserId = UserId FROM Users WHERE UserName = @AssignToUserName
UPDATE BugNet_ProjectMailBoxes SET
MailBox = @MailBoxEmailAddress,
ProjectId = @ProjectId,
AssignToUserId = @AssignToUserId,
IssueTypeId = @IssueTypeId,
CategoryId = @CategoryId
WHERE ProjectMailboxId = @ProjectMailboxId
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectMilestones_CanDeleteMilestone] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectMilestones_CanDeleteMilestone]
@MilestoneId INT
AS
SET NOCOUNT ON
DECLARE
@ProjectId INT,
@Count INT
SET @ProjectId = (SELECT ProjectId FROM BugNet_ProjectMilestones WHERE MilestoneId = @MilestoneId)
SET @Count =
(
SELECT COUNT(*)
FROM BugNet_Issues
WHERE ((IssueMilestoneId = @MilestoneId) OR (IssueAffectedMilestoneId = @MilestoneId))
AND ProjectId = @ProjectId
)
IF(@Count = 0)
RETURN 1
ELSE
RETURN 0
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectMilestones_CreateNewMilestone] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectMilestones_CreateNewMilestone]
@ProjectId INT,
@MilestoneName NVARCHAR(50),
@MilestoneImageUrl NVARCHAR(255),
@MilestoneDueDate DATETIME,
@MilestoneReleaseDate DATETIME,
@MilestoneNotes NVARCHAR(MAX),
@MilestoneCompleted bit
AS
IF NOT EXISTS(SELECT MilestoneId FROM BugNet_ProjectMilestones WHERE LOWER(MilestoneName)= LOWER(@MilestoneName) AND ProjectId = @ProjectId)
BEGIN
DECLARE @SortOrder int
SELECT @SortOrder = ISNULL(MAX(SortOrder + 1),1) FROM BugNet_ProjectMilestones WHERE ProjectId = @ProjectId
INSERT BugNet_ProjectMilestones
(
ProjectId,
MilestoneName ,
MilestoneImageUrl,
SortOrder,
MilestoneDueDate ,
MilestoneReleaseDate,
MilestoneNotes,
MilestoneCompleted
) VALUES (
@ProjectId,
@MilestoneName,
@MilestoneImageUrl,
@SortOrder,
@MilestoneDueDate,
@MilestoneReleaseDate,
@MilestoneNotes,
@MilestoneCompleted
)
RETURN SCOPE_IDENTITY()
END
RETURN -1
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectMilestones_DeleteMilestone] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectMilestones_DeleteMilestone]
@MilestoneIdToDelete INT
AS
DELETE
BugNet_ProjectMilestones
WHERE
MilestoneId = @MilestoneIdToDelete
IF @@ROWCOUNT > 0
RETURN 0
ELSE
RETURN 1
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectMilestones_GetMilestoneById] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectMilestones_GetMilestoneById]
@MilestoneId INT
AS
SELECT
MilestoneId,
ProjectId,
MilestoneName,
MilestoneImageUrl,
SortOrder,
MilestoneDueDate,
MilestoneReleaseDate,
MilestoneNotes,
MilestoneCompleted
FROM
BugNet_ProjectMilestones
WHERE
MilestoneId = @MilestoneId
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectMilestones_GetMilestonesByProjectId] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectMilestones_GetMilestonesByProjectId]
@ProjectId INT,
@MilestoneCompleted bit
AS
SELECT * FROM BugNet_ProjectMilestones WHERE ProjectId = @ProjectId AND
MilestoneCompleted = (CASE WHEN @MilestoneCompleted = 1 THEN MilestoneCompleted ELSE @MilestoneCompleted END) ORDER BY SortOrder ASC
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectMilestones_UpdateMilestone] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectMilestones_UpdateMilestone]
@ProjectId int,
@MilestoneId int,
@MilestoneName NVARCHAR(50),
@MilestoneImageUrl NVARCHAR(255),
@SortOrder int,
@MilestoneDueDate DATETIME,
@MilestoneReleaseDate DATETIME,
@MilestoneNotes NVARCHAR(MAX),
@MilestoneCompleted bit
AS
DECLARE @OldSortOrder int
DECLARE @OldMilestoneId int
SELECT @OldSortOrder = SortOrder FROM BugNet_ProjectMilestones WHERE MilestoneId = @MilestoneId
SELECT @OldMilestoneId = MilestoneId FROM BugNet_ProjectMilestones WHERE SortOrder = @SortOrder AND ProjectId = @ProjectId
UPDATE BugNet_ProjectMilestones SET
ProjectId = @ProjectId,
MilestoneName = @MilestoneName,
MilestoneImageUrl = @MilestoneImageUrl,
SortOrder = @SortOrder,
MilestoneDueDate = @MilestoneDueDate,
MilestoneReleaseDate = @MilestoneReleaseDate,
MilestoneNotes = @MilestoneNotes,
MilestoneCompleted = @MilestoneCompleted
WHERE MilestoneId = @MilestoneId
UPDATE BugNet_ProjectMilestones SET
SortOrder = @OldSortOrder
WHERE MilestoneId = @OldMilestoneId
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectNotification_CreateNewProjectNotification] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectNotification_CreateNewProjectNotification]
@ProjectId Int,
@NotificationUserName NVarChar(255)
AS
DECLARE @UserId UniqueIdentifier
SELECT @UserId = UserId FROM Users WHERE UserName = @NotificationUserName
IF NOT EXISTS( SELECT ProjectNotificationId FROM BugNet_ProjectNotifications WHERE UserId = @UserId AND ProjectId = @ProjectId)
BEGIN
INSERT BugNet_ProjectNotifications
(
ProjectId,
UserId
)
VALUES
(
@ProjectId,
@UserId
)
RETURN scope_identity()
END
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectNotification_DeleteProjectNotification] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectNotification_DeleteProjectNotification]
@ProjectId Int,
@UserName NVarChar(255)
AS
DECLARE @UserId uniqueidentifier
SELECT @UserId = UserId FROM Users WHERE UserName = @UserName
DELETE
BugNet_ProjectNotifications
WHERE
ProjectId = @ProjectId
AND UserId = @UserId
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectNotification_GetProjectNotificationsByProjectId] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectNotification_GetProjectNotificationsByProjectId]
@ProjectId Int
AS
SELECT
ProjectNotificationId,
P.ProjectId,
ProjectName,
U.UserId NotificationUserId,
U.UserName NotificationUserName,
IsNull(DisplayName,'') NotificationDisplayName,
M.Email NotificationEmail
FROM
BugNet_ProjectNotifications
INNER JOIN Users U ON BugNet_ProjectNotifications.UserId = U.UserId
INNER JOIN Memberships M ON BugNet_ProjectNotifications.UserId = M.UserId
INNER JOIN BugNet_Projects P ON BugNet_ProjectNotifications.ProjectId = P.ProjectId
LEFT OUTER JOIN BugNet_UserProfiles ON U.UserName = BugNet_UserProfiles.UserName
WHERE
P.ProjectId = @ProjectId
ORDER BY
DisplayName
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectNotification_GetProjectNotificationsByUsername] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectNotification_GetProjectNotificationsByUsername]
@UserName nvarchar(255)
AS
DECLARE @UserId UniqueIdentifier
SELECT @UserId = UserId FROM Users WHERE UserName = @UserName
SELECT
ProjectNotificationId,
P.ProjectId,
ProjectName,
U.UserId NotificationUserId,
U.UserName NotificationUserName,
IsNull(DisplayName,'') NotificationDisplayName,
M.Email NotificationEmail
FROM
BugNet_ProjectNotifications
INNER JOIN Users U ON BugNet_ProjectNotifications.UserId = U.UserId
INNER JOIN Memberships M ON BugNet_ProjectNotifications.UserId = M.UserId
INNER JOIN BugNet_Projects P ON BugNet_ProjectNotifications.ProjectId = P.ProjectId
LEFT OUTER JOIN BugNet_UserProfiles ON U.UserName = BugNet_UserProfiles.UserName
WHERE
U.UserId = @UserId
ORDER BY
DisplayName
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectPriorities_CanDeletePriority] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectPriorities_CanDeletePriority]
@PriorityId INT
AS
SET NOCOUNT ON
DECLARE
@ProjectId INT,
@Count INT
SET @ProjectId = (SELECT ProjectId FROM BugNet_ProjectPriorities WHERE PriorityId = @PriorityId)
SET @Count =
(
SELECT COUNT(*)
FROM BugNet_Issues
WHERE (IssuePriorityId = @PriorityId)
AND ProjectId = @ProjectId
)
IF(@Count = 0)
RETURN 1
ELSE
RETURN 0
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectPriorities_CreateNewPriority] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectPriorities_CreateNewPriority]
@ProjectId INT,
@PriorityName NVARCHAR(50),
@PriorityImageUrl NVarChar(50)
AS
IF NOT EXISTS(SELECT PriorityId FROM BugNet_ProjectPriorities WHERE LOWER(PriorityName)= LOWER(@PriorityName) AND ProjectId = @ProjectId)
BEGIN
DECLARE @SortOrder int
SELECT @SortOrder = ISNULL(MAX(SortOrder + 1),1) FROM BugNet_ProjectPriorities WHERE ProjectId = @ProjectId
INSERT BugNet_ProjectPriorities
(
ProjectId,
PriorityName,
PriorityImageUrl ,
SortOrder
) VALUES (
@ProjectId,
@PriorityName,
@PriorityImageUrl,
@SortOrder
)
RETURN scope_identity()
END
RETURN 0
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectPriorities_DeletePriority] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectPriorities_DeletePriority]
@PriorityIdToDelete INT
AS
DELETE
BugNet_ProjectPriorities
WHERE
PriorityId = @PriorityIdToDelete
IF @@ROWCOUNT > 0
RETURN 0
ELSE
RETURN 1
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectPriorities_GetPrioritiesByProjectId] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectPriorities_GetPrioritiesByProjectId]
@ProjectId int
AS
SELECT
PriorityId,
ProjectId,
PriorityName,
SortOrder,
PriorityImageUrl
FROM
BugNet_ProjectPriorities
WHERE
ProjectId = @ProjectId
ORDER BY SortOrder
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectPriorities_GetPriorityById] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectPriorities_GetPriorityById]
@PriorityId int
AS
SELECT
PriorityId,
ProjectId,
PriorityName,
SortOrder,
PriorityImageUrl
FROM
BugNet_ProjectPriorities
WHERE
PriorityId = @PriorityId
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectPriorities_UpdatePriority] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectPriorities_UpdatePriority]
@ProjectId int,
@PriorityId int,
@PriorityName NVARCHAR(50),
@PriorityImageUrl NVARCHAR(50),
@SortOrder int
AS
DECLARE @OldSortOrder int
DECLARE @OldPriorityId int
SELECT @OldSortOrder = SortOrder FROM BugNet_ProjectPriorities WHERE PriorityId = @PriorityId
SELECT @OldPriorityId = PriorityId FROM BugNet_ProjectPriorities WHERE SortOrder = @SortOrder AND ProjectId = @ProjectId
UPDATE BugNet_ProjectPriorities SET
ProjectId = @ProjectId,
PriorityName = @PriorityName,
PriorityImageUrl = @PriorityImageUrl,
SortOrder = @SortOrder
WHERE PriorityId = @PriorityId
UPDATE BugNet_ProjectPriorities SET
SortOrder = @OldSortOrder
WHERE PriorityId = @OldPriorityId
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectResolutions_CanDeleteResolution] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectResolutions_CanDeleteResolution]
@ResolutionId INT
AS
SET NOCOUNT ON
DECLARE
@ProjectId INT,
@Count INT
SET @ProjectId = (SELECT ProjectId FROM BugNet_ProjectResolutions WHERE ResolutionId = @ResolutionId)
SET @Count =
(
SELECT COUNT(*)
FROM BugNet_Issues
WHERE (IssueResolutionId = @ResolutionId)
AND ProjectId = @ProjectId
)
IF(@Count = 0)
RETURN 1
ELSE
RETURN 0
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectResolutions_CreateNewResolution] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectResolutions_CreateNewResolution]
@ProjectId INT,
@ResolutionName NVARCHAR(50),
@ResolutionImageUrl NVARCHAR(50)
AS
IF NOT EXISTS(SELECT ResolutionId FROM BugNet_ProjectResolutions WHERE LOWER(ResolutionName)= LOWER(@ResolutionName) AND ProjectId = @ProjectId)
BEGIN
DECLARE @SortOrder int
SELECT @SortOrder = ISNULL(MAX(SortOrder + 1),1) FROM BugNet_ProjectResolutions WHERE ProjectId = @ProjectId
INSERT BugNet_ProjectResolutions
(
ProjectId,
ResolutionName ,
ResolutionImageUrl,
SortOrder
) VALUES (
@ProjectId,
@ResolutionName,
@ResolutionImageUrl,
@SortOrder
)
RETURN SCOPE_IDENTITY()
END
RETURN -1
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectResolutions_DeleteResolution] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectResolutions_DeleteResolution]
@ResolutionIdToDelete INT
AS
DELETE
BugNet_ProjectResolutions
WHERE
ResolutionId = @ResolutionIdToDelete
IF @@ROWCOUNT > 0
RETURN 0
ELSE
RETURN 1
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectResolutions_GetResolutionById] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectResolutions_GetResolutionById]
@ResolutionId int
AS
SELECT
ResolutionId,
ProjectId,
ResolutionName,
SortOrder,
ResolutionImageUrl
FROM
BugNet_ProjectResolutions
WHERE
ResolutionId = @ResolutionId
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectResolutions_GetResolutionsByProjectId] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectResolutions_GetResolutionsByProjectId]
@ProjectId Int
AS
SELECT ResolutionId, ProjectId, ResolutionName,SortOrder, ResolutionImageUrl
FROM BugNet_ProjectResolutions
WHERE ProjectId = @ProjectId
ORDER BY SortOrder
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectResolutions_UpdateResolution] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectResolutions_UpdateResolution]
@ProjectId int,
@ResolutionId int,
@ResolutionName NVARCHAR(50),
@ResolutionImageUrl NVARCHAR(50),
@SortOrder int
AS
DECLARE @OldSortOrder int
DECLARE @OldResolutionId int
SELECT @OldSortOrder = SortOrder FROM BugNet_ProjectResolutions WHERE ResolutionId = @ResolutionId
SELECT @OldResolutionId = ResolutionId FROM BugNet_ProjectResolutions WHERE SortOrder = @SortOrder AND ProjectId = @ProjectId
UPDATE BugNet_ProjectResolutions SET
ProjectId = @ProjectId,
ResolutionName = @ResolutionName,
ResolutionImageUrl = @ResolutionImageUrl,
SortOrder = @SortOrder
WHERE ResolutionId = @ResolutionId
UPDATE BugNet_ProjectResolutions SET
SortOrder = @OldSortOrder
WHERE ResolutionId = @OldResolutionId
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectStatus_CanDeleteStatus] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectStatus_CanDeleteStatus]
@StatusId INT
AS
SET NOCOUNT ON
DECLARE
@ProjectId INT,
@Count INT
SET @ProjectId = (SELECT ProjectId FROM BugNet_ProjectStatus WHERE StatusId = @StatusId)
SET @Count =
(
SELECT COUNT(*)
FROM BugNet_Issues
WHERE (IssueStatusId = @StatusId)
AND ProjectId = @ProjectId
)
IF(@Count = 0)
RETURN 1
ELSE
RETURN 0
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectStatus_CreateNewStatus] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectStatus_CreateNewStatus]
@ProjectId INT,
@StatusName NVARCHAR(50),
@StatusImageUrl NVARCHAR(50),
@IsClosedState bit
AS
IF NOT EXISTS(SELECT StatusId FROM BugNet_ProjectStatus WHERE LOWER(StatusName)= LOWER(@StatusName) AND ProjectId = @ProjectId)
BEGIN
DECLARE @SortOrder int
SELECT @SortOrder = ISNULL(MAX(SortOrder + 1),1) FROM BugNet_ProjectStatus WHERE ProjectId = @ProjectId
INSERT BugNet_ProjectStatus
(
ProjectId,
StatusName ,
StatusImageUrl,
SortOrder,
IsClosedState
) VALUES (
@ProjectId,
@StatusName,
@StatusImageUrl,
@SortOrder,
@IsClosedState
)
RETURN SCOPE_IDENTITY()
END
RETURN -1
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectStatus_DeleteStatus] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectStatus_DeleteStatus]
@StatusIdToDelete INT
AS
DELETE
BugNet_ProjectStatus
WHERE
StatusId = @StatusIdToDelete
IF @@ROWCOUNT > 0
RETURN 0
ELSE
RETURN 1
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectStatus_GetStatusById] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectStatus_GetStatusById]
@StatusId int
AS
SELECT
StatusId,
ProjectId,
StatusName,
SortOrder,
StatusImageUrl,
IsClosedState
FROM
BugNet_ProjectStatus
WHERE
StatusId = @StatusId
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectStatus_GetStatusByProjectId] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectStatus_GetStatusByProjectId]
@ProjectId Int
AS
SELECT StatusId, ProjectId, StatusName,SortOrder, StatusImageUrl, IsClosedState
FROM BugNet_ProjectStatus
WHERE ProjectId = @ProjectId
ORDER BY SortOrder
GO
/****** Object: StoredProcedure [dbo].[BugNet_ProjectStatus_UpdateStatus] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_ProjectStatus_UpdateStatus]
@ProjectId int,
@StatusId int,
@StatusName NVARCHAR(50),
@StatusImageUrl NVARCHAR(50),
@SortOrder int,
@IsClosedState bit
AS
DECLARE @OldSortOrder int
DECLARE @OldStatusId int
SELECT @OldSortOrder = SortOrder FROM BugNet_ProjectStatus WHERE StatusId = @StatusId
SELECT @OldStatusId = StatusId FROM BugNet_ProjectStatus WHERE SortOrder = @SortOrder AND ProjectId = @ProjectId
UPDATE BugNet_ProjectStatus SET
ProjectId = @ProjectId,
StatusName = @StatusName,
StatusImageUrl = @StatusImageUrl,
SortOrder = @SortOrder,
IsClosedState = @IsClosedState
WHERE StatusId = @StatusId
UPDATE BugNet_ProjectStatus SET
SortOrder = @OldSortOrder
WHERE StatusId = @OldStatusId
GO
/****** Object: StoredProcedure [dbo].[BugNet_Query_DeleteQuery] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_Query_DeleteQuery]
@QueryId Int
AS
DELETE BugNet_Queries WHERE QueryId = @QueryId
DELETE BugNet_QueryClauses WHERE QueryId = @QueryId
GO
/****** Object: StoredProcedure [dbo].[BugNet_Query_GetQueriesByUserName] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_Query_GetQueriesByUserName]
@UserName NVarChar(255),
@ProjectId Int
AS
DECLARE @UserId UNIQUEIDENTIFIER
SELECT @UserId = UserId FROM Users WHERE UserName = @UserName
SELECT
QueryId,
QueryName + ' (' + BugNet_UserProfiles.DisplayName + ')' AS QueryName,
IsPublic
FROM
BugNet_Queries INNER JOIN
Users M ON BugNet_Queries.UserId = M.UserId JOIN
BugNet_UserProfiles ON M.UserName = BugNet_UserProfiles.UserName
WHERE
IsPublic = 1 AND ProjectId = @ProjectId
UNION
SELECT
QueryId,
QueryName,
IsPublic
FROM
BugNet_Queries
WHERE
UserId = @UserId
AND ProjectId = @ProjectId
AND IsPublic = 0
ORDER BY
QueryName
GO
/****** Object: StoredProcedure [dbo].[BugNet_Query_GetQueryById] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_Query_GetQueryById]
@QueryId Int
AS
SELECT
QueryId,
QueryName,
IsPublic
FROM
BugNet_Queries
WHERE
QueryId = @QueryId
ORDER BY
QueryName
GO
/****** Object: StoredProcedure [dbo].[BugNet_Query_GetSavedQuery] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_Query_GetSavedQuery]
@QueryId INT
AS
SELECT
BooleanOperator,
FieldName,
ComparisonOperator,
FieldValue,
DataType,
CustomFieldId
FROM
BugNet_QueryClauses
WHERE
QueryId = @QueryId;
GO
/****** Object: StoredProcedure [dbo].[BugNet_Query_SaveQuery] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_Query_SaveQuery]
@UserName NVarChar(255),
@ProjectId Int,
@QueryName NVarChar(50),
@IsPublic bit
AS
-- Get UserID
DECLARE @UserId UNIQUEIDENTIFIER
SELECT @UserId = UserId FROM Users WHERE UserName = @UserName
IF EXISTS(SELECT QueryName FROM BugNet_Queries WHERE QueryName = @QueryName AND UserId = @UserId AND ProjectId = @ProjectId)
BEGIN
RETURN 0
END
INSERT BugNet_Queries
(
UserId,
ProjectId,
QueryName,
IsPublic
)
VALUES
(
@UserId,
@ProjectId,
@QueryName,
@IsPublic
)
RETURN scope_identity()
GO
/****** Object: StoredProcedure [dbo].[BugNet_Query_SaveQueryClause] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_Query_SaveQueryClause]
@QueryId INT,
@BooleanOperator NVarChar(50),
@FieldName NVarChar(50),
@ComparisonOperator NVarChar(50),
@FieldValue NVarChar(50),
@DataType INT,
@CustomFieldId INT = NULL
AS
INSERT BugNet_QueryClauses
(
QueryId,
BooleanOperator,
FieldName,
ComparisonOperator,
FieldValue,
DataType,
CustomFieldId
)
VALUES (
@QueryId,
@BooleanOperator,
@FieldName,
@ComparisonOperator,
@FieldValue,
@DataType,
@CustomFieldId
)
GO
/****** Object: StoredProcedure [dbo].[BugNet_Query_UpdateQuery] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_Query_UpdateQuery]
@QueryId Int,
@UserName NVarChar(255),
@ProjectId Int,
@QueryName NVarChar(50),
@IsPublic bit
AS
-- Get UserID
DECLARE @UserId UNIQUEIDENTIFIER
SELECT @UserId = UserId FROM Users WHERE UserName = @UserName
UPDATE
BugNet_Queries
SET
UserId = @UserId,
ProjectId = @ProjectId,
QueryName = @QueryName,
IsPublic = @IsPublic
WHERE
QueryId = @QueryId
DELETE FROM BugNet_QueryClauses WHERE QueryId = @QueryId
GO
/****** Object: StoredProcedure [dbo].[BugNet_RelatedIssue_CreateNewChildIssue] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_RelatedIssue_CreateNewChildIssue]
@PrimaryIssueId Int,
@SecondaryIssueId Int,
@RelationType Int
AS
IF NOT EXISTS(SELECT PrimaryIssueId FROM BugNet_RelatedIssues WHERE PrimaryIssueId = @PrimaryIssueId AND SecondaryIssueId = @SecondaryIssueId AND RelationType = @RelationType)
BEGIN
INSERT BugNet_RelatedIssues
(
PrimaryIssueId,
SecondaryIssueId,
RelationType
)
VALUES
(
@PrimaryIssueId,
@SecondaryIssueId,
@RelationType
)
END
GO
/****** Object: StoredProcedure [dbo].[BugNet_RelatedIssue_CreateNewParentIssue] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_RelatedIssue_CreateNewParentIssue]
@PrimaryIssueId Int,
@SecondaryIssueId Int,
@RelationType Int
AS
IF NOT EXISTS(SELECT PrimaryIssueId FROM BugNet_RelatedIssues WHERE PrimaryIssueId = @SecondaryIssueId AND SecondaryIssueId = @PrimaryIssueId AND RelationType = @RelationType)
BEGIN
INSERT BugNet_RelatedIssues
(
PrimaryIssueId,
SecondaryIssueId,
RelationType
)
VALUES
(
@SecondaryIssueId,
@PrimaryIssueId,
@RelationType
)
END
GO
/****** Object: StoredProcedure [dbo].[BugNet_RelatedIssue_CreateNewRelatedIssue] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_RelatedIssue_CreateNewRelatedIssue]
@PrimaryIssueId Int,
@SecondaryIssueId Int,
@RelationType Int
AS
IF NOT EXISTS(SELECT PrimaryIssueId FROM BugNet_RelatedIssues WHERE (PrimaryIssueId = @PrimaryIssueId OR PrimaryIssueId = @SecondaryIssueId) AND (SecondaryIssueId = @SecondaryIssueId OR SecondaryIssueId = @PrimaryIssueId) AND RelationType = @RelationType)
BEGIN
INSERT BugNet_RelatedIssues
(
PrimaryIssueId,
SecondaryIssueId,
RelationType
)
VALUES
(
@SecondaryIssueId,
@PrimaryIssueId,
@RelationType
)
END
GO
/****** Object: StoredProcedure [dbo].[BugNet_RelatedIssue_DeleteChildIssue] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_RelatedIssue_DeleteChildIssue]
@PrimaryIssueId Int,
@SecondaryIssueId Int,
@RelationType Int
AS
DELETE
BugNet_RelatedIssues
WHERE
PrimaryIssueId = @PrimaryIssueId
AND SecondaryIssueId = @SecondaryIssueId
AND RelationType = @RelationType
GO
/****** Object: StoredProcedure [dbo].[BugNet_RelatedIssue_DeleteParentIssue] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_RelatedIssue_DeleteParentIssue]
@PrimaryIssueId Int,
@SecondaryIssueId Int,
@RelationType Int
AS
DELETE
BugNet_RelatedIssues
WHERE
PrimaryIssueId = @SecondaryIssueId
AND SecondaryIssueId = @PrimaryIssueId
AND RelationType = @RelationType
GO
/****** Object: StoredProcedure [dbo].[BugNet_RelatedIssue_DeleteRelatedIssue] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_RelatedIssue_DeleteRelatedIssue]
@PrimaryIssueId Int,
@SecondaryIssueId Int,
@RelationType Int
AS
DELETE
BugNet_RelatedIssues
WHERE
( (PrimaryIssueId = @PrimaryIssueId AND SecondaryIssueId = @SecondaryIssueId) OR (PrimaryIssueId = @SecondaryIssueId AND SecondaryIssueId = @PrimaryIssueId) )
AND RelationType = @RelationType
GO
/****** Object: StoredProcedure [dbo].[BugNet_RelatedIssue_GetChildIssues] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_RelatedIssue_GetChildIssues]
@IssueId Int,
@RelationType Int
AS
SELECT
IssueId,
IssueTitle,
StatusName as IssueStatus,
ResolutionName as IssueResolution,
DateCreated
FROM
BugNet_RelatedIssues
INNER JOIN BugNet_Issues ON SecondaryIssueId = IssueId
LEFT JOIN BugNet_ProjectStatus ON BugNet_Issues.IssueStatusId = BugNet_ProjectStatus.StatusId
LEFT JOIN BugNet_ProjectResolutions ON BugNet_Issues.IssueResolutionId = BugNet_ProjectResolutions.ResolutionId
WHERE
PrimaryIssueId = @IssueId
AND RelationType = @RelationType
ORDER BY
SecondaryIssueId
GO
/****** Object: StoredProcedure [dbo].[BugNet_RelatedIssue_GetParentIssues] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_RelatedIssue_GetParentIssues]
@IssueId Int,
@RelationType Int
AS
SELECT
IssueId,
IssueTitle,
StatusName as IssueStatus,
ResolutionName as IssueResolution,
DateCreated
FROM
BugNet_RelatedIssues
INNER JOIN BugNet_Issues ON PrimaryIssueId = IssueId
LEFT JOIN BugNet_ProjectStatus ON BugNet_Issues.IssueStatusId = BugNet_ProjectStatus.StatusId
LEFT JOIN BugNet_ProjectResolutions ON BugNet_Issues.IssueResolutionId = BugNet_ProjectResolutions.ResolutionId
WHERE
SecondaryIssueId = @IssueId
AND RelationType = @RelationType
ORDER BY
PrimaryIssueId
GO
/****** Object: StoredProcedure [dbo].[BugNet_RelatedIssue_GetRelatedIssues] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_RelatedIssue_GetRelatedIssues]
@IssueId Int,
@RelationType Int
AS
SELECT
IssueId,
IssueTitle,
StatusName as IssueStatus,
ResolutionName as IssueResolution,
DateCreated
FROM
BugNet_Issues
LEFT JOIN BugNet_ProjectStatus ON BugNet_Issues.IssueStatusId = BugNet_ProjectStatus.StatusId
LEFT JOIN BugNet_ProjectResolutions ON BugNet_Issues.IssueResolutionId = BugNet_ProjectResolutions.ResolutionId
WHERE
IssueId IN (SELECT PrimaryIssueId FROM BugNet_RelatedIssues WHERE SecondaryIssueId = @IssueId AND RelationType = @RelationType)
OR IssueId IN (SELECT SecondaryIssueId FROM BugNet_RelatedIssues WHERE PrimaryIssueId = @IssueId AND RelationType = @RelationType)
ORDER BY
IssueId
GO
/****** Object: StoredProcedure [dbo].[BugNet_RequiredField_GetRequiredFieldListForIssues] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_RequiredField_GetRequiredFieldListForIssues]
AS
BEGIN
SET NOCOUNT ON;
SELECT RequiredFieldId, FieldName, FieldValue FROM BugNet_RequiredFieldList
END
GO
/****** Object: StoredProcedure [dbo].[BugNet_Role_AddUserToRole] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_Role_AddUserToRole]
@UserName nvarchar(256),
@RoleId int
AS
DECLARE @ProjectId int
DECLARE @UserId UNIQUEIDENTIFIER
SELECT @UserId = UserId FROM Users WHERE UserName = @UserName
SELECT @ProjectId = ProjectId FROM BugNet_Roles WHERE RoleId = @RoleId
IF NOT EXISTS (SELECT UserId FROM BugNet_UserProjects WHERE UserId = @UserId AND ProjectId = @ProjectId) AND @RoleId <> 1
BEGIN
EXEC BugNet_Project_AddUserToProject @UserName, @ProjectId
END
IF NOT EXISTS (SELECT UserId FROM BugNet_UserRoles WHERE UserId = @UserId AND RoleId = @RoleId)
BEGIN
INSERT BugNet_UserRoles
(
UserId,
RoleId
)
VALUES
(
@UserId,
@RoleId
)
END
GO
/****** Object: StoredProcedure [dbo].[BugNet_Role_CreateNewRole] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_Role_CreateNewRole]
@ProjectId int,
@RoleName nvarchar(256),
@RoleDescription nvarchar(256),
@AutoAssign bit
AS
INSERT BugNet_Roles
(
ProjectId,
RoleName,
RoleDescription,
AutoAssign
)
VALUES
(
@ProjectId,
@RoleName,
@RoleDescription,
@AutoAssign
)
RETURN scope_identity()
GO
/****** Object: StoredProcedure [dbo].[BugNet_Role_DeleteRole] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_Role_DeleteRole]
@RoleId Int
AS
DELETE
BugNet_Roles
WHERE
RoleId = @RoleId
IF @@ROWCOUNT > 0
RETURN 0
ELSE
RETURN 1
GO
/****** Object: StoredProcedure [dbo].[BugNet_Role_GetAllRoles] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_Role_GetAllRoles]
AS
SELECT RoleId, RoleName,RoleDescription,ProjectId,AutoAssign FROM BugNet_Roles
GO
/****** Object: StoredProcedure [dbo].[BugNet_Role_GetProjectRolesByUser] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE procedure [dbo].[BugNet_Role_GetProjectRolesByUser]
@UserName nvarchar(256),
@ProjectId int
AS
DECLARE @UserId UNIQUEIDENTIFIER
SELECT @UserId = UserId FROM Users WHERE UserName = @UserName
SELECT R.RoleName,
R.ProjectId,
R.RoleDescription,
R.RoleId,
R.AutoAssign
FROM BugNet_UserRoles
INNER JOIN Users ON BugNet_UserRoles.UserId = Users.UserId
INNER JOIN BugNet_Roles R ON BugNet_UserRoles.RoleId = R.RoleId
WHERE Users.UserId = @UserId
AND (R.ProjectId IS NULL OR R.ProjectId = @ProjectId)
GO
/****** Object: StoredProcedure [dbo].[BugNet_Role_GetRoleById] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_Role_GetRoleById]
@RoleId int
AS
SELECT RoleId, ProjectId, RoleName, RoleDescription, AutoAssign
FROM BugNet_Roles
WHERE RoleId = @RoleId
GO
/****** Object: StoredProcedure [dbo].[BugNet_Role_GetRolesByProject] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_Role_GetRolesByProject]
@ProjectId int
AS
SELECT RoleId,ProjectId, RoleName, RoleDescription, AutoAssign
FROM BugNet_Roles
WHERE ProjectId = @ProjectId
GO
/****** Object: StoredProcedure [dbo].[BugNet_Role_GetRolesByUser] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE procedure [dbo].[BugNet_Role_GetRolesByUser]
@UserName nvarchar(256)
AS
DECLARE @UserId UNIQUEIDENTIFIER
SELECT @UserId = UserId FROM Users WHERE UserName = @UserName
SELECT BugNet_Roles.RoleName,
BugNet_Roles.ProjectId,
BugNet_Roles.RoleDescription,
BugNet_Roles.RoleId,
BugNet_Roles.AutoAssign
FROM BugNet_UserRoles
INNER JOIN Users ON BugNet_UserRoles.UserId = Users.UserId
INNER JOIN BugNet_Roles ON BugNet_UserRoles.RoleId = BugNet_Roles.RoleId
WHERE Users.UserId = @UserId
GO
/****** Object: StoredProcedure [dbo].[BugNet_Role_IsUserInRole] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE procedure [dbo].[BugNet_Role_IsUserInRole]
@UserName nvarchar(256),
@RoleId int,
@ProjectId int
AS
DECLARE @UserId UNIQUEIDENTIFIER
SELECT @UserId = UserId FROM Users WHERE UserName = @UserName
SELECT UR.UserId,
UR.RoleId
FROM BugNet_UserRoles UR
INNER JOIN BugNet_Roles R ON UR.RoleId = R.RoleId
WHERE UR.UserId = @UserId
AND UR.RoleId = @RoleId
AND R.ProjectId = @ProjectId
GO
/****** Object: StoredProcedure [dbo].[BugNet_Role_RemoveUserFromRole] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_Role_RemoveUserFromRole]
@UserName nvarchar(256),
@RoleId Int
AS
DECLARE @UserId UNIQUEIDENTIFIER
SELECT @UserId = UserId FROM Users WHERE UserName = @UserName
DELETE BugNet_UserRoles WHERE UserId = @UserId AND RoleId = @RoleId
GO
/****** Object: StoredProcedure [dbo].[BugNet_Role_RoleExists] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_Role_RoleExists]
@RoleName nvarchar(256),
@ProjectId int
AS
BEGIN
IF (EXISTS (SELECT RoleName FROM BugNet_Roles WHERE @RoleName = RoleName AND ProjectId = @ProjectId))
RETURN(1)
ELSE
RETURN(0)
END
GO
/****** Object: StoredProcedure [dbo].[BugNet_Role_RoleHasPermission] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_Role_RoleHasPermission]
@ProjectID int,
@Role nvarchar(256),
@PermissionKey nvarchar(50)
AS
SELECT COUNT(*) FROM BugNet_RolePermissions INNER JOIN BugNet_Roles ON BugNet_Roles.RoleId = BugNet_RolePermissions.RoleId INNER JOIN
BugNet_Permissions ON BugNet_RolePermissions.PermissionId = BugNet_Permissions.PermissionId
WHERE ProjectId = @ProjectID
AND
PermissionKey = @PermissionKey
AND
BugNet_Roles.RoleName = @Role
GO
/****** Object: StoredProcedure [dbo].[BugNet_Role_UpdateRole] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_Role_UpdateRole]
@RoleId int,
@RoleName nvarchar(256),
@RoleDescription nvarchar(256),
@AutoAssign bit,
@ProjectId int
AS
UPDATE BugNet_Roles SET
RoleName = @RoleName,
RoleDescription = @RoleDescription,
AutoAssign = @AutoAssign,
ProjectId = @ProjectId
WHERE
RoleId = @RoleId
GO
/****** Object: StoredProcedure [dbo].[BugNet_SetProjectSelectedColumnsWithUserIdAndProjectId] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_SetProjectSelectedColumnsWithUserIdAndProjectId]
@UserName nvarchar(255),
@ProjectId int,
@Columns nvarchar(255)
AS
DECLARE
@UserId UNIQUEIDENTIFIER
SELECT @UserId = UserId FROM Users WHERE UserName = @UserName
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
UPDATE BugNet_UserProjects
SET [SelectedIssueColumns] = @Columns
WHERE UserId = @UserId AND ProjectId = @ProjectId;
END
GO
/****** Object: StoredProcedure [dbo].[BugNet_User_GetUserIdByUserName] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_User_GetUserIdByUserName]
@UserName NVARCHAR(75),
@UserId UNIQUEIDENTIFIER OUTPUT
AS
SET NOCOUNT ON
SELECT @UserId = UserId
FROM Users
WHERE UserName = @UserName
GO
/****** Object: StoredProcedure [dbo].[BugNet_User_GetUserNameByPasswordResetToken] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_User_GetUserNameByPasswordResetToken]
@Token NVARCHAR(255),
@UserName NVARCHAR(255) OUTPUT
AS
SET NOCOUNT ON
SELECT @UserName = UserName
FROM BugNet_UserProfiles
WHERE PasswordVerificationToken = @Token
GO
/****** Object: StoredProcedure [dbo].[BugNet_User_GetUsersByProjectId] Script Date: 11/2/2014 3:54:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_User_GetUsersByProjectId]
@ProjectId Int,
@ExcludeReadonlyUsers bit
AS
SELECT DISTINCT U.UserId, U.UserName, FirstName, LastName, DisplayName FROM
Users U
JOIN BugNet_UserProjects
ON U.UserId = BugNet_UserProjects.UserId
JOIN BugNet_UserProfiles
ON U.UserName = BugNet_UserProfiles.UserName
JOIN Memberships M
ON U.UserId = M.UserId
LEFT JOIN BugNet_UserRoles UR
ON U.UserId = UR.UserId
LEFT JOIN BugNet_Roles R
ON UR.RoleId = R.RoleId AND R.ProjectId = @ProjectId
WHERE
BugNet_UserProjects.ProjectId = @ProjectId
AND M.IsApproved = 1
AND (@ExcludeReadonlyUsers = 0 OR @ExcludeReadonlyUsers = 1 AND R.RoleName != 'Read Only')
ORDER BY DisplayName ASC
GO
/****** Object: Statistic [ST_1410104064_1_2] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_1410104064_1_2] ON [dbo].[BugNet_IssueAttachments]([IssueAttachmentId], [IssueId])
GO
/****** Object: Statistic [ST_1410104064_1_8] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_1410104064_1_8] ON [dbo].[BugNet_IssueAttachments]([IssueAttachmentId], [UserId])
GO
/****** Object: Statistic [ST_1410104064_2_8_7] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_1410104064_2_8_7] ON [dbo].[BugNet_IssueAttachments]([IssueId], [UserId], [DateCreated])
GO
/****** Object: Statistic [ST_1474104292_1_5] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_1474104292_1_5] ON [dbo].[BugNet_IssueComments]([IssueCommentId], [UserId])
GO
/****** Object: Statistic [ST_1474104292_2_1] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_1474104292_2_1] ON [dbo].[BugNet_IssueComments]([IssueId], [IssueCommentId])
GO
/****** Object: Statistic [ST_1474104292_3_2] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_1474104292_3_2] ON [dbo].[BugNet_IssueComments]([DateCreated], [IssueId])
GO
/****** Object: Statistic [ST_1474104292_5_2_3] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_1474104292_5_2_3] ON [dbo].[BugNet_IssueComments]([UserId], [IssueId], [DateCreated])
GO
/****** Object: Statistic [ST_1442104178_2_3_5_4_7] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_1442104178_2_3_5_4_7] ON [dbo].[BugNet_IssueHistory]([IssueId], [FieldChanged], [NewValue], [OldValue], [UserId])
GO
/****** Object: Statistic [ST_1442104178_2_7_3_5] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_1442104178_2_7_3_5] ON [dbo].[BugNet_IssueHistory]([IssueId], [UserId], [FieldChanged], [NewValue])
GO
/****** Object: Statistic [ST_1442104178_6_2] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_1442104178_6_2] ON [dbo].[BugNet_IssueHistory]([DateCreated], [IssueId])
GO
/****** Object: Statistic [ST_1442104178_7_2_6] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_1442104178_7_2_6] ON [dbo].[BugNet_IssueHistory]([UserId], [IssueId], [DateCreated])
GO
/****** Object: Statistic [ST_1442104178_7_3_5_4] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_1442104178_7_3_5_4] ON [dbo].[BugNet_IssueHistory]([UserId], [FieldChanged], [NewValue], [OldValue])
GO
/****** Object: Statistic [ST_914102297_1_12_21_11_13_6_5_7_4_9_15] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_1_12_21_11_13_6_5_7_4_9_15] ON [dbo].[BugNet_Issues]([IssueId], [IssueAssignedUserId], [LastUpdateUserId], [IssueCreatorUserId], [IssueOwnerUserId], [IssueTypeId], [IssuePriorityId], [IssueCategoryId], [IssueStatusId], [IssueAffectedMilestoneId], [IssueMilestoneId])
GO
/****** Object: Statistic [ST_914102297_1_12_8_22_15] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_1_12_8_22_15] ON [dbo].[BugNet_Issues]([IssueId], [IssueAssignedUserId], [ProjectId], [Disabled], [IssueMilestoneId])
GO
/****** Object: Statistic [ST_914102297_1_4_22] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_1_4_22] ON [dbo].[BugNet_Issues]([IssueId], [IssueStatusId], [Disabled])
GO
/****** Object: Statistic [ST_914102297_1_4_6_5] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_1_4_6_5] ON [dbo].[BugNet_Issues]([IssueId], [IssueStatusId], [IssueTypeId], [IssuePriorityId])
GO
/****** Object: Statistic [ST_914102297_1_8_22_10_15] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_1_8_22_10_15] ON [dbo].[BugNet_Issues]([IssueId], [ProjectId], [Disabled], [IssueResolutionId], [IssueMilestoneId])
GO
/****** Object: Statistic [ST_914102297_1_8_6_5_7_4_9_15_10_12_21_11] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_1_8_6_5_7_4_9_15_10_12_21_11] ON [dbo].[BugNet_Issues]([IssueId], [ProjectId], [IssueTypeId], [IssuePriorityId], [IssueCategoryId], [IssueStatusId], [IssueAffectedMilestoneId], [IssueMilestoneId], [IssueResolutionId], [IssueAssignedUserId], [LastUpdateUserId], [IssueCreatorUserId])
GO
/****** Object: Statistic [ST_914102297_1_9] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_1_9] ON [dbo].[BugNet_Issues]([IssueId], [IssueAffectedMilestoneId])
GO
/****** Object: Statistic [ST_914102297_10_1_4] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_10_1_4] ON [dbo].[BugNet_Issues]([IssueResolutionId], [IssueId], [IssueStatusId])
GO
/****** Object: Statistic [ST_914102297_10_1_6_5_7_4_9] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_10_1_6_5_7_4_9] ON [dbo].[BugNet_Issues]([IssueResolutionId], [IssueId], [IssueTypeId], [IssuePriorityId], [IssueCategoryId], [IssueStatusId], [IssueAffectedMilestoneId])
GO
/****** Object: Statistic [ST_914102297_10_12_8_22_1_15_9_4_6_5] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_10_12_8_22_1_15_9_4_6_5] ON [dbo].[BugNet_Issues]([IssueResolutionId], [IssueAssignedUserId], [ProjectId], [Disabled], [IssueId], [IssueMilestoneId], [IssueAffectedMilestoneId], [IssueStatusId], [IssueTypeId], [IssuePriorityId])
GO
/****** Object: Statistic [ST_914102297_10_15_9_1_4_6_5_7_12_21_11_13_22] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_10_15_9_1_4_6_5_7_12_21_11_13_22] ON [dbo].[BugNet_Issues]([IssueResolutionId], [IssueMilestoneId], [IssueAffectedMilestoneId], [IssueId], [IssueStatusId], [IssueTypeId], [IssuePriorityId], [IssueCategoryId], [IssueAssignedUserId], [LastUpdateUserId], [IssueCreatorUserId], [IssueOwnerUserId], [Disabled])
GO
/****** Object: Statistic [ST_914102297_10_15_9_8_6_5_7_4_12_21_13_1_22] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_10_15_9_8_6_5_7_4_12_21_13_1_22] ON [dbo].[BugNet_Issues]([IssueResolutionId], [IssueMilestoneId], [IssueAffectedMilestoneId], [ProjectId], [IssueTypeId], [IssuePriorityId], [IssueCategoryId], [IssueStatusId], [IssueAssignedUserId], [LastUpdateUserId], [IssueOwnerUserId], [IssueId], [Disabled])
GO
/****** Object: Statistic [ST_914102297_10_22_13_11_21_12_15] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_10_22_13_11_21_12_15] ON [dbo].[BugNet_Issues]([IssueResolutionId], [Disabled], [IssueOwnerUserId], [IssueCreatorUserId], [LastUpdateUserId], [IssueAssignedUserId], [IssueMilestoneId])
GO
/****** Object: Statistic [ST_914102297_10_8_11] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_10_8_11] ON [dbo].[BugNet_Issues]([IssueResolutionId], [ProjectId], [IssueCreatorUserId])
GO
/****** Object: Statistic [ST_914102297_10_8_12_22_1_4_6_5_7_9] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_10_8_12_22_1_4_6_5_7_9] ON [dbo].[BugNet_Issues]([IssueResolutionId], [ProjectId], [IssueAssignedUserId], [Disabled], [IssueId], [IssueStatusId], [IssueTypeId], [IssuePriorityId], [IssueCategoryId], [IssueAffectedMilestoneId])
GO
/****** Object: Statistic [ST_914102297_10_8_12_22_15_9_6_5_7] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_10_8_12_22_15_9_6_5_7] ON [dbo].[BugNet_Issues]([IssueResolutionId], [ProjectId], [IssueAssignedUserId], [Disabled], [IssueMilestoneId], [IssueAffectedMilestoneId], [IssueTypeId], [IssuePriorityId], [IssueCategoryId])
GO
/****** Object: Statistic [ST_914102297_10_8_13] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_10_8_13] ON [dbo].[BugNet_Issues]([IssueResolutionId], [ProjectId], [IssueOwnerUserId])
GO
/****** Object: Statistic [ST_914102297_10_8_22_1_13_11_21] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_10_8_22_1_13_11_21] ON [dbo].[BugNet_Issues]([IssueResolutionId], [ProjectId], [Disabled], [IssueId], [IssueOwnerUserId], [IssueCreatorUserId], [LastUpdateUserId])
GO
/****** Object: Statistic [ST_914102297_11_10_15_9] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_11_10_15_9] ON [dbo].[BugNet_Issues]([IssueCreatorUserId], [IssueResolutionId], [IssueMilestoneId], [IssueAffectedMilestoneId])
GO
/****** Object: Statistic [ST_914102297_12_10_15_9] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_12_10_15_9] ON [dbo].[BugNet_Issues]([IssueAssignedUserId], [IssueResolutionId], [IssueMilestoneId], [IssueAffectedMilestoneId])
GO
/****** Object: Statistic [ST_914102297_12_15_9_22_8_6] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_12_15_9_22_8_6] ON [dbo].[BugNet_Issues]([IssueAssignedUserId], [IssueMilestoneId], [IssueAffectedMilestoneId], [Disabled], [ProjectId], [IssueTypeId])
GO
/****** Object: Statistic [ST_914102297_12_21_11_13_4_8_22] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_12_21_11_13_4_8_22] ON [dbo].[BugNet_Issues]([IssueAssignedUserId], [LastUpdateUserId], [IssueCreatorUserId], [IssueOwnerUserId], [IssueStatusId], [ProjectId], [Disabled])
GO
/****** Object: Statistic [ST_914102297_12_21_11_8_13_22_10_15_9_6_5_7] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_12_21_11_8_13_22_10_15_9_6_5_7] ON [dbo].[BugNet_Issues]([IssueAssignedUserId], [LastUpdateUserId], [IssueCreatorUserId], [ProjectId], [IssueOwnerUserId], [Disabled], [IssueResolutionId], [IssueMilestoneId], [IssueAffectedMilestoneId], [IssueTypeId], [IssuePriorityId], [IssueCategoryId])
GO
/****** Object: Statistic [ST_914102297_12_22_21_11] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_12_22_21_11] ON [dbo].[BugNet_Issues]([IssueAssignedUserId], [Disabled], [LastUpdateUserId], [IssueCreatorUserId])
GO
/****** Object: Statistic [ST_914102297_12_4] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_12_4] ON [dbo].[BugNet_Issues]([IssueAssignedUserId], [IssueStatusId])
GO
/****** Object: Statistic [ST_914102297_12_8_22_1_21_11] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_12_8_22_1_21_11] ON [dbo].[BugNet_Issues]([IssueAssignedUserId], [ProjectId], [Disabled], [IssueId], [LastUpdateUserId], [IssueCreatorUserId])
GO
/****** Object: Statistic [ST_914102297_12_8_22_1_6_15_9] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_12_8_22_1_6_15_9] ON [dbo].[BugNet_Issues]([IssueAssignedUserId], [ProjectId], [Disabled], [IssueId], [IssueTypeId], [IssueMilestoneId], [IssueAffectedMilestoneId])
GO
/****** Object: Statistic [ST_914102297_13_10_15_9_22] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_13_10_15_9_22] ON [dbo].[BugNet_Issues]([IssueOwnerUserId], [IssueResolutionId], [IssueMilestoneId], [IssueAffectedMilestoneId], [Disabled])
GO
/****** Object: Statistic [ST_914102297_13_11_21_12_10_15_9_4_7_5_6_1_22] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_13_11_21_12_10_15_9_4_7_5_6_1_22] ON [dbo].[BugNet_Issues]([IssueOwnerUserId], [IssueCreatorUserId], [LastUpdateUserId], [IssueAssignedUserId], [IssueResolutionId], [IssueMilestoneId], [IssueAffectedMilestoneId], [IssueStatusId], [IssueCategoryId], [IssuePriorityId], [IssueTypeId], [IssueId], [Disabled])
GO
/****** Object: Statistic [ST_914102297_13_11_21_12_8] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_13_11_21_12_8] ON [dbo].[BugNet_Issues]([IssueOwnerUserId], [IssueCreatorUserId], [LastUpdateUserId], [IssueAssignedUserId], [ProjectId])
GO
/****** Object: Statistic [ST_914102297_13_12] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_13_12] ON [dbo].[BugNet_Issues]([IssueOwnerUserId], [IssueAssignedUserId])
GO
/****** Object: Statistic [ST_914102297_15_4_8] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_15_4_8] ON [dbo].[BugNet_Issues]([IssueMilestoneId], [IssueStatusId], [ProjectId])
GO
/****** Object: Statistic [ST_914102297_15_8_22] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_15_8_22] ON [dbo].[BugNet_Issues]([IssueMilestoneId], [ProjectId], [Disabled])
GO
/****** Object: Statistic [ST_914102297_15_9_12_8_22_1] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_15_9_12_8_22_1] ON [dbo].[BugNet_Issues]([IssueMilestoneId], [IssueAffectedMilestoneId], [IssueAssignedUserId], [ProjectId], [Disabled], [IssueId])
GO
/****** Object: Statistic [ST_914102297_15_9_22_13_11_21_12_10_1_8_6_5_7_4] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_15_9_22_13_11_21_12_10_1_8_6_5_7_4] ON [dbo].[BugNet_Issues]([IssueMilestoneId], [IssueAffectedMilestoneId], [Disabled], [IssueOwnerUserId], [IssueCreatorUserId], [LastUpdateUserId], [IssueAssignedUserId], [IssueResolutionId], [IssueId], [ProjectId], [IssueTypeId], [IssuePriorityId], [IssueCategoryId], [IssueStatusId])
GO
/****** Object: Statistic [ST_914102297_15_9_4_8] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_15_9_4_8] ON [dbo].[BugNet_Issues]([IssueMilestoneId], [IssueAffectedMilestoneId], [IssueStatusId], [ProjectId])
GO
/****** Object: Statistic [ST_914102297_15_9_8_11] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_15_9_8_11] ON [dbo].[BugNet_Issues]([IssueMilestoneId], [IssueAffectedMilestoneId], [ProjectId], [IssueCreatorUserId])
GO
/****** Object: Statistic [ST_914102297_15_9_8_13_22] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_15_9_8_13_22] ON [dbo].[BugNet_Issues]([IssueMilestoneId], [IssueAffectedMilestoneId], [ProjectId], [IssueOwnerUserId], [Disabled])
GO
/****** Object: Statistic [ST_914102297_15_9_8_22_1_13_11_21_12] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_15_9_8_22_1_13_11_21_12] ON [dbo].[BugNet_Issues]([IssueMilestoneId], [IssueAffectedMilestoneId], [ProjectId], [Disabled], [IssueId], [IssueOwnerUserId], [IssueCreatorUserId], [LastUpdateUserId], [IssueAssignedUserId])
GO
/****** Object: Statistic [ST_914102297_15_9_8_6_5_7_4_10_21_11_13_1_22] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_15_9_8_6_5_7_4_10_21_11_13_1_22] ON [dbo].[BugNet_Issues]([IssueMilestoneId], [IssueAffectedMilestoneId], [ProjectId], [IssueTypeId], [IssuePriorityId], [IssueCategoryId], [IssueStatusId], [IssueResolutionId], [LastUpdateUserId], [IssueCreatorUserId], [IssueOwnerUserId], [IssueId], [Disabled])
GO
/****** Object: Statistic [ST_914102297_21_1] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_21_1] ON [dbo].[BugNet_Issues]([LastUpdateUserId], [IssueId])
GO
/****** Object: Statistic [ST_914102297_21_11_13_12_22_15_9_8_6_5_7_4] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_21_11_13_12_22_15_9_8_6_5_7_4] ON [dbo].[BugNet_Issues]([LastUpdateUserId], [IssueCreatorUserId], [IssueOwnerUserId], [IssueAssignedUserId], [Disabled], [IssueMilestoneId], [IssueAffectedMilestoneId], [ProjectId], [IssueTypeId], [IssuePriorityId], [IssueCategoryId], [IssueStatusId])
GO
/****** Object: Statistic [ST_914102297_21_11_13_12_8_22_1_15_9_4_6_5_7] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_21_11_13_12_8_22_1_15_9_4_6_5_7] ON [dbo].[BugNet_Issues]([LastUpdateUserId], [IssueCreatorUserId], [IssueOwnerUserId], [IssueAssignedUserId], [ProjectId], [Disabled], [IssueId], [IssueMilestoneId], [IssueAffectedMilestoneId], [IssueStatusId], [IssueTypeId], [IssuePriorityId], [IssueCategoryId])
GO
/****** Object: Statistic [ST_914102297_22_1_13_11_21_12_10_15] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_22_1_13_11_21_12_10_15] ON [dbo].[BugNet_Issues]([Disabled], [IssueId], [IssueOwnerUserId], [IssueCreatorUserId], [LastUpdateUserId], [IssueAssignedUserId], [IssueResolutionId], [IssueMilestoneId])
GO
/****** Object: Statistic [ST_914102297_22_10_15_9_11] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_22_10_15_9_11] ON [dbo].[BugNet_Issues]([Disabled], [IssueResolutionId], [IssueMilestoneId], [IssueAffectedMilestoneId], [IssueCreatorUserId])
GO
/****** Object: Statistic [ST_914102297_22_10_15_9_12] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_22_10_15_9_12] ON [dbo].[BugNet_Issues]([Disabled], [IssueResolutionId], [IssueMilestoneId], [IssueAffectedMilestoneId], [IssueAssignedUserId])
GO
/****** Object: Statistic [ST_914102297_22_12_13] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_22_12_13] ON [dbo].[BugNet_Issues]([Disabled], [IssueAssignedUserId], [IssueOwnerUserId])
GO
/****** Object: Statistic [ST_914102297_22_12_8_15] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_22_12_8_15] ON [dbo].[BugNet_Issues]([Disabled], [IssueAssignedUserId], [ProjectId], [IssueMilestoneId])
GO
/****** Object: Statistic [ST_914102297_22_13_11_21_12_10_15_9_4_7_5_6_8] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_22_13_11_21_12_10_15_9_4_7_5_6_8] ON [dbo].[BugNet_Issues]([Disabled], [IssueOwnerUserId], [IssueCreatorUserId], [LastUpdateUserId], [IssueAssignedUserId], [IssueResolutionId], [IssueMilestoneId], [IssueAffectedMilestoneId], [IssueStatusId], [IssueCategoryId], [IssuePriorityId], [IssueTypeId], [ProjectId])
GO
/****** Object: Statistic [ST_914102297_22_13_8_10_15_9_6] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_22_13_8_10_15_9_6] ON [dbo].[BugNet_Issues]([Disabled], [IssueOwnerUserId], [ProjectId], [IssueResolutionId], [IssueMilestoneId], [IssueAffectedMilestoneId], [IssueTypeId])
GO
/****** Object: Statistic [ST_914102297_22_15_4] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_22_15_4] ON [dbo].[BugNet_Issues]([Disabled], [IssueMilestoneId], [IssueStatusId])
GO
/****** Object: Statistic [ST_914102297_22_15_9_12] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_22_15_9_12] ON [dbo].[BugNet_Issues]([Disabled], [IssueMilestoneId], [IssueAffectedMilestoneId], [IssueAssignedUserId])
GO
/****** Object: Statistic [ST_914102297_22_15_9_4_8] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_22_15_9_4_8] ON [dbo].[BugNet_Issues]([Disabled], [IssueMilestoneId], [IssueAffectedMilestoneId], [IssueStatusId], [ProjectId])
GO
/****** Object: Statistic [ST_914102297_22_4_13_11_21_12_10_15_9_1_8_6_5] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_22_4_13_11_21_12_10_15_9_1_8_6_5] ON [dbo].[BugNet_Issues]([Disabled], [IssueStatusId], [IssueOwnerUserId], [IssueCreatorUserId], [LastUpdateUserId], [IssueAssignedUserId], [IssueResolutionId], [IssueMilestoneId], [IssueAffectedMilestoneId], [IssueId], [ProjectId], [IssueTypeId], [IssuePriorityId])
GO
/****** Object: Statistic [ST_914102297_22_5_8_4] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_22_5_8_4] ON [dbo].[BugNet_Issues]([Disabled], [IssuePriorityId], [ProjectId], [IssueStatusId])
GO
/****** Object: Statistic [ST_914102297_22_7_13_11_21_12_10_15_9_1_8_6] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_22_7_13_11_21_12_10_15_9_1_8_6] ON [dbo].[BugNet_Issues]([Disabled], [IssueCategoryId], [IssueOwnerUserId], [IssueCreatorUserId], [LastUpdateUserId], [IssueAssignedUserId], [IssueResolutionId], [IssueMilestoneId], [IssueAffectedMilestoneId], [IssueId], [ProjectId], [IssueTypeId])
GO
/****** Object: Statistic [ST_914102297_22_7_4] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_22_7_4] ON [dbo].[BugNet_Issues]([Disabled], [IssueCategoryId], [IssueStatusId])
GO
/****** Object: Statistic [ST_914102297_22_8_10_15_9_1_4_6_5] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_22_8_10_15_9_1_4_6_5] ON [dbo].[BugNet_Issues]([Disabled], [ProjectId], [IssueResolutionId], [IssueMilestoneId], [IssueAffectedMilestoneId], [IssueId], [IssueStatusId], [IssueTypeId], [IssuePriorityId])
GO
/****** Object: Statistic [ST_914102297_22_8_13_11_21_12_10_15_9_4_7_5] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_22_8_13_11_21_12_10_15_9_4_7_5] ON [dbo].[BugNet_Issues]([Disabled], [ProjectId], [IssueOwnerUserId], [IssueCreatorUserId], [LastUpdateUserId], [IssueAssignedUserId], [IssueResolutionId], [IssueMilestoneId], [IssueAffectedMilestoneId], [IssueStatusId], [IssueCategoryId], [IssuePriorityId])
GO
/****** Object: Statistic [ST_914102297_4_1_22] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_4_1_22] ON [dbo].[BugNet_Issues]([IssueStatusId], [IssueId], [Disabled])
GO
/****** Object: Statistic [ST_914102297_4_8_11] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_4_8_11] ON [dbo].[BugNet_Issues]([IssueStatusId], [ProjectId], [IssueCreatorUserId])
GO
/****** Object: Statistic [ST_914102297_4_8_12_22_10_15_9_6_5] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_4_8_12_22_10_15_9_6_5] ON [dbo].[BugNet_Issues]([IssueStatusId], [ProjectId], [IssueAssignedUserId], [Disabled], [IssueResolutionId], [IssueMilestoneId], [IssueAffectedMilestoneId], [IssueTypeId], [IssuePriorityId])
GO
/****** Object: Statistic [ST_914102297_4_8_12_22_15_9_6_5] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_4_8_12_22_15_9_6_5] ON [dbo].[BugNet_Issues]([IssueStatusId], [ProjectId], [IssueAssignedUserId], [Disabled], [IssueMilestoneId], [IssueAffectedMilestoneId], [IssueTypeId], [IssuePriorityId])
GO
/****** Object: Statistic [ST_914102297_4_8_13] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_4_8_13] ON [dbo].[BugNet_Issues]([IssueStatusId], [ProjectId], [IssueOwnerUserId])
GO
/****** Object: Statistic [ST_914102297_4_8_22_1_10_15] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_4_8_22_1_10_15] ON [dbo].[BugNet_Issues]([IssueStatusId], [ProjectId], [Disabled], [IssueId], [IssueResolutionId], [IssueMilestoneId])
GO
/****** Object: Statistic [ST_914102297_4_8_22_15] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_4_8_22_15] ON [dbo].[BugNet_Issues]([IssueStatusId], [ProjectId], [Disabled], [IssueMilestoneId])
GO
/****** Object: Statistic [ST_914102297_4_8_7] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_4_8_7] ON [dbo].[BugNet_Issues]([IssueStatusId], [ProjectId], [IssueCategoryId])
GO
/****** Object: Statistic [ST_914102297_5_1] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_5_1] ON [dbo].[BugNet_Issues]([IssuePriorityId], [IssueId])
GO
/****** Object: Statistic [ST_914102297_5_12_8_22_1_15_9_4] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_5_12_8_22_1_15_9_4] ON [dbo].[BugNet_Issues]([IssuePriorityId], [IssueAssignedUserId], [ProjectId], [Disabled], [IssueId], [IssueMilestoneId], [IssueAffectedMilestoneId], [IssueStatusId])
GO
/****** Object: Statistic [ST_914102297_5_22_13_11_21_12_10_15_9_1_8] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_5_22_13_11_21_12_10_15_9_1_8] ON [dbo].[BugNet_Issues]([IssuePriorityId], [Disabled], [IssueOwnerUserId], [IssueCreatorUserId], [LastUpdateUserId], [IssueAssignedUserId], [IssueResolutionId], [IssueMilestoneId], [IssueAffectedMilestoneId], [IssueId], [ProjectId])
GO
/****** Object: Statistic [ST_914102297_5_4_8_22_1_15_9] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_5_4_8_22_1_15_9] ON [dbo].[BugNet_Issues]([IssuePriorityId], [IssueStatusId], [ProjectId], [Disabled], [IssueId], [IssueMilestoneId], [IssueAffectedMilestoneId])
GO
/****** Object: Statistic [ST_914102297_5_8_11] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_5_8_11] ON [dbo].[BugNet_Issues]([IssuePriorityId], [ProjectId], [IssueCreatorUserId])
GO
/****** Object: Statistic [ST_914102297_5_8_12_22_1_4] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_5_8_12_22_1_4] ON [dbo].[BugNet_Issues]([IssuePriorityId], [ProjectId], [IssueAssignedUserId], [Disabled], [IssueId], [IssueStatusId])
GO
/****** Object: Statistic [ST_914102297_5_8_12_22_10_15_9] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_5_8_12_22_10_15_9] ON [dbo].[BugNet_Issues]([IssuePriorityId], [ProjectId], [IssueAssignedUserId], [Disabled], [IssueResolutionId], [IssueMilestoneId], [IssueAffectedMilestoneId])
GO
/****** Object: Statistic [ST_914102297_5_8_22] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_5_8_22] ON [dbo].[BugNet_Issues]([IssuePriorityId], [ProjectId], [Disabled])
GO
/****** Object: Statistic [ST_914102297_6_1_5_7_4_9_15_10_12_21_11_13_8] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_6_1_5_7_4_9_15_10_12_21_11_13_8] ON [dbo].[BugNet_Issues]([IssueTypeId], [IssueId], [IssuePriorityId], [IssueCategoryId], [IssueStatusId], [IssueAffectedMilestoneId], [IssueMilestoneId], [IssueResolutionId], [IssueAssignedUserId], [LastUpdateUserId], [IssueCreatorUserId], [IssueOwnerUserId], [ProjectId])
GO
/****** Object: Statistic [ST_914102297_6_12_22_15_9] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_6_12_22_15_9] ON [dbo].[BugNet_Issues]([IssueTypeId], [IssueAssignedUserId], [Disabled], [IssueMilestoneId], [IssueAffectedMilestoneId])
GO
/****** Object: Statistic [ST_914102297_6_12_8_22] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_6_12_8_22] ON [dbo].[BugNet_Issues]([IssueTypeId], [IssueAssignedUserId], [ProjectId], [Disabled])
GO
/****** Object: Statistic [ST_914102297_6_22_13_11_21_12_10_15_9_1] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_6_22_13_11_21_12_10_15_9_1] ON [dbo].[BugNet_Issues]([IssueTypeId], [Disabled], [IssueOwnerUserId], [IssueCreatorUserId], [LastUpdateUserId], [IssueAssignedUserId], [IssueResolutionId], [IssueMilestoneId], [IssueAffectedMilestoneId], [IssueId])
GO
/****** Object: Statistic [ST_914102297_6_4_8_22_1_15] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_6_4_8_22_1_15] ON [dbo].[BugNet_Issues]([IssueTypeId], [IssueStatusId], [ProjectId], [Disabled], [IssueId], [IssueMilestoneId])
GO
/****** Object: Statistic [ST_914102297_6_5_7_4_9_15_10_12_21_11_13_8] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_6_5_7_4_9_15_10_12_21_11_13_8] ON [dbo].[BugNet_Issues]([IssueTypeId], [IssuePriorityId], [IssueCategoryId], [IssueStatusId], [IssueAffectedMilestoneId], [IssueMilestoneId], [IssueResolutionId], [IssueAssignedUserId], [LastUpdateUserId], [IssueCreatorUserId], [IssueOwnerUserId], [ProjectId])
GO
/****** Object: Statistic [ST_914102297_6_8_11_22_10_15] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_6_8_11_22_10_15] ON [dbo].[BugNet_Issues]([IssueTypeId], [ProjectId], [IssueCreatorUserId], [Disabled], [IssueResolutionId], [IssueMilestoneId])
GO
/****** Object: Statistic [ST_914102297_6_8_12_22_10_15] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_6_8_12_22_10_15] ON [dbo].[BugNet_Issues]([IssueTypeId], [ProjectId], [IssueAssignedUserId], [Disabled], [IssueResolutionId], [IssueMilestoneId])
GO
/****** Object: Statistic [ST_914102297_6_8_13] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_6_8_13] ON [dbo].[BugNet_Issues]([IssueTypeId], [ProjectId], [IssueOwnerUserId])
GO
/****** Object: Statistic [ST_914102297_6_8_22_1_13_11_21_12_10_15_9_4_7] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_6_8_22_1_13_11_21_12_10_15_9_4_7] ON [dbo].[BugNet_Issues]([IssueTypeId], [ProjectId], [Disabled], [IssueId], [IssueOwnerUserId], [IssueCreatorUserId], [LastUpdateUserId], [IssueAssignedUserId], [IssueResolutionId], [IssueMilestoneId], [IssueAffectedMilestoneId], [IssueStatusId], [IssueCategoryId])
GO
/****** Object: Statistic [ST_914102297_7_1_6] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_7_1_6] ON [dbo].[BugNet_Issues]([IssueCategoryId], [IssueId], [IssueTypeId])
GO
/****** Object: Statistic [ST_914102297_7_12_8_22_1_15_9_4_6] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_7_12_8_22_1_15_9_4_6] ON [dbo].[BugNet_Issues]([IssueCategoryId], [IssueAssignedUserId], [ProjectId], [Disabled], [IssueId], [IssueMilestoneId], [IssueAffectedMilestoneId], [IssueStatusId], [IssueTypeId])
GO
/****** Object: Statistic [ST_914102297_7_4_8_22_1_15_9_6] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_7_4_8_22_1_15_9_6] ON [dbo].[BugNet_Issues]([IssueCategoryId], [IssueStatusId], [ProjectId], [Disabled], [IssueId], [IssueMilestoneId], [IssueAffectedMilestoneId], [IssueTypeId])
GO
/****** Object: Statistic [ST_914102297_7_8_11_22_10_15_9_6] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_7_8_11_22_10_15_9_6] ON [dbo].[BugNet_Issues]([IssueCategoryId], [ProjectId], [IssueCreatorUserId], [Disabled], [IssueResolutionId], [IssueMilestoneId], [IssueAffectedMilestoneId], [IssueTypeId])
GO
/****** Object: Statistic [ST_914102297_7_8_12_22_10_15_9_6] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_7_8_12_22_10_15_9_6] ON [dbo].[BugNet_Issues]([IssueCategoryId], [ProjectId], [IssueAssignedUserId], [Disabled], [IssueResolutionId], [IssueMilestoneId], [IssueAffectedMilestoneId], [IssueTypeId])
GO
/****** Object: Statistic [ST_914102297_7_8_12_22_15_9_6] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_7_8_12_22_15_9_6] ON [dbo].[BugNet_Issues]([IssueCategoryId], [ProjectId], [IssueAssignedUserId], [Disabled], [IssueMilestoneId], [IssueAffectedMilestoneId], [IssueTypeId])
GO
/****** Object: Statistic [ST_914102297_7_8_13] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_7_8_13] ON [dbo].[BugNet_Issues]([IssueCategoryId], [ProjectId], [IssueOwnerUserId])
GO
/****** Object: Statistic [ST_914102297_8_11_22_15_9] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_8_11_22_15_9] ON [dbo].[BugNet_Issues]([ProjectId], [IssueCreatorUserId], [Disabled], [IssueMilestoneId], [IssueAffectedMilestoneId])
GO
/****** Object: Statistic [ST_914102297_8_11_22_4_10_15_9_6_5] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_8_11_22_4_10_15_9_6_5] ON [dbo].[BugNet_Issues]([ProjectId], [IssueCreatorUserId], [Disabled], [IssueStatusId], [IssueResolutionId], [IssueMilestoneId], [IssueAffectedMilestoneId], [IssueTypeId], [IssuePriorityId])
GO
/****** Object: Statistic [ST_914102297_8_11_22_5_10_15_9] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_8_11_22_5_10_15_9] ON [dbo].[BugNet_Issues]([ProjectId], [IssueCreatorUserId], [Disabled], [IssuePriorityId], [IssueResolutionId], [IssueMilestoneId], [IssueAffectedMilestoneId])
GO
/****** Object: Statistic [ST_914102297_8_12_22_1_15_9_6_5_7_4_10_21_11] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_8_12_22_1_15_9_6_5_7_4_10_21_11] ON [dbo].[BugNet_Issues]([ProjectId], [IssueAssignedUserId], [Disabled], [IssueId], [IssueMilestoneId], [IssueAffectedMilestoneId], [IssueTypeId], [IssuePriorityId], [IssueCategoryId], [IssueStatusId], [IssueResolutionId], [LastUpdateUserId], [IssueCreatorUserId])
GO
/****** Object: Statistic [ST_914102297_8_12_22_1_7_4_6] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_8_12_22_1_7_4_6] ON [dbo].[BugNet_Issues]([ProjectId], [IssueAssignedUserId], [Disabled], [IssueId], [IssueCategoryId], [IssueStatusId], [IssueTypeId])
GO
/****** Object: Statistic [ST_914102297_8_12_22_1_9] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_8_12_22_1_9] ON [dbo].[BugNet_Issues]([ProjectId], [IssueAssignedUserId], [Disabled], [IssueId], [IssueAffectedMilestoneId])
GO
/****** Object: Statistic [ST_914102297_8_12_22_5_15_9_6_7_4_10_21_11] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_8_12_22_5_15_9_6_7_4_10_21_11] ON [dbo].[BugNet_Issues]([ProjectId], [IssueAssignedUserId], [Disabled], [IssuePriorityId], [IssueMilestoneId], [IssueAffectedMilestoneId], [IssueTypeId], [IssueCategoryId], [IssueStatusId], [IssueResolutionId], [LastUpdateUserId], [IssueCreatorUserId])
GO
/****** Object: Statistic [ST_914102297_8_12_22_6_15] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_8_12_22_6_15] ON [dbo].[BugNet_Issues]([ProjectId], [IssueAssignedUserId], [Disabled], [IssueTypeId], [IssueMilestoneId])
GO
/****** Object: Statistic [ST_914102297_8_13_22_12_21] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_8_13_22_12_21] ON [dbo].[BugNet_Issues]([ProjectId], [IssueOwnerUserId], [Disabled], [IssueAssignedUserId], [LastUpdateUserId])
GO
/****** Object: Statistic [ST_914102297_8_13_22_15] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_8_13_22_15] ON [dbo].[BugNet_Issues]([ProjectId], [IssueOwnerUserId], [Disabled], [IssueMilestoneId])
GO
/****** Object: Statistic [ST_914102297_8_13_22_4_10_15_9_6_5] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_8_13_22_4_10_15_9_6_5] ON [dbo].[BugNet_Issues]([ProjectId], [IssueOwnerUserId], [Disabled], [IssueStatusId], [IssueResolutionId], [IssueMilestoneId], [IssueAffectedMilestoneId], [IssueTypeId], [IssuePriorityId])
GO
/****** Object: Statistic [ST_914102297_8_13_22_6_10_15] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_8_13_22_6_10_15] ON [dbo].[BugNet_Issues]([ProjectId], [IssueOwnerUserId], [Disabled], [IssueTypeId], [IssueResolutionId], [IssueMilestoneId])
GO
/****** Object: Statistic [ST_914102297_8_13_22_7_10_15_9_6] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_8_13_22_7_10_15_9_6] ON [dbo].[BugNet_Issues]([ProjectId], [IssueOwnerUserId], [Disabled], [IssueCategoryId], [IssueResolutionId], [IssueMilestoneId], [IssueAffectedMilestoneId], [IssueTypeId])
GO
/****** Object: Statistic [ST_914102297_8_22_1_15] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_8_22_1_15] ON [dbo].[BugNet_Issues]([ProjectId], [Disabled], [IssueId], [IssueMilestoneId])
GO
/****** Object: Statistic [ST_914102297_8_22_1_4_13_11_21_12_10_15] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_8_22_1_4_13_11_21_12_10_15] ON [dbo].[BugNet_Issues]([ProjectId], [Disabled], [IssueId], [IssueStatusId], [IssueOwnerUserId], [IssueCreatorUserId], [LastUpdateUserId], [IssueAssignedUserId], [IssueResolutionId], [IssueMilestoneId])
GO
/****** Object: Statistic [ST_914102297_8_22_1_4_15_9] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_8_22_1_4_15_9] ON [dbo].[BugNet_Issues]([ProjectId], [Disabled], [IssueId], [IssueStatusId], [IssueMilestoneId], [IssueAffectedMilestoneId])
GO
/****** Object: Statistic [ST_914102297_8_22_1_5_10_15_9_4] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_8_22_1_5_10_15_9_4] ON [dbo].[BugNet_Issues]([ProjectId], [Disabled], [IssueId], [IssuePriorityId], [IssueResolutionId], [IssueMilestoneId], [IssueAffectedMilestoneId], [IssueStatusId])
GO
/****** Object: Statistic [ST_914102297_8_22_1_5_13_11_21_12_10_15_9_4] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_8_22_1_5_13_11_21_12_10_15_9_4] ON [dbo].[BugNet_Issues]([ProjectId], [Disabled], [IssueId], [IssuePriorityId], [IssueOwnerUserId], [IssueCreatorUserId], [LastUpdateUserId], [IssueAssignedUserId], [IssueResolutionId], [IssueMilestoneId], [IssueAffectedMilestoneId], [IssueStatusId])
GO
/****** Object: Statistic [ST_914102297_8_22_1_6_10_15_9] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_8_22_1_6_10_15_9] ON [dbo].[BugNet_Issues]([ProjectId], [Disabled], [IssueId], [IssueTypeId], [IssueResolutionId], [IssueMilestoneId], [IssueAffectedMilestoneId])
GO
/****** Object: Statistic [ST_914102297_8_22_13_11_21_12_10_15_9] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_8_22_13_11_21_12_10_15_9] ON [dbo].[BugNet_Issues]([ProjectId], [Disabled], [IssueOwnerUserId], [IssueCreatorUserId], [LastUpdateUserId], [IssueAssignedUserId], [IssueResolutionId], [IssueMilestoneId], [IssueAffectedMilestoneId])
GO
/****** Object: Statistic [ST_914102297_8_22_4_6] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_8_22_4_6] ON [dbo].[BugNet_Issues]([ProjectId], [Disabled], [IssueStatusId], [IssueTypeId])
GO
/****** Object: Statistic [ST_914102297_8_7_22_4] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_8_7_22_4] ON [dbo].[BugNet_Issues]([ProjectId], [IssueCategoryId], [Disabled], [IssueStatusId])
GO
/****** Object: Statistic [ST_914102297_9_15_1_6_5_7] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_9_15_1_6_5_7] ON [dbo].[BugNet_Issues]([IssueAffectedMilestoneId], [IssueMilestoneId], [IssueId], [IssueTypeId], [IssuePriorityId], [IssueCategoryId])
GO
/****** Object: Statistic [ST_914102297_9_15_8_12_22_1_4_6_5] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_914102297_9_15_8_12_22_1_4_6_5] ON [dbo].[BugNet_Issues]([IssueAffectedMilestoneId], [IssueMilestoneId], [ProjectId], [IssueAssignedUserId], [Disabled], [IssueId], [IssueStatusId], [IssueTypeId], [IssuePriorityId])
GO
/****** Object: Statistic [ST_1813581499_1_10_9_7] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_1813581499_1_10_9_7] ON [dbo].[BugNet_Projects]([ProjectId], [ProjectCreatorUserId], [ProjectManagerUserId], [ProjectDisabled])
GO
/****** Object: Statistic [ST_1813581499_1_8_9_7_10_2] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_1813581499_1_8_9_7_10_2] ON [dbo].[BugNet_Projects]([ProjectId], [ProjectAccessType], [ProjectManagerUserId], [ProjectDisabled], [ProjectCreatorUserId], [ProjectName])
GO
/****** Object: Statistic [ST_1813581499_10_9_8] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_1813581499_10_9_8] ON [dbo].[BugNet_Projects]([ProjectCreatorUserId], [ProjectManagerUserId], [ProjectAccessType])
GO
/****** Object: Statistic [ST_1813581499_2_1_8_9_7] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_1813581499_2_1_8_9_7] ON [dbo].[BugNet_Projects]([ProjectName], [ProjectId], [ProjectAccessType], [ProjectManagerUserId], [ProjectDisabled])
GO
/****** Object: Statistic [ST_1813581499_7_1_8_10] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_1813581499_7_1_8_10] ON [dbo].[BugNet_Projects]([ProjectDisabled], [ProjectId], [ProjectAccessType], [ProjectCreatorUserId])
GO
/****** Object: Statistic [ST_1813581499_7_8] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_1813581499_7_8] ON [dbo].[BugNet_Projects]([ProjectDisabled], [ProjectAccessType])
GO
/****** Object: Statistic [ST_1813581499_8_9_7_10] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_1813581499_8_9_7_10] ON [dbo].[BugNet_Projects]([ProjectAccessType], [ProjectManagerUserId], [ProjectDisabled], [ProjectCreatorUserId])
GO
/****** Object: Statistic [ST_1813581499_9_1_7] Script Date: 9/11/2014 10:01:37 PM ******/
CREATE STATISTICS [ST_1813581499_9_1_7] ON [dbo].[BugNet_Projects]([ProjectManagerUserId], [ProjectId], [ProjectDisabled])
GO | the_stack |
---------------------------
---------------------------
-- Creating Primary Keys --
---------------------------
---------------------------
----------
-- core --
----------
-- patients
ALTER TABLE mimic_core.patients DROP CONSTRAINT IF EXISTS patients_pk CASCADE;
ALTER TABLE mimic_core.patients
ADD CONSTRAINT patients_pk
PRIMARY KEY (subject_id);
-- admissions
ALTER TABLE mimic_core.admissions DROP CONSTRAINT IF EXISTS admissions_pk CASCADE;
ALTER TABLE mimic_core.admissions
ADD CONSTRAINT admissions_pk
PRIMARY KEY (hadm_id);
-- transfers
ALTER TABLE mimic_core.transfers DROP CONSTRAINT IF EXISTS transfers_pk CASCADE;
ALTER TABLE mimic_core.transfers
ADD CONSTRAINT transfers_pk
PRIMARY KEY (transfer_id);
----------
-- hosp --
----------
-- d_hcpcs
ALTER TABLE mimic_hosp.d_hcpcs DROP CONSTRAINT IF EXISTS d_hcpcs_pk CASCADE;
ALTER TABLE mimic_hosp.d_hcpcs
ADD CONSTRAINT d_hcpcs_pk
PRIMARY KEY (code);
-- diagnoses_icd
ALTER TABLE mimic_hosp.diagnoses_icd DROP CONSTRAINT IF EXISTS diagnoses_icd_pk CASCADE;
ALTER TABLE mimic_hosp.diagnoses_icd
ADD CONSTRAINT diagnoses_icd_pk
PRIMARY KEY (hadm_id, seq_num, icd_code, icd_version);
-- d_icd_diagnoses
ALTER TABLE mimic_hosp.d_icd_diagnoses DROP CONSTRAINT IF EXISTS d_icd_diagnoses_pk CASCADE;
ALTER TABLE mimic_hosp.d_icd_diagnoses
ADD CONSTRAINT d_icd_diagnoses_pk
PRIMARY KEY (icd_code, icd_version);
-- d_icd_procedures
ALTER TABLE mimic_hosp.d_icd_procedures DROP CONSTRAINT IF EXISTS d_icd_procedures_pk CASCADE;
ALTER TABLE mimic_hosp.d_icd_procedures
ADD CONSTRAINT d_icd_procedures_pk
PRIMARY KEY (icd_code, icd_version);
-- d_labitems
ALTER TABLE mimic_hosp.d_labitems DROP CONSTRAINT IF EXISTS d_labitems_pk CASCADE;
ALTER TABLE mimic_hosp.d_labitems
ADD CONSTRAINT d_labitems_pk
PRIMARY KEY (itemid);
-- emar_detail
-- ALTER TABLE mimic_hosp.emar_detail DROP CONSTRAINT IF EXISTS emar_detail_pk;
-- ALTER TABLE mimic_hosp.emar_detail
-- ADD CONSTRAINT emar_detail_pk
-- PRIMARY KEY (emar_id, parent_field_ordinal);
-- emar
ALTER TABLE mimic_hosp.emar DROP CONSTRAINT IF EXISTS emar_pk CASCADE;
ALTER TABLE mimic_hosp.emar
ADD CONSTRAINT emar_pk
PRIMARY KEY (emar_id);
-- hcpcsevents
ALTER TABLE mimic_hosp.hcpcsevents DROP CONSTRAINT IF EXISTS hcpcsevents_pk CASCADE;
ALTER TABLE mimic_hosp.hcpcsevents
ADD CONSTRAINT hcpcsevents_pk
PRIMARY KEY (hadm_id, hcpcs_cd, seq_num);
-- labevents
ALTER TABLE mimic_hosp.labevents DROP CONSTRAINT IF EXISTS labevents_pk CASCADE;
ALTER TABLE mimic_hosp.labevents
ADD CONSTRAINT labevents_pk
PRIMARY KEY (labevent_id);
-- microbiologyevents
ALTER TABLE mimic_hosp.microbiologyevents DROP CONSTRAINT IF EXISTS microbiologyevents_pk CASCADE;
ALTER TABLE mimic_hosp.microbiologyevents
ADD CONSTRAINT microbiologyevents_pk
PRIMARY KEY (microevent_id);
-- pharmacy
ALTER TABLE mimic_hosp.pharmacy DROP CONSTRAINT IF EXISTS pharmacy_pk CASCADE;
ALTER TABLE mimic_hosp.pharmacy
ADD CONSTRAINT pharmacy_pk
PRIMARY KEY (pharmacy_id);
-- poe_detail
ALTER TABLE mimic_hosp.poe_detail DROP CONSTRAINT IF EXISTS poe_detail_pk CASCADE;
ALTER TABLE mimic_hosp.poe_detail
ADD CONSTRAINT poe_detail_pk
PRIMARY KEY (poe_id, field_name);
-- poe
ALTER TABLE mimic_hosp.poe DROP CONSTRAINT IF EXISTS poe_pk CASCADE;
ALTER TABLE mimic_hosp.poe
ADD CONSTRAINT poe_pk
PRIMARY KEY (poe_id);
-- prescriptions
ALTER TABLE mimic_hosp.prescriptions DROP CONSTRAINT IF EXISTS prescriptions_pk CASCADE;
ALTER TABLE mimic_hosp.prescriptions
ADD CONSTRAINT prescriptions_pk
PRIMARY KEY (pharmacy_id, drug_type, drug);
-- procedures_icd
ALTER TABLE mimic_hosp.procedures_icd DROP CONSTRAINT IF EXISTS procedures_icd_pk CASCADE;
ALTER TABLE mimic_hosp.procedures_icd
ADD CONSTRAINT procedures_icd_pk
PRIMARY KEY (hadm_id, seq_num, icd_code, icd_version);
-- services
ALTER TABLE mimic_hosp.services DROP CONSTRAINT IF EXISTS services_pk CASCADE;
ALTER TABLE mimic_hosp.services
ADD CONSTRAINT services_pk
PRIMARY KEY (hadm_id, transfertime, curr_service);
---------
-- icu --
---------
-- datetimeevents
ALTER TABLE mimic_icu.datetimeevents DROP CONSTRAINT IF EXISTS datetimeevents_pk CASCADE;
ALTER TABLE mimic_icu.datetimeevents
ADD CONSTRAINT datetimeevents_pk
PRIMARY KEY (stay_id, itemid, charttime);
-- d_items
ALTER TABLE mimic_icu.d_items DROP CONSTRAINT IF EXISTS d_items_pk CASCADE;
ALTER TABLE mimic_icu.d_items
ADD CONSTRAINT d_items_pk
PRIMARY KEY (itemid);
-- icustays
ALTER TABLE mimic_icu.icustays DROP CONSTRAINT IF EXISTS icustays_pk CASCADE;
ALTER TABLE mimic_icu.icustays
ADD CONSTRAINT icustays_pk
PRIMARY KEY (stay_id);
-- inputevents
ALTER TABLE mimic_icu.inputevents DROP CONSTRAINT IF EXISTS inputevents_pk CASCADE;
ALTER TABLE mimic_icu.inputevents
ADD CONSTRAINT inputevents_pk
PRIMARY KEY (orderid, itemid);
-- outputevents
ALTER TABLE mimic_icu.outputevents DROP CONSTRAINT IF EXISTS outputevents_pk CASCADE;
ALTER TABLE mimic_icu.outputevents
ADD CONSTRAINT outputevents_pk
PRIMARY KEY (stay_id, charttime, itemid);
-- procedureevents
ALTER TABLE mimic_icu.procedureevents DROP CONSTRAINT IF EXISTS procedureevents_pk CASCADE;
ALTER TABLE mimic_icu.procedureevents
ADD CONSTRAINT procedureevents_pk
PRIMARY KEY (orderid);
---------------------------
---------------------------
-- Creating Foreign Keys --
---------------------------
---------------------------
----------
-- core --
----------
-- admissions
ALTER TABLE mimic_core.admissions DROP CONSTRAINT IF EXISTS admissions_patients_fk;
ALTER TABLE mimic_core.admissions
ADD CONSTRAINT admissions_patients_fk
FOREIGN KEY (subject_id)
REFERENCES mimic_core.patients (subject_id);
-- transfers
ALTER TABLE mimic_core.transfers DROP CONSTRAINT IF EXISTS transfers_patients_fk;
ALTER TABLE mimic_core.transfers
ADD CONSTRAINT transfers_patients_fk
FOREIGN KEY (subject_id)
REFERENCES mimic_core.patients (subject_id);
----------
-- hosp --
----------
-- diagnoses_icd
ALTER TABLE mimic_hosp.diagnoses_icd DROP CONSTRAINT IF EXISTS diagnoses_icd_patients_fk;
ALTER TABLE mimic_hosp.diagnoses_icd
ADD CONSTRAINT diagnoses_icd_patients_fk
FOREIGN KEY (subject_id)
REFERENCES mimic_core.patients (subject_id);
ALTER TABLE mimic_hosp.diagnoses_icd DROP CONSTRAINT IF EXISTS diagnoses_icd_admissions_fk;
ALTER TABLE mimic_hosp.diagnoses_icd
ADD CONSTRAINT diagnoses_icd_admissions_fk
FOREIGN KEY (hadm_id)
REFERENCES mimic_core.admissions (hadm_id);
-- drgcodes
ALTER TABLE mimic_hosp.drgcodes DROP CONSTRAINT IF EXISTS drgcodes_patients_fk;
ALTER TABLE mimic_hosp.drgcodes
ADD CONSTRAINT drgcodes_patients_fk
FOREIGN KEY (subject_id)
REFERENCES mimic_core.patients (subject_id);
ALTER TABLE mimic_hosp.drgcodes DROP CONSTRAINT IF EXISTS drgcodes_admissions_fk;
ALTER TABLE mimic_hosp.drgcodes
ADD CONSTRAINT drgcodes_admissions_fk
FOREIGN KEY (hadm_id)
REFERENCES mimic_core.admissions (hadm_id);
-- emar_detail
ALTER TABLE mimic_hosp.emar_detail DROP CONSTRAINT IF EXISTS emar_detail_patients_fk;
ALTER TABLE mimic_hosp.emar_detail
ADD CONSTRAINT emar_detail_patients_fk
FOREIGN KEY (subject_id)
REFERENCES mimic_core.patients (subject_id);
ALTER TABLE mimic_hosp.emar_detail DROP CONSTRAINT IF EXISTS emar_detail_emar_fk;
ALTER TABLE mimic_hosp.emar_detail
ADD CONSTRAINT emar_detail_emar_fk
FOREIGN KEY (emar_id)
REFERENCES mimic_hosp.emar (emar_id);
-- emar
ALTER TABLE mimic_hosp.emar DROP CONSTRAINT IF EXISTS emar_patients_fk;
ALTER TABLE mimic_hosp.emar
ADD CONSTRAINT emar_patients_fk
FOREIGN KEY (subject_id)
REFERENCES mimic_core.patients (subject_id);
ALTER TABLE mimic_hosp.emar DROP CONSTRAINT IF EXISTS emar_admissions_fk;
ALTER TABLE mimic_hosp.emar
ADD CONSTRAINT emar_admissions_fk
FOREIGN KEY (hadm_id)
REFERENCES mimic_core.admissions (hadm_id);
-- hcpcsevents
ALTER TABLE mimic_hosp.hcpcsevents DROP CONSTRAINT IF EXISTS hcpcsevents_patients_fk;
ALTER TABLE mimic_hosp.hcpcsevents
ADD CONSTRAINT hcpcsevents_patients_fk
FOREIGN KEY (subject_id)
REFERENCES mimic_core.patients (subject_id);
ALTER TABLE mimic_hosp.hcpcsevents DROP CONSTRAINT IF EXISTS hcpcsevents_admissions_fk;
ALTER TABLE mimic_hosp.hcpcsevents
ADD CONSTRAINT hcpcsevents_admissions_fk
FOREIGN KEY (hadm_id)
REFERENCES mimic_core.admissions (hadm_id);
ALTER TABLE mimic_hosp.hcpcsevents DROP CONSTRAINT IF EXISTS hcpcsevents_d_hcpcs_fk;
ALTER TABLE mimic_hosp.hcpcsevents
ADD CONSTRAINT hcpcsevents_d_hcpcs_fk
FOREIGN KEY (hcpcs_cd)
REFERENCES mimic_hosp.d_hcpcs (code);
-- labevents
ALTER TABLE mimic_hosp.labevents DROP CONSTRAINT IF EXISTS labevents_patients_fk;
ALTER TABLE mimic_hosp.labevents
ADD CONSTRAINT labevents_patients_fk
FOREIGN KEY (subject_id)
REFERENCES mimic_core.patients (subject_id);
ALTER TABLE mimic_hosp.labevents DROP CONSTRAINT IF EXISTS labevents_d_labitems_fk;
ALTER TABLE mimic_hosp.labevents
ADD CONSTRAINT labevents_d_labitems_fk
FOREIGN KEY (itemid)
REFERENCES mimic_hosp.d_labitems (itemid);
-- microbiologyevents
ALTER TABLE mimic_hosp.microbiologyevents DROP CONSTRAINT IF EXISTS microbiologyevents_patients_fk;
ALTER TABLE mimic_hosp.microbiologyevents
ADD CONSTRAINT microbiologyevents_patients_fk
FOREIGN KEY (subject_id)
REFERENCES mimic_core.patients (subject_id);
ALTER TABLE mimic_hosp.microbiologyevents DROP CONSTRAINT IF EXISTS microbiologyevents_admissions_fk;
ALTER TABLE mimic_hosp.microbiologyevents
ADD CONSTRAINT microbiologyevents_admissions_fk
FOREIGN KEY (hadm_id)
REFERENCES mimic_core.admissions (hadm_id);
-- pharmacy
ALTER TABLE mimic_hosp.pharmacy DROP CONSTRAINT IF EXISTS pharmacy_patients_fk;
ALTER TABLE mimic_hosp.pharmacy
ADD CONSTRAINT pharmacy_patients_fk
FOREIGN KEY (subject_id)
REFERENCES mimic_core.patients (subject_id);
ALTER TABLE mimic_hosp.pharmacy DROP CONSTRAINT IF EXISTS pharmacy_admissions_fk;
ALTER TABLE mimic_hosp.pharmacy
ADD CONSTRAINT pharmacy_admissions_fk
FOREIGN KEY (hadm_id)
REFERENCES mimic_core.admissions (hadm_id);
-- poe_detail
ALTER TABLE mimic_hosp.poe_detail DROP CONSTRAINT IF EXISTS poe_detail_patients_fk;
ALTER TABLE mimic_hosp.poe_detail
ADD CONSTRAINT poe_detail_patients_fk
FOREIGN KEY (subject_id)
REFERENCES mimic_core.patients (subject_id);
ALTER TABLE mimic_hosp.poe_detail DROP CONSTRAINT IF EXISTS poe_detail_poe_fk;
ALTER TABLE mimic_hosp.poe_detail
ADD CONSTRAINT poe_detail_poe_fk
FOREIGN KEY (poe_id)
REFERENCES mimic_hosp.poe (poe_id);
-- poe
ALTER TABLE mimic_hosp.poe DROP CONSTRAINT IF EXISTS poe_patients_fk;
ALTER TABLE mimic_hosp.poe
ADD CONSTRAINT poe_patients_fk
FOREIGN KEY (subject_id)
REFERENCES mimic_core.patients (subject_id);
ALTER TABLE mimic_hosp.poe DROP CONSTRAINT IF EXISTS poe_admissions_fk;
ALTER TABLE mimic_hosp.poe
ADD CONSTRAINT poe_admissions_fk
FOREIGN KEY (hadm_id)
REFERENCES mimic_core.admissions (hadm_id);
-- prescriptions
ALTER TABLE mimic_hosp.prescriptions DROP CONSTRAINT IF EXISTS prescriptions_patients_fk;
ALTER TABLE mimic_hosp.prescriptions
ADD CONSTRAINT prescriptions_patients_fk
FOREIGN KEY (subject_id)
REFERENCES mimic_core.patients (subject_id);
ALTER TABLE mimic_hosp.prescriptions DROP CONSTRAINT IF EXISTS prescriptions_admissions_fk;
ALTER TABLE mimic_hosp.prescriptions
ADD CONSTRAINT prescriptions_admissions_fk
FOREIGN KEY (hadm_id)
REFERENCES mimic_core.admissions (hadm_id);
-- procedures_icd
ALTER TABLE mimic_hosp.procedures_icd DROP CONSTRAINT IF EXISTS procedures_icd_patients_fk;
ALTER TABLE mimic_hosp.procedures_icd
ADD CONSTRAINT procedures_icd_patients_fk
FOREIGN KEY (subject_id)
REFERENCES mimic_core.patients (subject_id);
ALTER TABLE mimic_hosp.procedures_icd DROP CONSTRAINT IF EXISTS procedures_icd_admissions_fk;
ALTER TABLE mimic_hosp.procedures_icd
ADD CONSTRAINT procedures_icd_admissions_fk
FOREIGN KEY (hadm_id)
REFERENCES mimic_core.admissions (hadm_id);
-- services
ALTER TABLE mimic_hosp.services DROP CONSTRAINT IF EXISTS services_patients_fk;
ALTER TABLE mimic_hosp.services
ADD CONSTRAINT services_patients_fk
FOREIGN KEY (subject_id)
REFERENCES mimic_core.patients (subject_id);
ALTER TABLE mimic_hosp.services DROP CONSTRAINT IF EXISTS services_admissions_fk;
ALTER TABLE mimic_hosp.services
ADD CONSTRAINT services_admissions_fk
FOREIGN KEY (hadm_id)
REFERENCES mimic_core.admissions (hadm_id);
---------
-- icu --
---------
-- chartevents
ALTER TABLE mimic_icu.chartevents DROP CONSTRAINT IF EXISTS chartevents_patients_fk;
ALTER TABLE mimic_icu.chartevents
ADD CONSTRAINT chartevents_patients_fk
FOREIGN KEY (subject_id)
REFERENCES mimic_core.patients (subject_id);
ALTER TABLE mimic_icu.chartevents DROP CONSTRAINT IF EXISTS chartevents_admissions_fk;
ALTER TABLE mimic_icu.chartevents
ADD CONSTRAINT chartevents_admissions_fk
FOREIGN KEY (hadm_id)
REFERENCES mimic_core.admissions (hadm_id);
ALTER TABLE mimic_icu.chartevents DROP CONSTRAINT IF EXISTS chartevents_icustays_fk;
ALTER TABLE mimic_icu.chartevents
ADD CONSTRAINT chartevents_icustays_fk
FOREIGN KEY (stay_id)
REFERENCES mimic_icu.icustays (stay_id);
ALTER TABLE mimic_icu.chartevents DROP CONSTRAINT IF EXISTS chartevents_d_items_fk;
ALTER TABLE mimic_icu.chartevents
ADD CONSTRAINT chartevents_d_items_fk
FOREIGN KEY (itemid)
REFERENCES mimic_icu.d_items (itemid);
-- datetimeevents
ALTER TABLE mimic_icu.datetimeevents DROP CONSTRAINT IF EXISTS datetimeevents_patients_fk;
ALTER TABLE mimic_icu.datetimeevents
ADD CONSTRAINT datetimeevents_patients_fk
FOREIGN KEY (subject_id)
REFERENCES mimic_core.patients (subject_id);
ALTER TABLE mimic_icu.datetimeevents DROP CONSTRAINT IF EXISTS datetimeevents_admissions_fk;
ALTER TABLE mimic_icu.datetimeevents
ADD CONSTRAINT datetimeevents_admissions_fk
FOREIGN KEY (hadm_id)
REFERENCES mimic_core.admissions (hadm_id);
ALTER TABLE mimic_icu.datetimeevents DROP CONSTRAINT IF EXISTS datetimeevents_icustays_fk;
ALTER TABLE mimic_icu.datetimeevents
ADD CONSTRAINT datetimeevents_icustays_fk
FOREIGN KEY (stay_id)
REFERENCES mimic_icu.icustays (stay_id);
ALTER TABLE mimic_icu.datetimeevents DROP CONSTRAINT IF EXISTS datetimeevents_d_items_fk;
ALTER TABLE mimic_icu.datetimeevents
ADD CONSTRAINT datetimeevents_d_items_fk
FOREIGN KEY (itemid)
REFERENCES mimic_icu.d_items (itemid);
-- icustays
ALTER TABLE mimic_icu.icustays DROP CONSTRAINT IF EXISTS icustays_patients_fk;
ALTER TABLE mimic_icu.icustays
ADD CONSTRAINT icustays_patients_fk
FOREIGN KEY (subject_id)
REFERENCES mimic_core.patients (subject_id);
ALTER TABLE mimic_icu.icustays DROP CONSTRAINT IF EXISTS icustays_admissions_fk;
ALTER TABLE mimic_icu.icustays
ADD CONSTRAINT icustays_admissions_fk
FOREIGN KEY (hadm_id)
REFERENCES mimic_core.admissions (hadm_id);
-- inputevents
ALTER TABLE mimic_icu.inputevents DROP CONSTRAINT IF EXISTS inputevents_patients_fk;
ALTER TABLE mimic_icu.inputevents
ADD CONSTRAINT inputevents_patients_fk
FOREIGN KEY (subject_id)
REFERENCES mimic_core.patients (subject_id);
ALTER TABLE mimic_icu.inputevents DROP CONSTRAINT IF EXISTS inputevents_admissions_fk;
ALTER TABLE mimic_icu.inputevents
ADD CONSTRAINT inputevents_admissions_fk
FOREIGN KEY (hadm_id)
REFERENCES mimic_core.admissions (hadm_id);
ALTER TABLE mimic_icu.inputevents DROP CONSTRAINT IF EXISTS inputevents_icustays_fk;
ALTER TABLE mimic_icu.inputevents
ADD CONSTRAINT inputevents_icustays_fk
FOREIGN KEY (stay_id)
REFERENCES mimic_icu.icustays (stay_id);
ALTER TABLE mimic_icu.inputevents DROP CONSTRAINT IF EXISTS inputevents_d_items_fk;
ALTER TABLE mimic_icu.inputevents
ADD CONSTRAINT inputevents_d_items_fk
FOREIGN KEY (itemid)
REFERENCES mimic_icu.d_items (itemid);
-- outputevents
ALTER TABLE mimic_icu.outputevents DROP CONSTRAINT IF EXISTS outputevents_patients_fk;
ALTER TABLE mimic_icu.outputevents
ADD CONSTRAINT outputevents_patients_fk
FOREIGN KEY (subject_id)
REFERENCES mimic_core.patients (subject_id);
ALTER TABLE mimic_icu.outputevents DROP CONSTRAINT IF EXISTS outputevents_admissions_fk;
ALTER TABLE mimic_icu.outputevents
ADD CONSTRAINT outputevents_admissions_fk
FOREIGN KEY (hadm_id)
REFERENCES mimic_core.admissions (hadm_id);
ALTER TABLE mimic_icu.outputevents DROP CONSTRAINT IF EXISTS outputevents_icustays_fk;
ALTER TABLE mimic_icu.outputevents
ADD CONSTRAINT outputevents_icustays_fk
FOREIGN KEY (stay_id)
REFERENCES mimic_icu.icustays (stay_id);
ALTER TABLE mimic_icu.outputevents DROP CONSTRAINT IF EXISTS outputevents_d_items_fk;
ALTER TABLE mimic_icu.outputevents
ADD CONSTRAINT outputevents_d_items_fk
FOREIGN KEY (itemid)
REFERENCES mimic_icu.d_items (itemid);
-- procedureevents
ALTER TABLE mimic_icu.procedureevents DROP CONSTRAINT IF EXISTS procedureevents_patients_fk;
ALTER TABLE mimic_icu.procedureevents
ADD CONSTRAINT procedureevents_patients_fk
FOREIGN KEY (subject_id)
REFERENCES mimic_core.patients (subject_id);
ALTER TABLE mimic_icu.procedureevents DROP CONSTRAINT IF EXISTS procedureevents_admissions_fk;
ALTER TABLE mimic_icu.procedureevents
ADD CONSTRAINT procedureevents_admissions_fk
FOREIGN KEY (hadm_id)
REFERENCES mimic_core.admissions (hadm_id);
ALTER TABLE mimic_icu.procedureevents DROP CONSTRAINT IF EXISTS procedureevents_icustays_fk;
ALTER TABLE mimic_icu.procedureevents
ADD CONSTRAINT procedureevents_icustays_fk
FOREIGN KEY (stay_id)
REFERENCES mimic_icu.icustays (stay_id);
ALTER TABLE mimic_icu.procedureevents DROP CONSTRAINT IF EXISTS procedureevents_d_items_fk;
ALTER TABLE mimic_icu.procedureevents
ADD CONSTRAINT procedureevents_d_items_fk
FOREIGN KEY (itemid)
REFERENCES mimic_icu.d_items (itemid); | the_stack |
-- 2017-09-20T10:49:06.278
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Nr...',Updated=TO_TIMESTAMP('2017-09-20 10:49:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=1081
;
-- 2017-09-20T13:06:10.866
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Nr.',Updated=TO_TIMESTAMP('2017-09-20 13:06:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=1081
;
-- 2017-09-20T13:09:31.713
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=540005, SeqNo=140,Updated=TO_TIMESTAMP('2017-09-20 13:09:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544809
;
-- 2017-09-20T13:09:37.866
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=540005, SeqNo=150,Updated=TO_TIMESTAMP('2017-09-20 13:09:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544810
;
-- 2017-09-20T13:09:46.475
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=540005, SeqNo=160,Updated=TO_TIMESTAMP('2017-09-20 13:09:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544811
;
-- 2017-09-20T13:09:53.637
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=540005, SeqNo=170,Updated=TO_TIMESTAMP('2017-09-20 13:09:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544812
;
-- 2017-09-20T13:10:25.707
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_ElementGroup WHERE AD_UI_ElementGroup_ID=540925
;
-- 2017-09-20T13:10:37.055
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_ElementGroup SET Name='pricing', SeqNo=20,Updated=TO_TIMESTAMP('2017-09-20 13:10:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_ElementGroup_ID=1000026
;
-- 2017-09-20T13:10:41.358
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_ElementGroup SET Name='main',Updated=TO_TIMESTAMP('2017-09-20 13:10:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_ElementGroup_ID=540005
;
-- 2017-09-20T13:12:47.205
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=1000005, SeqNo=230,Updated=TO_TIMESTAMP('2017-09-20 13:12:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=1000036
;
-- 2017-09-20T13:12:53.715
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=1000005, SeqNo=240,Updated=TO_TIMESTAMP('2017-09-20 13:12:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=1000221
;
-- 2017-09-20T13:13:46.478
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_ElementGroup WHERE AD_UI_ElementGroup_ID=540921
;
-- 2017-09-20T13:13:54.679
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=1000005, SeqNo=250,Updated=TO_TIMESTAMP('2017-09-20 13:13:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=1000046
;
-- 2017-09-20T13:14:02.567
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=1000005, SeqNo=260,Updated=TO_TIMESTAMP('2017-09-20 13:14:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=1000044
;
-- 2017-09-20T13:14:10.094
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=1000005, SeqNo=270,Updated=TO_TIMESTAMP('2017-09-20 13:14:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=1000043
;
-- 2017-09-20T13:14:16.650
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=1000005, SeqNo=280,Updated=TO_TIMESTAMP('2017-09-20 13:14:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=1000045
;
-- 2017-09-20T13:14:29.483
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=1000005, SeqNo=290,Updated=TO_TIMESTAMP('2017-09-20 13:14:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=1000047
;
-- 2017-09-20T13:14:35.499
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=1000005, SeqNo=300,Updated=TO_TIMESTAMP('2017-09-20 13:14:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=1000040
;
-- 2017-09-20T13:14:44.388
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_ElementGroup WHERE AD_UI_ElementGroup_ID=540922
;
-- 2017-09-20T13:14:53.550
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=1000005, SeqNo=310,Updated=TO_TIMESTAMP('2017-09-20 13:14:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=1000048
;
-- 2017-09-20T13:14:59.162
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=1000005, SeqNo=320,Updated=TO_TIMESTAMP('2017-09-20 13:14:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=1000050
;
-- 2017-09-20T13:15:05.074
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=1000005, SeqNo=330,Updated=TO_TIMESTAMP('2017-09-20 13:15:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=1000039
;
-- 2017-09-20T13:15:09.381
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=1000005, SeqNo=340,Updated=TO_TIMESTAMP('2017-09-20 13:15:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=1000051
;
-- 2017-09-20T13:15:16.416
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_ElementGroup WHERE AD_UI_ElementGroup_ID=540923
;
-- 2017-09-20T13:15:25.828
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=20,Updated=TO_TIMESTAMP('2017-09-20 13:15:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=1000034
;
-- 2017-09-20T13:15:28.307
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=30,Updated=TO_TIMESTAMP('2017-09-20 13:15:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=1000035
;
-- 2017-09-20T13:15:31.456
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=40,Updated=TO_TIMESTAMP('2017-09-20 13:15:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=1000036
;
-- 2017-09-20T13:15:33.139
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=50,Updated=TO_TIMESTAMP('2017-09-20 13:15:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=1000221
;
-- 2017-09-20T13:15:35.185
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=60,Updated=TO_TIMESTAMP('2017-09-20 13:15:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=1000037
;
-- 2017-09-20T13:15:37.184
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=70,Updated=TO_TIMESTAMP('2017-09-20 13:15:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=1000038
;
-- 2017-09-20T13:15:39.436
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=80,Updated=TO_TIMESTAMP('2017-09-20 13:15:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=1000040
;
-- 2017-09-20T13:15:41.393
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=90,Updated=TO_TIMESTAMP('2017-09-20 13:15:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=1000041
;
-- 2017-09-20T13:15:43.368
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=100,Updated=TO_TIMESTAMP('2017-09-20 13:15:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=1000042
;
-- 2017-09-20T13:15:45.368
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=110,Updated=TO_TIMESTAMP('2017-09-20 13:15:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=1000043
;
-- 2017-09-20T13:15:47.253
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=120,Updated=TO_TIMESTAMP('2017-09-20 13:15:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=1000044
;
-- 2017-09-20T13:15:49.157
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=130,Updated=TO_TIMESTAMP('2017-09-20 13:15:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=1000045
;
-- 2017-09-20T13:15:51.331
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=140,Updated=TO_TIMESTAMP('2017-09-20 13:15:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=1000046
;
-- 2017-09-20T13:15:53.793
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=150,Updated=TO_TIMESTAMP('2017-09-20 13:15:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=1000047
;
-- 2017-09-20T13:15:56.705
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=160,Updated=TO_TIMESTAMP('2017-09-20 13:15:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=1000039
;
-- 2017-09-20T13:16:00.804
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=170,Updated=TO_TIMESTAMP('2017-09-20 13:16:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=1000050
;
-- 2017-09-20T13:16:03.671
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=180,Updated=TO_TIMESTAMP('2017-09-20 13:16:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=1000049
;
-- 2017-09-20T13:16:06.160
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=190,Updated=TO_TIMESTAMP('2017-09-20 13:16:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=1000048
;
-- 2017-09-20T13:16:09.234
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=200,Updated=TO_TIMESTAMP('2017-09-20 13:16:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=1000051
;
-- 2017-09-20T13:16:24.529
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=170,Updated=TO_TIMESTAMP('2017-09-20 13:16:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=547355
;
-- 2017-09-20T13:25:31.994
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_ElementGroup SET UIStyle='primary',Updated=TO_TIMESTAMP('2017-09-20 13:25:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_ElementGroup_ID=1000005
;
-- 2017-09-20T13:28:59.515
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2017-09-20 13:28:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=1000054
;
-- 2017-09-20T13:28:59.523
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=10,Updated=TO_TIMESTAMP('2017-09-20 13:28:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=1000055
;
-- 2017-09-20T13:28:59.528
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=20,Updated=TO_TIMESTAMP('2017-09-20 13:28:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=1000056
;
-- 2017-09-20T13:28:59.534
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=30,Updated=TO_TIMESTAMP('2017-09-20 13:28:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=1000057
;
-- 2017-09-20T13:28:59.538
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=40,Updated=TO_TIMESTAMP('2017-09-20 13:28:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=1000058
;
-- 2017-09-20T13:28:59.542
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=50,Updated=TO_TIMESTAMP('2017-09-20 13:28:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=1000059
;
-- 2017-09-20T13:28:59.546
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=60,Updated=TO_TIMESTAMP('2017-09-20 13:28:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=1000060
;
-- 2017-09-20T13:28:59.550
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=70,Updated=TO_TIMESTAMP('2017-09-20 13:28:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=1000053
;
-- 2017-09-20T13:29:35.521
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=10,Updated=TO_TIMESTAMP('2017-09-20 13:29:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=1000055
;
-- 2017-09-20T13:29:37.600
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=20,Updated=TO_TIMESTAMP('2017-09-20 13:29:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=1000056
;
-- 2017-09-20T13:29:39.656
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=30,Updated=TO_TIMESTAMP('2017-09-20 13:29:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=1000057
;
-- 2017-09-20T13:29:41.327
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=40,Updated=TO_TIMESTAMP('2017-09-20 13:29:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=1000058
;
-- 2017-09-20T13:29:42.824
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=50,Updated=TO_TIMESTAMP('2017-09-20 13:29:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=1000059
;
-- 2017-09-20T13:29:44.447
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=60,Updated=TO_TIMESTAMP('2017-09-20 13:29:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=1000060
;
-- 2017-09-20T13:29:47.103
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=70,Updated=TO_TIMESTAMP('2017-09-20 13:29:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=1000053
;
-- 2017-09-20T13:29:50.634
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=80,Updated=TO_TIMESTAMP('2017-09-20 13:29:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=1000052
;
-- 2017-09-20T13:29:52.429
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed='N',Updated=TO_TIMESTAMP('2017-09-20 13:29:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=1000054
;
-- 2017-09-20T13:31:39.756
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_ElementGroup SET UIStyle='primary',Updated=TO_TIMESTAMP('2017-09-20 13:31:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_ElementGroup_ID=1000006
; | the_stack |
-- like2.test
--
-- db eval {
/*
CREATE TABLE t1(x INT, y COLLATE NOCASE);
INSERT INTO t1(x,y) VALUES(1,CAST(x'01' AS TEXT));
INSERT INTO t1(x,y) VALUES(2,CAST(x'02' AS TEXT));
INSERT INTO t1(x,y) VALUES(3,CAST(x'03' AS TEXT));
INSERT INTO t1(x,y) VALUES(4,CAST(x'04' AS TEXT));
INSERT INTO t1(x,y) VALUES(5,CAST(x'05' AS TEXT));
INSERT INTO t1(x,y) VALUES(6,CAST(x'06' AS TEXT));
INSERT INTO t1(x,y) VALUES(7,CAST(x'07' AS TEXT));
INSERT INTO t1(x,y) VALUES(8,CAST(x'08' AS TEXT));
INSERT INTO t1(x,y) VALUES(9,CAST(x'09' AS TEXT));
INSERT INTO t1(x,y) VALUES(10,CAST(x'0a' AS TEXT));
INSERT INTO t1(x,y) VALUES(11,CAST(x'0b' AS TEXT));
INSERT INTO t1(x,y) VALUES(12,CAST(x'0c' AS TEXT));
INSERT INTO t1(x,y) VALUES(13,CAST(x'0d' AS TEXT));
INSERT INTO t1(x,y) VALUES(14,CAST(x'0e' AS TEXT));
INSERT INTO t1(x,y) VALUES(15,CAST(x'0f' AS TEXT));
INSERT INTO t1(x,y) VALUES(16,CAST(x'10' AS TEXT));
INSERT INTO t1(x,y) VALUES(17,CAST(x'11' AS TEXT));
INSERT INTO t1(x,y) VALUES(18,CAST(x'12' AS TEXT));
INSERT INTO t1(x,y) VALUES(19,CAST(x'13' AS TEXT));
INSERT INTO t1(x,y) VALUES(20,CAST(x'14' AS TEXT));
INSERT INTO t1(x,y) VALUES(21,CAST(x'15' AS TEXT));
INSERT INTO t1(x,y) VALUES(22,CAST(x'16' AS TEXT));
INSERT INTO t1(x,y) VALUES(23,CAST(x'17' AS TEXT));
INSERT INTO t1(x,y) VALUES(24,CAST(x'18' AS TEXT));
INSERT INTO t1(x,y) VALUES(25,CAST(x'19' AS TEXT));
INSERT INTO t1(x,y) VALUES(26,CAST(x'1a' AS TEXT));
INSERT INTO t1(x,y) VALUES(27,CAST(x'1b' AS TEXT));
INSERT INTO t1(x,y) VALUES(28,CAST(x'1c' AS TEXT));
INSERT INTO t1(x,y) VALUES(29,CAST(x'1d' AS TEXT));
INSERT INTO t1(x,y) VALUES(30,CAST(x'1e' AS TEXT));
INSERT INTO t1(x,y) VALUES(31,CAST(x'1f' AS TEXT));
INSERT INTO t1(x,y) VALUES(32,' ');
INSERT INTO t1(x,y) VALUES(33,'!');
INSERT INTO t1(x,y) VALUES(34,'"');
INSERT INTO t1(x,y) VALUES(35,'#');
INSERT INTO t1(x,y) VALUES(36,'$');
INSERT INTO t1(x,y) VALUES(37,'%');
INSERT INTO t1(x,y) VALUES(38,'&');
INSERT INTO t1(x,y) VALUES(39,'''');
INSERT INTO t1(x,y) VALUES(40,'(');
INSERT INTO t1(x,y) VALUES(41,')');
INSERT INTO t1(x,y) VALUES(42,'*');
INSERT INTO t1(x,y) VALUES(43,'+');
INSERT INTO t1(x,y) VALUES(44,',');
INSERT INTO t1(x,y) VALUES(45,'-');
INSERT INTO t1(x,y) VALUES(46,'.');
INSERT INTO t1(x,y) VALUES(47,'/');
INSERT INTO t1(x,y) VALUES(48,'0');
INSERT INTO t1(x,y) VALUES(49,'1');
INSERT INTO t1(x,y) VALUES(50,'2');
INSERT INTO t1(x,y) VALUES(51,'3');
INSERT INTO t1(x,y) VALUES(52,'4');
INSERT INTO t1(x,y) VALUES(53,'5');
INSERT INTO t1(x,y) VALUES(54,'6');
INSERT INTO t1(x,y) VALUES(55,'7');
INSERT INTO t1(x,y) VALUES(56,'8');
INSERT INTO t1(x,y) VALUES(57,'9');
INSERT INTO t1(x,y) VALUES(58,':');
INSERT INTO t1(x,y) VALUES(59,';');
INSERT INTO t1(x,y) VALUES(60,'<');
INSERT INTO t1(x,y) VALUES(61,'=');
INSERT INTO t1(x,y) VALUES(62,'>');
INSERT INTO t1(x,y) VALUES(63,'?');
INSERT INTO t1(x,y) VALUES(64,'@');
INSERT INTO t1(x,y) VALUES(65,'A');
INSERT INTO t1(x,y) VALUES(66,'B');
INSERT INTO t1(x,y) VALUES(67,'C');
INSERT INTO t1(x,y) VALUES(68,'D');
INSERT INTO t1(x,y) VALUES(69,'E');
INSERT INTO t1(x,y) VALUES(70,'F');
INSERT INTO t1(x,y) VALUES(71,'G');
INSERT INTO t1(x,y) VALUES(72,'H');
INSERT INTO t1(x,y) VALUES(73,'I');
INSERT INTO t1(x,y) VALUES(74,'J');
INSERT INTO t1(x,y) VALUES(75,'K');
INSERT INTO t1(x,y) VALUES(76,'L');
INSERT INTO t1(x,y) VALUES(77,'M');
INSERT INTO t1(x,y) VALUES(78,'N');
INSERT INTO t1(x,y) VALUES(79,'O');
INSERT INTO t1(x,y) VALUES(80,'P');
INSERT INTO t1(x,y) VALUES(81,'Q');
INSERT INTO t1(x,y) VALUES(82,'R');
INSERT INTO t1(x,y) VALUES(83,'S');
INSERT INTO t1(x,y) VALUES(84,'T');
INSERT INTO t1(x,y) VALUES(85,'U');
INSERT INTO t1(x,y) VALUES(86,'V');
INSERT INTO t1(x,y) VALUES(87,'W');
INSERT INTO t1(x,y) VALUES(88,'X');
INSERT INTO t1(x,y) VALUES(89,'Y');
INSERT INTO t1(x,y) VALUES(90,'Z');
INSERT INTO t1(x,y) VALUES(91,'[');
INSERT INTO t1(x,y) VALUES(92,'\');
INSERT INTO t1(x,y) VALUES(93,']');
INSERT INTO t1(x,y) VALUES(94,'^');
INSERT INTO t1(x,y) VALUES(95,'_');
INSERT INTO t1(x,y) VALUES(96,'`');
INSERT INTO t1(x,y) VALUES(97,'a');
INSERT INTO t1(x,y) VALUES(98,'b');
INSERT INTO t1(x,y) VALUES(99,'c');
INSERT INTO t1(x,y) VALUES(100,'d');
INSERT INTO t1(x,y) VALUES(101,'e');
INSERT INTO t1(x,y) VALUES(102,'f');
INSERT INTO t1(x,y) VALUES(103,'g');
INSERT INTO t1(x,y) VALUES(104,'h');
INSERT INTO t1(x,y) VALUES(105,'i');
INSERT INTO t1(x,y) VALUES(106,'j');
INSERT INTO t1(x,y) VALUES(107,'k');
INSERT INTO t1(x,y) VALUES(108,'l');
INSERT INTO t1(x,y) VALUES(109,'m');
INSERT INTO t1(x,y) VALUES(110,'n');
INSERT INTO t1(x,y) VALUES(111,'o');
INSERT INTO t1(x,y) VALUES(112,'p');
INSERT INTO t1(x,y) VALUES(113,'q');
INSERT INTO t1(x,y) VALUES(114,'r');
INSERT INTO t1(x,y) VALUES(115,'s');
INSERT INTO t1(x,y) VALUES(116,'t');
INSERT INTO t1(x,y) VALUES(117,'u');
INSERT INTO t1(x,y) VALUES(118,'v');
INSERT INTO t1(x,y) VALUES(119,'w');
INSERT INTO t1(x,y) VALUES(120,'x');
INSERT INTO t1(x,y) VALUES(121,'y');
INSERT INTO t1(x,y) VALUES(122,'z');
INSERT INTO t1(x,y) VALUES(123,'{');
INSERT INTO t1(x,y) VALUES(124,'|');
INSERT INTO t1(x,y) VALUES(125,'}');
INSERT INTO t1(x,y) VALUES(126,'~');
INSERT INTO t1(x,y) VALUES(127,CAST(x'7f' AS TEXT));
SELECT count(*) FROM t1;
*/
-- }
CREATE TABLE t1(x INT, y COLLATE NOCASE);
INSERT INTO t1(x,y) VALUES(1,CAST(x'01' AS TEXT));
INSERT INTO t1(x,y) VALUES(2,CAST(x'02' AS TEXT));
INSERT INTO t1(x,y) VALUES(3,CAST(x'03' AS TEXT));
INSERT INTO t1(x,y) VALUES(4,CAST(x'04' AS TEXT));
INSERT INTO t1(x,y) VALUES(5,CAST(x'05' AS TEXT));
INSERT INTO t1(x,y) VALUES(6,CAST(x'06' AS TEXT));
INSERT INTO t1(x,y) VALUES(7,CAST(x'07' AS TEXT));
INSERT INTO t1(x,y) VALUES(8,CAST(x'08' AS TEXT));
INSERT INTO t1(x,y) VALUES(9,CAST(x'09' AS TEXT));
INSERT INTO t1(x,y) VALUES(10,CAST(x'0a' AS TEXT));
INSERT INTO t1(x,y) VALUES(11,CAST(x'0b' AS TEXT));
INSERT INTO t1(x,y) VALUES(12,CAST(x'0c' AS TEXT));
INSERT INTO t1(x,y) VALUES(13,CAST(x'0d' AS TEXT));
INSERT INTO t1(x,y) VALUES(14,CAST(x'0e' AS TEXT));
INSERT INTO t1(x,y) VALUES(15,CAST(x'0f' AS TEXT));
INSERT INTO t1(x,y) VALUES(16,CAST(x'10' AS TEXT));
INSERT INTO t1(x,y) VALUES(17,CAST(x'11' AS TEXT));
INSERT INTO t1(x,y) VALUES(18,CAST(x'12' AS TEXT));
INSERT INTO t1(x,y) VALUES(19,CAST(x'13' AS TEXT));
INSERT INTO t1(x,y) VALUES(20,CAST(x'14' AS TEXT));
INSERT INTO t1(x,y) VALUES(21,CAST(x'15' AS TEXT));
INSERT INTO t1(x,y) VALUES(22,CAST(x'16' AS TEXT));
INSERT INTO t1(x,y) VALUES(23,CAST(x'17' AS TEXT));
INSERT INTO t1(x,y) VALUES(24,CAST(x'18' AS TEXT));
INSERT INTO t1(x,y) VALUES(25,CAST(x'19' AS TEXT));
INSERT INTO t1(x,y) VALUES(26,CAST(x'1a' AS TEXT));
INSERT INTO t1(x,y) VALUES(27,CAST(x'1b' AS TEXT));
INSERT INTO t1(x,y) VALUES(28,CAST(x'1c' AS TEXT));
INSERT INTO t1(x,y) VALUES(29,CAST(x'1d' AS TEXT));
INSERT INTO t1(x,y) VALUES(30,CAST(x'1e' AS TEXT));
INSERT INTO t1(x,y) VALUES(31,CAST(x'1f' AS TEXT));
INSERT INTO t1(x,y) VALUES(32,' ');
INSERT INTO t1(x,y) VALUES(33,'!');
INSERT INTO t1(x,y) VALUES(34,'"');
INSERT INTO t1(x,y) VALUES(35,'#');
INSERT INTO t1(x,y) VALUES(36,'$');
INSERT INTO t1(x,y) VALUES(37,'%');
INSERT INTO t1(x,y) VALUES(38,'&');
INSERT INTO t1(x,y) VALUES(39,'''');
INSERT INTO t1(x,y) VALUES(40,'(');
INSERT INTO t1(x,y) VALUES(41,')');
INSERT INTO t1(x,y) VALUES(42,'*');
INSERT INTO t1(x,y) VALUES(43,'+');
INSERT INTO t1(x,y) VALUES(44,',');
INSERT INTO t1(x,y) VALUES(45,'-');
INSERT INTO t1(x,y) VALUES(46,'.');
INSERT INTO t1(x,y) VALUES(47,'/');
INSERT INTO t1(x,y) VALUES(48,'0');
INSERT INTO t1(x,y) VALUES(49,'1');
INSERT INTO t1(x,y) VALUES(50,'2');
INSERT INTO t1(x,y) VALUES(51,'3');
INSERT INTO t1(x,y) VALUES(52,'4');
INSERT INTO t1(x,y) VALUES(53,'5');
INSERT INTO t1(x,y) VALUES(54,'6');
INSERT INTO t1(x,y) VALUES(55,'7');
INSERT INTO t1(x,y) VALUES(56,'8');
INSERT INTO t1(x,y) VALUES(57,'9');
INSERT INTO t1(x,y) VALUES(58,':');
INSERT INTO t1(x,y) VALUES(59,';');
INSERT INTO t1(x,y) VALUES(60,'<');
INSERT INTO t1(x,y) VALUES(61,'=');
INSERT INTO t1(x,y) VALUES(62,'>');
INSERT INTO t1(x,y) VALUES(63,'?');
INSERT INTO t1(x,y) VALUES(64,'@');
INSERT INTO t1(x,y) VALUES(65,'A');
INSERT INTO t1(x,y) VALUES(66,'B');
INSERT INTO t1(x,y) VALUES(67,'C');
INSERT INTO t1(x,y) VALUES(68,'D');
INSERT INTO t1(x,y) VALUES(69,'E');
INSERT INTO t1(x,y) VALUES(70,'F');
INSERT INTO t1(x,y) VALUES(71,'G');
INSERT INTO t1(x,y) VALUES(72,'H');
INSERT INTO t1(x,y) VALUES(73,'I');
INSERT INTO t1(x,y) VALUES(74,'J');
INSERT INTO t1(x,y) VALUES(75,'K');
INSERT INTO t1(x,y) VALUES(76,'L');
INSERT INTO t1(x,y) VALUES(77,'M');
INSERT INTO t1(x,y) VALUES(78,'N');
INSERT INTO t1(x,y) VALUES(79,'O');
INSERT INTO t1(x,y) VALUES(80,'P');
INSERT INTO t1(x,y) VALUES(81,'Q');
INSERT INTO t1(x,y) VALUES(82,'R');
INSERT INTO t1(x,y) VALUES(83,'S');
INSERT INTO t1(x,y) VALUES(84,'T');
INSERT INTO t1(x,y) VALUES(85,'U');
INSERT INTO t1(x,y) VALUES(86,'V');
INSERT INTO t1(x,y) VALUES(87,'W');
INSERT INTO t1(x,y) VALUES(88,'X');
INSERT INTO t1(x,y) VALUES(89,'Y');
INSERT INTO t1(x,y) VALUES(90,'Z');
INSERT INTO t1(x,y) VALUES(91,'[');
INSERT INTO t1(x,y) VALUES(92,'\');
INSERT INTO t1(x,y) VALUES(93,']');
INSERT INTO t1(x,y) VALUES(94,'^');
INSERT INTO t1(x,y) VALUES(95,'_');
INSERT INTO t1(x,y) VALUES(96,'`');
INSERT INTO t1(x,y) VALUES(97,'a');
INSERT INTO t1(x,y) VALUES(98,'b');
INSERT INTO t1(x,y) VALUES(99,'c');
INSERT INTO t1(x,y) VALUES(100,'d');
INSERT INTO t1(x,y) VALUES(101,'e');
INSERT INTO t1(x,y) VALUES(102,'f');
INSERT INTO t1(x,y) VALUES(103,'g');
INSERT INTO t1(x,y) VALUES(104,'h');
INSERT INTO t1(x,y) VALUES(105,'i');
INSERT INTO t1(x,y) VALUES(106,'j');
INSERT INTO t1(x,y) VALUES(107,'k');
INSERT INTO t1(x,y) VALUES(108,'l');
INSERT INTO t1(x,y) VALUES(109,'m');
INSERT INTO t1(x,y) VALUES(110,'n');
INSERT INTO t1(x,y) VALUES(111,'o');
INSERT INTO t1(x,y) VALUES(112,'p');
INSERT INTO t1(x,y) VALUES(113,'q');
INSERT INTO t1(x,y) VALUES(114,'r');
INSERT INTO t1(x,y) VALUES(115,'s');
INSERT INTO t1(x,y) VALUES(116,'t');
INSERT INTO t1(x,y) VALUES(117,'u');
INSERT INTO t1(x,y) VALUES(118,'v');
INSERT INTO t1(x,y) VALUES(119,'w');
INSERT INTO t1(x,y) VALUES(120,'x');
INSERT INTO t1(x,y) VALUES(121,'y');
INSERT INTO t1(x,y) VALUES(122,'z');
INSERT INTO t1(x,y) VALUES(123,'{');
INSERT INTO t1(x,y) VALUES(124,'|');
INSERT INTO t1(x,y) VALUES(125,'}');
INSERT INTO t1(x,y) VALUES(126,'~');
INSERT INTO t1(x,y) VALUES(127,CAST(x'7f' AS TEXT));
SELECT count(*) FROM t1; | the_stack |
-- 2020-04-01T10:48:17.646Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2020-04-01 13:48:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='en_GB' AND AD_Element_ID=2663
;
-- 2020-04-01T10:48:17.682Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(2663,'en_GB')
;
-- 2020-04-01T10:48:24.863Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET PrintName='Vorauszahlung', IsTranslated='Y', Name='Vorauszahlung',Updated=TO_TIMESTAMP('2020-04-01 13:48:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_CH' AND AD_Element_ID=2663
;
-- 2020-04-01T10:48:24.864Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(2663,'de_CH')
;
-- 2020-04-01T12:38:40.723Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET Help='', Description='Die Zahlung ist eine Vorauszahlung',Updated=TO_TIMESTAMP('2020-04-01 15:38:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_CH' AND AD_Element_ID=2663
;
-- 2020-04-01T12:38:40.726Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(2663,'de_CH')
;
-- 2020-04-01T12:38:56.952Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2020-04-01 15:38:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_DE' AND AD_Element_ID=2663
;
-- 2020-04-01T12:38:56.953Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(2663,'de_DE')
;
-- 2020-04-01T12:38:56.986Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_ad_element_on_ad_element_trl_update(2663,'de_DE')
;
-- 2020-04-01T12:39:28.670Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2020-04-01 15:39:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='en_GB' AND AD_Element_ID=1105
;
-- 2020-04-01T12:39:28.671Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(1105,'en_GB')
;
-- 2020-04-01T12:40:45.458Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET PrintName='Abgeglichen', IsTranslated='Y', Name='Abgeglichen',Updated=TO_TIMESTAMP('2020-04-01 15:40:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_CH' AND AD_Element_ID=1105
;
-- 2020-04-01T12:40:45.460Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(1105,'de_CH')
;
-- 2020-04-01T12:41:17.622Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2020-04-01 15:41:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_DE' AND AD_Element_ID=1105
;
-- 2020-04-01T12:41:17.625Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(1105,'de_DE')
;
-- 2020-04-01T12:41:17.661Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_ad_element_on_ad_element_trl_update(1105,'de_DE')
;
-- 2020-04-01T12:41:23.133Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET Description='Zeigt an ob eine Zahlung bereits mit einem Kontoauszug abgeglichen wurde',Updated=TO_TIMESTAMP('2020-04-01 15:41:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_CH' AND AD_Element_ID=1105
;
-- 2020-04-01T12:41:23.134Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(1105,'de_CH')
;
-- 2020-04-01T12:44:22.241Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y', Name='Pre',Updated=TO_TIMESTAMP('2020-04-01 15:44:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='en_GB' AND AD_Element_ID=541047
;
-- 2020-04-01T12:44:22.243Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(541047,'en_GB')
;
-- 2020-04-01T12:44:33.601Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET PrintName='Prepay Order', Name='Prepay Order',Updated=TO_TIMESTAMP('2020-04-01 15:44:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='en_GB' AND AD_Element_ID=541047
;
-- 2020-04-01T12:44:33.602Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(541047,'en_GB')
;
-- 2020-04-01T12:44:36.538Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2020-04-01 15:44:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_CH' AND AD_Element_ID=541047
;
-- 2020-04-01T12:44:36.539Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(541047,'de_CH')
;
-- 2020-04-01T12:44:41.547Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET PrintName='Prepay Order', IsTranslated='Y', Name='Prepay Order',Updated=TO_TIMESTAMP('2020-04-01 15:44:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='en_US' AND AD_Element_ID=541047
;
-- 2020-04-01T12:44:41.548Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(541047,'en_US')
;
-- 2020-04-01T12:44:45.982Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2020-04-01 15:44:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_DE' AND AD_Element_ID=541047
;
-- 2020-04-01T12:44:45.983Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(541047,'de_DE')
;
-- 2020-04-01T12:44:46.010Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_ad_element_on_ad_element_trl_update(541047,'de_DE')
;
-- 2020-04-01T13:10:26.521Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET PrintName='Über-/Unterzahlung', IsTranslated='Y', Name='Über-/Unterzahlung',Updated=TO_TIMESTAMP('2020-04-01 16:10:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_DE' AND AD_Element_ID=1818
;
-- 2020-04-01T13:10:26.522Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(1818,'de_DE')
;
-- 2020-04-01T13:10:26.558Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_ad_element_on_ad_element_trl_update(1818,'de_DE')
;
-- 2020-04-01T13:10:26.560Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName='IsOverUnderPayment', Name='Über-/Unterzahlung', 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.' WHERE AD_Element_ID=1818
;
-- 2020-04-01T13:10:26.563Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='IsOverUnderPayment', Name='Über-/Unterzahlung', 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.', AD_Element_ID=1818 WHERE UPPER(ColumnName)='ISOVERUNDERPAYMENT' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2020-04-01T13:10:26.567Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='IsOverUnderPayment', Name='Über-/Unterzahlung', 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.' WHERE AD_Element_ID=1818 AND IsCentrallyMaintained='Y'
;
-- 2020-04-01T13:10:26.568Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Über-/Unterzahlung', 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.' WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=1818) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 1818)
;
-- 2020-04-01T13:10:26.584Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_PrintFormatItem pi SET PrintName='Über-/Unterzahlung', Name='Über-/Unterzahlung' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=1818)
;
-- 2020-04-01T13:10:26.601Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET Name='Über-/Unterzahlung', 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.', CommitWarning = NULL WHERE AD_Element_ID = 1818
;
-- 2020-04-01T13:10:26.603Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_WINDOW SET Name='Über-/Unterzahlung', 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.' WHERE AD_Element_ID = 1818
;
-- 2020-04-01T13:10:26.605Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu SET Name = 'Über-/Unterzahlung', Description = 'Over-Payment (unallocated) or Under-Payment (partial payment)', WEBUI_NameBrowse = NULL, WEBUI_NameNew = NULL, WEBUI_NameNewBreadcrumb = NULL WHERE AD_Element_ID = 1818
;
-- 2020-04-01T13:11:04.525Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET PrintName='Über-/Unterzahlung', Help='Überzahlungen (negativ) sind nicht zugewiesene Beträge und ermöglichen es Ihnen, Geld für mehr als die jeweilige Rechnung zu erhalten.
Unterzahlungen (positiv) sind Teilzahlungen für eine Rechnung. Sie schreiben den unbezahlten Betrag nicht ab.', IsTranslated='Y', Name='Über-/Unterzahlung', Description='Überzahlung (nicht zugewiesen) oder Unterzahlung (Teilzahlung)',Updated=TO_TIMESTAMP('2020-04-01 16:11:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_CH' AND AD_Element_ID=1818
;
-- 2020-04-01T13:11:04.526Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(1818,'de_CH')
;
-- 2020-04-01T13:11:18.742Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET Help='Überzahlungen (negativ) sind nicht zugewiesene Beträge und ermöglichen es Ihnen, Geld für mehr als die jeweilige Rechnung zu erhalten.
Unterzahlungen (positiv) sind Teilzahlungen für eine Rechnung. Sie schreiben den unbezahlten Betrag nicht ab.', Description='Überzahlung (nicht zugewiesen) oder Unterzahlung (Teilzahlung)',Updated=TO_TIMESTAMP('2020-04-01 16:11:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_DE' AND AD_Element_ID=1818
;
-- 2020-04-01T13:11:18.743Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(1818,'de_DE')
;
-- 2020-04-01T13:11:18.775Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_ad_element_on_ad_element_trl_update(1818,'de_DE')
;
-- 2020-04-01T13:11:18.776Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName='IsOverUnderPayment', Name='Über-/Unterzahlung', Description='Überzahlung (nicht zugewiesen) oder Unterzahlung (Teilzahlung)', Help='Überzahlungen (negativ) sind nicht zugewiesene Beträge und ermöglichen es Ihnen, Geld für mehr als die jeweilige Rechnung zu erhalten.
Unterzahlungen (positiv) sind Teilzahlungen für eine Rechnung. Sie schreiben den unbezahlten Betrag nicht ab.' WHERE AD_Element_ID=1818
;
-- 2020-04-01T13:11:18.778Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='IsOverUnderPayment', Name='Über-/Unterzahlung', Description='Überzahlung (nicht zugewiesen) oder Unterzahlung (Teilzahlung)', Help='Überzahlungen (negativ) sind nicht zugewiesene Beträge und ermöglichen es Ihnen, Geld für mehr als die jeweilige Rechnung zu erhalten.
Unterzahlungen (positiv) sind Teilzahlungen für eine Rechnung. Sie schreiben den unbezahlten Betrag nicht ab.', AD_Element_ID=1818 WHERE UPPER(ColumnName)='ISOVERUNDERPAYMENT' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2020-04-01T13:11:18.780Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='IsOverUnderPayment', Name='Über-/Unterzahlung', Description='Überzahlung (nicht zugewiesen) oder Unterzahlung (Teilzahlung)', Help='Überzahlungen (negativ) sind nicht zugewiesene Beträge und ermöglichen es Ihnen, Geld für mehr als die jeweilige Rechnung zu erhalten.
Unterzahlungen (positiv) sind Teilzahlungen für eine Rechnung. Sie schreiben den unbezahlten Betrag nicht ab.' WHERE AD_Element_ID=1818 AND IsCentrallyMaintained='Y'
;
-- 2020-04-01T13:11:18.780Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Über-/Unterzahlung', Description='Überzahlung (nicht zugewiesen) oder Unterzahlung (Teilzahlung)', Help='Überzahlungen (negativ) sind nicht zugewiesene Beträge und ermöglichen es Ihnen, Geld für mehr als die jeweilige Rechnung zu erhalten.
Unterzahlungen (positiv) sind Teilzahlungen für eine Rechnung. Sie schreiben den unbezahlten Betrag nicht ab.' WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=1818) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 1818)
;
-- 2020-04-01T13:11:18.792Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET Name='Über-/Unterzahlung', Description='Überzahlung (nicht zugewiesen) oder Unterzahlung (Teilzahlung)', Help='Überzahlungen (negativ) sind nicht zugewiesene Beträge und ermöglichen es Ihnen, Geld für mehr als die jeweilige Rechnung zu erhalten.
Unterzahlungen (positiv) sind Teilzahlungen für eine Rechnung. Sie schreiben den unbezahlten Betrag nicht ab.', CommitWarning = NULL WHERE AD_Element_ID = 1818
;
-- 2020-04-01T13:11:18.794Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_WINDOW SET Name='Über-/Unterzahlung', Description='Überzahlung (nicht zugewiesen) oder Unterzahlung (Teilzahlung)', Help='Überzahlungen (negativ) sind nicht zugewiesene Beträge und ermöglichen es Ihnen, Geld für mehr als die jeweilige Rechnung zu erhalten.
Unterzahlungen (positiv) sind Teilzahlungen für eine Rechnung. Sie schreiben den unbezahlten Betrag nicht ab.' WHERE AD_Element_ID = 1818
;
-- 2020-04-01T13:11:18.795Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu SET Name = 'Über-/Unterzahlung', Description = 'Überzahlung (nicht zugewiesen) oder Unterzahlung (Teilzahlung)', WEBUI_NameBrowse = NULL, WEBUI_NameNew = NULL, WEBUI_NameNewBreadcrumb = NULL WHERE AD_Element_ID = 1818
;
-- 2020-04-01T13:14:13.375Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2020-04-01 16:14:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='en_GB' AND AD_Element_ID=1487
;
-- 2020-04-01T13:14:13.376Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(1487,'en_GB')
;
-- 2020-04-01T13:14:30.437Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET PrintName='Effektives Datum', IsTranslated='Y', Name='Effektives Datum',Updated=TO_TIMESTAMP('2020-04-01 16:14:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_DE' AND AD_Element_ID=1487
;
-- 2020-04-01T13:14:30.438Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(1487,'de_DE')
;
-- 2020-04-01T13:14:30.470Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_ad_element_on_ad_element_trl_update(1487,'de_DE')
;
-- 2020-04-01T13:14:30.472Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName='ValutaDate', Name='Effektives Datum', Description='Date when money is available', Help='The Effective Date indicates the date that money is available from the bank.' WHERE AD_Element_ID=1487
;
-- 2020-04-01T13:14:30.474Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='ValutaDate', Name='Effektives Datum', Description='Date when money is available', Help='The Effective Date indicates the date that money is available from the bank.', AD_Element_ID=1487 WHERE UPPER(ColumnName)='VALUTADATE' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2020-04-01T13:14:30.475Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='ValutaDate', Name='Effektives Datum', Description='Date when money is available', Help='The Effective Date indicates the date that money is available from the bank.' WHERE AD_Element_ID=1487 AND IsCentrallyMaintained='Y'
;
-- 2020-04-01T13:14:30.476Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Effektives Datum', Description='Date when money is available', Help='The Effective Date indicates the date that money is available from the bank.' WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=1487) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 1487)
;
-- 2020-04-01T13:14:30.490Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_PrintFormatItem pi SET PrintName='Effektives Datum', Name='Effektives Datum' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=1487)
;
-- 2020-04-01T13:14:30.504Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET Name='Effektives Datum', Description='Date when money is available', Help='The Effective Date indicates the date that money is available from the bank.', CommitWarning = NULL WHERE AD_Element_ID = 1487
;
-- 2020-04-01T13:14:30.506Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_WINDOW SET Name='Effektives Datum', Description='Date when money is available', Help='The Effective Date indicates the date that money is available from the bank.' WHERE AD_Element_ID = 1487
;
-- 2020-04-01T13:14:30.507Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu SET Name = 'Effektives Datum', Description = 'Date when money is available', WEBUI_NameBrowse = NULL, WEBUI_NameNew = NULL, WEBUI_NameNewBreadcrumb = NULL WHERE AD_Element_ID = 1487
;
-- 2020-04-01T13:14:37.023Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET PrintName='Effektives Datum', IsTranslated='Y', Name='Effektives Datum',Updated=TO_TIMESTAMP('2020-04-01 16:14:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_CH' AND AD_Element_ID=1487
;
-- 2020-04-01T13:14:37.024Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(1487,'de_CH')
;
-- 2020-04-02T06:04:44.169Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Trl SET IsTranslated='Y', Name='Zahlung zuordnen',Updated=TO_TIMESTAMP('2020-04-02 09:04:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=540554 AND AD_Language='de_CH'
;
-- 2020-04-02T06:04:46.983Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2020-04-02 09:04:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=540554 AND AD_Language='de_DE'
;
-- 2020-04-02T06:05:00.833Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process SET Name='Allocate Payment',Updated=TO_TIMESTAMP('2020-04-02 09:05:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=540554
;
-- some more fields
-- 2020-04-02T07:07:44.812Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element SET ColumnName='BankStatementLine',Updated=TO_TIMESTAMP('2020-04-02 10:07:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=1001846
;
-- 2020-04-02T07:07:44.828Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName='BankStatementLine', Name='Auszugs-Position', 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.' WHERE AD_Element_ID=1001846
;
-- 2020-04-02T07:07:44.828Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='BankStatementLine', Name='Auszugs-Position', 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.', AD_Element_ID=1001846 WHERE UPPER(ColumnName)='BANKSTATEMENTLINE' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2020-04-02T07:07:44.830Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='BankStatementLine', Name='Auszugs-Position', 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.' WHERE AD_Element_ID=1001846 AND IsCentrallyMaintained='Y'
;
-- 2020-04-02T07:08:30.380Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2020-04-02 10:08:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_CH' AND AD_Element_ID=1001846
;
-- 2020-04-02T07:08:30.405Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(1001846,'de_CH')
;
-- 2020-04-02T07:08:54.803Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2020-04-02 10:08:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_DE' AND AD_Element_ID=1001846
;
-- 2020-04-02T07:08:54.805Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(1001846,'de_DE')
;
-- 2020-04-02T07:08:54.829Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_ad_element_on_ad_element_trl_update(1001846,'de_DE')
;
-- 2020-04-02T07:15:44.701Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element SET PrintName='Write-off Amount',Updated=TO_TIMESTAMP('2020-04-02 10:15:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=1450
;
-- 2020-04-02T07:15:44.706Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_PrintFormatItem pi SET PrintName='Write-off Amount', Name='Write-off Amount' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=1450)
;
-- 2020-04-02T07:16:05.145Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET PrintName='Write-off Amount', IsTranslated='Y',Updated=TO_TIMESTAMP('2020-04-02 10:16:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='en_GB' AND AD_Element_ID=1450
;
-- 2020-04-02T07:16:05.148Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(1450,'en_GB')
;
-- 2020-04-02T07:16:17.733Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET PrintName='Write-off',Updated=TO_TIMESTAMP('2020-04-02 10:16:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='en_GB' AND AD_Element_ID=1450
;
-- 2020-04-02T07:16:17.734Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(1450,'en_GB')
;
-- 2020-04-02T07:16:26.465Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y', Name='Abschreiben',Updated=TO_TIMESTAMP('2020-04-02 10:16:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_DE' AND AD_Element_ID=1450
;
-- 2020-04-02T07:16:26.467Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(1450,'de_DE')
;
-- 2020-04-02T07:16:26.502Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_ad_element_on_ad_element_trl_update(1450,'de_DE')
;
-- 2020-04-02T07:16:26.504Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName='WriteOffAmt', Name='Abschreiben', Description='Amount to write-off', Help='The Write Off Amount indicates the amount to be written off as uncollectible.' WHERE AD_Element_ID=1450
;
-- 2020-04-02T07:16:26.506Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='WriteOffAmt', Name='Abschreiben', Description='Amount to write-off', Help='The Write Off Amount indicates the amount to be written off as uncollectible.', AD_Element_ID=1450 WHERE UPPER(ColumnName)='WRITEOFFAMT' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2020-04-02T07:16:26.507Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='WriteOffAmt', Name='Abschreiben', Description='Amount to write-off', Help='The Write Off Amount indicates the amount to be written off as uncollectible.' WHERE AD_Element_ID=1450 AND IsCentrallyMaintained='Y'
;
-- 2020-04-02T07:16:26.508Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Abschreiben', Description='Amount to write-off', Help='The Write Off Amount indicates the amount to be written off as uncollectible.' WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=1450) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 1450)
;
-- 2020-04-02T07:16:26.527Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_PrintFormatItem pi SET PrintName='Abschreiben', Name='Abschreiben' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=1450)
;
-- 2020-04-02T07:16:26.541Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET Name='Abschreiben', Description='Amount to write-off', Help='The Write Off Amount indicates the amount to be written off as uncollectible.', CommitWarning = NULL WHERE AD_Element_ID = 1450
;
-- 2020-04-02T07:16:26.544Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_WINDOW SET Name='Abschreiben', Description='Amount to write-off', Help='The Write Off Amount indicates the amount to be written off as uncollectible.' WHERE AD_Element_ID = 1450
;
-- 2020-04-02T07:16:26.545Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu SET Name = 'Abschreiben', Description = 'Amount to write-off', WEBUI_NameBrowse = NULL, WEBUI_NameNew = NULL, WEBUI_NameNewBreadcrumb = NULL WHERE AD_Element_ID = 1450
;
-- 2020-04-02T07:16:32.426Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET Name='Abschreiben',Updated=TO_TIMESTAMP('2020-04-02 10:16:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_CH' AND AD_Element_ID=1450
;
-- 2020-04-02T07:16:32.427Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(1450,'de_CH')
; | the_stack |
use master;
GO
-- real+bigint -> real
select cast(pg_typeof(CAST(324.463 AS real) + CAST(5000 AS bigint)) as varchar(100)) rettype;
GO
-- real*bigint -> real
select cast(pg_typeof(CAST(324.463 AS real) * CAST(5000 AS bigint)) as varchar(100)) rettype;
GO
-- smallmoney+bigint -> smallmoney
select cast(pg_typeof(CAST(42.1256 AS smallmoney) + CAST(5000 AS bigint)) as varchar(100)) rettype;
GO
-- smallmoney/bigint -> smallmoney
select cast(pg_typeof(CAST(42.1256 AS smallmoney) / CAST(5000 AS bigint)) as varchar(100)) rettype;
GO
-- real*decimal(12,4) -> real
select cast(pg_typeof(CAST(324.463 AS real) * CAST(54535.5656 AS decimal(12,4))) as varchar(100)) rettype;
GO
-- smallmoney-int -> smallmoney
select cast(pg_typeof(CAST(42.1256 AS smallmoney) - CAST(1000 AS int)) as varchar(100)) rettype;
GO
-- real/decimal(12,4) -> real
select cast(pg_typeof(CAST(324.463 AS real) / CAST(54535.5656 AS decimal(12,4))) as varchar(100)) rettype;
GO
-- real-decimal(12,4) -> real
select cast(pg_typeof(CAST(324.463 AS real) - CAST(54535.5656 AS decimal(12,4))) as varchar(100)) rettype;
GO
-- real/int -> real
select cast(pg_typeof(CAST(324.463 AS real) / CAST(1000 AS int)) as varchar(100)) rettype;
GO
-- real*int -> real
select cast(pg_typeof(CAST(324.463 AS real) * CAST(1000 AS int)) as varchar(100)) rettype;
GO
-- real+int -> real
select cast(pg_typeof(CAST(324.463 AS real) + CAST(1000 AS int)) as varchar(100)) rettype;
GO
-- smallmoney*int -> smallmoney
select cast(pg_typeof(CAST(42.1256 AS smallmoney) * CAST(1000 AS int)) as varchar(100)) rettype;
GO
-- smallmoney+int -> smallmoney
select cast(pg_typeof(CAST(42.1256 AS smallmoney) + CAST(1000 AS int)) as varchar(100)) rettype;
GO
-- smallmoney+int -> smallmoney
select cast(pg_typeof(CAST(42.1256 AS smallmoney) / CAST(1000 AS int)) as varchar(100)) rettype;
GO
-- smallint/money -> money
select cast(pg_typeof(CAST(100 AS smallint) / CAST(420.2313 AS money)) as varchar(100)) rettype;
GO
-- int/money -> money
select cast(pg_typeof(CAST(1000 AS int) / CAST(420.2313 AS money)) as varchar(100)) rettype;
GO
-- real+money -> real
select cast(pg_typeof(CAST(324.463 AS real) + CAST(420.2313 AS money)) as varchar(100)) rettype;
GO
-- real-money -> real
select cast(pg_typeof(CAST(324.463 AS real) - CAST(420.2313 AS money)) as varchar(100)) rettype;
GO
-- real/money -> real
select cast(pg_typeof(CAST(324.463 AS real) / CAST(420.2313 AS money)) as varchar(100)) rettype;
GO
-- real/numeric(12,4) -> real
select cast(pg_typeof(CAST(324.463 AS real) / CAST(54535.5656 AS numeric(12,4))) as varchar(100)) rettype;
GO
-- real-numeric(12,4) -> real
select cast(pg_typeof(CAST(324.463 AS real) - CAST(54535.5656 AS numeric(12,4))) as varchar(100)) rettype;
GO
-- real*numeric(12,4) --> real
select cast(pg_typeof(CAST(324.463 AS real) * CAST(54535.5656 AS numeric(12,4))) as varchar(100)) rettype;
GO
-- smallint+real -> real
select cast(pg_typeof(CAST(100 AS smallint) + CAST(324.463 AS real)) as varchar(100)) rettype;
GO
-- decimal(12,4)-real -> real
select cast(pg_typeof(CAST(54535.5656 AS decimal(12,4)) - CAST(324.463 AS real)) as varchar(100)) rettype;
GO
-- smallmoney-real -> real
select cast(pg_typeof(CAST(42.1256 AS smallmoney) - CAST(324.463 AS real)) as varchar(100)) rettype;
GO
-- numeric(12,4)-real -> real
select cast(pg_typeof(CAST(54535.5656 AS numeric(12,4)) - CAST(324.463 AS real)) as varchar(100)) rettype;
GO
-- int+real -> real
select cast(pg_typeof(CAST(1000 AS int) + CAST(324.463 AS real)) as varchar(100)) rettype;
GO
-- bigint-real -> real
select cast(pg_typeof(CAST(5000 AS bigint) - CAST(324.463 AS real)) as varchar(100)) rettype;
GO
-- tinyint+real -> real
select cast(pg_typeof(CAST(10 AS tinyint) + CAST(324.463 AS real)) as varchar(100)) rettype;
GO
-- tinyint-real -> real
select cast(pg_typeof(CAST(10 AS tinyint) - CAST(324.463 AS real)) as varchar(100)) rettype;
GO
-- money+real -> real
select cast(pg_typeof(CAST(420.2313 AS money) + CAST(324.463 AS real)) as varchar(100)) rettype;
GO
-- money*real -> real
select cast(pg_typeof(CAST(420.2313 AS money) * CAST(324.463 AS real)) as varchar(100)) rettype;
GO
-- decimal(12,4)+real -> real
select cast(pg_typeof(CAST(54535.5656 AS decimal(12,4)) + CAST(324.463 AS real)) as varchar(100)) rettype;
GO
-- decimal(12,4)*real -> real
select cast(pg_typeof(CAST(54535.5656 AS decimal(12,4)) * CAST(324.463 AS real)) as varchar(100)) rettype;
GO
-- smallmoney/real -> real
select cast(pg_typeof(CAST(42.1256 AS smallmoney) / CAST(324.463 AS real)) as varchar(100)) rettype;
GO
-- smallmoney*real -> real
select cast(pg_typeof(CAST(42.1256 AS smallmoney) * CAST(324.463 AS real)) as varchar(100)) rettype;
GO
-- bigint/real -> real
select cast(pg_typeof(CAST(5000 AS bigint) / CAST(324.463 AS real)) as varchar(100)) rettype;
GO
-- numeric(12,4)*real -> real
select cast(pg_typeof(CAST(54535.5656 AS numeric(12,4)) * CAST(324.463 AS real)) as varchar(100)) rettype;
GO
-- numeric(12,4)/real -> real
select cast(pg_typeof(CAST(54535.5656 AS numeric(12,4)) / CAST(324.463 AS real)) as varchar(100)) rettype;
GO
-- int/real -> real
select cast(pg_typeof(CAST(1000 AS int) / CAST(324.463 AS real)) as varchar(100)) rettype;
GO
-- smallmoney+real -> real
select cast(pg_typeof(CAST(42.1256 AS smallmoney) + CAST(324.463 AS real)) as varchar(100)) rettype;
GO
-- bigint*real -> real
select cast(pg_typeof(CAST(5000 AS bigint) * CAST(324.463 AS real)) as varchar(100)) rettype;
GO
-- tinyint/real -> real
select cast(pg_typeof(CAST(10 AS tinyint) / CAST(324.463 AS real)) as varchar(100)) rettype;
GO
-- smallint*real -> real
select cast(pg_typeof(CAST(100 AS smallint) * CAST(324.463 AS real)) as varchar(100)) rettype;
GO
-- real/smallint -> real
select cast(pg_typeof(CAST(324.463 AS real) / CAST(100 AS smallint)) as varchar(100)) rettype;
GO
-- real*smallint -> real
select cast(pg_typeof(CAST(324.463 AS real) * CAST(100 AS smallint)) as varchar(100)) rettype;
GO
-- real+smallint -> real
select cast(pg_typeof(CAST(324.463 AS real) + CAST(100 AS smallint)) as varchar(100)) rettype;
GO
-- smallmoney+smallint -> smallmoney
select cast(pg_typeof(CAST(42.1256 AS smallmoney) + CAST(100 AS smallint)) as varchar(100)) rettype;
GO
-- real-smallint -> real
select cast(pg_typeof(CAST(324.463 AS real) - CAST(100 AS smallint)) as varchar(100)) rettype;
GO
-- smallmoney-smallint -> smallmoney
select cast(pg_typeof(CAST(42.1256 AS smallmoney) - CAST(100 AS smallint)) as varchar(100)) rettype;
GO
-- tinyint*smallmoney -> smallmoney
select cast(pg_typeof(CAST(10 AS tinyint) * CAST(42.1256 AS smallmoney)) as varchar(100)) rettype;
GO
-- bigint*smallmoney -> smallmoney
select cast(pg_typeof(CAST(5000 AS bigint) * CAST(42.1256 AS smallmoney)) as varchar(100)) rettype;
GO
-- bigint-smallmoney -> smallmoney
select cast(pg_typeof(CAST(5000 AS bigint) - CAST(42.1256 AS smallmoney)) as varchar(100)) rettype;
GO
-- bigint+smallmoney -> smallmoney
select cast(pg_typeof(CAST(5000 AS bigint) + CAST(42.1256 AS smallmoney)) as varchar(100)) rettype;
GO
-- real+smallmoney -> real
select cast(pg_typeof(CAST(324.463 AS real) + CAST(42.1256 AS smallmoney)) as varchar(100)) rettype;
GO
-- real*smallmoney -> real
select cast(pg_typeof(CAST(324.463 AS real) * CAST(42.1256 AS smallmoney)) as varchar(100)) rettype;
GO
-- real/smallmoney -> real
select cast(pg_typeof(CAST(324.463 AS real) / CAST(42.1256 AS smallmoney)) as varchar(100)) rettype;
GO
-- int/smallmoney -> smallmoney
select cast(pg_typeof(CAST(1000 AS int) / CAST(42.1256 AS smallmoney)) as varchar(100)) rettype;
GO
-- int-smallmoney -> smallmoney
select cast(pg_typeof(CAST(1000 AS int) - CAST(42.1256 AS smallmoney)) as varchar(100)) rettype;
GO
-- int+smallmoney -> smallmoney
select cast(pg_typeof(CAST(1000 AS int) + CAST(42.1256 AS smallmoney)) as varchar(100)) rettype;
GO
-- tinyint+smallmoney -> smallmoney
select cast(pg_typeof(CAST(10 AS tinyint) + CAST(42.1256 AS smallmoney)) as varchar(100)) rettype;
GO
-- smallint/smallmoney -> smallmoney
select cast(pg_typeof(CAST(100 AS smallint) / CAST(42.1256 AS smallmoney)) as varchar(100)) rettype;
GO
-- smallint*smallmoney -> smallmoney
select cast(pg_typeof(CAST(100 AS smallint) * CAST(42.1256 AS smallmoney)) as varchar(100)) rettype;
GO
-- smallint-smallmoney -> smallmoney
select cast(pg_typeof(CAST(100 AS smallint) - CAST(42.1256 AS smallmoney)) as varchar(100)) rettype;
GO
-- tinyint/smallmoney -> smallmoney
select cast(pg_typeof(CAST(10 AS tinyint) / CAST(42.1256 AS smallmoney)) as varchar(100)) rettype;
GO
-- smallmoney+smallmoney -> smallmoney
select cast(pg_typeof(CAST(42.1256 AS smallmoney) + CAST(42.1256 AS smallmoney)) as varchar(100)) rettype;
GO
-- smallmoney-smallmoney -> smallmoney
select cast(pg_typeof(CAST(42.1256 AS smallmoney) - CAST(42.1256 AS smallmoney)) as varchar(100)) rettype;
GO
-- smallmoney*smallmoney -> smallmoney
select cast(pg_typeof(CAST(42.1256 AS smallmoney) * CAST(42.1256 AS smallmoney)) as varchar(100)) rettype;
GO
-- smallmoney/smallmoney -> smallmoney
select cast(pg_typeof(CAST(42.1256 AS smallmoney) / CAST(42.1256 AS smallmoney)) as varchar(100)) rettype;
GO
-- real-bigint -> real
select cast(pg_typeof(CAST(324.463 AS real) - CAST(5000 AS bigint)) as varchar(100)) rettype;
GO
-- real/bigint -> real
select cast(pg_typeof(CAST(324.463 AS real) / CAST(5000 AS bigint)) as varchar(100)) rettype;
GO
-- smallmoney-bigint -> smallmoney
select cast(pg_typeof(CAST(42.1256 AS smallmoney) - CAST(5000 AS bigint)) as varchar(100)) rettype;
GO
-- smallmoney*bigint -> smallmoney
select cast(pg_typeof(CAST(42.1256 AS smallmoney) * CAST(5000 AS bigint)) as varchar(100)) rettype;
GO
-- real*tinyint -> real
select cast(pg_typeof(CAST(324.463 AS real) * CAST(10 AS tinyint)) as varchar(100)) rettype;
GO
-- real-tinyint -> real
select cast(pg_typeof(CAST(324.463 AS real) - CAST(10 AS tinyint)) as varchar(100)) rettype;
GO
-- smallmoney*tinyint -> smallmoney
select cast(pg_typeof(CAST(42.1256 AS smallmoney) * CAST(10 AS tinyint)) as varchar(100)) rettype;
GO
-- smallmoney-tinyint -> smallmoney
select cast(pg_typeof(CAST(42.1256 AS smallmoney) - CAST(10 AS tinyint)) as varchar(100)) rettype;
GO
-- smallmoney+tinyint -> smallmoney
select cast(pg_typeof(CAST(42.1256 AS smallmoney) + CAST(10 AS tinyint)) as varchar(100)) rettype;
GO
-- real+tinyint -> real
select cast(pg_typeof(CAST(324.463 AS real) + CAST(10 AS tinyint)) as varchar(100)) rettype;
GO
-- tinyint+tinyint -> tinyint
select cast(pg_typeof(CAST(10 AS tinyint) + CAST(10 AS tinyint)) as varchar(100)) rettype;
GO
-- tinyint-tinyint -> tinyint
select cast(pg_typeof(CAST(10 AS tinyint) - CAST(10 AS tinyint)) as varchar(100)) rettype;
GO
-- tinyint*tinyint -> tinyint
select cast(pg_typeof(CAST(10 AS tinyint) * CAST(10 AS tinyint)) as varchar(100)) rettype;
GO
-- tinyint/tinyint -> tinyint
select cast(pg_typeof(CAST(10 AS tinyint) / CAST(10 AS tinyint)) as varchar(100)) rettype;
GO
-- real+decimal(12,4) -> real
select cast(pg_typeof(CAST(324.463 AS real) + CAST(54535.5656 AS decimal(12,4))) as varchar(100)) rettype;
GO
-- real-int -> real
select cast(pg_typeof(CAST(324.463 AS real) - CAST(1000 AS int)) as varchar(100)) rettype;
GO
-- tinyint/money -> money
select cast(pg_typeof(CAST(10 AS tinyint) / CAST(420.2313 AS money)) as varchar(100)) rettype;
GO
-- bigint/money -> money
select cast(pg_typeof(CAST(5000 AS bigint) / CAST(420.2313 AS money)) as varchar(100)) rettype;
GO
-- real*money -> real
select cast(pg_typeof(CAST(324.463 AS real) * CAST(420.2313 AS money)) as varchar(100)) rettype;
GO
-- real+numeric(12,4) -> real
select cast(pg_typeof(CAST(324.463 AS real) + CAST(54535.5656 AS numeric(12,4))) as varchar(100)) rettype;
GO
-- money-real -> real
select cast(pg_typeof(CAST(420.2313 AS money) - CAST(324.463 AS real)) as varchar(100)) rettype;
GO
-- money/real -> real
select cast(pg_typeof(CAST(420.2313 AS money) / CAST(324.463 AS real)) as varchar(100)) rettype;
GO
-- decimal(12,4)/real -> real
select cast(pg_typeof(CAST(54535.5656 AS decimal(12,4)) / CAST(324.463 AS real)) as varchar(100)) rettype;
GO
-- numeric(12,4)+real -> real
select cast(pg_typeof(CAST(54535.5656 AS numeric(12,4)) + CAST(324.463 AS real)) as varchar(100)) rettype;
GO
-- int*real -> real
select cast(pg_typeof(CAST(1000 AS int) * CAST(324.463 AS real)) as varchar(100)) rettype;
GO
-- int-real -> real
select cast(pg_typeof(CAST(1000 AS int) - CAST(324.463 AS real)) as varchar(100)) rettype;
GO
-- bigint+real -> real
select cast(pg_typeof(CAST(5000 AS bigint) + CAST(324.463 AS real)) as varchar(100)) rettype;
GO
-- tinyint*real -> real
select cast(pg_typeof(CAST(10 AS tinyint) * CAST(324.463 AS real)) as varchar(100)) rettype;
GO
-- smallint/real -> real
select cast(pg_typeof(CAST(100 AS smallint) / CAST(324.463 AS real)) as varchar(100)) rettype;
GO
-- smallint-real -> real
select cast(pg_typeof(CAST(100 AS smallint) - CAST(324.463 AS real)) as varchar(100)) rettype;
GO
-- smallmoney/smallint -> smallmoney
select cast(pg_typeof(CAST(42.1256 AS smallmoney) / CAST(100 AS smallint)) as varchar(100)) rettype;
GO
-- smallmoney*smallint -> smallmoney
select cast(pg_typeof(CAST(42.1256 AS smallmoney) * CAST(100 AS smallint)) as varchar(100)) rettype;
GO
-- bigint/smallmoney -> smallmoney
select cast(pg_typeof(CAST(5000 AS bigint) / CAST(42.1256 AS smallmoney)) as varchar(100)) rettype;
GO
-- real-smallmoney -> real
select cast(pg_typeof(CAST(324.463 AS real) - CAST(42.1256 AS smallmoney)) as varchar(100)) rettype;
GO
-- int*smallmoney -> smallmoney
select cast(pg_typeof(CAST(1000 AS int) * CAST(42.1256 AS smallmoney)) as varchar(100)) rettype;
GO
-- smallint+smallmoney -> smallmoney
select cast(pg_typeof(CAST(100 AS smallint) + CAST(42.1256 AS smallmoney)) as varchar(100)) rettype;
GO
-- tinyint-smallmoney -> smallmoney
select cast(pg_typeof(CAST(10 AS tinyint) - CAST(42.1256 AS smallmoney)) as varchar(100)) rettype;
GO
-- smallmoney/tinyint -> smallmoney
select cast(pg_typeof(CAST(42.1256 AS smallmoney) / CAST(10 AS tinyint)) as varchar(100)) rettype;
GO
-- real/tinyint -> real
select cast(pg_typeof(CAST(324.463 AS real) / CAST(10 AS tinyint)) as varchar(100)) rettype;
GO | the_stack |
-- PAGES & BLOCKS
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_timeline_view', '_bx_timeline_page_title_sys_view', '_bx_timeline_page_title_view', 'bx_timeline', 5, 2147483647, 1, 'timeline-view', 'page.php?i=timeline-view', '', '', '', 0, 1, 0, 'BxTimelinePageView', 'modules/boonex/timeline/classes/BxTimelinePageView.php'),
('bx_timeline_view_home', '_bx_timeline_page_title_sys_view_home', '_bx_timeline_page_title_view_home', 'bx_timeline', 5, 2147483647, 1, 'timeline-view-home', 'page.php?i=timeline-view-home', '', '', '', 0, 1, 0, '', ''),
('bx_timeline_item', '_bx_timeline_page_title_sys_item', '_bx_timeline_page_title_item', 'bx_timeline', 5, 2147483647, 1, 'timeline-item', 'page.php?i=timeline-item', '', '', '', 0, 1, 0, '', '');
INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
('bx_timeline_view', 1, 'bx_timeline', '_bx_timeline_page_block_title_post', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:14:"get_block_post";}', 0, 0, 1),
('bx_timeline_view', 1, 'bx_timeline', '_bx_timeline_page_block_title_view', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:14:"get_block_view";}', 0, 0, 2),
('bx_timeline_view', 1, 'bx_timeline', '_bx_timeline_page_block_title_view_outline', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:22:"get_block_view_outline";}', 0, 0, 3),
('bx_timeline_view_home', 1, 'bx_timeline', '_bx_timeline_page_block_title_post_home', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:19:"get_block_post_home";}', 0, 0, 1),
('bx_timeline_view_home', 1, 'bx_timeline', '_bx_timeline_page_block_title_view_home', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:19:"get_block_view_home";}', 0, 0, 2),
('bx_timeline_view_home', 1, 'bx_timeline', '_bx_timeline_page_block_title_view_home_outline', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:27:"get_block_view_home_outline";}', 0, 0, 3),
('bx_timeline_item', 1, 'bx_timeline', '_bx_timeline_page_block_title_item', 0, 2147483647, 'service', 'a:2:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:14:"get_block_item";}', 0, 0, 1);
-- PAGES: add page block on dashboard
SET @iPBCellDashboard = 1;
SET @iPBOrderDashboard = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_pages_blocks` WHERE `object` = 'sys_dashboard' AND `cell_id` = @iPBCellDashboard LIMIT 1);
INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
('sys_dashboard', @iPBCellDashboard, 'bx_timeline', '_bx_timeline_page_block_title_view_account', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:22:"get_block_view_account";}', 0, 1, @iPBOrderDashboard + 1),
('sys_dashboard', @iPBCellDashboard, 'bx_timeline', '_bx_timeline_page_block_title_view_account_outline', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:30:"get_block_view_account_outline";}', 0, 1, @iPBOrderDashboard + 2);
-- PAGES: add page block on home
SET @iPBCellHome = 1;
SET @iPBOrderHome = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_pages_blocks` WHERE `object` = 'sys_home' AND `cell_id` = @iPBCellHome ORDER BY `order` DESC LIMIT 1);
INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
('sys_home', @iPBCellHome, 'bx_timeline', '_bx_timeline_page_block_title_post_home', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:19:"get_block_post_home";}', 0, 1, @iPBOrderHome + 1),
('sys_home', @iPBCellHome, 'bx_timeline', '_bx_timeline_page_block_title_view_home', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:19:"get_block_view_home";}', 0, 1, @iPBOrderHome + 2),
('sys_home', @iPBCellHome, 'bx_timeline', '_bx_timeline_page_block_title_view_home_outline', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:27:"get_block_view_home_outline";}', 0, 1, @iPBOrderHome + 3);
-- PAGES: add page block to profiles modules (trigger* page objects are processed separately upon modules enable/disable)
SET @iPBCellProfile = 2;
SET @iPBCellGroup = 4;
INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
('trigger_page_profile_view_entry', @iPBCellProfile, 'bx_timeline', '_bx_timeline_page_block_title_post_profile', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:22:"get_block_post_profile";s:6:"params";a:1:{i:0;s:6:"{type}";}}', 0, 0, 0),
('trigger_page_profile_view_entry', @iPBCellProfile, 'bx_timeline', '_bx_timeline_page_block_title_view_profile', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:22:"get_block_view_profile";s:6:"params";a:1:{i:0;s:6:"{type}";}}', 0, 0, 0),
('trigger_page_profile_view_entry', @iPBCellProfile, 'bx_timeline', '_bx_timeline_page_block_title_view_profile_outline', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:30:"get_block_view_profile_outline";s:6:"params";a:1:{i:0;s:6:"{type}";}}', 0, 0, 0),
('trigger_page_group_view_entry', @iPBCellGroup, 'bx_timeline', '_bx_timeline_page_block_title_post_profile', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:22:"get_block_post_profile";s:6:"params";a:1:{i:0;s:6:"{type}";}}', 0, 0, 0),
('trigger_page_group_view_entry', @iPBCellGroup, 'bx_timeline', '_bx_timeline_page_block_title_view_profile', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:22:"get_block_view_profile";s:6:"params";a:1:{i:0;s:6:"{type}";}}', 0, 0, 0),
('trigger_page_group_view_entry', @iPBCellGroup, 'bx_timeline', '_bx_timeline_page_block_title_view_profile_outline', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:22:"get_block_view_profile_outline";s:6:"params";a:1:{i:0;s:6:"{type}";}}', 0, 0, 0);
-- MENU: Item Share (Repost, Send to Friend, etc)
INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
('bx_timeline_menu_item_share', '_bx_timeline_menu_title_item_share', 'bx_timeline_menu_item_share', 'bx_timeline', 6, 0, 1, 'BxTimelineMenuItemShare', 'modules/boonex/timeline/classes/BxTimelineMenuItemShare.php');
INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES
('bx_timeline_menu_item_share', 'bx_timeline', '_bx_timeline_menu_set_title_item_share', 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_timeline_menu_item_share', 'bx_timeline', 'item-repost', '_bx_timeline_menu_item_title_system_item_repost', '_bx_timeline_menu_item_title_item_repost', 'javascript:void(0)', 'javascript:{js_onclick_repost}', '_self', 'repeat', '', 2147483647, 1, 0, 1),
('bx_timeline_menu_item_share', 'bx_timeline', 'item-send', '_bx_timeline_menu_item_title_system_item_send', '_bx_timeline_menu_item_title_item_send', 'page.php?i=start-convo&et={et_send}', '', '_self', 'envelope', '', 2147483647, 1, 0, 2);
-- MENU: Item Manage (Pin, Delete, etc)
INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
('bx_timeline_menu_item_manage', '_bx_timeline_menu_title_item_manage', 'bx_timeline_menu_item_manage', 'bx_timeline', 6, 0, 1, 'BxTimelineMenuItemManage', 'modules/boonex/timeline/classes/BxTimelineMenuItemManage.php');
INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES
('bx_timeline_menu_item_manage', 'bx_timeline', '_bx_timeline_menu_set_title_item_manage', 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_timeline_menu_item_manage', 'bx_timeline', 'item-pin', '_bx_timeline_menu_item_title_system_item_pin', '_bx_timeline_menu_item_title_item_pin', 'javascript:void(0)', 'javascript:{js_object_view}.pinPost(this, {content_id}, 1)', '_self', 'thumb-tack', '', 2147483647, 1, 0, 0),
('bx_timeline_menu_item_manage', 'bx_timeline', 'item-unpin', '_bx_timeline_menu_item_title_system_item_unpin', '_bx_timeline_menu_item_title_item_unpin', 'javascript:void(0)', 'javascript:{js_object_view}.pinPost(this, {content_id}, 0)', '_self', 'thumb-tack', '', 2147483647, 1, 0, 1),
('bx_timeline_menu_item_manage', 'bx_timeline', 'item-delete', '_bx_timeline_menu_item_title_system_item_delete', '_bx_timeline_menu_item_title_item_delete', 'javascript:void(0)', 'javascript:{js_object_view}.deletePost(this, {content_id})', '_self', 'remove', '', 2147483647, 1, 0, 2);
-- MENU: Item Actions (Comment, Vote, Share, Report, etc)
INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
('bx_timeline_menu_item_actions', '_bx_timeline_menu_title_item_actions', 'bx_timeline_menu_item_actions', 'bx_timeline', 15, 0, 1, 'BxTimelineMenuItemActions', 'modules/boonex/timeline/classes/BxTimelineMenuItemActions.php');
INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES
('bx_timeline_menu_item_actions', 'bx_timeline', '_bx_timeline_menu_set_title_item_actions', 0);
INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `submenu_object`, `submenu_popup`, `visible_for_levels`, `active`, `copyable`, `editable`, `order`) VALUES
('bx_timeline_menu_item_actions', 'bx_timeline', 'item-comment', '_bx_timeline_menu_item_title_system_item_comment', '_bx_timeline_menu_item_title_item_comment', 'javascript:void(0)', 'javascript:{comment_onclick}', '_self', 'comment', 'a:3:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:27:"get_menu_item_addon_comment";s:6:"params";a:3:{i:0;s:16:"{comment_system}";i:1;s:16:"{comment_object}";i:2;s:6:"{view}";}}', '', 0, 2147483647, 1, 0, 1, 1),
('bx_timeline_menu_item_actions', 'bx_timeline', 'item-vote', '_bx_timeline_menu_item_title_system_item_vote', '', 'javascript:void(0)', '', '', '', '', '', 0, 2147483647, 1, 0, 0, 2),
('bx_timeline_menu_item_actions', 'bx_timeline', 'item-share', '_bx_timeline_menu_item_title_system_item_share', '', 'javascript:void(0)', 'bx_menu_popup(''bx_timeline_menu_item_share'', this, {''id'':''bx_timeline_menu_item_share_{content_id}''}, {content_id:{content_id}});', '', 'share-alt', '', 'bx_timeline_menu_item_share', 1, 2147483647, 1, 0, 0, 3),
('bx_timeline_menu_item_actions', 'bx_timeline', 'item-report', '_bx_timeline_menu_item_title_system_item_report', '', 'javascript:void(0)', '', '', '', '', '', 0, 2147483647, 1, 0, 0, 4),
('bx_timeline_menu_item_actions', 'bx_timeline', 'item-more', '_bx_timeline_menu_item_title_system_item_more', '', 'javascript:void(0)', 'bx_menu_popup(''bx_timeline_menu_item_manage'', this, {''id'':''bx_timeline_menu_item_manage_{content_id}''}, {content_id:{content_id}});', '', 'ellipsis-h', '', 'bx_timeline_menu_item_manage', 1, 2147483647, 1, 0, 0, 5);
-- MENU: Post form attachments (Link, Photo, Video)
INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
('bx_timeline_menu_post_attachments', '_bx_timeline_menu_title_post_attachments', 'bx_timeline_menu_post_attachments', 'bx_timeline', 9, 0, 1, '', '');
INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES
('bx_timeline_menu_post_attachments', 'bx_timeline', '_bx_timeline_menu_set_title_post_attachments', 0);
INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `editable`, `order`) VALUES
('bx_timeline_menu_post_attachments', 'bx_timeline', 'add-link', '_bx_timeline_menu_item_title_system_add_link', '_bx_timeline_menu_item_title_add_link', 'javascript:void(0)', 'javascript:{js_object}.showAttachLink(this);', '_self', 'link', '', '', 2147483647, 1, 0, 1, 1),
('bx_timeline_menu_post_attachments', 'bx_timeline', 'add-photo', '_bx_timeline_menu_item_title_system_add_photo', '_bx_timeline_menu_item_title_add_photo', 'javascript:void(0)', 'javascript:{js_object_uploader_photo}.showUploaderForm();', '_self', 'camera', '', '', 2147483647, 1, 0, 1, 2),
('bx_timeline_menu_post_attachments', 'bx_timeline', 'add-video', '_bx_timeline_menu_item_title_system_add_video', '_bx_timeline_menu_item_title_add_video', 'javascript:void(0)', 'javascript:{js_object_uploader_video}.showUploaderForm();', '_self', 'video-camera', '', '', 2147483647, 1, 0, 1, 3);
-- MENU: add to "add content" menu
SET @iAddMenuOrder = (SELECT `order` FROM `sys_menu_items` WHERE `set_name` = 'sys_add_content_links' AND `active` = 1 ORDER BY `order` DESC LIMIT 1);
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
('sys_add_content_links', 'bx_timeline', 'create-post', '_bx_timeline_menu_item_title_system_create_entry', '_bx_timeline_menu_item_title_create_entry', 'page.php?i=timeline-view', '', '', 'clock-o col-green1', '', 2147483647, 1, 1, IFNULL(@iAddMenuOrder, 0) + 1);
-- MENU: add menu item to profiles modules (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_submenu', 'bx_timeline', 'timeline-view', '_bx_timeline_menu_item_title_system_view_timeline_view', '_bx_timeline_menu_item_title_view_timeline_view', 'page.php?i=timeline-view&profile_id={profile_id}', '', '', 'clock-o col-green1', '', 2147483647, 1, 0, 0),
('trigger_group_view_submenu', 'bx_timeline', 'timeline-view', '_bx_timeline_menu_item_title_system_view_timeline_view', '_bx_timeline_menu_item_title_view_timeline_view', 'page.php?i=timeline-view&profile_id={profile_id}', '', '', 'clock-o col-green1', '', 2147483647, 1, 0, 0);
-- 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_timeline', '_bx_timeline', 'bx_timeline@modules/boonex/timeline/|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_timeline', '_bx_timeline', 1);
SET @iCategId = LAST_INSERT_ID();
INSERT INTO `sys_options` (`name`, `value`, `category_id`, `caption`, `type`, `check`, `check_params`, `check_error`, `extra`, `order`) VALUES
('bx_timeline_enable_delete', 'on', @iCategId, '_bx_timeline_option_enable_delete', 'checkbox', '', '', '', '', 1),
('bx_timeline_events_per_page_profile', '10', @iCategId, '_bx_timeline_option_events_per_page_profile', 'digit', '', '', '', '', 2),
('bx_timeline_events_per_page_account', '20', @iCategId, '_bx_timeline_option_events_per_page_account', 'digit', '', '', '', '', 3),
('bx_timeline_events_per_page_home', '20', @iCategId, '_bx_timeline_option_events_per_page_home', 'digit', '', '', '', '', 4),
('bx_timeline_events_per_page', '20', @iCategId, '_bx_timeline_option_events_per_page', 'digit', '', '', '', '', 5),
('bx_timeline_rss_length', '5', @iCategId, '_bx_timeline_option_rss_length', 'digit', '', '', '', '', 6),
('bx_timeline_events_hide', '', @iCategId, '_bx_timeline_option_events_hide', 'rlist', '', '', '', 'a:2:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:21:"get_actions_checklist";}', 7),
('bx_timeline_chars_display_max', '300', @iCategId, '_bx_timeline_option_chars_display_max', 'digit', 'GreaterThan', 'a:1:{s:3:"min";i:150;}', '_bx_timeline_option_err_chars_display_max', '', 8);
-- PRIVACY
INSERT INTO `sys_objects_privacy` (`object`, `module`, `action`, `title`, `default_group`, `table`, `table_field_id`, `table_field_author`, `override_class_name`, `override_class_file`) VALUES
('bx_timeline_privacy_view', 'bx_timeline', 'view', '_bx_timeline_privacy_view', '3', 'bx_timeline_events', 'id', 'owner_id', 'BxTimelinePrivacy', 'modules/boonex/timeline/classes/BxTimelinePrivacy.php');
-- ACL
INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
('bx_timeline', 'post', NULL, '_bx_timeline_acl_action_post', '', 1, 3);
SET @iIdActionPost = LAST_INSERT_ID();
INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
('bx_timeline', 'delete', NULL, '_bx_timeline_acl_action_delete', '', 1, 3);
SET @iIdActionDelete = LAST_INSERT_ID();
INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
('bx_timeline', 'vote', NULL, '_bx_timeline_acl_action_vote', '', 1, 0);
SET @iIdActionVote = LAST_INSERT_ID();
INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
('bx_timeline', 'repost', NULL, '_bx_timeline_acl_action_repost', '', 1, 3);
SET @iIdActionRepost = LAST_INSERT_ID();
INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
('bx_timeline', 'send', NULL, '_bx_timeline_acl_action_send', '', 1, 3);
SET @iIdActionSend = LAST_INSERT_ID();
INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
('bx_timeline', 'pin', NULL, '_bx_timeline_acl_action_pin', '', 1, 3);
SET @iIdActionPin = 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
-- post
(@iStandard, @iIdActionPost),
(@iModerator, @iIdActionPost),
(@iAdministrator, @iIdActionPost),
(@iPremium, @iIdActionPost),
-- delete
(@iModerator, @iIdActionDelete),
(@iAdministrator, @iIdActionDelete),
-- vote
(@iStandard, @iIdActionVote),
(@iModerator, @iIdActionVote),
(@iAdministrator, @iIdActionVote),
(@iPremium, @iIdActionVote),
-- repost
(@iStandard, @iIdActionRepost),
(@iModerator, @iIdActionRepost),
(@iAdministrator, @iIdActionRepost),
(@iPremium, @iIdActionRepost),
-- send
(@iStandard, @iIdActionSend),
(@iModerator, @iIdActionSend),
(@iAdministrator, @iIdActionSend),
(@iPremium, @iIdActionSend),
-- pin
(@iModerator, @iIdActionPin),
(@iAdministrator, @iIdActionPin);
-- ALERTS
INSERT INTO `sys_alerts_handlers`(`name`, `class`, `file`, `service_call`) VALUES
('bx_timeline', 'BxTimelineResponse', 'modules/boonex/timeline/classes/BxTimelineResponse.php', '');
SET @iHandler := LAST_INSERT_ID();
INSERT INTO `sys_alerts` (`unit`, `action`, `handler_id`) VALUES
('profile', 'delete', @iHandler);
-- COMMENTS
INSERT INTO `sys_objects_cmts` (`Name`, `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_timeline', 'bx_timeline_comments', 1, 5000, 1000, 1, 5, 3, 'tail', 1, 'bottom', 1, 1, 1, -3, 1, 'cmt', 'page.php?i=timeline-item&id={object_id}', '', 'bx_timeline_events', 'id', 'object_id', 'title', 'comments', 'BxTimelineCmts', 'modules/boonex/timeline/classes/BxTimelineCmts.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_timeline', 'bx_timeline_views_track', '86400', '1', 'bx_timeline_events', 'id', 'object_id', 'views', '', '');
-- VOTES
INSERT INTO `sys_objects_vote`(`Name`, `TableMain`, `TableTrack`, `PostTimeout`, `MinValue`, `MaxValue`, `IsUndo`, `IsOn`, `TriggerTable`, `TriggerFieldId`, `TriggerFieldAuthor`, `TriggerFieldRate`, `TriggerFieldRateCount`, `ClassName`, `ClassFile`) VALUES
('bx_timeline', 'bx_timeline_votes', 'bx_timeline_votes_track', '604800', '1', '1', '0', '1', 'bx_timeline_events', 'id', 'object_id', 'rate', 'votes', 'BxTimelineVote', 'modules/boonex/timeline/classes/BxTimelineVote.php');
-- REPORTS
INSERT INTO `sys_objects_report` (`name`, `table_main`, `table_track`, `is_on`, `base_url`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES
('bx_timeline', 'bx_timeline_reports', 'bx_timeline_reports_track', '1', 'page.php?i=timeline-item&id={object_id}', 'bx_timeline_events', 'id', 'owner_id', 'reports', 'BxTimelineReport', 'modules/boonex/timeline/classes/BxTimelineReport.php');
-- SEARCH
SET @iSearchOrder = (SELECT IFNULL(MAX(`Order`), 0) FROM `sys_objects_search`);
INSERT INTO `sys_objects_search` (`ObjectName`, `Title`, `Order`, `ClassName`, `ClassPath`) VALUES
('bx_timeline', '_bx_timeline', @iSearchOrder + 1, 'BxTimelineSearchResult', 'modules/boonex/timeline/classes/BxTimelineSearchResult.php'),
('bx_timeline_cmts', '_bx_timeline_cmts', @iSearchOrder + 2, 'BxTimelineCmtsSearchResult', 'modules/boonex/timeline/classes/BxTimelineCmtsSearchResult.php');
-- METATAGS
INSERT INTO `sys_objects_metatags` (`object`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
('bx_timeline', 'bx_timeline_meta_keywords', 'bx_timeline_meta_locations', '', '', '');
-- EMAIL TEMPLATES
INSERT INTO `sys_email_templates` (`Module`, `NameSystem`, `Name`, `Subject`, `Body`) VALUES
('bx_timeline', '_bx_timeline_et_txt_name_send', 'bx_timeline_send', '_bx_timeline_et_txt_subject_send', '_bx_timeline_et_txt_body_send'); | the_stack |
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[LookupConnectionID]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[LookupConnectionID](
[ConnectionGUID] [nvarchar](1000) NOT NULL,
[ConnectionDescription] [nvarchar](1000) NOT NULL
) ON [PRIMARY]
INSERT [dbo].[LookupConnectionID] ([ConnectionGUID], [ConnectionDescription]) VALUES (N'{5F2826BC-648B-4f3e-B930-587F4EF331D4}', N'ODBC 2005')
INSERT [dbo].[LookupConnectionID] ([ConnectionGUID], [ConnectionDescription]) VALUES (N'{9B5D63AB-A629-4A56-9F3E-B1044134B649}', N'OLEDB 2005')
INSERT [dbo].[LookupConnectionID] ([ConnectionGUID], [ConnectionDescription]) VALUES (N'{72692A11-F5CC-42b8-869D-84E7C8E48B14}', N'ADO.NET 2005')
INSERT [dbo].[LookupConnectionID] ([ConnectionGUID], [ConnectionDescription]) VALUES (N'{4CF60474-BA87-4ac2-B9F3-B7B9179D4183}', N'ADO 2005')
INSERT [dbo].[LookupConnectionID] ([ConnectionGUID], [ConnectionDescription]) VALUES (N'RelationalDataSource', N'olap relational data source')
INSERT [dbo].[LookupConnectionID] ([ConnectionGUID], [ConnectionDescription]) VALUES (N'{09AD884B-0248-42C1-90E6-897D1CD16D37}', N'ODBC 2008')
INSERT [dbo].[LookupConnectionID] ([ConnectionGUID], [ConnectionDescription]) VALUES (N'{3BA51769-6C3C-46B2-85A1-81E58DB7DAE1}', N'OLEDB 2008')
INSERT [dbo].[LookupConnectionID] ([ConnectionGUID], [ConnectionDescription]) VALUES (N'{A1100566-934E-470C-9ECE-0D5EB920947D}', N'ADO 2008')
INSERT [dbo].[LookupConnectionID] ([ConnectionGUID], [ConnectionDescription]) VALUES (N'{894CAE21-539F-46EB-B36D-9381163B6C4E}', N'ADO.Net 2008')
END
GO
/****** Object: Table [dbo].[Audit] Script Date: 12/05/2009 20:31:46 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Audit]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Audit](
[PackageGUID] [varchar](50) NOT NULL,
[DataFlowTaskID] [int] NOT NULL,
[SourceReadRows] [int] NULL,
[SourceReadErrorRows] [int] NULL,
[CleansedRows] [int] NULL,
[TargetWriteRows] [int] NULL,
[TargetWriteErrorRows] [int] NULL,
[Comment] [nvarchar](255) NULL
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
/****** Object: Table [dbo].[Version] Script Date: 12/05/2009 20:31:46 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Version]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Version](
[VersionID] [int] NOT NULL,
[InstallDate] [datetime] NOT NULL,
CONSTRAINT [PK_Version] PRIMARY KEY CLUSTERED
(
[VersionID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
/****** Object: Table [dbo].[RunScan] Script Date: 12/05/2009 20:31:46 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[RunScan]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[RunScan](
[RunKey] [int] NOT NULL,
[RunDate] [datetime] NOT NULL,
[RunCommand] [nvarchar](512) NOT NULL,
CONSTRAINT [PK_RunScan] PRIMARY KEY CLUSTERED
(
[RunKey] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
IF NOT EXISTS (SELECT * FROM ::fn_listextendedproperty(N'MS_Description' , N'SCHEMA',N'dbo', N'TABLE',N'RunScan', NULL,NULL))
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Stores a row for each execution of the DependancyAnalyzer program' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'RunScan'
GO
/****** Object: Table [dbo].[ObjectTypes] Script Date: 12/05/2009 20:31:46 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[ObjectTypes]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[ObjectTypes](
[ObjectTypeKey] [nvarchar](255) NOT NULL,
[ObjectTypeName] [nvarchar](255) NULL,
[ObjectTypeDesc] [nvarchar](2000) NULL,
[ObjectMetaType] [nvarchar](255) NULL,
[Domain] [nvarchar](50) NULL
) ON [PRIMARY]
END
GO
/****** Object: Table [dbo].[Objects] Script Date: 12/05/2009 20:31:46 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Objects]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Objects](
[RunKey] [int] NOT NULL,
[ObjectKey] [int] NOT NULL,
[ObjectName] [nvarchar](1000) NULL,
[ObjectTypeString] [nvarchar](1000) NOT NULL,
[ObjectDesc] [nvarchar](1000) NULL,
CONSTRAINT [PK_Objects] PRIMARY KEY CLUSTERED
(
[RunKey] ASC,
[ObjectKey] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
/****** Object: Table [dbo].[ObjectDependencies] Script Date: 12/05/2009 20:31:46 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[ObjectDependencies]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[ObjectDependencies](
[RunKey] [int] NOT NULL,
[SrcObjectKey] [int] NOT NULL,
[TgtObjectKey] [int] NOT NULL,
[DependencyType] [nvarchar](50) NOT NULL,
CONSTRAINT [PK_ObjectDependencies] PRIMARY KEY CLUSTERED
(
[RunKey] ASC,
[SrcObjectKey] ASC,
[TgtObjectKey] ASC,
[DependencyType] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
/****** Object: Table [dbo].[ObjectAttributes] Script Date: 12/05/2009 20:31:46 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[ObjectAttributes]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[ObjectAttributes](
[RunKey] [int] NOT NULL,
[ObjectKey] [int] NOT NULL,
[ObjectAttrName] [nvarchar](1000) NOT NULL,
[ObjectAttrValue] [nvarchar](max) NOT NULL
) ON [PRIMARY]
END
GO
/****** Object: ForeignKey [FK_ObjectAttributes_Objects] Script Date: 12/05/2009 20:31:46 ******/
IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_ObjectAttributes_Objects]') AND parent_object_id = OBJECT_ID(N'[dbo].[ObjectAttributes]'))
ALTER TABLE [dbo].[ObjectAttributes] WITH CHECK ADD CONSTRAINT [FK_ObjectAttributes_Objects] FOREIGN KEY([RunKey], [ObjectKey])
REFERENCES [dbo].[Objects] ([RunKey], [ObjectKey])
GO
IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_ObjectAttributes_Objects]') AND parent_object_id = OBJECT_ID(N'[dbo].[ObjectAttributes]'))
ALTER TABLE [dbo].[ObjectAttributes] CHECK CONSTRAINT [FK_ObjectAttributes_Objects]
GO
/****** Object: ForeignKey [FK_ObjectDependencies_Objects] Script Date: 12/05/2009 20:31:46 ******/
IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_ObjectDependencies_Objects]') AND parent_object_id = OBJECT_ID(N'[dbo].[ObjectDependencies]'))
ALTER TABLE [dbo].[ObjectDependencies] WITH CHECK ADD CONSTRAINT [FK_ObjectDependencies_Objects] FOREIGN KEY([RunKey], [SrcObjectKey])
REFERENCES [dbo].[Objects] ([RunKey], [ObjectKey])
GO
IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_ObjectDependencies_Objects]') AND parent_object_id = OBJECT_ID(N'[dbo].[ObjectDependencies]'))
ALTER TABLE [dbo].[ObjectDependencies] CHECK CONSTRAINT [FK_ObjectDependencies_Objects]
GO
/****** Object: ForeignKey [FK_ObjectDependencies_Objects1] Script Date: 12/05/2009 20:31:46 ******/
IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_ObjectDependencies_Objects1]') AND parent_object_id = OBJECT_ID(N'[dbo].[ObjectDependencies]'))
ALTER TABLE [dbo].[ObjectDependencies] WITH CHECK ADD CONSTRAINT [FK_ObjectDependencies_Objects1] FOREIGN KEY([RunKey], [TgtObjectKey])
REFERENCES [dbo].[Objects] ([RunKey], [ObjectKey])
GO
IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_ObjectDependencies_Objects1]') AND parent_object_id = OBJECT_ID(N'[dbo].[ObjectDependencies]'))
ALTER TABLE [dbo].[ObjectDependencies] CHECK CONSTRAINT [FK_ObjectDependencies_Objects1]
GO
/****** Object: ForeignKey [FK_Objects_RunScan] Script Date: 12/05/2009 20:31:46 ******/
IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_Objects_RunScan]') AND parent_object_id = OBJECT_ID(N'[dbo].[Objects]'))
ALTER TABLE [dbo].[Objects] WITH CHECK ADD CONSTRAINT [FK_Objects_RunScan] FOREIGN KEY([RunKey])
REFERENCES [dbo].[RunScan] ([RunKey])
GO
IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_Objects_RunScan]') AND parent_object_id = OBJECT_ID(N'[dbo].[Objects]'))
ALTER TABLE [dbo].[Objects] CHECK CONSTRAINT [FK_Objects_RunScan]
GO
/* Start Views */
IF NOT EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[Connections]'))
EXEC dbo.sp_executesql @statement = N'CREATE VIEW [dbo].[Connections]
AS SELECT 1 AS Column1'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[SourceTables]'))
EXEC dbo.sp_executesql @statement = N'CREATE VIEW [dbo].[SourceTables]
AS SELECT 1 AS Column1'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[ObjectRelationships]'))
EXEC dbo.sp_executesql @statement = N'CREATE VIEW [dbo].[ObjectRelationships]
AS
SELECT 1 AS Column1'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[LineageMap]'))
EXEC dbo.sp_executesql @statement = N'CREATE VIEW [dbo].[LineageMap]
AS
SELECT 1 AS Column1'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[TargetTables]'))
EXEC dbo.sp_executesql @statement = N'CREATE VIEW [dbo].[TargetTables]
AS
SELECT 1 AS Column1'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[DataFlows]'))
EXEC dbo.sp_executesql @statement = N'CREATE VIEW [dbo].[DataFlows]
AS
SELECT 1 AS Column1'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[WalkSources]'))
EXEC dbo.sp_executesql @statement = N'CREATE VIEW [dbo].[WalkSources]
AS
SELECT 1 AS Column1'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[Packages]'))
EXEC dbo.sp_executesql @statement = N'CREATE VIEW [dbo].[Packages]
AS
SELECT 1 AS Column1'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[vAudit]'))
EXEC dbo.sp_executesql @statement = N'CREATE VIEW [dbo].[vAudit]
AS
SELECT 1 AS Column1'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[TableLineageMap]'))
EXEC dbo.sp_executesql @statement = N'CREATE VIEW [dbo].[TableLineageMap]
AS
SELECT 1 AS Column1'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[ConnectionsMapping]'))
EXEC dbo.sp_executesql @statement = N'CREATE VIEW [dbo].[ConnectionsMapping]
AS
SELECT 1 AS Column1'
GO
/* Start View Definitions */
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
GO
ALTER VIEW [dbo].[TargetTables]
AS
SELECT
Objects.RunKey,
ObjectDependencies.DependencyType,
Objects.ObjectKey,
Objects.ObjectName,
Objects.ObjectDesc,
ObjectDependencies.SrcObjectKey AS TgtComponentKey,
TargetObjects.ObjectName AS TargetComponentName,
TargetObjects.ObjectDesc AS TargetComponentDesc,
OD_DataFlow.SrcObjectKey AS DataFlowID,
OD_DestConnection.SrcObjectKey AS DestinationConnectionID
FROM dbo.Objects
INNER JOIN dbo.ObjectDependencies AS ObjectDependencies
ON Objects.ObjectKey = ObjectDependencies.TgtObjectKey
AND Objects.RunKey = ObjectDependencies.RunKey
INNER JOIN dbo.Objects AS TargetObjects
ON ObjectDependencies.SrcObjectKey = TargetObjects.ObjectKey
AND Objects.RunKey = TargetObjects.RunKey
AND ObjectDependencies.RunKey = TargetObjects.RunKey
INNER JOIN dbo.ObjectDependencies AS OD_DataFlow
ON ObjectDependencies.SrcObjectKey = OD_DataFlow.TgtObjectKey
AND ObjectDependencies.RunKey = OD_DataFlow.RunKey
INNER JOIN dbo.ObjectDependencies AS OD_DestConnection
ON Objects.ObjectKey = OD_DestConnection.TgtObjectKey
AND Objects.RunKey = OD_DestConnection.RunKey
WHERE ObjectDependencies.DependencyType = N'Map'
AND Objects.ObjectTypeString = N'Table'
AND OD_DataFlow.DependencyType = N'Containment'
AND OD_DestConnection.DependencyType = N'Containment'
GO
ALTER VIEW [dbo].[SourceTables]
AS
SELECT
dbo.Objects.RunKey,
dbo.Objects.ObjectKey,
dbo.Objects.ObjectName,
dbo.Objects.ObjectTypeString,
dbo.Objects.ObjectDesc,
dbo.ObjectDependencies.TgtObjectKey AS SrcComponentKey,
SourceObjects.ObjectName AS SourceObjectsName,
SourceObjects.ObjectDesc AS SourceObjectsDesc,
OD_DataFlow.SrcObjectKey AS DataFlowID,
OD_DestConnection.SrcObjectKey AS SourceConnectionID
FROM dbo.Objects
INNER JOIN dbo.ObjectDependencies
ON dbo.Objects.ObjectKey = dbo.ObjectDependencies.SrcObjectKey
AND dbo.Objects.RunKey = dbo.ObjectDependencies.RunKey
INNER JOIN dbo.ObjectDependencies AS OD_DataFlow
ON dbo.ObjectDependencies.TgtObjectKey = OD_DataFlow.TgtObjectKey
AND dbo.ObjectDependencies.RunKey = OD_DataFlow.RunKey
INNER JOIN dbo.Objects AS SourceObjects
ON dbo.ObjectDependencies.TgtObjectKey = SourceObjects.ObjectKey
AND dbo.ObjectDependencies.RunKey = SourceObjects.RunKey
INNER JOIN dbo.ObjectDependencies AS OD_DestConnection
ON dbo.Objects.ObjectKey = OD_DestConnection.TgtObjectKey
AND dbo.Objects.RunKey = OD_DestConnection.RunKey
WHERE dbo.ObjectDependencies.DependencyType = N'Map'
AND dbo.Objects.ObjectTypeString = N'Table'
AND OD_DataFlow.DependencyType = N'Containment'
AND OD_DataFlow.DependencyType = OD_DestConnection.DependencyType
GO
ALTER VIEW [dbo].[LineageMap]
AS
SELECT
RunKey,
SrcObjectKey,
TgtObjectKey
FROM dbo.ObjectDependencies
WHERE DependencyType = N'Map'
GO
ALTER VIEW [dbo].[WalkSources]
AS
WITH f(RunKey, osrc, tgt, lvl, objecttype)
AS
(SELECT Objects.RunKey, dbo.SourceTables.ObjectKey
, dbo.SourceTables.SrcComponentKey
, 0 AS Expr1
, dbo.Objects.ObjectTypeString
FROM dbo.SourceTables
INNER JOIN dbo.Objects
ON dbo.SourceTables.ObjectKey = dbo.Objects.ObjectKey
AND SourceTables.RunKey = Objects.RunKey
UNION ALL
SELECT Objects_1.RunKey, f_2.osrc
, dbo.LineageMap.TgtObjectKey
, f_2.lvl + 1 AS Expr1
, Objects_1.ObjectTypeString
FROM f AS f_2
INNER JOIN dbo.LineageMap
ON f_2.tgt = dbo.LineageMap.SrcObjectKey
INNER JOIN dbo.Objects AS Objects_1
ON dbo.LineageMap.TgtObjectKey = Objects_1.ObjectKey
AND LineageMap.RunKey = Objects_1.RunKey
WHERE (NOT (f_2.osrc = f_2.tgt)))
SELECT RunKey, osrc, tgt, lvl, objecttype
FROM f AS f_1
GO
ALTER VIEW [dbo].[ObjectRelationships]
AS
SELECT
RunKey,
SrcObjectKey AS ParentObjectKey,
TgtObjectKey AS ChildObjectKey
FROM dbo.ObjectDependencies
WHERE DependencyType = N'Containment'
GO
ALTER VIEW [dbo].[Packages]
AS
SELECT
Objects.RunKey,
Objects.ObjectKey AS PackageID,
Objects.ObjectName AS PackageName,
Objects.ObjectDesc AS PackageDesc,
PackageProperties.PackageLocation,
PackageProperties.PackageGUID
FROM [dbo].[Objects],
(SELECT
RunKey,
PackageProperties.ObjectKey,
[PackageLocation],
[PackageGUID]
FROM dbo.ObjectAttributes
PIVOT (
MIN (ObjectAttrValue)
FOR ObjectAttrName
IN ([PackageLocation], [PackageGUID])
) AS PackageProperties
) AS PackageProperties
WHERE [Objects].ObjectKey = PackageProperties.ObjectKey
AND [Objects].RunKey = PackageProperties.RunKey
AND [Objects].ObjectTypeString = N'SSIS Package'
GO
ALTER VIEW [dbo].[Connections]
AS
SELECT
[Objects].[RunKey],
[Objects].ObjectKey AS ConnectionID,
[Objects].ObjectName AS ConnectionName,
[Objects].ObjectDesc AS ConnectionDesc,
ConnectionString,
ConnectionProperties.[Server],
ConnectionProperties.[Database]
FROM [dbo].[Objects]
INNER JOIN
(SELECT
RunKey,
ConnectionProperties.ObjectKey,
ConnectionString,
[Server],
[Database]
FROM [dbo].[ObjectAttributes]
PIVOT
(
MIN(ObjectAttrValue) FOR ObjectAttrName
IN (ConnectionString, [Server], [Database])
) AS ConnectionProperties
) AS ConnectionProperties
ON [Objects].ObjectKey = ConnectionProperties.ObjectKey
AND [Objects].RunKey = ConnectionProperties.RunKey
INNER JOIN dbo.LookupConnectionID
ON ConnectionGUID = [Objects].ObjectTypeString
GO
ALTER VIEW [dbo].[TableLineageMap]
AS
SELECT
dbo.WalkSources.RunKey,
dbo.SourceTables.ObjectKey AS SourceTableObjectKey,
dbo.SourceTables.ObjectName AS SourceTable,
srel.ParentObjectKey AS SourceConnectionKey,
sconn.ConnectionName AS SourceConnectionName,
sconn.ConnectionString AS SourceConnectionString,
sconn.[Server] AS SourceServer,
sconn.[Database] AS SourceDatabase,
dbo.SourceTables.SrcComponentKey AS SourceComponentKey,
dbo.TargetTables.ObjectName AS TargetTable,
dbo.TargetTables.TgtComponentKey AS TargetComponentKey,
trel.ParentObjectKey AS TargetConnectionKey,
tconn.ConnectionName AS TargetConnectionName,
tconn.ConnectionString AS TargetConnectionString,
tconn.[Server] AS TargetServer,
tconn.[Database] AS TargetDatabase,
dfrel.ParentObjectKey AS DataFlowKey,
dbo.Packages.PackageName,
dbo.Packages.PackageDesc,
dbo.Packages.PackageLocation,
dbo.Packages.PackageGUID
FROM dbo.WalkSources
INNER JOIN dbo.SourceTables
ON dbo.WalkSources.osrc = dbo.SourceTables.ObjectKey
AND dbo.WalkSources.RunKey = dbo.SourceTables.RunKey
INNER JOIN dbo.TargetTables
ON dbo.WalkSources.tgt = dbo.TargetTables.ObjectKey
AND dbo.WalkSources.RunKey = dbo.TargetTables.RunKey
INNER JOIN dbo.ObjectRelationships AS srel
ON dbo.SourceTables.ObjectKey = srel.ChildObjectKey
AND dbo.SourceTables.RunKey = srel.RunKey
INNER JOIN dbo.ObjectRelationships AS trel
ON dbo.TargetTables.ObjectKey = trel.ChildObjectKey
AND dbo.TargetTables.RunKey = trel.RunKey
INNER JOIN dbo.ObjectRelationships AS dfrel
ON dbo.TargetTables.TgtComponentKey = dfrel.ChildObjectKey
AND dbo.TargetTables.RunKey = dfrel.RunKey
INNER JOIN dbo.ObjectRelationships AS pkgrel
ON dfrel.ParentObjectKey = pkgrel.ChildObjectKey
AND dfrel.RunKey = pkgrel.RunKey
INNER JOIN dbo.Packages
ON pkgrel.ParentObjectKey = dbo.Packages.PackageID
AND pkgrel.RunKey = dbo.Packages.RunKey
INNER JOIN dbo.Connections AS sconn
ON srel.ParentObjectKey = sconn.ConnectionID
AND srel.RunKey = sconn.RunKey
INNER JOIN dbo.Connections AS tconn
ON trel.ParentObjectKey = tconn.ConnectionID
AND trel.RunKey = tconn.RunKey
GO
ALTER VIEW [dbo].[DataFlows]
AS
SELECT
dbo.Objects.RunKey,
dbo.Objects.ObjectKey,
dbo.Objects.ObjectName,
dbo.Objects.ObjectDesc,
dbo.ObjectDependencies.SrcObjectKey AS PackageID
FROM dbo.Objects
INNER JOIN dbo.ObjectDependencies
ON dbo.Objects.ObjectKey = dbo.ObjectDependencies.TgtObjectKey
AND dbo.Objects.RunKey = dbo.ObjectDependencies.RunKey
WHERE dbo.Objects.ObjectTypeString IN (
N'{C3BF9DC1-4715-4694-936F-D3CFDA9E42C5}',
N'{E3CFBEA8-1F48-40D8-91E1-2DEDC1EDDD56}'
)
AND dbo.ObjectDependencies.DependencyType = N'Containment'
GO
ALTER VIEW [dbo].[ConnectionsMapping]
AS
SELECT DISTINCT
srel.ParentObjectKey AS SourceConnectionID,
trel.ParentObjectKey AS TargetConnectionID
FROM dbo.WalkSources
INNER JOIN dbo.SourceTables
ON dbo.WalkSources.osrc = dbo.SourceTables.ObjectKey
AND dbo.WalkSources.RunKey = dbo.SourceTables.RunKey
INNER JOIN dbo.TargetTables
ON dbo.WalkSources.tgt = dbo.TargetTables.ObjectKey
AND dbo.WalkSources.RunKey = dbo.TargetTables.RunKey
INNER JOIN dbo.ObjectRelationships AS srel
ON dbo.SourceTables.ObjectKey = srel.ChildObjectKey
AND srel.RunKey = dbo.SourceTables.RunKey
INNER JOIN dbo.ObjectRelationships AS trel
ON dbo.TargetTables.ObjectKey = trel.ChildObjectKey
AND dbo.TargetTables.RunKey = trel.RunKey
GO
/* End Views */
-- Alpha 4
INSERT INTO dbo.Version
(VersionID, InstallDate)
VALUES
(4, GETDATE())
GO
/****** Object: View [dbo].[WalkSources] Script Date: 04/05/2010 22:06:05 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER VIEW [dbo].[WalkSources]
AS
WITH WalkSourceCTE(RunKey, osrc, tgt, lvl, objecttype, ParentString)
AS
(
SELECT Objects.RunKey
, dbo.SourceTables.ObjectKey
, dbo.SourceTables.SrcComponentKey
, 0 AS Expr1
, dbo.Objects.ObjectTypeString
, CAST(',' + CAST(dbo.SourceTables.ObjectKey as varchar(14)) + ',' AS VARCHAR(2000)) AS ParentString
FROM dbo.SourceTables
INNER JOIN dbo.Objects
ON dbo.SourceTables.ObjectKey = dbo.Objects.ObjectKey
AND SourceTables.RunKey = Objects.RunKey
UNION ALL
SELECT Objects.RunKey
, WalkSourceCTE.osrc
, dbo.LineageMap.TgtObjectKey
, WalkSourceCTE.lvl + 1 AS Expr1
, Objects.ObjectTypeString
, CAST(WalkSourceCTE.ParentString + CAST(WalkSourceCTE.tgt as varchar(14)) + ',' AS VARCHAR(2000)) AS ParentString
FROM WalkSourceCTE
INNER JOIN dbo.LineageMap
ON WalkSourceCTE.tgt = dbo.LineageMap.SrcObjectKey
AND WalkSourceCTE.RunKey = dbo.LineageMap.RunKey
INNER JOIN dbo.Objects
ON dbo.LineageMap.TgtObjectKey = Objects.ObjectKey
AND LineageMap.RunKey = Objects.RunKey
WHERE NOT ((WalkSourceCTE.osrc = WalkSourceCTE.tgt)
OR CHARINDEX(',' + CAST(WalkSourceCTE.tgt AS VARCHAR(40)) + ',', WalkSourceCTE.ParentString) > 0)
)
SELECT RunKey, osrc, tgt, lvl, objecttype
FROM WalkSourceCTE
GO
-- Alpha 5
INSERT INTO dbo.Version
(VersionID, InstallDate)
VALUES
(5, GETDATE())
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[usp_RetrieveRunIDs]') AND type in (N'P', N'PC'))
EXEC ('CREATE PROCEDURE [dbo].[usp_RetrieveRunIDs] AS SELECT 1')
GO
-- =============================================
-- Author: Keith Martin
-- Create date: 2011-11-16
-- Description: Retrieves the list of Run's
-- =============================================
ALTER PROCEDURE [dbo].[usp_RetrieveRunIDs]
AS
BEGIN
SET NOCOUNT ON;
SELECT [RunKey] ,CONVERT(NVARCHAR(40), [RunDate], 120) + CHAR(9) + [RunCommand] FROM [dbo].[RunScan]
END
GO
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[fn_IntCSVSplit]') AND type in (N'FN', N'IF', N'TF', N'FS', N'FT'))
DROP FUNCTION [dbo].[fn_IntCSVSplit]
GO
-- =============================================
-- Author: Keith Martin
-- Create date: 2011-11-16
-- Description: Retrieves a table of integers from a csv string
-- =============================================
CREATE FUNCTION [dbo].[fn_IntCSVSplit]
( @RowData NVARCHAR(MAX) )
RETURNS @RtnValue TABLE
( Data INT )
AS
BEGIN
DECLARE @Iterator INT
DECLARE @WorkString NVARCHAR(MAX)
SET @Iterator = 1
DECLARE @FoundIndex INT
SET @FoundIndex = CHARINDEX(',',@RowData)
WHILE (@FoundIndex>0)
BEGIN
SET @WorkString = LTRIM(RTRIM(SUBSTRING(@RowData, 1, @FoundIndex - 1)))
IF ISNUMERIC(@WorkString) = 1
BEGIN
INSERT INTO @RtnValue (data) VALUES (@WorkString)
END
ELSE
BEGIN
INSERT INTO @RtnValue (data) VALUES(NULL)
END
SET @RowData = SUBSTRING(@RowData, @FoundIndex + 1,LEN(@RowData))
SET @Iterator = @Iterator + 1
SET @FoundIndex = CHARINDEX(',', @RowData)
END
IF ISNUMERIC(LTRIM(RTRIM(@RowData))) = 1
BEGIN
INSERT INTO @RtnValue (Data) SELECT LTRIM(RTRIM(@RowData))
END
RETURN
END
GO
IF NOT EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[usp_RetrieveObjects]') AND type in (N'P', N'PC'))
EXEC ('CREATE PROCEDURE [dbo].[usp_RetrieveObjects] AS SELECT 1')
GO
-- =============================================
-- Author: Keith Martin
-- Create date: 2011-11-16
-- Description: Retrieves the list of Objects
-- =============================================
ALTER PROCEDURE [dbo].[usp_RetrieveObjects]
@RunList nvarchar(max)
AS
BEGIN
SET NOCOUNT ON;
SELECT [ObjectKey], [ObjectName], [Objects].[ObjectTypeString], [ObjectTypes].[ObjectTypeName], [RunKey]
FROM [dbo].[Objects]
LEFT OUTER JOIN [dbo].[ObjectTypes]
ON [Objects].[ObjectTypeString] = [ObjectTypes].[ObjectTypeKey]
INNER JOIN [dbo].[fn_IntCSVSplit](@RunList) AS Filter
ON Filter.Data = [RunKey]
END
GO
IF NOT EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[usp_RetrieveLineageMap]') AND type in (N'P', N'PC'))
EXEC ('CREATE PROCEDURE [dbo].[usp_RetrieveLineageMap] AS SELECT 1')
GO
-- =============================================
-- Author: Keith Martin
-- Create date: 2011-11-16
-- Description: Retrieves the list of LineageMap
-- =============================================
ALTER PROCEDURE [dbo].[usp_RetrieveLineageMap]
@RunList nvarchar(max)
AS
BEGIN
SET NOCOUNT ON;
SELECT [SrcObjectKey], [TgtObjectKey], [DependencyType]
FROM [dbo].[ObjectDependencies]
INNER JOIN [dbo].[fn_IntCSVSplit](@RunList) AS Filter
ON Filter.Data = [RunKey]
END
GO
IF NOT EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[usp_RetrieveObjectDetails]') AND type in (N'P', N'PC'))
EXEC ('CREATE PROCEDURE [dbo].[usp_RetrieveObjectDetails] AS SELECT 1')
GO
-- =============================================
-- Author: Keith Martin
-- Create date: 2011-11-16
-- Description: Retrieves the ObjectDetails
-- =============================================
ALTER PROCEDURE [dbo].[usp_RetrieveObjectDetails]
@RunList nvarchar(max)
, @ObjectKey INT
AS
BEGIN
SET NOCOUNT ON;
SELECT [ObjectTypeString], [ObjectDesc]
FROM [dbo].[Objects]
INNER JOIN [dbo].[fn_IntCSVSplit](@RunList) AS Filter
ON Filter.Data = [RunKey]
AND ObjectKey = @ObjectKey
END
GO
IF NOT EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[usp_RetrieveObjectTypes]') AND type in (N'P', N'PC'))
EXEC ('CREATE PROCEDURE [dbo].[usp_RetrieveObjectTypes] AS SELECT 1')
GO
-- =============================================
-- Author: Keith Martin
-- Create date: 2011-11-16
-- Description: Retrieves the ObjectTypes
-- =============================================
ALTER PROCEDURE [dbo].[usp_RetrieveObjectTypes]
@ObjectTypeKey NVARCHAR(255)
AS
BEGIN
SET NOCOUNT ON;
SELECT [ObjectTypeName]
FROM [dbo].[ObjectTypes]
WHERE ObjectTypeKey = @ObjectTypeKey
END
GO
IF NOT EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[usp_RetrieveObjectAttributes]') AND type in (N'P', N'PC'))
EXEC ('CREATE PROCEDURE [dbo].[usp_RetrieveObjectAttributes] AS SELECT 1')
GO
-- =============================================
-- Author: Keith Martin
-- Create date: 2011-11-16
-- Description: Retrieves the ObjectAttributes
-- =============================================
ALTER PROCEDURE [dbo].[usp_RetrieveObjectAttributes]
@RunList nvarchar(max)
, @ObjectKey INT
AS
BEGIN
SET NOCOUNT ON;
SELECT [ObjectAttrName], [ObjectAttrValue]
FROM [dbo].[ObjectAttributes]
INNER JOIN [dbo].[fn_IntCSVSplit](@RunList) AS Filter
ON Filter.Data = [RunKey]
AND ObjectKey = @ObjectKey
ORDER BY [ObjectAttrName];
END
GO
IF NOT EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[usp_RetrieveContainedTargetDependencies]') AND type in (N'P', N'PC'))
EXEC ('CREATE PROCEDURE [dbo].[usp_RetrieveContainedTargetDependencies] AS SELECT 1')
GO
-- =============================================
-- Author: Keith Martin
-- Create date: 2011-11-16
-- Description: Retrieves the Contained Target Dependencies
-- =============================================
ALTER PROCEDURE [dbo].[usp_RetrieveContainedTargetDependencies]
@RunList nvarchar(max)
, @TgtObjectKey INT
AS
BEGIN
SET NOCOUNT ON;
SELECT [SrcObjectKey]
FROM [dbo].[ObjectDependencies]
INNER JOIN [dbo].[fn_IntCSVSplit](@RunList) AS Filter
ON Filter.Data = [RunKey]
AND [DependencyType] = 'Containment'
AND [TgtObjectKey] = @TgtObjectKey
END
GO
IF NOT EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[usp_RetrieveSSASObjects]') AND type in (N'P', N'PC'))
EXEC ('CREATE PROCEDURE [dbo].[usp_RetrieveSSASObjects] AS SELECT 1')
GO
-- =============================================
-- Author: Keith Martin
-- Create date: 2011-11-16
-- Description: Retrieves the SSAS Objects
-- =============================================
ALTER PROCEDURE [dbo].[usp_RetrieveSSASObjects]
@RunList nvarchar(max)
AS
BEGIN
SET NOCOUNT ON;
SELECT [ObjectKey], [ObjectName]
FROM [dbo].[Objects]
INNER JOIN [dbo].[fn_IntCSVSplit](@RunList) AS Filter
ON Filter.Data = [RunKey]
AND [ObjectTypeString] = 'Ssas.Analysis Server'
ORDER BY [ObjectName]
END
GO
IF NOT EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[usp_RetrieveSQLSObjects]') AND type in (N'P', N'PC'))
EXEC ('CREATE PROCEDURE [dbo].[usp_RetrieveSQLSObjects] AS SELECT 1')
GO
-- =============================================
-- Author: Keith Martin
-- Create date: 2011-11-16
-- Description: Retrieves the SQL Server Objects
-- =============================================
ALTER PROCEDURE [dbo].[usp_RetrieveSQLSObjects]
@RunList nvarchar(max)
AS
BEGIN
SET NOCOUNT ON;
SELECT ConnectionID, ISNULL([Server], ConnectionName) + ISNULL('.' + [Database], '') as DisplayName
FROM [dbo].[Connections]
INNER JOIN [dbo].[fn_IntCSVSplit](@RunList) AS Filter
ON Filter.Data = [RunKey]
ORDER BY DisplayName
END
GO
IF NOT EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[usp_RetrieveSSRSObjects]') AND type in (N'P', N'PC'))
EXEC ('CREATE PROCEDURE [dbo].[usp_RetrieveSSRSObjects] AS SELECT 1')
GO
-- =============================================
-- Author: Keith Martin
-- Create date: 2011-11-16
-- Description: Retrieves the SSRS Objects
-- =============================================
ALTER PROCEDURE [dbo].[usp_RetrieveSSRSObjects]
@RunList nvarchar(max)
AS
BEGIN
SET NOCOUNT ON;
SELECT [ObjectKey], [ObjectName]
FROM [dbo].[Objects]
INNER JOIN [dbo].[fn_IntCSVSplit](@RunList) AS Filter
ON Filter.Data = [RunKey]
AND [ObjectTypeString] = 'ReportServer'
ORDER BY [ObjectName]
END
GO
IF NOT EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[usp_RetrieveFileObjects]') AND type in (N'P', N'PC'))
EXEC ('CREATE PROCEDURE [dbo].[usp_RetrieveFileObjects] AS SELECT 1')
GO
-- =============================================
-- Author: Keith Martin
-- Create date: 2011-11-16
-- Description: Retrieves the File Server Objects
-- =============================================
ALTER PROCEDURE [dbo].[usp_RetrieveFileObjects]
@RunList nvarchar(max)
AS
BEGIN
SET NOCOUNT ON;
SELECT [ObjectKey], [ObjectName]
FROM [dbo].[Objects]
INNER JOIN [dbo].[fn_IntCSVSplit](@RunList) AS Filter
ON Filter.Data = [RunKey]
AND [ObjectTypeString] = 'Machine'
ORDER BY [ObjectName]
END
GO
IF NOT EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[usp_RetrieveSSISObjects]') AND type in (N'P', N'PC'))
EXEC ('CREATE PROCEDURE [dbo].[usp_RetrieveSSISObjects] AS SELECT 1')
GO
-- =============================================
-- Author: Keith Martin
-- Create date: 2011-11-16
-- Description: Retrieves the SSIS Objects
-- =============================================
ALTER PROCEDURE [dbo].[usp_RetrieveSSISObjects]
@RunList nvarchar(max)
AS
BEGIN
SET NOCOUNT ON;
SELECT [PackageID], [PackageLocation]
FROM [dbo].[Packages]
INNER JOIN [dbo].[fn_IntCSVSplit](@RunList) AS Filter
ON Filter.Data = [RunKey]
ORDER BY [PackageID]
END
GO
IF NOT EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[usp_RetrieveContained]') AND type in (N'P', N'PC'))
EXEC ('CREATE PROCEDURE [dbo].[usp_RetrieveContained] AS SELECT 1')
GO
-- =============================================
-- Author: Keith Martin
-- Create date: 2011-11-16
-- Description: Retrieves the Children of this Containment Object
-- =============================================
ALTER PROCEDURE [dbo].[usp_RetrieveContained]
@SrcObjectKey INT
AS
BEGIN
SET NOCOUNT ON;
SELECT DISTINCT TgtObjectKey, ObjectName, ISNULL(ObjectTypes.ObjectTypeName, ObjectTypeString) as ObjectTypeString
FROM [dbo].[ObjectDependencies]
INNER JOIN [dbo].[Objects]
ON ObjectKey = TgtObjectKey
AND [DependencyType] = 'Containment'
AND SrcObjectKey = @SrcObjectKey
LEFT OUTER JOIN [dbo].[ObjectTypes]
ON ObjectTypes.ObjectTypeKey = ObjectTypeString
ORDER BY ObjectTypeString, ObjectName
END
GO
INSERT INTO dbo.Version
(VersionID, InstallDate)
VALUES
(6, GETDATE())
GO | the_stack |
-- 2019-04-01T14:19:58.266
-- 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,567353,578276,0,541014,0,TO_TIMESTAMP('2019-04-01 14:19:58','YYYY-MM-DD HH24:MI:SS'),100,0,'de.metas.vertical.pharma',0,'Y','Y','Y','N','N','N','N','N','Betäubungsmittel',510,500,0,1,1,TO_TIMESTAMP('2019-04-01 14:19:58','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-04-01T14:19:58.269
-- 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=578276 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)
;
-- 2019-04-01T14:21:57.572
-- 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,578276,0,541014,541547,558148,'F',TO_TIMESTAMP('2019-04-01 14:21:57','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','N',0,'IsPharmaCustomerNarcoticsPermission',100,0,0,TO_TIMESTAMP('2019-04-01 14:21:57','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-04-01T14:22:41.451
-- 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,567354,578277,0,541015,0,TO_TIMESTAMP('2019-04-01 14:22:41','YYYY-MM-DD HH24:MI:SS'),100,0,'de.metas.vertical.pharma',0,'Y','Y','Y','N','N','N','N','N','Betäubungsmittel',280,260,0,1,1,TO_TIMESTAMP('2019-04-01 14:22:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-04-01T14:22:41.453
-- 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=578277 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)
;
-- 2019-04-01T14:23:35.932
-- 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,578277,0,541015,541548,558149,'F',TO_TIMESTAMP('2019-04-01 14:23:35','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','N',0,'IsPharmaVendorNarcoticsPermission',60,0,0,TO_TIMESTAMP('2019-04-01 14:23:35','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-04-01T14:27:31.138
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=40,Updated=TO_TIMESTAMP('2019-04-01 14:27:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=550680
;
-- 2019-04-01T14:27:31.146
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=50,Updated=TO_TIMESTAMP('2019-04-01 14:27:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=551497
;
-- 2019-04-01T14:27:31.153
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=60,Updated=TO_TIMESTAMP('2019-04-01 14:27:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=550676
;
-- 2019-04-01T14:27:31.159
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=70,Updated=TO_TIMESTAMP('2019-04-01 14:27:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=550677
;
-- 2019-04-01T14:27:31.164
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=80,Updated=TO_TIMESTAMP('2019-04-01 14:27:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=551496
;
-- 2019-04-01T14:27:31.170
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=90,Updated=TO_TIMESTAMP('2019-04-01 14:27:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=551495
;
-- 2019-04-01T14:27:31.178
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=100,Updated=TO_TIMESTAMP('2019-04-01 14:27:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=551505
;
-- 2019-04-01T14:27:31.185
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=110,Updated=TO_TIMESTAMP('2019-04-01 14:27:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=550673
;
-- 2019-04-01T14:27:31.192
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=120,Updated=TO_TIMESTAMP('2019-04-01 14:27:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=550683
;
-- 2019-04-01T14:27:31.198
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=130,Updated=TO_TIMESTAMP('2019-04-01 14:27:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=550681
;
-- 2019-04-01T14:27:31.203
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=140,Updated=TO_TIMESTAMP('2019-04-01 14:27:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552280
;
-- 2019-04-01T14:27:31.209
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=150,Updated=TO_TIMESTAMP('2019-04-01 14:27:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=550674
;
-- 2019-04-01T14:27:31.214
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=160,Updated=TO_TIMESTAMP('2019-04-01 14:27:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=550685
;
-- 2019-04-01T14:27:31.219
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=170,Updated=TO_TIMESTAMP('2019-04-01 14:27:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=550686
;
-- 2019-04-01T14:27:31.225
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=180,Updated=TO_TIMESTAMP('2019-04-01 14:27:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=550687
;
-- 2019-04-01T14:27:31.230
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=190,Updated=TO_TIMESTAMP('2019-04-01 14:27:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=550688
;
-- 2019-04-01T14:27:31.235
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=200,Updated=TO_TIMESTAMP('2019-04-01 14:27:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=550689
;
-- 2019-04-01T14:27:31.241
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=210,Updated=TO_TIMESTAMP('2019-04-01 14:27:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558149
;
-- 2019-04-01T14:27:49.529
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=60,Updated=TO_TIMESTAMP('2019-04-01 14:27:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558149
;
-- 2019-04-01T14:27:49.537
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=70,Updated=TO_TIMESTAMP('2019-04-01 14:27:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=550676
;
-- 2019-04-01T14:27:49.544
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=80,Updated=TO_TIMESTAMP('2019-04-01 14:27:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=550677
;
-- 2019-04-01T14:27:49.553
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=90,Updated=TO_TIMESTAMP('2019-04-01 14:27:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=551496
;
-- 2019-04-01T14:27:49.561
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=100,Updated=TO_TIMESTAMP('2019-04-01 14:27:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=551495
;
-- 2019-04-01T14:27:49.568
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=110,Updated=TO_TIMESTAMP('2019-04-01 14:27:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=551505
;
-- 2019-04-01T14:27:49.577
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=120,Updated=TO_TIMESTAMP('2019-04-01 14:27:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=550673
;
-- 2019-04-01T14:27:49.585
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=130,Updated=TO_TIMESTAMP('2019-04-01 14:27:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=550683
;
-- 2019-04-01T14:27:49.592
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=140,Updated=TO_TIMESTAMP('2019-04-01 14:27:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=550681
;
-- 2019-04-01T14:27:49.602
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=150,Updated=TO_TIMESTAMP('2019-04-01 14:27:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552280
;
-- 2019-04-01T14:27:49.607
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=160,Updated=TO_TIMESTAMP('2019-04-01 14:27:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=550674
;
-- 2019-04-01T14:27:49.612
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=170,Updated=TO_TIMESTAMP('2019-04-01 14:27:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=550685
;
-- 2019-04-01T14:27:49.617
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=180,Updated=TO_TIMESTAMP('2019-04-01 14:27:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=550686
;
-- 2019-04-01T14:27:49.623
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=190,Updated=TO_TIMESTAMP('2019-04-01 14:27:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=550687
;
-- 2019-04-01T14:27:49.628
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=200,Updated=TO_TIMESTAMP('2019-04-01 14:27:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=550688
;
-- 2019-04-01T14:27:49.633
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=210,Updated=TO_TIMESTAMP('2019-04-01 14:27:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=550689
;
-- 2019-04-01T14:29:52.208
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsReadOnly='Y',Updated=TO_TIMESTAMP('2019-04-01 14:29:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=578277
;
-- 2019-04-01T14:31:45.881
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=40,Updated=TO_TIMESTAMP('2019-04-01 14:31:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=551497
;
-- 2019-04-01T14:31:52.204
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=30,Updated=TO_TIMESTAMP('2019-04-01 14:31:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558149
;
-- 2019-04-01T14:31:54.630
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=50,Updated=TO_TIMESTAMP('2019-04-01 14:31:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=551503
;
-- 2019-04-01T14:31:59.147
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=60,Updated=TO_TIMESTAMP('2019-04-01 14:31:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=551505
;
-- 2019-04-01T14:34:07.967
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsReadOnly='Y',Updated=TO_TIMESTAMP('2019-04-01 14:34:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=578276
;
-- 2019-04-01T14:36:04.022
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET Name='Pharma Narcotic', PrintName='Pharma Narcotic',Updated=TO_TIMESTAMP('2019-04-01 14:36:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=576507 AND AD_Language='en_US'
;
-- 2019-04-01T14:36:04.067
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(576507,'en_US')
;
-- 2019-04-01T14:37:17.668
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET Name='Pharma Narcotics', PrintName='Pharma Narcotics',Updated=TO_TIMESTAMP('2019-04-01 14:37:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=576507 AND AD_Language='en_US'
;
-- 2019-04-01T14:37:17.671
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(576507,'en_US')
;
-- 2019-04-01T14:37:26.344
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET PrintName='Pharma Narcotic',Updated=TO_TIMESTAMP('2019-04-01 14:37:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=576506 AND AD_Language='en_US'
;
-- 2019-04-01T14:37:26.347
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(576506,'en_US')
;
-- 2019-04-01T14:37:44.896
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET PrintName='Pharma Narcotics',Updated=TO_TIMESTAMP('2019-04-01 14:37:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=576506 AND AD_Language='en_US'
;
-- 2019-04-01T14:37:44.901
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(576506,'en_US')
;
-- 2019-04-01T14:39:06.099
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=60,Updated=TO_TIMESTAMP('2019-04-01 14:39:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558148
;
-- 2019-04-01T14:39:08.871
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=70,Updated=TO_TIMESTAMP('2019-04-01 14:39:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=551504
;
-- 2019-04-01T14:39:10.651
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=80,Updated=TO_TIMESTAMP('2019-04-01 14:39:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=551501
;
-- 2019-04-01T14:39:12.072
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=90,Updated=TO_TIMESTAMP('2019-04-01 14:39:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=551919
;
-- 2019-04-01T14:39:13.573
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=100,Updated=TO_TIMESTAMP('2019-04-01 14:39:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=551920
;
-- 2019-04-01T14:40:26.185
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=90,Updated=TO_TIMESTAMP('2019-04-01 14:40:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=558148
;
-- 2019-04-01T14:40:26.193
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=100,Updated=TO_TIMESTAMP('2019-04-01 14:40:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=551504
;
-- 2019-04-01T14:40:26.199
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=110,Updated=TO_TIMESTAMP('2019-04-01 14:40:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552278
;
-- 2019-04-01T14:40:26.206
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=120,Updated=TO_TIMESTAMP('2019-04-01 14:40:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552279
;
-- 2019-04-01T14:40:26.213
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=130,Updated=TO_TIMESTAMP('2019-04-01 14:40:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=550651
;
-- 2019-04-01T14:40:26.218
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=140,Updated=TO_TIMESTAMP('2019-04-01 14:40:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=550652
;
-- 2019-04-01T14:40:26.224
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=150,Updated=TO_TIMESTAMP('2019-04-01 14:40:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=550650
;
-- 2019-04-01T14:40:26.230
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=160,Updated=TO_TIMESTAMP('2019-04-01 14:40:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=550653
;
-- 2019-04-01T14:40:26.236
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=170,Updated=TO_TIMESTAMP('2019-04-01 14:40:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=550656
;
-- 2019-04-01T14:40:26.244
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=180,Updated=TO_TIMESTAMP('2019-04-01 14:40:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=550667
;
-- 2019-04-01T14:40:26.251
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=190,Updated=TO_TIMESTAMP('2019-04-01 14:40:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=550642
; | the_stack |
--
-- PostgreSQL database dump
--
-- Dumped from database version 9.4.21
-- Dumped by pg_dump version 9.6.13
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: plpgsql; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
--
-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: -
--
COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
SET default_tablespace = '';
SET default_with_oids = false;
--
-- Name: article_groups; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.article_groups (
id integer NOT NULL,
group_id integer NOT NULL,
article_id integer NOT NULL,
index_in_group integer NOT NULL,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
--
-- Name: article_groups_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.article_groups_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: article_groups_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.article_groups_id_seq OWNED BY public.article_groups.id;
--
-- Name: articles; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.articles (
id integer NOT NULL,
project_id integer NOT NULL,
name text NOT NULL,
sections_hash text NOT NULL,
base_rfc5646_locale character varying(255) NOT NULL,
targeted_rfc5646_locales text NOT NULL,
description text,
email character varying(255),
import_batch_id character varying(255),
ready boolean DEFAULT false NOT NULL,
first_import_requested_at timestamp without time zone,
last_import_requested_at timestamp without time zone,
first_import_started_at timestamp without time zone,
last_import_started_at timestamp without time zone,
first_import_finished_at timestamp without time zone,
last_import_finished_at timestamp without time zone,
first_completed_at timestamp without time zone,
last_completed_at timestamp without time zone,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
due_date date,
priority integer,
creator_id integer,
updater_id integer,
created_via_api boolean DEFAULT true NOT NULL,
name_sha character varying(64) NOT NULL,
hidden boolean DEFAULT false NOT NULL,
human_review boolean DEFAULT true NOT NULL
);
--
-- Name: articles_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.articles_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: articles_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.articles_id_seq OWNED BY public.articles.id;
--
-- Name: assets; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.assets (
id integer NOT NULL,
name character varying NOT NULL,
project_id integer NOT NULL,
user_id integer NOT NULL,
base_rfc5646_locale character varying NOT NULL,
targeted_rfc5646_locales text NOT NULL,
description text,
email character varying,
priority integer,
due_date timestamp without time zone,
ready boolean DEFAULT false NOT NULL,
loading boolean DEFAULT false NOT NULL,
approved_at timestamp without time zone,
hidden boolean DEFAULT false NOT NULL,
file_name character varying NOT NULL,
import_batch_id character varying,
file_file_name character varying,
file_content_type character varying,
file_file_size integer,
file_updated_at timestamp without time zone,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
--
-- Name: assets_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.assets_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: assets_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.assets_id_seq OWNED BY public.assets.id;
--
-- Name: assets_keys; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.assets_keys (
id integer NOT NULL,
asset_id integer,
key_id integer,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
--
-- Name: assets_keys_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.assets_keys_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: assets_keys_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.assets_keys_id_seq OWNED BY public.assets_keys.id;
--
-- Name: blobs; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.blobs (
project_id integer NOT NULL,
parsed boolean DEFAULT false NOT NULL,
errored boolean DEFAULT false NOT NULL,
id integer NOT NULL,
path text NOT NULL,
created_at timestamp without time zone,
updated_at timestamp without time zone,
sha character varying(40) NOT NULL,
path_sha character varying(64) NOT NULL
);
--
-- Name: blobs_commits; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.blobs_commits (
commit_id integer NOT NULL,
id integer NOT NULL,
blob_id integer NOT NULL,
created_at timestamp without time zone,
updated_at timestamp without time zone
);
--
-- Name: blobs_commits_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.blobs_commits_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: blobs_commits_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.blobs_commits_id_seq OWNED BY public.blobs_commits.id;
--
-- Name: blobs_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.blobs_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: blobs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.blobs_id_seq OWNED BY public.blobs.id;
--
-- Name: blobs_keys; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.blobs_keys (
key_id integer NOT NULL,
id integer NOT NULL,
blob_id integer NOT NULL,
created_at timestamp without time zone,
updated_at timestamp without time zone
);
--
-- Name: blobs_keys_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.blobs_keys_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: blobs_keys_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.blobs_keys_id_seq OWNED BY public.blobs_keys.id;
--
-- Name: comments; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.comments (
id integer NOT NULL,
user_id integer,
issue_id integer NOT NULL,
content text,
created_at timestamp without time zone,
updated_at timestamp without time zone
);
--
-- Name: comments_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.comments_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: comments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.comments_id_seq OWNED BY public.comments.id;
--
-- Name: commits; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.commits (
id integer NOT NULL,
project_id integer NOT NULL,
message character varying(256) NOT NULL,
committed_at timestamp without time zone NOT NULL,
ready boolean DEFAULT false NOT NULL,
loading boolean DEFAULT false NOT NULL,
created_at timestamp without time zone,
due_date date,
priority integer,
user_id integer,
approved_at timestamp without time zone,
exported boolean DEFAULT false NOT NULL,
loaded_at timestamp without time zone,
description text,
author character varying(255),
author_email character varying(255),
pull_request_url text,
import_batch_id character varying(255),
import_errors text,
revision character varying(40) NOT NULL,
fingerprint character varying,
duplicate boolean DEFAULT false,
CONSTRAINT commits_message_check CHECK ((char_length((message)::text) > 0)),
CONSTRAINT commits_priority_check CHECK (((priority >= 0) AND (priority <= 3)))
);
--
-- Name: commits_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.commits_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: commits_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.commits_id_seq OWNED BY public.commits.id;
--
-- Name: commits_keys; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.commits_keys (
commit_id integer NOT NULL,
key_id integer NOT NULL,
created_at timestamp without time zone
);
--
-- Name: daily_metrics; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.daily_metrics (
id integer NOT NULL,
date date NOT NULL,
created_at timestamp without time zone,
updated_at timestamp without time zone,
num_commits_loaded integer,
num_commits_loaded_per_project text,
avg_load_time double precision,
avg_load_time_per_project text,
num_commits_completed integer,
num_commits_completed_per_project text,
num_words_created integer,
num_words_created_per_language text,
num_words_completed integer,
num_words_completed_per_language text
);
--
-- Name: daily_metrics_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.daily_metrics_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: daily_metrics_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.daily_metrics_id_seq OWNED BY public.daily_metrics.id;
--
-- Name: edit_reasons; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.edit_reasons (
id integer NOT NULL,
reason_id integer,
translation_change_id integer
);
--
-- Name: edit_reasons_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.edit_reasons_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: edit_reasons_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.edit_reasons_id_seq OWNED BY public.edit_reasons.id;
--
-- Name: globalsight_api_records; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.globalsight_api_records (
id integer NOT NULL,
job_id integer NOT NULL,
status character varying(255) NOT NULL,
article_id integer,
created_at timestamp without time zone,
updated_at timestamp without time zone
);
--
-- Name: globalsight_api_records_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.globalsight_api_records_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: globalsight_api_records_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.globalsight_api_records_id_seq OWNED BY public.globalsight_api_records.id;
--
-- Name: groups; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.groups (
id integer NOT NULL,
project_id integer NOT NULL,
name text NOT NULL,
description text,
ready boolean DEFAULT false NOT NULL,
loading boolean DEFAULT false NOT NULL,
hidden boolean DEFAULT false,
due_date date,
priority integer,
creator_id integer,
updater_id integer,
email character varying(255),
created_via_api boolean DEFAULT true NOT NULL,
loaded_at timestamp without time zone,
translated_at timestamp without time zone,
approved_at timestamp without time zone,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
display_name character varying(256)
);
--
-- Name: groups_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.groups_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: groups_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.groups_id_seq OWNED BY public.groups.id;
--
-- Name: issues; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.issues (
id integer NOT NULL,
user_id integer,
updater_id integer,
translation_id integer NOT NULL,
summary character varying(255),
description text,
priority integer,
kind integer,
status integer,
created_at timestamp without time zone,
updated_at timestamp without time zone,
subscribed_emails text
);
--
-- Name: issues_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.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 public.issues_id_seq OWNED BY public.issues.id;
--
-- Name: keys; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.keys (
id integer NOT NULL,
project_id integer NOT NULL,
ready boolean DEFAULT true NOT NULL,
key text NOT NULL,
original_key text NOT NULL,
source_copy text,
context text,
importer character varying(255),
source text,
fencers text,
other_data text,
section_id integer,
index_in_section integer,
is_block_tag boolean DEFAULT false NOT NULL,
key_sha character varying(64) NOT NULL,
source_copy_sha character varying(64) NOT NULL,
hidden_in_search boolean DEFAULT false,
CONSTRAINT non_negative_index_in_section CHECK ((index_in_section >= 0))
);
--
-- Name: keys_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.keys_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: keys_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.keys_id_seq OWNED BY public.keys.id;
--
-- Name: locale_associations; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.locale_associations (
id integer NOT NULL,
source_rfc5646_locale character varying(255) NOT NULL,
target_rfc5646_locale character varying(255) NOT NULL,
checked boolean DEFAULT false NOT NULL,
uncheck_disabled boolean DEFAULT false NOT NULL,
created_at timestamp without time zone,
updated_at timestamp without time zone
);
--
-- Name: locale_associations_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.locale_associations_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: locale_associations_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.locale_associations_id_seq OWNED BY public.locale_associations.id;
--
-- Name: locale_glossary_entries; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.locale_glossary_entries (
id integer NOT NULL,
translator_id integer,
reviewer_id integer,
source_glossary_entry_id integer,
rfc5646_locale character varying(15) NOT NULL,
translated boolean DEFAULT false NOT NULL,
approved boolean,
created_at timestamp without time zone,
updated_at timestamp without time zone,
copy text,
notes text
);
--
-- Name: locale_glossary_entries_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.locale_glossary_entries_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: locale_glossary_entries_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.locale_glossary_entries_id_seq OWNED BY public.locale_glossary_entries.id;
--
-- Name: projects; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.projects (
id integer NOT NULL,
name character varying(256) NOT NULL,
repository_url character varying(256),
created_at timestamp without time zone,
translations_adder_and_remover_batch_id character varying(255),
disable_locale_association_checkbox_settings boolean DEFAULT false NOT NULL,
base_rfc5646_locale character varying(255) DEFAULT 'en'::character varying NOT NULL,
targeted_rfc5646_locales text,
skip_imports text,
key_exclusions text,
key_inclusions text,
key_locale_exclusions text,
key_locale_inclusions text,
skip_paths text,
only_paths text,
skip_importer_paths text,
only_importer_paths text,
default_manifest_format character varying(255),
watched_branches text,
touchdown_branch character varying(255),
manifest_directory text,
manifest_filename character varying(255),
github_webhook_url text,
stash_webhook_url text,
api_token character(240) NOT NULL,
article_webhook_url character varying,
job_type smallint DEFAULT 0 NOT NULL,
CONSTRAINT projects_name_check CHECK ((char_length((name)::text) > 0))
);
--
-- 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: reasons; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.reasons (
id integer NOT NULL,
name character varying NOT NULL,
category character varying NOT NULL,
description character varying,
created_at timestamp without time zone,
updated_at timestamp without time zone
);
--
-- Name: reasons_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.reasons_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: reasons_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.reasons_id_seq OWNED BY public.reasons.id;
--
-- Name: reports; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.reports (
id integer NOT NULL,
date timestamp without time zone,
project character varying,
locale character varying,
strings integer,
words integer,
report_type character varying,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
--
-- Name: reports_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.reports_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: reports_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.reports_id_seq OWNED BY public.reports.id;
--
-- Name: schema_migrations; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.schema_migrations (
version character varying(255) NOT NULL
);
--
-- Name: screenshots; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.screenshots (
commit_id integer NOT NULL,
created_at timestamp without time zone,
updated_at timestamp without time zone,
image_file_name character varying(255),
image_content_type character varying(255),
image_file_size integer,
image_updated_at timestamp without time zone,
id integer NOT NULL
);
--
-- Name: screenshots_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.screenshots_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: screenshots_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.screenshots_id_seq OWNED BY public.screenshots.id;
--
-- Name: sections; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.sections (
id integer NOT NULL,
article_id integer NOT NULL,
name text NOT NULL,
source_copy text NOT NULL,
active boolean DEFAULT true NOT NULL,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
name_sha character varying(64) NOT NULL,
source_copy_sha character varying(64) NOT NULL
);
--
-- Name: sections_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.sections_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: sections_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.sections_id_seq OWNED BY public.sections.id;
--
-- Name: slugs; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.slugs (
id integer NOT NULL,
sluggable_id integer NOT NULL,
active boolean DEFAULT true NOT NULL,
slug character varying(126) NOT NULL,
scope character varying(126),
created_at timestamp without time zone NOT NULL,
sluggable_type character varying(126) NOT NULL,
CONSTRAINT slugs_slug_check CHECK ((char_length((slug)::text) > 0))
);
--
-- Name: slugs_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.slugs_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: slugs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.slugs_id_seq OWNED BY public.slugs.id;
--
-- Name: source_glossary_entries; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.source_glossary_entries (
id integer NOT NULL,
source_rfc5646_locale character varying(15) DEFAULT 'en'::character varying NOT NULL,
created_at timestamp without time zone,
updated_at timestamp without time zone,
source_copy text NOT NULL,
context text,
notes text,
due_date date,
source_copy_sha character varying(64) NOT NULL
);
--
-- Name: source_glossary_entries_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.source_glossary_entries_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: source_glossary_entries_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.source_glossary_entries_id_seq OWNED BY public.source_glossary_entries.id;
--
-- Name: translation_changes; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.translation_changes (
id integer NOT NULL,
translation_id integer NOT NULL,
created_at timestamp without time zone,
user_id integer,
diff text,
tm_match numeric,
sha character varying(40),
role character varying,
project_id integer,
is_edit boolean DEFAULT false,
article_id integer,
asset_id integer,
reason_severity smallint
);
--
-- Name: translation_changes_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.translation_changes_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: translation_changes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.translation_changes_id_seq OWNED BY public.translation_changes.id;
--
-- Name: translations; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.translations (
id integer NOT NULL,
key_id integer NOT NULL,
translator_id integer,
reviewer_id integer,
source_rfc5646_locale character varying(15) NOT NULL,
rfc5646_locale character varying(15) NOT NULL,
translated boolean DEFAULT false NOT NULL,
approved boolean,
created_at timestamp without time zone,
updated_at timestamp without time zone,
words_count integer DEFAULT 0 NOT NULL,
source_copy text,
copy text,
notes text,
tm_match numeric,
translation_date timestamp without time zone,
review_date timestamp without time zone
);
--
-- 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: users; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.users (
id integer NOT NULL,
email character varying(255) NOT NULL,
reset_password_token character varying(255),
sign_in_count integer DEFAULT 0 NOT NULL,
failed_attempts integer DEFAULT 0 NOT NULL,
unlock_token character varying(255),
role character varying(50) DEFAULT NULL::character varying,
created_at timestamp without time zone,
updated_at timestamp without time zone,
confirmation_token character varying(255),
first_name character varying(255) NOT NULL,
last_name character varying(255) NOT NULL,
encrypted_password character varying(255) NOT NULL,
remember_created_at timestamp without time zone,
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),
confirmed_at timestamp without time zone,
confirmation_sent_at timestamp without time zone,
locked_at timestamp without time zone,
reset_password_sent_at timestamp without time zone,
approved_rfc5646_locales text,
last_activity_at timestamp without time zone,
expired_at timestamp without time zone,
CONSTRAINT encrypted_password_exists CHECK ((char_length((encrypted_password)::text) > 20)),
CONSTRAINT users_email_check CHECK ((char_length((email)::text) > 0)),
CONSTRAINT users_failed_attempts_check CHECK ((failed_attempts >= 0)),
CONSTRAINT users_sign_in_count_check CHECK ((sign_in_count >= 0))
);
--
-- 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: article_groups id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.article_groups ALTER COLUMN id SET DEFAULT nextval('public.article_groups_id_seq'::regclass);
--
-- Name: articles id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.articles ALTER COLUMN id SET DEFAULT nextval('public.articles_id_seq'::regclass);
--
-- Name: assets id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.assets ALTER COLUMN id SET DEFAULT nextval('public.assets_id_seq'::regclass);
--
-- Name: assets_keys id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.assets_keys ALTER COLUMN id SET DEFAULT nextval('public.assets_keys_id_seq'::regclass);
--
-- Name: blobs id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.blobs ALTER COLUMN id SET DEFAULT nextval('public.blobs_id_seq'::regclass);
--
-- Name: blobs_commits id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.blobs_commits ALTER COLUMN id SET DEFAULT nextval('public.blobs_commits_id_seq'::regclass);
--
-- Name: blobs_keys id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.blobs_keys ALTER COLUMN id SET DEFAULT nextval('public.blobs_keys_id_seq'::regclass);
--
-- Name: comments id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.comments ALTER COLUMN id SET DEFAULT nextval('public.comments_id_seq'::regclass);
--
-- Name: commits id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.commits ALTER COLUMN id SET DEFAULT nextval('public.commits_id_seq'::regclass);
--
-- Name: daily_metrics id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.daily_metrics ALTER COLUMN id SET DEFAULT nextval('public.daily_metrics_id_seq'::regclass);
--
-- Name: edit_reasons id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.edit_reasons ALTER COLUMN id SET DEFAULT nextval('public.edit_reasons_id_seq'::regclass);
--
-- Name: globalsight_api_records id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.globalsight_api_records ALTER COLUMN id SET DEFAULT nextval('public.globalsight_api_records_id_seq'::regclass);
--
-- Name: groups id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.groups ALTER COLUMN id SET DEFAULT nextval('public.groups_id_seq'::regclass);
--
-- Name: issues id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.issues ALTER COLUMN id SET DEFAULT nextval('public.issues_id_seq'::regclass);
--
-- Name: keys id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.keys ALTER COLUMN id SET DEFAULT nextval('public.keys_id_seq'::regclass);
--
-- Name: locale_associations id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.locale_associations ALTER COLUMN id SET DEFAULT nextval('public.locale_associations_id_seq'::regclass);
--
-- Name: locale_glossary_entries id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.locale_glossary_entries ALTER COLUMN id SET DEFAULT nextval('public.locale_glossary_entries_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: reasons id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.reasons ALTER COLUMN id SET DEFAULT nextval('public.reasons_id_seq'::regclass);
--
-- Name: reports id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.reports ALTER COLUMN id SET DEFAULT nextval('public.reports_id_seq'::regclass);
--
-- Name: screenshots id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.screenshots ALTER COLUMN id SET DEFAULT nextval('public.screenshots_id_seq'::regclass);
--
-- Name: sections id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.sections ALTER COLUMN id SET DEFAULT nextval('public.sections_id_seq'::regclass);
--
-- Name: slugs id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.slugs ALTER COLUMN id SET DEFAULT nextval('public.slugs_id_seq'::regclass);
--
-- Name: source_glossary_entries id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.source_glossary_entries ALTER COLUMN id SET DEFAULT nextval('public.source_glossary_entries_id_seq'::regclass);
--
-- Name: translation_changes id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.translation_changes ALTER COLUMN id SET DEFAULT nextval('public.translation_changes_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: users id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.users ALTER COLUMN id SET DEFAULT nextval('public.users_id_seq'::regclass);
--
-- Name: article_groups article_groups_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.article_groups
ADD CONSTRAINT article_groups_pkey PRIMARY KEY (id);
--
-- Name: articles articles_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.articles
ADD CONSTRAINT articles_pkey PRIMARY KEY (id);
--
-- Name: assets_keys assets_keys_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.assets_keys
ADD CONSTRAINT assets_keys_pkey PRIMARY KEY (id);
--
-- Name: assets assets_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.assets
ADD CONSTRAINT assets_pkey PRIMARY KEY (id);
--
-- Name: blobs_commits blobs_commits_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.blobs_commits
ADD CONSTRAINT blobs_commits_pkey PRIMARY KEY (id);
--
-- Name: blobs_keys blobs_keys_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.blobs_keys
ADD CONSTRAINT blobs_keys_pkey PRIMARY KEY (id);
--
-- Name: blobs blobs_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.blobs
ADD CONSTRAINT blobs_pkey PRIMARY KEY (id);
--
-- Name: comments comments_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.comments
ADD CONSTRAINT comments_pkey PRIMARY KEY (id);
--
-- Name: commits commits_new_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.commits
ADD CONSTRAINT commits_new_pkey PRIMARY KEY (id);
--
-- Name: daily_metrics daily_metrics_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.daily_metrics
ADD CONSTRAINT daily_metrics_pkey PRIMARY KEY (id);
--
-- Name: edit_reasons edit_reasons_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.edit_reasons
ADD CONSTRAINT edit_reasons_pkey PRIMARY KEY (id);
--
-- Name: globalsight_api_records globalsight_api_records_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.globalsight_api_records
ADD CONSTRAINT globalsight_api_records_pkey PRIMARY KEY (id);
--
-- Name: groups groups_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.groups
ADD CONSTRAINT groups_pkey PRIMARY KEY (id);
--
-- Name: issues issues_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.issues
ADD CONSTRAINT issues_pkey PRIMARY KEY (id);
--
-- Name: keys keys_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.keys
ADD CONSTRAINT keys_pkey PRIMARY KEY (id);
--
-- Name: locale_associations locale_associations_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.locale_associations
ADD CONSTRAINT locale_associations_pkey PRIMARY KEY (id);
--
-- Name: locale_glossary_entries locale_glossary_entries_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.locale_glossary_entries
ADD CONSTRAINT locale_glossary_entries_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: reasons reasons_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.reasons
ADD CONSTRAINT reasons_pkey PRIMARY KEY (id);
--
-- Name: reports reports_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.reports
ADD CONSTRAINT reports_pkey PRIMARY KEY (id);
--
-- Name: screenshots screenshots_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.screenshots
ADD CONSTRAINT screenshots_pkey PRIMARY KEY (id);
--
-- Name: sections sections_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.sections
ADD CONSTRAINT sections_pkey PRIMARY KEY (id);
--
-- Name: slugs slugs_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.slugs
ADD CONSTRAINT slugs_pkey PRIMARY KEY (id);
--
-- Name: source_glossary_entries source_glossary_entries_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.source_glossary_entries
ADD CONSTRAINT source_glossary_entries_pkey PRIMARY KEY (id);
--
-- Name: translation_changes translation_changes_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.translation_changes
ADD CONSTRAINT translation_changes_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: users users_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.users
ADD CONSTRAINT users_pkey PRIMARY KEY (id);
--
-- Name: comments_issue; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX comments_issue ON public.comments USING btree (issue_id);
--
-- Name: comments_user; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX comments_user ON public.comments USING btree (user_id);
--
-- Name: commits_date_new; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX commits_date_new ON public.commits USING btree (project_id, committed_at);
--
-- Name: commits_keys_key_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX commits_keys_key_id ON public.commits_keys USING btree (key_id);
--
-- Name: commits_priority; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX commits_priority ON public.commits USING btree (priority, due_date);
--
-- Name: commits_ready_date_new; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX commits_ready_date_new ON public.commits USING btree (project_id, ready, committed_at);
--
-- Name: daily_metrics_date; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX daily_metrics_date ON public.daily_metrics USING btree (date);
--
-- Name: index_article_groups_on_article_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_article_groups_on_article_id ON public.article_groups USING btree (article_id);
--
-- Name: index_article_groups_on_group_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_article_groups_on_group_id ON public.article_groups USING btree (group_id);
--
-- Name: index_articles_on_name_sha; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_articles_on_name_sha ON public.articles USING btree (name_sha);
--
-- Name: index_articles_on_project_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_articles_on_project_id ON public.articles USING btree (project_id);
--
-- Name: index_articles_on_project_id_and_name_sha; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX index_articles_on_project_id_and_name_sha ON public.articles USING btree (project_id, name_sha);
--
-- Name: index_articles_on_ready; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_articles_on_ready ON public.articles USING btree (ready);
--
-- Name: index_assets_keys_on_asset_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_assets_keys_on_asset_id ON public.assets_keys USING btree (asset_id);
--
-- Name: index_assets_keys_on_key_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_assets_keys_on_key_id ON public.assets_keys USING btree (key_id);
--
-- Name: index_assets_on_project_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_assets_on_project_id ON public.assets USING btree (project_id);
--
-- Name: index_assets_on_user_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_assets_on_user_id ON public.assets USING btree (user_id);
--
-- Name: index_blobs_commits_on_blob_id_and_commit_id; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX index_blobs_commits_on_blob_id_and_commit_id ON public.blobs_commits USING btree (blob_id, commit_id);
--
-- Name: index_blobs_keys_on_blob_id_and_key_id; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX index_blobs_keys_on_blob_id_and_key_id ON public.blobs_keys USING btree (blob_id, key_id);
--
-- Name: index_blobs_on_project_id_and_sha_and_path_sha; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX index_blobs_on_project_id_and_sha_and_path_sha ON public.blobs USING btree (project_id, sha, path_sha);
--
-- Name: index_commits_keys_on_commit_id_and_key_id; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX index_commits_keys_on_commit_id_and_key_id ON public.commits_keys USING btree (commit_id, key_id);
--
-- Name: index_commits_keys_on_created_at; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_commits_keys_on_created_at ON public.commits_keys USING btree (created_at);
--
-- Name: index_commits_on_fingerprint; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_commits_on_fingerprint ON public.commits USING btree (fingerprint);
--
-- Name: index_commits_on_project_id_and_revision; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX index_commits_on_project_id_and_revision ON public.commits USING btree (project_id, revision);
--
-- Name: index_edit_reasons_on_reason_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_edit_reasons_on_reason_id ON public.edit_reasons USING btree (reason_id);
--
-- Name: index_edit_reasons_on_translation_change_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_edit_reasons_on_translation_change_id ON public.edit_reasons USING btree (translation_change_id);
--
-- Name: index_groups_on_name; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_groups_on_name ON public.groups USING btree (name);
--
-- Name: index_groups_on_project_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_groups_on_project_id ON public.groups USING btree (project_id);
--
-- Name: index_in_section_unique; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX index_in_section_unique ON public.keys USING btree (section_id, index_in_section) WHERE ((section_id IS NOT NULL) AND (index_in_section IS NOT NULL));
--
-- Name: index_keys_on_is_block_tag; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_keys_on_is_block_tag ON public.keys USING btree (is_block_tag);
--
-- Name: index_keys_on_project_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_keys_on_project_id ON public.keys USING btree (project_id);
--
-- Name: index_keys_on_ready; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_keys_on_ready ON public.keys USING btree (ready);
--
-- Name: index_keys_on_source_copy_sha; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_keys_on_source_copy_sha ON public.keys USING btree (source_copy_sha);
--
-- Name: index_locale_associations_on_source_and_target_rfc5646_locales; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX index_locale_associations_on_source_and_target_rfc5646_locales ON public.locale_associations USING btree (source_rfc5646_locale, target_rfc5646_locale);
--
-- Name: index_projects_on_api_token; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX index_projects_on_api_token ON public.projects USING btree (api_token);
--
-- Name: index_reports_on_date; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_reports_on_date ON public.reports USING btree (date);
--
-- Name: index_sections_on_article_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_sections_on_article_id ON public.sections USING btree (article_id);
--
-- Name: index_sections_on_article_id_and_name_sha; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX index_sections_on_article_id_and_name_sha ON public.sections USING btree (article_id, name_sha);
--
-- Name: index_sections_on_name_sha; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_sections_on_name_sha ON public.sections USING btree (name_sha);
--
-- Name: index_translation_changes_on_article_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_translation_changes_on_article_id ON public.translation_changes USING btree (article_id);
--
-- Name: index_translation_changes_on_asset_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_translation_changes_on_asset_id ON public.translation_changes USING btree (asset_id);
--
-- Name: index_translation_changes_on_project_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_translation_changes_on_project_id ON public.translation_changes USING btree (project_id);
--
-- Name: index_translation_changes_on_translation_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_translation_changes_on_translation_id ON public.translation_changes USING btree (translation_id);
--
-- Name: index_translations_on_rfc5646_locale; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_translations_on_rfc5646_locale ON public.translations USING btree (rfc5646_locale);
--
-- Name: index_users_on_confirmation_token; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX index_users_on_confirmation_token ON public.users USING btree (confirmation_token);
--
-- Name: index_users_on_expired_at; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_users_on_expired_at ON public.users USING btree (expired_at);
--
-- Name: index_users_on_last_activity_at; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_users_on_last_activity_at ON public.users USING btree (last_activity_at);
--
-- Name: issues_translation; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX issues_translation ON public.issues USING btree (translation_id);
--
-- Name: issues_translation_status; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX issues_translation_status ON public.issues USING btree (translation_id, status);
--
-- Name: issues_translation_status_priority_created_at; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX issues_translation_status_priority_created_at ON public.issues USING btree (translation_id, status, priority, created_at);
--
-- Name: issues_updater; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX issues_updater ON public.issues USING btree (updater_id);
--
-- Name: issues_user; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX issues_user ON public.issues USING btree (user_id);
--
-- Name: keys_in_section_unique_new; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX keys_in_section_unique_new ON public.keys USING btree (section_id, key_sha) WHERE (section_id IS NOT NULL);
--
-- Name: keys_unique_new; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX keys_unique_new ON public.keys USING btree (project_id, key_sha, source_copy_sha) WHERE (section_id IS NULL);
--
-- Name: projects_name; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX projects_name ON public.projects USING btree (lower((name)::text));
--
-- Name: slugs_for_record; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX slugs_for_record ON public.slugs USING btree (sluggable_type, sluggable_id, active);
--
-- Name: slugs_unique; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX slugs_unique ON public.slugs USING btree (sluggable_type, lower((scope)::text), lower((slug)::text));
--
-- Name: translations_by_key; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX translations_by_key ON public.translations USING btree (key_id, rfc5646_locale);
--
-- Name: unique_schema_migrations; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX unique_schema_migrations ON public.schema_migrations USING btree (version);
--
-- Name: users_email; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX users_email ON public.users USING btree (email);
--
-- Name: users_reset_token; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX users_reset_token ON public.users USING btree (reset_password_token);
--
-- Name: users_unlock_token; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX users_unlock_token ON public.users USING btree (unlock_token);
--
-- Name: article_groups article_groups_article_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.article_groups
ADD CONSTRAINT article_groups_article_id_fkey FOREIGN KEY (article_id) REFERENCES public.articles(id) ON DELETE CASCADE;
--
-- Name: article_groups article_groups_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.article_groups
ADD CONSTRAINT article_groups_group_id_fkey FOREIGN KEY (group_id) REFERENCES public.groups(id) ON DELETE CASCADE;
--
-- Name: articles articles_project_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.articles
ADD CONSTRAINT articles_project_id_fkey FOREIGN KEY (project_id) REFERENCES public.projects(id) ON DELETE CASCADE;
--
-- Name: blobs_commits blobs_commits_blob_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.blobs_commits
ADD CONSTRAINT blobs_commits_blob_id_fkey FOREIGN KEY (blob_id) REFERENCES public.blobs(id) ON DELETE CASCADE;
--
-- Name: blobs_commits blobs_commits_commit_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.blobs_commits
ADD CONSTRAINT blobs_commits_commit_id_fkey FOREIGN KEY (commit_id) REFERENCES public.commits(id) ON DELETE CASCADE;
--
-- Name: blobs_keys blobs_keys_blob_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.blobs_keys
ADD CONSTRAINT blobs_keys_blob_id_fkey FOREIGN KEY (blob_id) REFERENCES public.blobs(id) ON DELETE CASCADE;
--
-- Name: blobs_keys blobs_keys_key_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.blobs_keys
ADD CONSTRAINT blobs_keys_key_id_fkey FOREIGN KEY (key_id) REFERENCES public.keys(id) ON DELETE CASCADE;
--
-- Name: blobs blobs_project_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.blobs
ADD CONSTRAINT blobs_project_id_fkey FOREIGN KEY (project_id) REFERENCES public.projects(id) ON DELETE CASCADE;
--
-- Name: comments comments_issue_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.comments
ADD CONSTRAINT comments_issue_id_fkey FOREIGN KEY (issue_id) REFERENCES public.issues(id) ON DELETE CASCADE;
--
-- Name: comments comments_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.comments
ADD CONSTRAINT comments_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id) ON DELETE SET NULL;
--
-- Name: commits_keys commits_keys_commit_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.commits_keys
ADD CONSTRAINT commits_keys_commit_id_fkey FOREIGN KEY (commit_id) REFERENCES public.commits(id) ON DELETE CASCADE;
--
-- Name: commits_keys commits_keys_commit_id_fkey1; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.commits_keys
ADD CONSTRAINT commits_keys_commit_id_fkey1 FOREIGN KEY (commit_id) REFERENCES public.commits(id) ON DELETE CASCADE;
--
-- Name: commits_keys commits_keys_key_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.commits_keys
ADD CONSTRAINT commits_keys_key_id_fkey FOREIGN KEY (key_id) REFERENCES public.keys(id) ON DELETE CASCADE;
--
-- Name: commits commits_new_project_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.commits
ADD CONSTRAINT commits_new_project_id_fkey FOREIGN KEY (project_id) REFERENCES public.projects(id) ON DELETE CASCADE;
--
-- Name: commits commits_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.commits
ADD CONSTRAINT commits_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id) ON DELETE SET NULL;
--
-- Name: assets_keys fk_rails_2caeca904e; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.assets_keys
ADD CONSTRAINT fk_rails_2caeca904e FOREIGN KEY (asset_id) REFERENCES public.assets(id);
--
-- Name: assets_keys fk_rails_7912b868b8; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.assets_keys
ADD CONSTRAINT fk_rails_7912b868b8 FOREIGN KEY (key_id) REFERENCES public.keys(id);
--
-- Name: translation_changes fk_rails_7d85ba02c1; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.translation_changes
ADD CONSTRAINT fk_rails_7d85ba02c1 FOREIGN KEY (asset_id) REFERENCES public.assets(id);
--
-- Name: edit_reasons fk_rails_bac020938b; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.edit_reasons
ADD CONSTRAINT fk_rails_bac020938b FOREIGN KEY (reason_id) REFERENCES public.reasons(id);
--
-- Name: translation_changes fk_rails_c5bea0b054; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.translation_changes
ADD CONSTRAINT fk_rails_c5bea0b054 FOREIGN KEY (article_id) REFERENCES public.articles(id);
--
-- Name: edit_reasons fk_rails_d4c92da42d; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.edit_reasons
ADD CONSTRAINT fk_rails_d4c92da42d FOREIGN KEY (translation_change_id) REFERENCES public.translation_changes(id);
--
-- Name: groups groups_project_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.groups
ADD CONSTRAINT groups_project_id_fkey FOREIGN KEY (project_id) REFERENCES public.projects(id) ON DELETE CASCADE;
--
-- Name: issues issues_translation_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.issues
ADD CONSTRAINT issues_translation_id_fkey FOREIGN KEY (translation_id) REFERENCES public.translations(id) ON DELETE CASCADE;
--
-- Name: issues issues_updater_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.issues
ADD CONSTRAINT issues_updater_id_fkey FOREIGN KEY (updater_id) REFERENCES public.users(id) ON DELETE SET NULL;
--
-- Name: issues issues_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.issues
ADD CONSTRAINT issues_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id) ON DELETE SET NULL;
--
-- Name: keys keys_project_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.keys
ADD CONSTRAINT keys_project_id_fkey FOREIGN KEY (project_id) REFERENCES public.projects(id) ON DELETE CASCADE;
--
-- Name: keys keys_section_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.keys
ADD CONSTRAINT keys_section_id_fkey FOREIGN KEY (section_id) REFERENCES public.sections(id) ON DELETE CASCADE;
--
-- Name: locale_glossary_entries locale_glossary_entries_reviewer_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.locale_glossary_entries
ADD CONSTRAINT locale_glossary_entries_reviewer_id_fkey FOREIGN KEY (reviewer_id) REFERENCES public.users(id) ON DELETE SET NULL;
--
-- Name: locale_glossary_entries locale_glossary_entries_source_glossary_entry_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.locale_glossary_entries
ADD CONSTRAINT locale_glossary_entries_source_glossary_entry_id_fkey FOREIGN KEY (source_glossary_entry_id) REFERENCES public.source_glossary_entries(id) ON DELETE CASCADE;
--
-- Name: locale_glossary_entries locale_glossary_entries_translator_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.locale_glossary_entries
ADD CONSTRAINT locale_glossary_entries_translator_id_fkey FOREIGN KEY (translator_id) REFERENCES public.users(id) ON DELETE SET NULL;
--
-- Name: screenshots screenshots_commit_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.screenshots
ADD CONSTRAINT screenshots_commit_id_fkey FOREIGN KEY (commit_id) REFERENCES public.commits(id) ON DELETE CASCADE;
--
-- Name: sections sections_article_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.sections
ADD CONSTRAINT sections_article_id_fkey FOREIGN KEY (article_id) REFERENCES public.articles(id) ON DELETE CASCADE;
--
-- Name: translation_changes translation_changes_translation_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.translation_changes
ADD CONSTRAINT translation_changes_translation_id_fkey FOREIGN KEY (translation_id) REFERENCES public.translations(id) ON DELETE CASCADE;
--
-- Name: translation_changes translation_changes_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.translation_changes
ADD CONSTRAINT translation_changes_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id) ON DELETE SET NULL;
--
-- Name: translations translations_key_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.translations
ADD CONSTRAINT translations_key_id_fkey FOREIGN KEY (key_id) REFERENCES public.keys(id) ON DELETE CASCADE;
--
-- Name: translations translations_reviewer_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.translations
ADD CONSTRAINT translations_reviewer_id_fkey FOREIGN KEY (reviewer_id) REFERENCES public.users(id) ON DELETE SET NULL;
--
-- Name: translations translations_translator_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.translations
ADD CONSTRAINT translations_translator_id_fkey FOREIGN KEY (translator_id) REFERENCES public.users(id) ON DELETE SET NULL;
--
-- PostgreSQL database dump complete
--
SET search_path TO "$user",public;
INSERT INTO schema_migrations (version) VALUES ('20130605211557');
INSERT INTO schema_migrations (version) VALUES ('20130611035759');
INSERT INTO schema_migrations (version) VALUES ('20130612201509');
INSERT INTO schema_migrations (version) VALUES ('20130612202700');
INSERT INTO schema_migrations (version) VALUES ('20130612203159');
INSERT INTO schema_migrations (version) VALUES ('20130612204200');
INSERT INTO schema_migrations (version) VALUES ('20130612204433');
INSERT INTO schema_migrations (version) VALUES ('20130612204434');
INSERT INTO schema_migrations (version) VALUES ('20130612213313');
INSERT INTO schema_migrations (version) VALUES ('20130614052719');
INSERT INTO schema_migrations (version) VALUES ('20130619195215');
INSERT INTO schema_migrations (version) VALUES ('20130801190316');
INSERT INTO schema_migrations (version) VALUES ('20130807224704');
INSERT INTO schema_migrations (version) VALUES ('20130821011600');
INSERT INTO schema_migrations (version) VALUES ('20130821011614');
INSERT INTO schema_migrations (version) VALUES ('20131008220117');
INSERT INTO schema_migrations (version) VALUES ('20131031034100');
INSERT INTO schema_migrations (version) VALUES ('20131111213136');
INSERT INTO schema_migrations (version) VALUES ('20131116042827');
INSERT INTO schema_migrations (version) VALUES ('20131204020552');
INSERT INTO schema_migrations (version) VALUES ('20140219040119');
INSERT INTO schema_migrations (version) VALUES ('20140228025058');
INSERT INTO schema_migrations (version) VALUES ('20140306064700');
INSERT INTO schema_migrations (version) VALUES ('20140311011156');
INSERT INTO schema_migrations (version) VALUES ('20140320053508');
INSERT INTO schema_migrations (version) VALUES ('20140518040822');
INSERT INTO schema_migrations (version) VALUES ('20140520233119');
INSERT INTO schema_migrations (version) VALUES ('20140521001017');
INSERT INTO schema_migrations (version) VALUES ('20140521010749');
INSERT INTO schema_migrations (version) VALUES ('20140521213501');
INSERT INTO schema_migrations (version) VALUES ('20140522002732');
INSERT INTO schema_migrations (version) VALUES ('20140523201654');
INSERT INTO schema_migrations (version) VALUES ('20140523201726');
INSERT INTO schema_migrations (version) VALUES ('20140531020536');
INSERT INTO schema_migrations (version) VALUES ('20140606111509');
INSERT INTO schema_migrations (version) VALUES ('20140613215228');
INSERT INTO schema_migrations (version) VALUES ('20140616232942');
INSERT INTO schema_migrations (version) VALUES ('20140714173058');
INSERT INTO schema_migrations (version) VALUES ('20140717192729');
INSERT INTO schema_migrations (version) VALUES ('20140721233942');
INSERT INTO schema_migrations (version) VALUES ('20140919214058');
INSERT INTO schema_migrations (version) VALUES ('20140925191736');
INSERT INTO schema_migrations (version) VALUES ('20140927210829');
INSERT INTO schema_migrations (version) VALUES ('20140930013949');
INSERT INTO schema_migrations (version) VALUES ('20141002074759');
INSERT INTO schema_migrations (version) VALUES ('20141022174649');
INSERT INTO schema_migrations (version) VALUES ('20141022191209');
INSERT INTO schema_migrations (version) VALUES ('20141022223754');
INSERT INTO schema_migrations (version) VALUES ('20141103204013');
INSERT INTO schema_migrations (version) VALUES ('20141104215833');
INSERT INTO schema_migrations (version) VALUES ('20141105193238');
INSERT INTO schema_migrations (version) VALUES ('20141113025632');
INSERT INTO schema_migrations (version) VALUES ('20141114011624');
INSERT INTO schema_migrations (version) VALUES ('20141114073933');
INSERT INTO schema_migrations (version) VALUES ('20141119005842');
INSERT INTO schema_migrations (version) VALUES ('20141119043427');
INSERT INTO schema_migrations (version) VALUES ('20141119215724');
INSERT INTO schema_migrations (version) VALUES ('20141119230218');
INSERT INTO schema_migrations (version) VALUES ('20141119235158');
INSERT INTO schema_migrations (version) VALUES ('20141120005608');
INSERT INTO schema_migrations (version) VALUES ('20141120006009');
INSERT INTO schema_migrations (version) VALUES ('20141120007440');
INSERT INTO schema_migrations (version) VALUES ('20141120011722');
INSERT INTO schema_migrations (version) VALUES ('20141121202324');
INSERT INTO schema_migrations (version) VALUES ('20141203212948');
INSERT INTO schema_migrations (version) VALUES ('20141205235631');
INSERT INTO schema_migrations (version) VALUES ('20141212011818');
INSERT INTO schema_migrations (version) VALUES ('20141212012945');
INSERT INTO schema_migrations (version) VALUES ('20141212232303');
INSERT INTO schema_migrations (version) VALUES ('20141217214242');
INSERT INTO schema_migrations (version) VALUES ('20141218002351');
INSERT INTO schema_migrations (version) VALUES ('20141229041151');
INSERT INTO schema_migrations (version) VALUES ('20141230094906');
INSERT INTO schema_migrations (version) VALUES ('20150228020547');
INSERT INTO schema_migrations (version) VALUES ('20150825010811');
INSERT INTO schema_migrations (version) VALUES ('20150828004150');
INSERT INTO schema_migrations (version) VALUES ('20151110220302');
INSERT INTO schema_migrations (version) VALUES ('20151210163604');
INSERT INTO schema_migrations (version) VALUES ('20151210165453');
INSERT INTO schema_migrations (version) VALUES ('20151210165629');
INSERT INTO schema_migrations (version) VALUES ('20151210170111');
INSERT INTO schema_migrations (version) VALUES ('20160229212753');
INSERT INTO schema_migrations (version) VALUES ('20160302033924');
INSERT INTO schema_migrations (version) VALUES ('20160303001118');
INSERT INTO schema_migrations (version) VALUES ('20160303235403');
INSERT INTO schema_migrations (version) VALUES ('20160404235737');
INSERT INTO schema_migrations (version) VALUES ('20160516051607');
INSERT INTO schema_migrations (version) VALUES ('20170126001545');
INSERT INTO schema_migrations (version) VALUES ('20170508202319');
INSERT INTO schema_migrations (version) VALUES ('20171024225818');
INSERT INTO schema_migrations (version) VALUES ('20171103183318');
INSERT INTO schema_migrations (version) VALUES ('20171206152825');
INSERT INTO schema_migrations (version) VALUES ('20180129223845');
INSERT INTO schema_migrations (version) VALUES ('20180506023840');
INSERT INTO schema_migrations (version) VALUES ('20180525005743');
INSERT INTO schema_migrations (version) VALUES ('20180604202337');
INSERT INTO schema_migrations (version) VALUES ('20180604202547');
INSERT INTO schema_migrations (version) VALUES ('20180608004859');
INSERT INTO schema_migrations (version) VALUES ('20180722180453');
INSERT INTO schema_migrations (version) VALUES ('20180803153222');
INSERT INTO schema_migrations (version) VALUES ('20180806002252');
INSERT INTO schema_migrations (version) VALUES ('20180814210040');
INSERT INTO schema_migrations (version) VALUES ('20180814210112');
INSERT INTO schema_migrations (version) VALUES ('20180825234430');
INSERT INTO schema_migrations (version) VALUES ('20180924195012');
INSERT INTO schema_migrations (version) VALUES ('20181028020548');
INSERT INTO schema_migrations (version) VALUES ('20181029221959');
INSERT INTO schema_migrations (version) VALUES ('20190517232627');
INSERT INTO schema_migrations (version) VALUES ('20190620214800'); | the_stack |
CREATE KEYSPACE IF NOT EXISTS sunbird WITH replication = {'class':'SimpleStrategy','replication_factor':1};
//to change cluster name
//UPDATE system.local SET cluster_name = 'sunbird' where key='local';
//ALTER USER cassandra WITH PASSWORD 'password';
USE sunbird;
/*
creation of id= one way hash of (userId##courseId) here courseId is identifier of course mgmt table
toc url we have to generate through json of content id from ekStep
here status is (default(0),inProgress(1),completed(2))
progress is no of content completed
*/
CREATE TABLE IF NOT EXISTS sunbird.course_enrollment(id text, courseId text, courseName text,userId text,enrolledDate text,
description text,tocUrl text,status int,active boolean,delta text,grade text,progress int,lastReadContentId text,
lastReadContentStatus int,addedBy text,courseLogoUrl text,dateTime timestamp,contentId text,PRIMARY KEY (id));
CREATE INDEX inx_ce_userId ON sunbird.course_enrollment (userId);
CREATE INDEX inx_ce_courseId ON sunbird.course_enrollment (courseId);
CREATE INDEX inx_ce_course_name ON sunbird.course_enrollment (courseName);
CREATE INDEX inx_ce_status ON sunbird.course_enrollment (status);
/*
creation of id = one way hash of (userId##contentId##courseId)
status is (default(0),inProgress(1),completed(2))
*/
CREATE TABLE IF NOT EXISTS sunbird.content_consumption(id text, contentId text, courseId text, userId text,viewPosition text,viewCount int,lastAccessTime text,
contentVersion text,completedCount int,status int,result text,score text,grade text,lastUpdatedTime text,lastCompletedTime text,dateTime timestamp,PRIMARY KEY (id));
CREATE INDEX inx_cc_userId ON sunbird.content_consumption (userId);
CREATE INDEX inx_cc_contentId ON sunbird.content_consumption (contentId);
CREATE INDEX inx_cc_status ON sunbird.content_consumption (status);
CREATE INDEX inx_cc_courseId ON sunbird.content_consumption (courseId);
/*
creation of id = using timestamp and env
id and courseId both are same
content id is from ekstep
status DRAFT("draft"), LIVE("live"), RETIRED("retired")
contentType (pdf,video,word doc etc)
tutor map<id,name>
*/
CREATE TABLE IF NOT EXISTS sunbird.course_management(id text, courseId text, contentId text, courseName text,courseType text,
facultyId text,facultyName text,organisationId text,organisationName text,enrollementStartDate text,enrollementEndDate text,
courseDuration text,description text,status text,addedBy text,addedByName text,publishedBy text,publishedByName text,createdDate text,
publishedDate text,updatedDate text,updatedBy text,updatedByName text,contentType text,createdfor list<text>,noOfLectures int,tocUrl text,
tutor map<text,text>,courseLogoUrl text,courseRating text,userCount int,PRIMARY KEY (id));
CREATE INDEX inx_cm_facultyId ON sunbird.course_management (facultyId);
CREATE INDEX inx_cm_organisationId ON sunbird.course_management (organisationId);
CREATE INDEX inx_cm_courseId ON sunbird.course_management (courseId);
CREATE INDEX inx_cm_course_name ON sunbird.course_management (courseName);
CREATE INDEX inx_cm_status ON sunbird.course_management (status);
CREATE INDEX inx_cm_contentId ON sunbird.course_management (contentId);
/*
creation of id = one way hash of userName
here id and userId both are same
currently username and email is same
email and username is unique
*/
CREATE TABLE IF NOT EXISTS sunbird.user(id text,userId text,userName text, email text,phone text,aadhaarNo text,createdDate text,updatedDate text,updatedBy text,
lastLoginTime text,status int,firstName text,lastName text,password text,avatar text,gender text,language text,state text,city text,zipcode text,PRIMARY KEY (id));
CREATE INDEX inx_u_email ON sunbird.user (email);
CREATE INDEX inx_u_phone ON sunbird.user (phone);
CREATE INDEX inx_u_status ON sunbird.user (status);
CREATE INDEX inx_u_userId ON sunbird.user (userId);
CREATE INDEX inx_u_userName ON sunbird.user (userName);
//user_auth
//id is auth token
CREATE TABLE IF NOT EXISTS sunbird.user_auth(id text, userId text,createdDate text,updatedDate text,source text,PRIMARY KEY (id));
CREATE INDEX inx_ua_userId ON sunbird.user_auth (userId);
CREATE INDEX inx_ua_source ON sunbird.user_auth (source);
//organisation
CREATE TABLE IF NOT EXISTS sunbird.organisation(id text, orgName text, description text,communityId text,createdBy text,createdByName text,createdDate text,
updatedDate text,updatedBy text,status int,relation text,parentOrgId text,orgType text,state text,city text,zipcode text,orgCode text,dateTime timestamp,PRIMARY KEY (id));
CREATE INDEX inx_org_orgName ON sunbird.organisation (orgName);
CREATE INDEX inx_org_status ON sunbird.organisation (status);
//page_management
//id= using timestamp and env
CREATE TABLE sunbird.page_management(id text, name text, appMap text,portalMap text,createdDate text,createdBy text,
updatedDate text,updatedBy text,organisationId text,PRIMARY KEY (id));
CREATE INDEX inx_pm_pageName ON sunbird.page_management (name);
CREATE INDEX inx_vm_organisationId ON sunbird.page_management (organisationId);
//page_section
//id= using timestamp and env
CREATE TABLE IF NOT EXISTS sunbird.page_section(id text, name text, sectionDataType text,description text,display text,
searchQuery text,createdDate text,createdBy text,updatedDate text,updatedBy text,imgUrl text,alt text,status int,PRIMARY KEY (id));
CREATE INDEX inx_ps_sectionDataType ON sunbird.page_section (sectionDataType);
CREATE INDEX inx_ps_sectionName ON sunbird.page_section (name);
//Assessment Eval
//id= using timestamp and env
CREATE TABLE IF NOT EXISTS sunbird.assessment_eval(id text, contentId text, courseId text, userId text,assessmentItemId text,
createdDate text,result text,score text,attemptId text,attemptedCount int,PRIMARY KEY (id));
CREATE INDEX inx_ae_userId ON sunbird.assessment_eval (userId);
CREATE INDEX inx_ae_contentId ON sunbird.assessment_eval (contentId);
CREATE INDEX inx_ae_assessmentItemId ON sunbird.assessment_eval (assessmentItemId);
CREATE INDEX inx_ae_courseId ON sunbird.assessment_eval (courseId);
//Assessment item
//id= using timestamp and userId
CREATE TABLE IF NOT EXISTS sunbird.assessment_item(id text, contentId text, courseId text, userId text,assessmentItemId text,
assessmentType text,attemptedDate text,createdDate text,timeTaken int,result text,score text,maxScore text,answers text,
evaluationStatus boolean,processingStatus boolean,attemptId text,PRIMARY KEY (id));
CREATE INDEX inx_ai_userId ON sunbird.assessment_item (userId);
CREATE INDEX inx_ai_contentId ON sunbird.assessment_item (contentId);
CREATE INDEX inx_ai_assessmentItemId ON sunbird.assessment_item (assessmentItemId);
CREATE INDEX inx_ai_courseId ON sunbird.assessment_item (courseId);
CREATE INDEX inx_ai_processingStatus ON sunbird.assessment_item (processingStatus);
ALTER TABLE sunbird.course_management DROP noOfLectures;
ALTER TABLE sunbird.course_management ADD noOfLectures int;
ALTER TABLE sunbird.assessment_item DROP evaluationStatus;
ALTER TABLE sunbird.assessment_item DROP processingStatus;
ALTER TABLE sunbird.assessment_item ADD evaluationStatus boolean;
ALTER TABLE sunbird.assessment_item ADD processingStatus boolean;
ALTER TABLE sunbird.assessment_eval DROP assessmentItemId;
ALTER TABLE sunbird.assessment_eval DROP maxScore;
ALTER TABLE sunbird.page_management ADD organisationId text;
ALTER TABLE sunbird.page_management DROP appMap;
ALTER TABLE sunbird.page_management DROP portalMap;
ALTER TABLE sunbird.page_management ADD appMap text;
ALTER TABLE sunbird.page_management ADD portalMap text;
ALTER TABLE sunbird.organisation ADD orgCode text;
//2017-06-30 changes for user and organisation
ALTER TABLE sunbird.user DROP zipcode;
ALTER TABLE sunbird.user DROP city;
ALTER TABLE sunbird.user DROP state;
ALTER TABLE sunbird.user DROP language;
ALTER TABLE sunbird.user ADD thumbnail text;
ALTER TABLE sunbird.user ADD dob text;
ALTER TABLE sunbird.user ADD regOrgId text;
ALTER TABLE sunbird.user ADD subject list<text>;
ALTER TABLE sunbird.user ADD language list<text>;
ALTER TABLE sunbird.user ADD grade list<text>;
CREATE TABLE IF NOT EXISTS sunbird.user_external_identity(id text, userId text, externalId text,source text,isVerified boolean,PRIMARY KEY (id));
CREATE INDEX inx_uei_userid ON sunbird.user_external_identity (userId);
CREATE INDEX inx_uei_externalId ON sunbird.user_external_identity (externalId);
CREATE INDEX inx_uei_source ON sunbird.user_external_identity (source);
CREATE TABLE IF NOT EXISTS sunbird.address(id text, userId text, country text,state text,city text,zipCode text,addType text,createdDate text,createdBy text,updatedDate text,updatedBy text, PRIMARY KEY (id));
CREATE INDEX inx_add_userid ON sunbird.address (userId);
CREATE INDEX inx_add_addType ON sunbird.address (addType);
CREATE TABLE IF NOT EXISTS sunbird.user_education(id text, userId text, courseName text,duration int,yearOfPassing int,percentage double,grade text,name text,boardOrUniversity text,addressId text,createdDate text,createdBy text,updatedDate text,updatedBy text, PRIMARY KEY (id));
CREATE INDEX inx_ueu_userid ON sunbird.user_education (userId);
CREATE TABLE IF NOT EXISTS sunbird.user_job_profile(id text, userId text, jobName text,role text,joiningDate text,endDate text,orgName text,orgId text,subject list<text>,addressId text,boardName text,isVerified boolean,isRejected boolean,verifiedDate text,verifiedBy text,createdDate text,createdBy text,updatedDate text,updatedBy text, PRIMARY KEY (id));
CREATE INDEX inx_ujp_userid ON sunbird.user_job_profile (userId);
CREATE TABLE IF NOT EXISTS sunbird.user_org(id text, userId text, role text,orgId text,orgJoinDate text,orgLeftDate text,isApproved boolean,
isRejected boolean,approvedBy text,approvalDate text,updatedDate text,updatedBy text, PRIMARY KEY (id));
CREATE INDEX inx_uorg_userid ON sunbird.user_org(userId);
CREATE INDEX inx_uorg_orgId ON sunbird.user_org(orgId);
CREATE TABLE IF NOT EXISTS sunbird.subject(id text, name text, PRIMARY KEY (id));
CREATE INDEX inx_sb_name ON sunbird.subject(name);
CREATE TABLE IF NOT EXISTS sunbird.role(id text, name text, PRIMARY KEY (id));
CREATE INDEX inx_role_name ON sunbird.role(name);
ALTER TABLE sunbird.organisation DROP city;
ALTER TABLE sunbird.organisation DROP state;
ALTER TABLE sunbird.organisation DROP zipcode;
ALTER TABLE sunbird.organisation DROP relation;
ALTER TABLE sunbird.organisation DROP createdbyname;
ALTER TABLE sunbird.organisation ADD imgUrl text;
ALTER TABLE sunbird.organisation ADD thumbnail text;
ALTER TABLE sunbird.organisation ADD channel text;
ALTER TABLE sunbird.organisation ADD preferredLanguage text;
ALTER TABLE sunbird.organisation ADD homeUrl text;
ALTER TABLE sunbird.organisation ADD isRootOrg boolean;
ALTER TABLE sunbird.organisation ADD addId text;
ALTER TABLE sunbird.organisation ADD noOfmembers int;
ALTER TABLE sunbird.organisation ADD orgCode text;
ALTER TABLE sunbird.organisation ADD isApproved boolean;
ALTER TABLE sunbird.organisation ADD approvedBy text;
ALTER TABLE sunbird.organisation ADD approvedDate text;
//ALTER TABLE sunbird.organisation ADD isRejected boolean;
CREATE INDEX inx_org_channel ON sunbird.organisation(channel);
CREATE INDEX inx_org_orgType ON sunbird.organisation(orgType);
CREATE INDEX inx_org_orgCode ON sunbird.organisation(orgCode);
CREATE TABLE IF NOT EXISTS sunbird.org_type(id text, name text, PRIMARY KEY (id));
CREATE INDEX inx_ot_name ON sunbird.org_type(name);
CREATE TABLE IF NOT EXISTS sunbird.org_mapping(id text, orgIdOne text,relation text,orgIdTwo text, PRIMARY KEY (id));
CREATE INDEX inx_om_orgIdOne ON sunbird.org_mapping(orgIdOne);
CREATE INDEX inx_om_orgIdTwo ON sunbird.org_mapping(orgIdTwo);
CREATE TABLE IF NOT EXISTS sunbird.role(id text, name text,status int, PRIMARY KEY (id));
CREATE INDEX inx_ro_master_name ON sunbird.role(name);
insert into role (id,name,status) values ('r_101','ADMIN',1);
insert into role (id,name,status) values ('r_102','ORG_ADMIN',1);
insert into role (id,name,status) values ('r_103','ORG_MODERATOR',1);
insert into role (id,name,status) values ('r_104','CONTENT_CREATOR',1);
insert into role (id,name,status) values ('r_105','CONTENT_REVIEWER',1);
insert into role (id,name,status) values ('r_106','ORG_MEMBER',1);
ALTER TABLE sunbird.user ADD rootOrgId text;
ALTER TABLE sunbird.address ADD addressLine1 text;
ALTER TABLE sunbird.address ADD addressLine2 text;
ALTER TABLE sunbird.user_education ADD degree text;
insert into sunbird.role (id,name,status) values ('r_101','SYSTEM_ADMINISTRATION',1);
insert into sunbird.role (id,name,status) values ('r_102','ORG_MANAGEMENT',1);
insert into sunbird.role (id,name,status) values ('r_103','MEMBERSHIP_MANAGEMENT',1);
insert into sunbird.role (id,name,status) values ('r_104','CONTENT_CREATION',1);
insert into sunbird.role (id,name,status) values ('r_105','CONTENT_REVIEW',1);
insert into sunbird.role (id,name,status) values ('r_106','CONTENT_CURATION',1);
insert into sunbird.role (id,name,status) values ('r_107','PUBLIC',1);
CREATE TABLE IF NOT EXISTS sunbird.master_action(id text, name text, PRIMARY KEY (id));
CREATE INDEX inx_ma_name ON sunbird.master_action(name);
CREATE TABLE IF NOT EXISTS sunbird.url_action(id text, url text,name text, PRIMARY KEY (id));
CREATE INDEX inx_ua_name ON sunbird.url_action(name);
CREATE INDEX inx_ua_url ON sunbird.url_action(url);
CREATE TABLE IF NOT EXISTS sunbird.action_group(id text, actionId list<text>,groupName text, PRIMARY KEY (id));
CREATE INDEX inx_uacg_groupName ON sunbird.action_group(groupName);
CREATE TABLE IF NOT EXISTS sunbird.user_action_role(id text, actionGroupId list<text>,roleId text, PRIMARY KEY (id));
CREATE INDEX inx_uactr_roleId ON sunbird.user_action_role(roleId);
insert into sunbird.url_action(id,url,name) values ('1','','suspendOrg');
insert into sunbird.url_action(id,url,name) values ('2','','suspendUser');
insert into sunbird.url_action(id,url,name) values ('3','','createOrg');
insert into sunbird.url_action(id,url,name) values ('4','','updateOrg');
insert into sunbird.url_action(id,url,name) values ('5','','updateUser');
insert into sunbird.url_action(id,url,name) values ('6','','addMember');
insert into sunbird.url_action(id,url,name) values ('7','','removeOrg');
insert into sunbird.url_action(id,url,name) values ('8','','createUser');
insert into sunbird.url_action(id,url,name) values ('9','','removeMember');
insert into sunbird.url_action(id,url,name) values ('10','','suspendMember');
insert into sunbird.url_action(id,url,name) values ('11','','createCourse');
insert into sunbird.url_action(id,url,name) values ('12','','updateCourse');
insert into sunbird.url_action(id,url,name) values ('13','','createContent');
insert into sunbird.url_action(id,url,name) values ('14','','updateContent');
insert into sunbird.url_action(id,url,name) values ('15','','publishCourse');
insert into sunbird.url_action(id,url,name) values ('16','','publishContent');
insert into sunbird.url_action(id,url,name) values ('17','','flagCourse');
insert into sunbird.url_action(id,url,name) values ('18','','flagContent');
insert into sunbird.url_action(id,url,name) values ('19','','getProfile');
insert into sunbird.url_action(id,url,name) values ('20','','updateProfile');
insert into sunbird.url_action(id,url,name) values ('21','','readCourse');
insert into sunbird.url_action(id,url,name) values ('22','','readContent');
insert into sunbird.url_action(id,url,name) values ('23','','rateCourse');
insert into sunbird.url_action(id,url,name) values ('24','','rateContent');
insert into sunbird.url_action(id,url,name) values ('25','','searchCourse');
insert into sunbird.url_action(id,url,name) values ('26','','searchContent');
insert into sunbird.action_group(id,actionId,groupName) values ('ag_12',['1','2'],'SYSTEM_ADMINISTRATION');
insert into sunbird.action_group(id,actionId,groupName) values ('ag_13',['3','4','7','8','5'],'ORG_MANAGEMENT');
insert into sunbird.action_group(id,actionId,groupName) values ('ag_14',['6','9','10'],'MEMBERSHIP_MANAGEMENT');
insert into sunbird.action_group(id,actionId,groupName) values ('ag_15',['11','12','13','14'],'CONTENT_CREATION');
insert into sunbird.action_group(id,actionId,groupName) values ('ag_16',['15','16'],'CONTENT_REVIEW');
insert into sunbird.action_group(id,actionId,groupName) values ('ag_17',['17','18','10'],'CONTENT_CURATION');
insert into sunbird.action_group(id,actionId,groupName) values ('ag_17',['19','20','21','22','23','24','25','26'],'PUBLIC');
ALTER TABLE sunbird.user ADD loginId text;
ALTER TABLE sunbird.user ADD provider text;
ALTER TABLE sunbird.user_external_identity ADD idType text;
insert into sunbird.user_action_role(id,actiongroupid,roleid) values ('uar_1',['ag_17'],'r_107');
insert into sunbird.user_action_role(id,actiongroupid,roleid) values ('uar_2',['ag_13'],'r_102');
insert into sunbird.user_action_role(id,actiongroupid,roleid) values ('uar_3',['ag_14'],'r_103');
insert into sunbird.user_action_role(id,actiongroupid,roleid) values ('uar_3',['ag_15'],'r_104');
insert into sunbird.user_action_role(id,actiongroupid,roleid) values ('uar_3',['ag_16'],'r_105');
insert into sunbird.user_action_role(id,actiongroupid,roleid) values ('uar_3',['ag_12'],'r_101');
ALTER TABLE sunbird.organisation DROP addId;
ALTER TABLE sunbird.organisation ADD addressId text;
ALTER TABLE sunbird.user ADD roles List<text>;
CREATE TABLE IF NOT EXISTS sunbird.role_group(id text, name text, PRIMARY KEY (id));
insert into sunbird.role_group (id,name) values ('SYSTEM_ADMINISTRATION','SYSTEM_ADMINISTRATION');
insert into sunbird.role_group (id,name) values ('ORG_MANAGEMENT','ORG_MANAGEMENT');
insert into sunbird.role_group (id,name) values ('MEMBERSHIP_MANAGEMENT','MEMBERSHIP_MANAGEMENT');
insert into sunbird.role_group (id,name) values ('CONTENT_CREATION','CONTENT_CREATION');
insert into sunbird.role_group (id,name) values ('CONTENT_CURATION','CONTENT_CURATION');
insert into sunbird.role_group (id,name) values ('CONTENT_REVIEW','CONTENT_REVIEW');
drop table sunbird.role;
CREATE TABLE IF NOT EXISTS sunbird.role(id text, name text,roleGroupId List<text>,status int, PRIMARY KEY (id));
CREATE INDEX inx_ro_master_name ON sunbird.role(name);
insert into sunbird.role (id,name,rolegroupid,status) values ('ADMIN','ADMIN',['SYSTEM_ADMINISTRATION','ORG_MANAGEMENT'],1);
insert into sunbird.role (id,name,rolegroupid,status) values ('ORG_ADMIN','ORG_ADMIN',['ORG_MANAGEMENT','MEMBERSHIP_MANAGEMENT'],1);
insert into sunbird.role (id,name,rolegroupid,status) values ('ORG_MODERATOR','ORG_MODERATOR',['MEMBERSHIP_MANAGEMENT'],1);
insert into sunbird.role (id,name,rolegroupid,status) values ('CONTENT_CREATOR','CONTENT_CREATOR',['CONTENT_CREATION'],1);
insert into sunbird.role (id,name,rolegroupid,status) values ('CONTENT_REVIEWER','CONTENT_REVIEWER',['CONTENT_CREATION','CONTENT_CURATION','CONTENT_REVIEW'],1);
drop table sunbird.url_action;
CREATE TABLE IF NOT EXISTS sunbird.url_action(id text, url list<text>,name text, PRIMARY KEY (id));
CREATE INDEX inx_ua_name ON sunbird.url_action(name);
CREATE INDEX inx_ua_url ON sunbird.url_action(url);
insert into sunbird.url_action (id,name) values ('suspendOrg','suspendOrg');
insert into sunbird.url_action (id,name) values ('suspendUser','suspendUser');
insert into sunbird.url_action (id,name) values ('createOrg','createOrg');
insert into sunbird.url_action (id,name) values ('updateOrg','updateOrg');
insert into sunbird.url_action (id,name) values ('removeOrg','removeOrg');
insert into sunbird.url_action (id,name) values ('createUser','createUser');
insert into sunbird.url_action (id,name) values ('updateUser','updateUser');
insert into sunbird.url_action (id,name) values ('ORG_MANAGEMENT','ORG_MANAGEMENT');
insert into sunbird.url_action (id,name) values ('createOrg','createOrg');
insert into sunbird.url_action (id,name) values ('addMember','addMember');
insert into sunbird.url_action (id,name) values ('removeMember','removeMember');
insert into sunbird.url_action (id,name) values ('suspendMember','suspendMember');
insert into sunbird.url_action (id,name) values ('createCourse','createCourse');
insert into sunbird.url_action (id,name) values ('updateCourse','updateCourse');
insert into sunbird.url_action (id,name) values ('createContent','createContent');
insert into sunbird.url_action (id,name) values ('updateContent','updateContent');
insert into sunbird.url_action (id,name) values ('flagCourse','flagCourse');
insert into sunbird.url_action (id,name) values ('flagContent','flagContent');
insert into sunbird.url_action (id,name) values ('publishCourse','publishCourse');
insert into sunbird.url_action (id,name) values ('publishContent','publishContent');
ALTER table sunbird.role_group add url_action_ids list<text>;
update sunbird.role_group set url_action_ids=['addMember','removeMember','suspendMember'] where id='MEMBERSHIP_MANAGEMENT';
update sunbird.role_group set url_action_ids=['createCourse','updateCourse','createContent','updateContent'] where id='CONTENT_CREATION';
update sunbird.role_group set url_action_ids=['suspendOrg','suspendUser'] where id='SYSTEM_ADMINISTRATION';
update sunbird.role_group set url_action_ids=['publishCourse','publishContent'] where id='CONTENT_REVIEW';
update sunbird.role_group set url_action_ids=['createOrg','updateOrg','removeOrg','createUser','updateUser'] where id='ORG_MANAGEMENT';
update sunbird.role_group set url_action_ids=['flagCourse','flagContent'] where id='CONTENT_CURATION';
update sunbird.url_action set url=['/v1/course/publish'] where id='publishContent';
update sunbird.url_action set url=['/v1/user/create'] where id='addMember';
update sunbird.url_action set url=['v1/course/create'] where id='createCourse';
update sunbird.url_action set url=['/v1/user/create'] where id='createUser';
update sunbird.url_action set url=['/v1/course/publish'] where id='publishCourse';
update sunbird.url_action set url=['/v1/organisation/update'] where id='updateOrg';
drop index inx_uorg_orgid;
ALTER TABLE sunbird.user_org DROP orgid;
ALTER TABLE sunbird.user_org ADD organisationid text;
ALTER TABLE sunbird.user_org ADD addedby text;
ALTER TABLE sunbird.user_org ADD addedbyname text;
CREATE INDEX inx_uorg_orgid ON sunbird.user_org (organisationid);
/*
creation of id= one way hash of (userId##courseId) here courseId is identifier of EkStep course
toc url is generated from ekStep
here status is (default(0),inProgress(1),completed(2))
progress is no of content completed
*/
CREATE TABLE IF NOT EXISTS sunbird.user_courses(id text, courseId text, courseName text, userId text, batchId text, enrolledDate text,
description text,tocUrl text,status int,active boolean,delta text,grade text,progress int,lastReadContentId text,
lastReadContentStatus int,addedBy text,courseLogoUrl text, dateTime timestamp, contentId text, PRIMARY KEY (id));
CREATE INDEX inx_ucs_userId ON sunbird.user_courses (userId);
CREATE INDEX inx_ucs_courseId ON sunbird.user_courses (courseId);
CREATE INDEX inx_ucs_batchId ON sunbird.user_courses (batchId);
CREATE INDEX inx_ucs_course_name ON sunbird.user_courses (courseName);
CREATE INDEX inx_ucs_status ON sunbird.user_courses (status);
ALTER TABLE sunbird.user_external_identity DROP source;
ALTER TABLE sunbird.user_external_identity ADD provider text;
ALTER TABLE sunbird.user_external_identity ADD externalIdValue text;
DROP INDEX inx_uei_source;
CREATE INDEX inx_uei_provider ON sunbird.user_external_identity (provider);
//changes 7 July 2017 updated organization table
ALTER TABLE sunbird.organisation ADD rootOrgID text;
ALTER TABLE sunbird.org_mapping ADD rootOrgID text;
CREATE TABLE IF NOT EXISTS sunbird.org_type(id text, name text, PRIMARY KEY (id));
DROP INDEX sunbird.inx_org_status;
ALTER TABLE sunbird.organisation DROP status ;
ALTER TABLE sunbird.organisation ADD status text;
CREATE INDEX inx_org_status ON sunbird.organisation (status);
CREATE INDEX inx_u_loginId ON sunbird.user(loginId);
ALTER TABLE sunbird.user_job_profile ADD isCurrentJob boolean;
ALTER TABLE sunbird.content_consumption ADD progress int;
ALTER TABLE sunbird.content_consumption DROP viewPosition;
//changes on 12th july 2017
ALTER TABLE sunbird.user_job_profile ADD isDeleted boolean;
ALTER TABLE sunbird.user_education ADD isDeleted boolean;
ALTER TABLE sunbird.address ADD isDeleted boolean;
ALTER TABLE sunbird.user_org ADD isDeleted boolean;
ALTER TABLE sunbird.user ADD profileSummary text;
ALTER TABLE sunbird.organisation ADD source text;
ALTER TABLE sunbird.organisation ADD externalId text;
//to export data from csv to cassandra table run below command(for page_section and page_management table)
// change the path of csv file
//COPY sunbird.page_management(id, appmap,createdby ,createddate ,name ,organisationid ,portalmap ,updatedby ,updateddate ) FROM '/tmp/cql/pageMgmt.csv';
//COPY sunbird.page_section(id, alt,createdby ,createddate ,description ,display ,imgurl ,name,searchquery , sectiondatatype ,status , updatedby ,updateddate) FROM '/tmp/cql/pageSection.csv'; | the_stack |
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for yy_admin_user
-- ----------------------------
DROP TABLE IF EXISTS `yy_admin_user`;
CREATE TABLE `yy_admin_user` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增ID',
`username` varchar(255) NOT NULL COMMENT '用户名',
`nickname` varchar(127) NOT NULL,
`auth_key` varchar(32) NOT NULL COMMENT '自动登录key',
`password_hash` varchar(255) NOT NULL COMMENT '加密密码',
`head_img` varchar(255) NOT NULL DEFAULT '',
`password_reset_token` varchar(255) DEFAULT NULL COMMENT '重置密码token',
`email` varchar(255) NOT NULL COMMENT '邮箱',
`role` smallint(6) NOT NULL DEFAULT '30' COMMENT '角色等级10 超级30 为一般',
`status` smallint(6) NOT NULL DEFAULT '10' COMMENT '状态',
`created_at` int(11) NOT NULL COMMENT '创建时间',
`updated_at` int(11) NOT NULL COMMENT '更新时间',
`last_login_at` int(11) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='用户表';
-- ----------------------------
-- Records of yy_admin_user
-- ----------------------------
INSERT INTO `yy_admin_user` VALUES ('1', 'fengahan', '冯阿含', 'HP187Mvq7Mmm3CTU80dLkGmni_FUH_lR', '$2y$13$EjaPFBnZOQsHdGuHI.xvhuDp1fHpo8hKRSk6yshqa9c5EG8s3C3lO', 'https://www.yiichina.com/uploads/avatar/000/02/90/86_avatar_small.jpg', 'ExzkCOaYc1L8IOBs4wdTGGbgNiG3Wz1I_1402312317', 'nicole.paucek@schultz.info', '10', '10', '1402312317', '1552371146', '1552371146');
INSERT INTO `yy_admin_user` VALUES ('2', 'zhangshan', 'zhangshan', 'DITUOiGgKIlrvp9SR0evg2Oci0lJ0lM9', '$2y$13$S59h.0Q1.GcXLnaz8YWkAePErnyKYl6KeMhLrHdZhxLcbBCwk9HfO', '', null, '544976880@qq.com', '10', '0', '1552319483', '1552366383', '0');
INSERT INTO `yy_admin_user` VALUES ('3', 'lisige', '李四哥哥', 'j2BjkzEMOfkNyKeAjYm3PKBExpn6-tko', '$2y$13$12XQmdF8p0nPz.WMxUwz6O/cw7CbuMwtwDACINnOPKzfH/rdaIhp2', '', null, '544976880@qq.com', '30', '10', '1552366992', '1552368687', '1552368687');
-- ----------------------------
-- Table structure for yy_auth_assignment
-- ----------------------------
DROP TABLE IF EXISTS `yy_auth_assignment`;
CREATE TABLE `yy_auth_assignment` (
`item_name` varchar(64) NOT NULL,
`user_id` varchar(64) NOT NULL,
`created_at` int(11) DEFAULT NULL,
PRIMARY KEY (`item_name`,`user_id`),
CONSTRAINT `yy_auth_assignment_ibfk_1` FOREIGN KEY (`item_name`) REFERENCES `yy_auth_item` (`name`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='角色和用户对应表';
-- ----------------------------
-- Records of yy_auth_assignment
-- ----------------------------
INSERT INTO `yy_auth_assignment` VALUES ('新的测试', '1', '1552318717');
INSERT INTO `yy_auth_assignment` VALUES ('新的测试', '14', '1545986840');
INSERT INTO `yy_auth_assignment` VALUES ('新的测试', '2', '1552319483');
INSERT INTO `yy_auth_assignment` VALUES ('新的测试', '3', '1552366992');
INSERT INTO `yy_auth_assignment` VALUES ('新的测试修改', '1', '1552318717');
INSERT INTO `yy_auth_assignment` VALUES ('新的测试修改', '2', '1552319483');
INSERT INTO `yy_auth_assignment` VALUES ('新的测试修改', '3', '1552366993');
INSERT INTO `yy_auth_assignment` VALUES ('新的测试的子类3', '1', '1552318717');
INSERT INTO `yy_auth_assignment` VALUES ('新的测试的子类3', '14', '1545986840');
INSERT INTO `yy_auth_assignment` VALUES ('新的测试的子类3', '2', '1552319483');
INSERT INTO `yy_auth_assignment` VALUES ('新的测试的子类3', '3', '1552366993');
INSERT INTO `yy_auth_assignment` VALUES ('权限Ao', '1', '1552318717');
INSERT INTO `yy_auth_assignment` VALUES ('权限Ao', '14', '1545984164');
INSERT INTO `yy_auth_assignment` VALUES ('权限Ao', '2', '1552319483');
INSERT INTO `yy_auth_assignment` VALUES ('权限Ao', '3', '1552366993');
INSERT INTO `yy_auth_assignment` VALUES ('校草', '1', '1545992226');
INSERT INTO `yy_auth_assignment` VALUES ('校草', '14', '1545984163');
INSERT INTO `yy_auth_assignment` VALUES ('校草', '2', '1552319483');
INSERT INTO `yy_auth_assignment` VALUES ('校草', '3', '1552366993');
-- ----------------------------
-- Table structure for yy_auth_item
-- ----------------------------
DROP TABLE IF EXISTS `yy_auth_item`;
CREATE TABLE `yy_auth_item` (
`name` varchar(64) NOT NULL,
`type` int(11) NOT NULL,
`description` text,
`rule_name` varchar(64) DEFAULT NULL,
`data` text,
`created_at` int(11) DEFAULT NULL,
`updated_at` int(11) DEFAULT NULL,
PRIMARY KEY (`name`),
KEY `rule_name` (`rule_name`),
KEY `type` (`type`),
CONSTRAINT `yy_auth_item_ibfk_1` FOREIGN KEY (`rule_name`) REFERENCES `yy_auth_rule` (`name`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='路由表和角色表';
-- ----------------------------
-- Records of yy_auth_item
-- ----------------------------
INSERT INTO `yy_auth_item` VALUES ('/*', '2', null, null, 'a:2:{s:10:\"route_name\";s:0:\"\";s:17:\"route_description\";s:0:\"\";}', '1546063462', '1546063462');
INSERT INTO `yy_auth_item` VALUES ('/admin-user/*', '2', null, null, 'a:2:{s:10:\"route_name\";s:0:\"\";s:17:\"route_description\";s:0:\"\";}', '1546063459', '1546063459');
INSERT INTO `yy_auth_item` VALUES ('/admin-user/create', '2', null, null, 'a:2:{s:10:\"route_name\";s:15:\"创建管理员\";s:17:\"route_description\";s:21:\"创建新的管理员\";}', '1546063459', '1546063459');
INSERT INTO `yy_auth_item` VALUES ('/admin-user/delete', '2', null, null, 'a:2:{s:10:\"route_name\";s:15:\"删除管理员\";s:17:\"route_description\";s:21:\"删除指定管理员\";}', '1546063459', '1546063459');
INSERT INTO `yy_auth_item` VALUES ('/admin-user/index', '2', null, null, 'a:2:{s:10:\"route_name\";s:15:\"管理员管理\";s:17:\"route_description\";s:15:\"管理员管理\";}', '1546063458', '1546063458');
INSERT INTO `yy_auth_item` VALUES ('/admin-user/list', '2', null, null, 'a:2:{s:10:\"route_name\";s:15:\"管理员列表\";s:17:\"route_description\";s:15:\"管理员列表\";}', '1546063459', '1546063459');
INSERT INTO `yy_auth_item` VALUES ('/admin-user/update', '2', null, null, 'a:2:{s:10:\"route_name\";s:15:\"更新管理员\";s:17:\"route_description\";s:21:\"更新管理员信息\";}', '1546063459', '1546063459');
INSERT INTO `yy_auth_item` VALUES ('/admin-user/update-status', '2', null, null, 'a:2:{s:10:\"route_name\";s:12:\"更新状态\";s:17:\"route_description\";s:12:\"更新状态\";}', '1546063459', '1546063459');
INSERT INTO `yy_auth_item` VALUES ('/admin-user/upload-head-img', '2', null, null, 'a:2:{s:10:\"route_name\";s:12:\"上传头像\";s:17:\"route_description\";s:12:\"上传头像\";}', '1546063459', '1546063459');
INSERT INTO `yy_auth_item` VALUES ('/menu/*', '2', null, null, 'a:2:{s:10:\"route_name\";s:0:\"\";s:17:\"route_description\";s:0:\"\";}', '1546063459', '1546063459');
INSERT INTO `yy_auth_item` VALUES ('/menu/create', '2', null, null, 'a:2:{s:10:\"route_name\";s:12:\"添加菜单\";s:17:\"route_description\";s:18:\"添加新的菜单\";}', '1546063459', '1546063459');
INSERT INTO `yy_auth_item` VALUES ('/menu/delete', '2', null, null, 'a:2:{s:10:\"route_name\";s:12:\"删除菜单\";s:17:\"route_description\";s:12:\"删除菜单\";}', '1546063459', '1546063459');
INSERT INTO `yy_auth_item` VALUES ('/menu/index', '2', null, null, 'a:2:{s:10:\"route_name\";s:12:\"菜单管理\";s:17:\"route_description\";s:0:\"\";}', '1546063459', '1546063459');
INSERT INTO `yy_auth_item` VALUES ('/menu/menu-list', '2', null, null, 'a:2:{s:10:\"route_name\";s:12:\"菜单列表\";s:17:\"route_description\";s:12:\"菜单列表\";}', '1546063459', '1546063459');
INSERT INTO `yy_auth_item` VALUES ('/menu/update', '2', null, null, 'a:2:{s:10:\"route_name\";s:12:\"更新菜单\";s:17:\"route_description\";s:18:\"更新菜单详情\";}', '1546063459', '1546063459');
INSERT INTO `yy_auth_item` VALUES ('/menu/view', '2', null, null, 'a:2:{s:10:\"route_name\";s:12:\"菜单详情\";s:17:\"route_description\";s:18:\"获取菜单详情\";}', '1546063459', '1546063459');
INSERT INTO `yy_auth_item` VALUES ('/permission/*', '2', null, null, 'a:2:{s:10:\"route_name\";s:0:\"\";s:17:\"route_description\";s:0:\"\";}', '1546063460', '1546063460');
INSERT INTO `yy_auth_item` VALUES ('/permission/assign', '2', null, null, 'a:2:{s:10:\"route_name\";s:12:\"分配路由\";s:17:\"route_description\";s:21:\"分配路由到权限\";}', '1546063460', '1546063460');
INSERT INTO `yy_auth_item` VALUES ('/permission/create', '2', null, null, 'a:2:{s:10:\"route_name\";s:12:\"创建权限\";s:17:\"route_description\";s:21:\"创建管理员权限\";}', '1546063460', '1546063460');
INSERT INTO `yy_auth_item` VALUES ('/permission/delete', '2', null, null, 'a:2:{s:10:\"route_name\";s:12:\"删除权限\";s:17:\"route_description\";s:18:\"删除指定权限\";}', '1546063460', '1546063460');
INSERT INTO `yy_auth_item` VALUES ('/permission/index', '2', null, null, 'a:2:{s:10:\"route_name\";s:12:\"权限管理\";s:17:\"route_description\";s:12:\"权限管理\";}', '1546063460', '1546063460');
INSERT INTO `yy_auth_item` VALUES ('/permission/list', '2', null, null, 'a:2:{s:10:\"route_name\";s:12:\"权限列表\";s:17:\"route_description\";s:12:\"所有权限\";}', '1546063460', '1546063460');
INSERT INTO `yy_auth_item` VALUES ('/permission/permission-all', '2', null, null, 'a:2:{s:10:\"route_name\";s:12:\"所有权限\";s:17:\"route_description\";s:27:\"所有可以分配到权限\";}', '1546063460', '1546063460');
INSERT INTO `yy_auth_item` VALUES ('/permission/permission-ass', '2', null, null, 'a:2:{s:10:\"route_name\";s:12:\"已有权限\";s:17:\"route_description\";s:24:\"所拥有的权限列表\";}', '1546063460', '1546063460');
INSERT INTO `yy_auth_item` VALUES ('/permission/remove', '2', null, null, 'a:2:{s:10:\"route_name\";s:12:\"移除权限\";s:17:\"route_description\";s:39:\"移除权限的其他权限或者路由\";}', '1546063460', '1546063460');
INSERT INTO `yy_auth_item` VALUES ('/permission/update', '2', null, null, 'a:2:{s:10:\"route_name\";s:12:\"更新权限\";s:17:\"route_description\";s:12:\"更新权限\";}', '1546063460', '1546063460');
INSERT INTO `yy_auth_item` VALUES ('/permission/view', '2', null, null, 'a:2:{s:10:\"route_name\";s:12:\"查看权限\";s:17:\"route_description\";s:18:\"查看权限详情\";}', '1546063460', '1546063460');
INSERT INTO `yy_auth_item` VALUES ('/role/*', '2', null, null, 'a:2:{s:10:\"route_name\";s:0:\"\";s:17:\"route_description\";s:0:\"\";}', '1546063461', '1546063461');
INSERT INTO `yy_auth_item` VALUES ('/role/assign', '2', null, null, 'a:2:{s:10:\"route_name\";s:21:\"分配路由或权限\";s:17:\"route_description\";s:21:\"分配路由到角色\";}', '1546063461', '1546063461');
INSERT INTO `yy_auth_item` VALUES ('/role/create', '2', null, null, 'a:2:{s:10:\"route_name\";s:12:\"创建角色\";s:17:\"route_description\";s:21:\"创建管理员角色\";}', '1546063460', '1546063460');
INSERT INTO `yy_auth_item` VALUES ('/role/delete', '2', null, null, 'a:2:{s:10:\"route_name\";s:12:\"删除角色\";s:17:\"route_description\";s:18:\"删除指定角色\";}', '1546063460', '1546063460');
INSERT INTO `yy_auth_item` VALUES ('/role/index', '2', null, null, 'a:2:{s:10:\"route_name\";s:12:\"角色管理\";s:17:\"route_description\";s:12:\"角色管理\";}', '1546063460', '1546063460');
INSERT INTO `yy_auth_item` VALUES ('/role/list', '2', null, null, 'a:2:{s:10:\"route_name\";s:12:\"角色列表\";s:17:\"route_description\";s:12:\"角色列表\";}', '1546063460', '1546063460');
INSERT INTO `yy_auth_item` VALUES ('/role/permission-all', '2', null, null, 'a:2:{s:10:\"route_name\";s:12:\"所有权限\";s:17:\"route_description\";s:27:\"所有可以分配到权限\";}', '1546063461', '1546063461');
INSERT INTO `yy_auth_item` VALUES ('/role/permission-ass', '2', null, null, 'a:2:{s:10:\"route_name\";s:12:\"已有权限\";s:17:\"route_description\";s:24:\"所拥有的权限列表\";}', '1546063461', '1546063461');
INSERT INTO `yy_auth_item` VALUES ('/role/remove', '2', null, null, 'a:2:{s:10:\"route_name\";s:12:\"移除权限\";s:17:\"route_description\";s:39:\"移除权限的其他权限或者路由\";}', '1546063461', '1546063461');
INSERT INTO `yy_auth_item` VALUES ('/role/update', '2', null, null, 'a:2:{s:10:\"route_name\";s:12:\"更新角色\";s:17:\"route_description\";s:24:\"更新指定角色信息\";}', '1546063460', '1546063460');
INSERT INTO `yy_auth_item` VALUES ('/role/view', '2', null, null, 'a:2:{s:10:\"route_name\";s:12:\"查看角色\";s:17:\"route_description\";s:18:\"查看角色详情\";}', '1546063461', '1546063461');
INSERT INTO `yy_auth_item` VALUES ('/route/*', '2', null, null, 'a:2:{s:10:\"route_name\";s:0:\"\";s:17:\"route_description\";s:0:\"\";}', '1546063462', '1546063462');
INSERT INTO `yy_auth_item` VALUES ('/route/as-index', '2', null, null, 'a:2:{s:10:\"route_name\";s:12:\"路由管理\";s:17:\"route_description\";s:24:\"获取已有路由列表\";}', '1546063461', '1546063461');
INSERT INTO `yy_auth_item` VALUES ('/route/assign-route', '2', null, null, 'a:2:{s:10:\"route_name\";s:21:\"添加路由到可用\";s:17:\"route_description\";s:21:\"添加路由到可用\";}', '1546063461', '1546063461');
INSERT INTO `yy_auth_item` VALUES ('/route/assigned-list', '2', null, null, 'a:2:{s:10:\"route_name\";s:12:\"路由列表\";s:17:\"route_description\";s:30:\"获得当前数据库的路由\";}', '1546063461', '1546063461');
INSERT INTO `yy_auth_item` VALUES ('/route/av-index', '2', null, null, 'a:2:{s:10:\"route_name\";s:12:\"路由管理\";s:17:\"route_description\";s:24:\"获取已有路由列表\";}', '1546063461', '1546063461');
INSERT INTO `yy_auth_item` VALUES ('/route/available-list', '2', null, null, 'a:2:{s:10:\"route_name\";s:21:\"可添加路由列表\";s:17:\"route_description\";s:33:\"获取当前项目支持的路由\";}', '1546063461', '1546063461');
INSERT INTO `yy_auth_item` VALUES ('/route/create', '2', null, null, 'a:2:{s:10:\"route_name\";s:12:\"添加路由\";s:17:\"route_description\";s:15:\"添加新路由\";}', '1546063461', '1546063461');
INSERT INTO `yy_auth_item` VALUES ('/route/remove-route', '2', null, null, 'a:2:{s:10:\"route_name\";s:12:\"移出路由\";s:17:\"route_description\";s:27:\"从可用路由列表移除\";}', '1546063461', '1546063461');
INSERT INTO `yy_auth_item` VALUES ('/route/update', '2', null, null, 'a:2:{s:10:\"route_name\";s:12:\"更新路由\";s:17:\"route_description\";s:18:\"更新路由详情\";}', '1546063461', '1546063461');
INSERT INTO `yy_auth_item` VALUES ('/route/view', '2', null, null, 'a:2:{s:10:\"route_name\";s:12:\"路由详情\";s:17:\"route_description\";s:18:\"获取路由详情\";}', '1546063461', '1546063461');
INSERT INTO `yy_auth_item` VALUES ('/rule/*', '2', null, null, 'a:2:{s:10:\"route_name\";s:0:\"\";s:17:\"route_description\";s:0:\"\";}', '1546063462', '1546063462');
INSERT INTO `yy_auth_item` VALUES ('/rule/create', '2', null, null, 'a:2:{s:10:\"route_name\";s:12:\"创建规则\";s:17:\"route_description\";s:18:\"创建访问规则\";}', '1546063462', '1546063462');
INSERT INTO `yy_auth_item` VALUES ('/rule/delete', '2', null, null, 'a:2:{s:10:\"route_name\";s:12:\"删除规则\";s:17:\"route_description\";s:18:\"删除指定规则\";}', '1546063462', '1546063462');
INSERT INTO `yy_auth_item` VALUES ('/rule/index', '2', null, null, 'a:2:{s:10:\"route_name\";s:12:\"规则管理\";s:17:\"route_description\";s:12:\"规则管理\";}', '1546063462', '1546063462');
INSERT INTO `yy_auth_item` VALUES ('/rule/list', '2', null, null, 'a:2:{s:10:\"route_name\";s:12:\"规则列表\";s:17:\"route_description\";s:12:\"规则列表\";}', '1546063462', '1546063462');
INSERT INTO `yy_auth_item` VALUES ('/rule/update', '2', null, null, 'a:2:{s:10:\"route_name\";s:12:\"更新规则\";s:17:\"route_description\";s:24:\"更新指定规则信息\";}', '1546063462', '1546063462');
INSERT INTO `yy_auth_item` VALUES ('/site/*', '2', null, null, 'a:2:{s:10:\"route_name\";s:0:\"\";s:17:\"route_description\";s:0:\"\";}', '1546063462', '1546063462');
INSERT INTO `yy_auth_item` VALUES ('/site/index', '2', null, null, 'a:2:{s:10:\"route_name\";s:0:\"\";s:17:\"route_description\";s:0:\"\";}', '1546063462', '1546063462');
INSERT INTO `yy_auth_item` VALUES ('/site/left-nav', '2', null, null, 'a:2:{s:10:\"route_name\";s:0:\"\";s:17:\"route_description\";s:0:\"\";}', '1552317535', '1552317535');
INSERT INTO `yy_auth_item` VALUES ('/site/login', '2', null, null, 'a:2:{s:10:\"route_name\";s:0:\"\";s:17:\"route_description\";s:0:\"\";}', '1546063462', '1546063462');
INSERT INTO `yy_auth_item` VALUES ('/site/logout', '2', null, null, 'a:2:{s:10:\"route_name\";s:0:\"\";s:17:\"route_description\";s:0:\"\";}', '1546063462', '1546063462');
INSERT INTO `yy_auth_item` VALUES ('/site/main', '2', null, null, 'a:2:{s:10:\"route_name\";s:0:\"\";s:17:\"route_description\";s:0:\"\";}', '1546063462', '1546063462');
INSERT INTO `yy_auth_item` VALUES ('/site/menu', '2', null, null, 'a:2:{s:10:\"route_name\";s:0:\"\";s:17:\"route_description\";s:0:\"\";}', '1546063462', '1546063462');
INSERT INTO `yy_auth_item` VALUES ('/site/nav', '2', null, null, 'a:2:{s:10:\"route_name\";s:0:\"\";s:17:\"route_description\";s:0:\"\";}', '1546063462', '1546063462');
INSERT INTO `yy_auth_item` VALUES ('新的测试', '1', '新的测试角色', null, null, '1545806711', '1545806711');
INSERT INTO `yy_auth_item` VALUES ('新的测试修改', '2', '新的测试2修改', null, null, '1545576515', '1545576584');
INSERT INTO `yy_auth_item` VALUES ('新的测试的子类3', '2', '测试权限ch测试权限ch', '测试规则A', null, '1545815699', '1545992504');
INSERT INTO `yy_auth_item` VALUES ('权限Ao', '2', '权限Ao2', null, null, '1545576911', '1545740136');
INSERT INTO `yy_auth_item` VALUES ('校草', '1', '校草', null, null, '1545808590', '1545808590');
-- ----------------------------
-- Table structure for yy_auth_item_child
-- ----------------------------
DROP TABLE IF EXISTS `yy_auth_item_child`;
CREATE TABLE `yy_auth_item_child` (
`parent` varchar(64) NOT NULL,
`child` varchar(64) NOT NULL,
PRIMARY KEY (`parent`,`child`),
KEY `child` (`child`),
CONSTRAINT `yy_auth_item_child_ibfk_1` FOREIGN KEY (`parent`) REFERENCES `yy_auth_item` (`name`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `yy_auth_item_child_ibfk_2` FOREIGN KEY (`child`) REFERENCES `yy_auth_item` (`name`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='角色 和 权限对应表';
-- ----------------------------
-- Records of yy_auth_item_child
-- ----------------------------
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/*');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/admin-user/*');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/admin-user/create');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/admin-user/delete');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/admin-user/index');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/admin-user/list');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/admin-user/update');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/admin-user/update-status');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/admin-user/upload-head-img');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/menu/*');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/menu/create');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/menu/delete');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/menu/index');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/menu/menu-list');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/menu/update');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/menu/view');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/permission/*');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/permission/assign');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/permission/create');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/permission/delete');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/permission/index');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/permission/list');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/permission/permission-all');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/permission/permission-ass');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/permission/remove');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/permission/update');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/permission/view');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/role/*');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/role/assign');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/role/create');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/role/delete');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/role/index');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/role/list');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/role/permission-all');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/role/permission-ass');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/role/remove');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/role/update');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/role/view');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/route/*');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/route/as-index');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/route/assign-route');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/route/assigned-list');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/route/av-index');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/route/available-list');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/route/create');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/route/remove-route');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/route/update');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/route/view');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/rule/*');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/rule/create');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/rule/delete');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/rule/index');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/rule/list');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/rule/update');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/site/*');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/site/index');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/site/login');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/site/logout');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/site/main');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/site/menu');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '/site/nav');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '新的测试修改');
INSERT INTO `yy_auth_item_child` VALUES ('权限Ao', '新的测试的子类3');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '新的测试的子类3');
INSERT INTO `yy_auth_item_child` VALUES ('校草', '权限Ao');
-- ----------------------------
-- Table structure for yy_auth_rule
-- ----------------------------
DROP TABLE IF EXISTS `yy_auth_rule`;
CREATE TABLE `yy_auth_rule` (
`name` varchar(64) NOT NULL,
`data` text,
`created_at` int(11) DEFAULT NULL,
`updated_at` int(11) DEFAULT NULL,
PRIMARY KEY (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of yy_auth_rule
-- ----------------------------
INSERT INTO `yy_auth_rule` VALUES ('route_rule', 'O:30:\"mdm\\admin\\components\\RouteRule\":3:{s:4:\"name\";s:10:\"route_rule\";s:9:\"createdAt\";i:1544611865;s:9:\"updatedAt\";i:1544611865;}', '1544611865', '1544611865');
INSERT INTO `yy_auth_rule` VALUES ('测试规则A', 'O:32:\"backend\\components\\rbac\\BugsRule\":4:{s:4:\"name\";s:13:\"测试规则A\";s:5:\"model\";N;s:9:\"createdAt\";i:1545817537;s:9:\"updatedAt\";i:1545992125;}', '1545817537', '1545992125');
-- ----------------------------
-- Table structure for yy_menu
-- ----------------------------
DROP TABLE IF EXISTS `yy_menu`;
CREATE TABLE `yy_menu` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(128) NOT NULL,
`parent` int(11) DEFAULT NULL,
`route` varchar(256) DEFAULT NULL,
`order` int(11) DEFAULT NULL,
`data` text,
PRIMARY KEY (`id`),
KEY `parent` (`parent`),
CONSTRAINT `yy_menu_ibfk_1` FOREIGN KEY (`parent`) REFERENCES `yy_menu` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=52 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of yy_menu
-- ----------------------------
INSERT INTO `yy_menu` VALUES ('41', '权限管理', null, '/*', null, '{\"icon\":\"layui-icon-female\"}');
INSERT INTO `yy_menu` VALUES ('42', '管理员列表', '41', '/admin-user/index', null, '{\"icon\":\"layui-icon-camera\"}');
INSERT INTO `yy_menu` VALUES ('43', '权限列表', '41', '/permission/index', null, '{\"icon\":\"layui-icon-diamond\"}');
INSERT INTO `yy_menu` VALUES ('44', '菜单管理', '41', '/menu/index', null, '{\"icon\":\"layui-icon-more\"}');
INSERT INTO `yy_menu` VALUES ('45', '角色列表', '41', '/role/index', null, '{\"icon\":\"layui-icon-star-fill\"}');
INSERT INTO `yy_menu` VALUES ('47', '会员列表', null, '/admin-user/index', null, '{\"icon\":\"layui-icon-play\"}');
INSERT INTO `yy_menu` VALUES ('50', '已有路由', '41', '/route/av-index', null, '{\"icon\":\"layui-icon-more\"}');
INSERT INTO `yy_menu` VALUES ('51', '路由管理', '41', '/route/as-index', null, '{\"icon\":\"layui-icon-engine\"}'); | the_stack |
IF NOT EXISTS(SELECT * FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = 'RDO')
EXEC sp_executesql N'CREATE SCHEMA RDO AUTHORIZATION dbo;';
CREATE TABLE RDO.ExposureSet(
id BIGINT NOT NULL,
name VARCHAR(256) NOT NULL,
externalId VARCHAR(256),
description VARCHAR(512),
createUserId VARCHAR(32),
createDate DATETIME,
updateUserId VARCHAR(32),
updateDate DATETIME
)
;
ALTER TABLE RDO.ExposureSet ADD CONSTRAINT PK_ExposureSet PRIMARY KEY(id);
CREATE TABLE RDO.Address(
id BIGINT NOT NULL,
addressSchemeId SMALLINT NOT NULL DEFAULT 1,
exposureSetId BIGINT NOT NULL,
externalId VARCHAR(256),
UGId VARCHAR(256),
source VARCHAR(256),
latitude FLOAT,
longitude FLOAT,
addressText VARCHAR(512),
campusCorrelationId BIGINT NOT NULL,
countryCode VARCHAR(4) NOT NULL,
countryName VARCHAR(256),
countryGeoId INT,
countryScheme VARCHAR(6),
countryModelCode VARCHAR(4),
zone1Code VARCHAR(16),
zone1Name VARCHAR(256),
zone2Code VARCHAR(16),
zone1GeoId BIGINT,
zone2Name VARCHAR(256),
zone2GeoId BIGINT,
zone3Code VARCHAR(16),
zone3Name VARCHAR(256),
zone3GeoId BIGINT,
zone4Code VARCHAR(16),
zone4Name VARCHAR(256),
zone4GeoId BIGINT,
zone5Code VARCHAR(16),
zone5Name VARCHAR(256),
zone5GeoId BIGINT,
admin1Code VARCHAR(16),
admin1Name VARCHAR(256),
admin1GeoId BIGINT,
admin2Code VARCHAR(16),
admin2Name VARCHAR(256),
admin2GeoId BIGINT,
admin3Code VARCHAR(16),
admin3Name VARCHAR(256),
admin3GeoId BIGINT,
admin4Code VARCHAR(16),
admin4Name VARCHAR(256),
admin4GeoId BIGINT,
admin5Code VARCHAR(16),
admin5Name VARCHAR(256),
admin5GeoId BIGINT,
cityCode VARCHAR(16),
cityName VARCHAR(256),
cityGeoId BIGINT,
cityPreferred VARCHAR(256),
postalCode VARCHAR(16),
postalCodeGeoId BIGINT,
postalCode1GeoId BIGINT,
postalCode2GeoId BIGINT,
postalCode3GeoId BIGINT,
postalCode4GeoId BIGINT,
locationCode VARCHAR(16),
locationCodeGeoId BIGINT,
census1Code VARCHAR(16),
census1Name VARCHAR(256),
census1GeoId BIGINT,
census2Code VARCHAR(16),
census2Name VARCHAR(256),
census2GeoId BIGINT,
streetAddress VARCHAR(256),
streetIsIntersection VARCHAR(64),
streetGeoId BIGINT,
streetType VARCHAR(256),
parcelName VARCHAR(256),
parcelNumber VARCHAR(50),
parcelGeoId BIGINT,
pointOfInterestFirmName VARCHAR(256),
pointOfInterestName VARCHAR(256),
pointOfInterestGeoId BIGINT,
pointOfInterestType VARCHAR(32),
buildingId VARCHAR(50),
buildingName VARCHAR(256),
buildingGeoId BIGINT,
unitNumber VARCHAR(64),
isSubmittedAddress BIT NOT NULL DEFAULT 1,
geocodingDataSourceId SMALLINT,
quadKey BIGINT,
geoProductVersion VARCHAR(20),
ACORDResolutionCode VARCHAR(64),
geocodingLocationCode VARCHAR(64),
geocodingMatchCode VARCHAR(64),
geoModelResolutionCode SMALLINT,
geocodingMatchConfidence FLOAT,
sublocality VARCHAR(256),
uncertainty FLOAT,
uncertaintyBuffer FLOAT,
geoCodedDate DATETIME
);
ALTER TABLE RDO.Address ADD CONSTRAINT PK_Address PRIMARY KEY(id);
ALTER TABLE RDO.Address ADD CONSTRAINT UQ_Address UNIQUE (id, addressSchemeId);
ALTER TABLE RDO.Address ADD CONSTRAINT FK_Address_ExposureSet FOREIGN KEY(exposureSetId) REFERENCES RDO.ExposureSet(id);
-----*** START RISKITEM SUBTYPE TABLES *** ----
CREATE TABLE RDO.RiskItem(
id BIGINT NOT NULL,
name VARCHAR(256) NOT NULL);
CREATE TABLE RDO.RiskItem_ContainedProperty(
riskItemId BIGINT NOT NULL,
externalId VARCHAR(256),
parentRiskItemId BIGINT,
name VARCHAR(256) NOT NULL,
number VARCHAR(256),
replacementCostValue FLOAT,
currencyCode CHAR(3)
);
ALTER TABLE RDO.RiskItem_ContainedProperty ADD CONSTRAINT PK_RiskItem_ContainedProperty PRIMARY KEY(riskItemId);
CREATE TABLE RDO.RiskItem_TimeElement (
riskItemId BIGINT NOT NULL,
externalId VARCHAR(256),
name VARCHAR(256) NOT NULL,
number VARCHAR(256),
parentRiskItemId BIGINT,
replacementCostValue FLOAT,
currencyCode CHAR(3)
);
ALTER TABLE RDO.RiskItem_TimeElement ADD CONSTRAINT PK_RiskItem_TimeElement PRIMARY KEY(riskItemId);
CREATE TABLE RDO.RiskItem_RealProperty(
riskItemId BIGINT NOT NULL,
addressId BIGINT NOT NULL,
externalId VARCHAR(256),
parentRiskItemId BIGINT,
name VARCHAR(256) NOT NULL,
number VARCHAR(256),
replacementCostValue FLOAT,
currencyCode CHAR(3),
buildingHeight FLOAT,
constructionCompleteDate DATETIME,
constructionCompletePercent FLOAT,
constructionSchemeName VARCHAR(10) NOT NULL,
constructionCode VARCHAR(5) NOT NULL,
constructionStartDate DATETIME,
floorArea FLOAT,
floorAreaUnitCode SMALLINT NOT NULL DEFAULT 2,
floorOccupied VARCHAR(256),
floorSize FLOAT,
floorsUnderground SMALLINT,
footprintArea FLOAT,
heightUnitCode SMALLINT,
numberOfBaths SMALLINT,
numberOfBedrooms SMALLINT,
numberOfBuildings SMALLINT,
numberOfStories SMALLINT,
occupancyschemeName VARCHAR(10) NOT NULL,
occupancyCode VARCHAR(10) NOT NULL,
rentalPropertyIdentifierCode SMALLINT,
secondaryOccupancyList VARCHAR(2048),
totalRooms INT,
yearBuilt SMALLINT
);
ALTER TABLE RDO.RiskItem_RealProperty ADD CONSTRAINT PK_RiskItem_RealProperty PRIMARY KEY(riskItemId);
ALTER TABLE RDO.RiskItem_RealProperty ADD CONSTRAINT FK_RiskItem_RealProperty_Address FOREIGN KEY(addressId) REFERENCES RDO.Address(id);
CREATE TABLE RDO.RiskItem_Population(
riskItemId BIGINT NOT NULL,
externalId VARCHAR(256),
parentRiskItemId BIGINT,
name VARCHAR(256) NOT NULL,
number VARCHAR(256),
groupName VARCHAR(256),
groupNumber VARCHAR(256),
occupationSchemeName VARCHAR(10) NOT NULL,
occupationCode INTEGER NOT NULL,
totalPayroll FLOAT NOT NULL DEFAULT 0.0,
totalNumPeople INT NOT NULL DEFAULT 0,
maxNumPeople INT NOT NULL DEFAULT 0,
calculatedNumPeople INT NOT NULL DEFAULT 0,
shiftTypeId SMALLINT NOT NULL DEFAULT 0,
emergencyProtectionProxCode SMALLINT,
hazardousMaterialCode SMALLINT,
wageRelativityRankCode SMALLINT,
riskManagementOnsiteRankCode SMALLINT,
populationDensityCode SMALLINT,
USLHCoveredPercent FLOAT,
hasExcessWorkersComp BIT NOT NULL DEFAULT 0,
UWManagementAdjustment FLOAT
);
ALTER TABLE RDO.RiskItem_Population ADD CONSTRAINT PK_RiskItem_Population PRIMARY KEY(riskItemId);
CREATE TABLE RDO.PopulationShift(
riskItemId BIGINT NOT NULL,
shiftId SMALLINT NOT NULL,
count INT NOT NULL
);
ALTER TABLE RDO.PopulationShift ADD CONSTRAINT PK_PopulationShift PRIMARY KEY(riskItemId, shiftId);
CREATE TABLE RDO.RealPropertyCharacteristics (
riskItemId BIGINT NOT NULL,
characteristicsSchemeCode VARCHAR(32) NOT NULL DEFAULT 'XX',
basementCode SMALLINT,
BIPreparednessCode SMALLINT,
BIRedundancyCode SMALLINT,
commercialAppurtenantCode SMALLINT,
contentsVulnWaterCode SMALLINT,
contentsVulnWindCode SMALLINT,
engineeredFoundationCode SMALLINT,
exteriorCode SMALLINT,
exteriorRatingCode SMALLINT,
externalOrnamentationCode SMALLINT,
fireSprinklerSystemCode SMALLINT,
fireSuppressionCode SMALLINT,
fireRemoteAlarmPresenceCode SMALLINT,
floorTypeCode SMALLINT,
floodingMissileCode SMALLINT,
floodingProtectionCode SMALLINT,
foundationTypeCode SMALLINT,
frameFoundationConnectionCode SMALLINT,
garagingCode SMALLINT,
marineProtectionCode SMALLINT,
plumbingInsulationCode SMALLINT,
openingProtectCode SMALLINT,
performanceCode SMALLINT,
planIrregularityCode SMALLINT,
poundingCode SMALLINT,
residentialAppurtenantCode SMALLINT,
roofAdditionsCode SMALLINT,
roofAgeConditionCode SMALLINT,
roofAnchorCode SMALLINT,
roofCoveringCode SMALLINT,
roofGeometryCode SMALLINT,
roofVentCode SMALLINT,
structuralUpgradeNonURMCode SMALLINT,
tankCode SMALLINT,
URMRetrofitCode SMALLINT,
URMChimneyCode SMALLINT,
verticalIrregularityCode SMALLINT,
windMissileExposureCode TINYINT,
yearOfUpgrade SMALLINT
);
ALTER TABLE RDO.RealPropertyCharacteristics ADD CONSTRAINT PK_RealPropertyCharacteristics PRIMARY KEY(riskItemId);
ALTER TABLE RDO.RealPropertyCharacteristics ADD CONSTRAINT UQ_RealPropertyCharacteristics UNIQUE (riskItemId,characteristicsSchemeCode);
-----*** END RISKITEM SUBTYPE TABLES *** ----
-----*** START RISK, SCHEDULE TABLES *** ----
CREATE TABLE RDO.Risk (
id BIGINT NOT NULL,
exposureSetId BIGINT NOT NULL,
primaryRiskItemId BIGINT NOT NULL,
externalId VARCHAR(256),
name VARCHAR(256) NOT NULL,
number VARCHAR(256),
description VARCHAR(512),
accountName VARCHAR(256),
numberOfUnits INTEGER NOT NULL DEFAULT 1
);
ALTER TABLE RDO.Risk ADD CONSTRAINT PK_Risk PRIMARY KEY(id);
ALTER TABLE RDO.Risk ADD CONSTRAINT FK_Risk_ExposureSet FOREIGN KEY(exposureSetId) REFERENCES RDO.ExposureSet(id);
CREATE TABLE RDO.RiskExposure (
riskExposureId BIGINT NOT NULL,
exposureSetId BIGINT NOT NULL,
riskId BIGINT,
riskItemId BIGINT NOT NULL,
lossTypeCode VARCHAR(32) NOT NULL,
insurableInterest FLOAT NOT NULL DEFAULT 1.0
);
ALTER TABLE RDO.RiskExposure ADD CONSTRAINT PK_RiskExposure PRIMARY KEY(riskExposureId);
ALTER TABLE RDO.RiskExposure ADD CONSTRAINT UQ_RiskExposure UNIQUE (riskId, riskItemId, lossTypeCode, insurableInterest);
ALTER TABLE RDO.RiskExposure ADD CONSTRAINT FK_RiskExposure_ExposureSet FOREIGN KEY(exposureSetId) REFERENCES RDO.ExposureSet(id);
ALTER TABLE RDO.RiskExposure ADD CONSTRAINT FK_RiskExposure_Risk FOREIGN KEY(riskId) REFERENCES RDO.Risk(Id);
CREATE TABLE RDO.Schedule (
id BIGINT NOT NULL,
exposureSetId BIGINT NOT NULL,
externalId VARCHAR(256),
name VARCHAR(256) NOT NULL,
number VARCHAR(256),
description VARCHAR(512),
scheduleExpression VARCHAR(2048),
accountName VARCHAR(256)
);
ALTER TABLE RDO.Schedule ADD CONSTRAINT PK_Schedule PRIMARY KEY(id);
ALTER TABLE RDO.Schedule ADD CONSTRAINT FK_Schedule_ExposureSet FOREIGN KEY(exposureSetId) REFERENCES RDO.ExposureSet(id);
CREATE TABLE RDO.ScheduleRiskMap (
scheduleId BIGINT NOT NULL,
riskId BIGINT NOT NULL
);
ALTER TABLE RDO.ScheduleRiskMap ADD CONSTRAINT PK_ScheduleRiskMap PRIMARY KEY(scheduleId, riskId);
ALTER TABLE RDO.ScheduleRiskMap ADD CONSTRAINT FK_ScheduleRiskMap_Schedule FOREIGN KEY(scheduleId) REFERENCES RDO.Schedule(id);
ALTER TABLE RDO.ScheduleRiskMap ADD CONSTRAINT FK_ScheduleRiskMap_Risk FOREIGN KEY(riskId) REFERENCES RDO.Risk(id);
-----*** END RISK, SCHEDULE TABLES *** ----
-----*** START CONTRACT TABLES *** ----
CREATE TABLE RDO.Contract(
id BIGINT NOT NULL,
name VARCHAR(256) NOT NULL
);
CREATE TABLE RDO.Contract_Insurance(
id BIGINT NOT NULL,
exposureSetId BIGINT NOT NULL,
externalId VARCHAR(256),
name VARCHAR(256) NOT NULL,
number VARCHAR(256),
description VARCHAR(512),
statusCode VARCHAR(32),
insuranceContractTypeCode VARCHAR(32),
subjectId BIGINT,
subjectName VARCHAR(256),
subjectScopeCode VARCHAR(16),
renewalExternalId VARCHAR(256),
brokerage FLOAT DEFAULT 0.0
);
ALTER TABLE RDO.Contract_Insurance ADD CONSTRAINT PK_Contract_Insurance PRIMARY KEY(id);
ALTER TABLE RDO.Contract_Insurance ADD CONSTRAINT FK_Contract_Insurance_ExposureSet FOREIGN KEY(exposureSetId) REFERENCES RDO.ExposureSet(id);
ALTER TABLE RDO.Contract_Insurance ADD CONSTRAINT CK_Contract_Insurance_subjectScopeCode CHECK (subjectScopeCode IN ('RISK' , 'SCHEDULE'));
CREATE TABLE RDO.InsuranceLayer (
id BIGINT NOT NULL,
externalId VARCHAR(256),
insuranceContractId BIGINT NOT NULL,
name VARCHAR(256) NOT NULL,
number VARCHAR(256),
description VARCHAR(512),
inceptionDate DATE,
expirationDate DATE,
contractLineOfBusinessCode VARCHAR(32),
premium FLOAT DEFAULT 0.0,
premiumCurrencyCode CHAR(3),
tax FLOAT DEFAULT 0.0,
payoutShare FLOAT NOT NULL DEFAULT 1.0,
payoutFunctionCode VARCHAR(32) NOT NULL DEFAULT 'LIMIT',
payoutAmount FLOAT NOT NULL DEFAULT 0.0,
payoutAmountBasisCode VARCHAR(32) NOT NULL,
payoutTimeBasisCode VARCHAR(32) NOT NULL,
payoutCurrencyCode CHAR(3) NOT NULL,
excessIsFranchise BIT NOT NULL DEFAULT 0,
excessAmount FLOAT NOT NULL DEFAULT 0.0,
excessAmountBasisCode VARCHAR(32) NOT NULL,
excessTimeBasisCode VARCHAR(32) NOT NULL,
excessCurrencyCode CHAR(3) NOT NULL,
lossTypeCode VARCHAR(32) NOT NULL,
causeOfLossCode VARCHAR(32) NOT NULL,
subjectId BIGINT, -- could be another layerId (if parent layer pointing to child) otherwise schedule/riskId
subjectScopeCode VARCHAR(32) NOT NULL,
subjectResolutionCode VARCHAR(32)
);
ALTER TABLE RDO.InsuranceLayer ADD CONSTRAINT PK_InsuranceLayer PRIMARY KEY(id);
ALTER TABLE RDO.InsuranceLayer ADD CONSTRAINT UQ_InsuranceLayer UNIQUE(insuranceContractId, name);
ALTER TABLE RDO.InsuranceLayer ADD CONSTRAINT FK_InsuranceLayer_InsuranceContract FOREIGN KEY(insuranceContractId) REFERENCES RDO.Contract_Insurance(id);
ALTER TABLE RDO.InsuranceLayer ADD CONSTRAINT CK_InsuranceLayer_subjectScopeCode CHECK (subjectScopeCode IN ('RISK' , 'SCHEDULE', 'SUBSCHEDULE','LAYER'));
CREATE TABLE RDO.InsuranceTerm(
id BIGINT IDENTITY,
insuranceContractId BIGINT NOT NULL,
termTypeCode VARCHAR(32) NOT NULL,
amount FLOAT,
amountBasisCode VARCHAR(32) NOT NULL,
timeBasisCode VARCHAR(32) NOT NULL,
currencyCode CHAR(3) NOT NULL,
lossTypeCode VARCHAR(32) NOT NULL,
causeOfLossCode VARCHAR(32) NOT NULL,
subjectId BIGINT,
subjectScopeCode VARCHAR(32),
subjectResolutionCode VARCHAR(32)
);
ALTER TABLE RDO.InsuranceTerm ADD CONSTRAINT PK_InsuranceTerm PRIMARY KEY(id);
ALTER TABLE RDO.InsuranceTerm ADD CONSTRAINT FK_InsuranceTerm_InsuranceContract FOREIGN KEY(insuranceContractId) REFERENCES RDO.Contract_Insurance(id);
CREATE TABLE RDO.SubscheduleRiskMap (
subscheduleId BIGINT NOT NULL,
insuranceContractId BIGINT NOT NULL,
riskId BIGINT NOT NULL
);
ALTER TABLE RDO.SubscheduleRiskMap ADD CONSTRAINT PK_SubscheduleRiskMap PRIMARY KEY(insuranceContractId, subscheduleId, riskId);
ALTER TABLE RDO.SubscheduleRiskMap ADD CONSTRAINT FK_SubscheduleRiskMap_Risk FOREIGN KEY(riskId) REFERENCES RDO.Risk(id);
CREATE TABLE RDO.Contract_Facultative (
id BIGINT NOT NULL,
exposureSetId BIGINT NOT NULL,
name VARCHAR(256) NOT NULL,
number VARCHAR(256),
inceptionDate DATE,
expirationDate DATE,
producerCode VARCHAR(80),
cedantCode VARCHAR(80),
lossTypeCodes VARCHAR(128) NOT NULL, -- "loss" if no restrictions
causeOfLossCodes VARCHAR(32) NOT NULL, --"all" if no restrictions
lineOfBusinessCodes VARCHAR(256),
premium FLOAT,
excessAmount FLOAT NOT NULL DEFAULT 0.0,
excessCurrencyCode CHAR(3) NOT NULL,
limitAmount FLOAT, -- use for EDM surplus share's occurrence limit
limitCurrencyCode CHAR(3) NOT NULL,
share FLOAT NOT NULL DEFAULT 1.0,
inuringPriority SMALLINT NOT NULL DEFAULT 1,
);
ALTER TABLE RDO.Contract_Facultative ADD CONSTRAINT PK_Contract_Facultative PRIMARY KEY(id);
ALTER TABLE RDO.Contract_Facultative ADD CONSTRAINT FK_Contract_Facultative_ExposureSet FOREIGN KEY(exposureSetId) REFERENCES RDO.ExposureSet(id);
CREATE TABLE RDO.FacultativeCession (
id BIGINT NOT NULL,
facultativeId BIGINT NOT NULL,
excessAmount FLOAT NOT NULL DEFAULT 0.0,
excessCurrencyCode CHAR(3) NOT NULL,
limitAmount FLOAT,
limitCurrencyCode CHAR(3) NOT NULL,
share FLOAT NOT NULL DEFAULT 1.0,
subjectScopeCode VARCHAR(32) NOT NULL, -- "contract", "contractLayer", or "risk"
subjectInsuranceContractId BIGINT NOT NULL,
subjectInsuranceLayerId BIGINT,
subjectRiskId BIGINT
);
ALTER TABLE RDO.FacultativeCession ADD CONSTRAINT PK_FacultativeCession PRIMARY KEY(id);
ALTER TABLE RDO.FacultativeCession ADD CONSTRAINT FK_FacultativeCession_Facultative FOREIGN KEY(facultativeId) REFERENCES RDO.Contract_Facultative(id);
ALTER TABLE RDO.FacultativeCession ADD CONSTRAINT FK_FacultativeCession_InsuranceContract FOREIGN KEY(subjectInsuranceContractId) REFERENCES RDO.Contract_Insurance(id);
ALTER TABLE RDO.FacultativeCession ADD CONSTRAINT FK_FacultativeCession_InsuranceLayer FOREIGN KEY(subjectInsuranceLayerId) REFERENCES RDO.InsuranceLayer(id);
ALTER TABLE RDO.FacultativeCession ADD CONSTRAINT FK_FacultativeCession_Risk FOREIGN KEY(subjectRiskId) REFERENCES RDO.Risk(id);
CREATE TABLE RDO.Contract_Treaty(
id BIGINT NOT NULL,
name VARCHAR(256) NOT NULL,
number VARCHAR(256),
externalId VARCHAR(256),
treatyTypeCode VARCHAR(32) NOT NULL,
depositPremium FLOAT DEFAULT 0.0,
depositPremiumCurrencyCode CHAR(3),
taxRate FLOAT DEFAULT 0.0,
brokerageRate FLOAT DEFAULT 0.0,
variableExpenseRate FLOAT DEFAULT 0.0,
lossAdjustmentExpenseRate FLOAT DEFAULT 0.0,
fixedExpense FLOAT DEFAULT 0.0,
inuringPriority SMALLINT,
attachmentLevelCode VARCHAR(32) NOT NULL, -- per_contract/per_contractlayer/per_risk/per_occurrence
attachmentBasisCode VARCHAR(32) NOT NULL, -- risks attaching/losses occurring
percentRetention FLOAT NOT NULL DEFAULT 1.0,
percentShare FLOAT NOT NULL DEFAULT 1.0
);
ALTER TABLE RDO.Contract_Treaty ADD CONSTRAINT PK_Contract_Treaty PRIMARY KEY(id);
CREATE TABLE Rdo.PerRiskTreatySubject (
id BIGINT NOT NULL,
treatyId BIGINT NOT NULL,
portfolioId BIGINT NOT NULL,
filterAttribute VARCHAR(32), -- contractLineOfBusinessCode or contractCedantCode
filterValue VARCHAR(80) -- ex: "RES", "COM", "ABC Insurance"
);
ALTER TABLE RDO.PerRiskTreatySubject ADD CONSTRAINT PK_PerRiskTreatySubject PRIMARY KEY(id);
CREATE TABLE RDO.TreatyReinstatements(
treatyId BIGINT NOT NULL,
numberOfReinstatements SMALLINT NOT NULL DEFAULT 0,
isUnlimited BIT NOT NULL DEFAULT 0,
ordinal SMALLINT NOT NULL DEFAULT 1,
isPaid BIT DEFAULT 1,
rate FLOAT DEFAULT 1.0,
proRataOptionTypeCode VARCHAR(32) -- "Amount", "Time", "Amount_and_Time", ""
);
ALTER TABLE RDO.TreatyReinstatements ADD CONSTRAINT PK_TreatyReinstatements PRIMARY KEY(treatyId);
CREATE TABLE RDO.TreatyLayer(
treatyId BIGINT NOT NULL,
id SMALLINT NOT NULL,
name VARCHAR(256) NOT NULL,
parentLayerId SMALLINT NOT NULL,
isPerRisk BIT NOT NULL,
inceptionDate DATE NOT NULL,
expirationDate DATE NOT NULL,
payoutShare FLOAT NOT NULL DEFAULT 1.0,
payoutFunctionCode VARCHAR(32) NOT NULL DEFAULT 'LIMIT',
payoutAmount FLOAT NOT NULL DEFAULT 0.0,
payoutAmountBasisCode VARCHAR(32) NOT NULL,
payoutTimeBasisCode VARCHAR(32) NOT NULL,
payoutCurrencyCode CHAR(3) NOT NULL,
excessIsFranchise BIT NOT NULL DEFAULT 0,
excessAmount FLOAT NOT NULL DEFAULT 0.0,
excessAmountBasisCode VARCHAR(32) NOT NULL DEFAULT 'MONEY',
excessTimeBasisCode VARCHAR(32) NOT NULL,
excessCurrencyCode CHAR(3) NOT NULL
);
ALTER TABLE RDO.TreatyLayer ADD CONSTRAINT PK_TreatyLayer PRIMARY KEY(id, treatyId);
CREATE TABLE RDO.ContractDeclaration(
contractId BIGINT NOT NULL,
contractLayerId BIGINT,
contractScopeCode VARCHAR(32), -- 'Layer' or 'Contract'
contractCedantCode VARCHAR(80),
reinsurerCode VARCHAR(80),
underwriterShortName VARCHAR(80),
producerShortName VARCHAR(80),
branchShortName VARCHAR(80),
brokerShortName VARCHAR(80)
);
ALTER TABLE RDO.ContractDeclaration ADD CONSTRAINT CK_ContractDeclaration_scopeCode CHECK (contractScopeCode IN ('CONTRACT' , 'LAYER'));
CREATE TABLE RDO.ContractCDL(
contractId BIGINT NOT NULL,
CDL VARCHAR(MAX)
);
ALTER TABLE RDO.ContractCDL ADD CONSTRAINT PK_ContractCDL PRIMARY KEY(contractId);
-----*** END CONTRACT TABLES *** ----
-----*** START PORTFOLIO and PORTFOLIO-CONTRACT MEMBERSHIP *** ----
CREATE TABLE RDO.Portfolio (
id BIGINT NOT NULL,
externalId VARCHAR(256),
name VARCHAR(512) NOT NULL,
exposureSetId BIGINT,
number VARCHAR(256),
portfolioTypeCode VARCHAR(32),
description VARCHAR(512)
);
ALTER TABLE RDO.Portfolio ADD CONSTRAINT PK_Portfolio PRIMARY KEY(id);
ALTER TABLE RDO.Portfolio ADD CONSTRAINT UQ_Portfolio_name UNIQUE(name);
CREATE TABLE RDO.PortfolioTag (
portfolioId BIGINT NOT NULL,
tagCode VARCHAR(32) NOT NULL, -- lineOfBusinessCode, underwriterCode...
tagValue VARCHAR(80) -- ex: "RES", "Joe", "ABC Insurance"
);
ALTER TABLE RDO.PortfolioTag ADD CONSTRAINT PK_PortfolioTag PRIMARY KEY(portfolioId, tagCode);
CREATE TABLE RDO.PortfolioMembership (
portfolioId BIGINT NOT NULL,
insuranceContractId BIGINT NOT NULL
)
;
ALTER TABLE RDO.PortfolioMembership ADD CONSTRAINT PK_PortfolioMembership PRIMARY KEY(portfolioId, insuranceContractId);
ALTER TABLE RDO.PortfolioMembership ADD CONSTRAINT FK_PortfolioMembership_Portfolio FOREIGN KEY(portfolioId) REFERENCES RDO.Portfolio(id);
ALTER TABLE RDO.PortfolioMembership ADD CONSTRAINT FK_PortfolioMembership_InsuranceContract FOREIGN KEY(insuranceContractId) REFERENCES RDO.Contract_Insurance(id);
CREATE TABLE RDO.AggregatePortfolioMembership (
id BIGINT NOT NULL,
portfolioId BIGINT NOT NULL,
exposureSetId BIGINT,
countryCode VARCHAR(4) NOT NULL,
admin1Code VARCHAR(16),
admin2Code VARCHAR(16),
cresta VARCHAR(16),
postalCode VARCHAR(16),
riskCount BIGINT,
totalReplacementCostValue FLOAT,
currencyCode CHAR(3) NOT NULL,
lossTypeCode VARCHAR(32) NOT NULL,
causeOfLossCode VARCHAR(32) NOT NULL,
contractLineOfBusinessCode VARCHAR(32),
totalPremium FLOAT,
totalLimit FLOAT,
averageDeductible FLOAT
)
;
ALTER TABLE RDO.AggregatePortfolioMembership ADD CONSTRAINT PK_AggregatePortfolioMembership PRIMARY KEY(id);
ALTER TABLE RDO.AggregatePortfolioMembership ADD CONSTRAINT FK_AggregatePortfolioMembership FOREIGN KEY(portfolioId) REFERENCES RDO.Portfolio(id);
ALTER TABLE RDO.AggregatePortfolioMembership ADD CONSTRAINT FK_AggregatePortfolioMembership_ExposureSet FOREIGN KEY(exposureSetId) REFERENCES RDO.ExposureSet(id);
-----*** END PORTFOLIO and PORTFOLIO MEMBERSHIP *** ----
-----*** START STRUCTURE and STRUCTURE-POSITIONS *** ----
CREATE TABLE RDO.SDLStructure (
id BIGINT NOT NULL,
name VARCHAR(512) NOT NULL,
externalId VARCHAR(256),
description VARCHAR(512),
SDL VARCHAR(MAX)
);
ALTER TABLE RDO.SDLStructure ADD CONSTRAINT PK_SDLStructure PRIMARY KEY(id);
ALTER TABLE RDO.SDLStructure ADD CONSTRAINT UQ_SDLStructure_name UNIQUE(name);
CREATE TABLE RDO.StructurePositions (
id BIGINT NOT NULL,
structureId BIGINT NOT NULL,
positionName VARCHAR(512) NOT NULL,
positionTypeCode VARCHAR(32) NOT NULL,
children VARCHAR(512),
instructions VARCHAR(MAX)
)
ALTER TABLE RDO.StructurePositions ADD CONSTRAINT PK_StructurePositions PRIMARY KEY(id);
-----*** END STRUCTURE and STRUCTURE-POSITIONS *** ---- | the_stack |
\connect mobydq
/*Create data source*/
INSERT INTO base.data_source (name, connection_string, login, password, data_source_type_id, user_group_id) VALUES
(
'example_cloudera_hive'
,'driver={Cloudera Hive};host=db-cloudera;port=10000;'
,'cloudera'
,'cloudera'
,1 -- Cloudera Hive
,1 -- Public user group
),
(
'example_mariadb'
,'driver={MariaDB Unicode};server=db-mariadb;port=3306;database=star_wars;'
,'root'
,'1234'
,3 -- MariaDB
,1 -- Public user group
),
(
'example_microsoft_sql_server'
,'driver={FreeTDS};server=db-sql-server;port=1433;database=star_wars;tds_version=8.0;'
,'sa'
,'1234-abcd'
,4 -- Microsoft SQL Server
,1 -- Public user group
),
(
'example_mysql'
,'driver={MySQL Unicode};server=db-mysql;port=3306;database=star_wars;'
,'root'
,'1234'
,5 -- MySQL
,1 -- Public user group
),
(
'example_oracle'
,'driver={Oracle};dbq=db-oracle:1521/orclcdb;'
,'oracle'
,'1234-abcd'
,6 -- Oracle
,1 -- Public user group
),
(
'example_postgresql'
,'driver={PostgreSQL Unicode};server=db-postgresql;port=5432;database=star_wars;'
,'postgres'
,'1234'
,7 -- PostgreSQL
,1 -- Public user group
)
,(
'example_snowflake'
,'driver={Snowflake};server=account-name.snowflakecomputing.com;port=443;'
,'snowflake_user'
,'snowflake_password'
,10 -- Snowflake
,1 -- Public user group
)
,(
'example_teradata'
,'driver={Teradata 64};dbcname=db-teradata;defaultdatabase=star_wars;charset=utf8;'
,'dbc'
,'1234'
,9 -- Teradata
,1 -- Public user group
);
/*Create indicator group*/
INSERT INTO base.indicator_group (name, user_group_id) VALUES
(
'example_indicator_group'
,1 -- Public user group
);
/*Create indicators*/
INSERT INTO base.indicator (name, description, execution_order, flag_active, indicator_type_id, indicator_group_id, user_group_id) VALUES
(
'example_completeness_indicator'
,'Example of completeness indicator'
,1
,true
,(SELECT id FROM base.indicator_type WHERE id=1) -- Completeness
,(SELECT id FROM base.indicator_group WHERE name='example_indicator_group')
,1 -- Public user group
),
(
'example_freshness_indicator'
,'Example of freshness indicator'
,1
,true
,(SELECT id FROM base.indicator_type WHERE id=2) -- Freshness
,(SELECT id FROM base.indicator_group WHERE name='example_indicator_group')
,1 -- Public user group
),
(
'example_latency_indicator'
,'Example of latency indicator'
,1
,true
,(SELECT id FROM base.indicator_type WHERE id=3) -- Latency
,(SELECT id FROM base.indicator_group WHERE name='example_indicator_group')
,1 -- Public user group
),
(
'example_validity_indicator'
,'Example of validity indicator'
,1
,true
,(SELECT id FROM base.indicator_type WHERE id=4) -- Validity
,(SELECT id FROM base.indicator_group WHERE name='example_indicator_group')
,1 -- Public user group
);
/*Create completeness indicator parameters*/
INSERT INTO base.parameter (indicator_id, parameter_type_id, value, user_group_id) VALUES
(
(SELECT id FROM base.indicator WHERE name='example_completeness_indicator')
,(SELECT id FROM base.parameter_type WHERE id=1) -- Alert operator
,'>='
,1 -- Public user group
),
(
(SELECT id FROM base.indicator WHERE name='example_completeness_indicator')
,(SELECT id FROM base.parameter_type WHERE id=2) -- Alert threshold
,'0'
,1 -- Public user group
),
(
(SELECT id FROM base.indicator WHERE name='example_completeness_indicator')
,(SELECT id FROM base.parameter_type WHERE id=3) -- Distribution list
,'[''contact.mobydq@gmail.com'']'
,1 -- Public user group
),
(
(SELECT id FROM base.indicator WHERE name='example_completeness_indicator')
,(SELECT id FROM base.parameter_type WHERE id=4) -- Dimension
,'[''gender'']'
,1 -- Public user group
),
(
(SELECT id FROM base.indicator WHERE name='example_completeness_indicator')
,(SELECT id FROM base.parameter_type WHERE id=5) -- Measure
,'[''nb_people'']'
,1 -- Public user group
),
(
(SELECT id FROM base.indicator WHERE name='example_completeness_indicator')
,(SELECT id FROM base.parameter_type WHERE id=6) -- Source
,'example_postgresql'
,1 -- Public user group
),
(
(SELECT id FROM base.indicator WHERE name='example_completeness_indicator')
,(SELECT id FROM base.parameter_type WHERE id=7) -- Source request
,'SELECT gender, COUNT(id) FROM people GROUP BY gender;'
,1 -- Public user group
),
(
(SELECT id FROM base.indicator WHERE name='example_completeness_indicator')
,(SELECT id FROM base.parameter_type WHERE id=8) -- Target
,'example_mysql'
,1 -- Public user group
),
(
(SELECT id FROM base.indicator WHERE name='example_completeness_indicator')
,(SELECT id FROM base.parameter_type WHERE id=9) -- Target request
,'SELECT gender, COUNT(id) FROM people GROUP BY gender;'
,1 -- Public user group
);
/*Create freshness indicator parameters*/
INSERT INTO base.parameter (indicator_id, parameter_type_id, value, user_group_id) VALUES
(
(SELECT id FROM base.indicator WHERE name='example_freshness_indicator')
,(SELECT id FROM base.parameter_type WHERE id=1) -- Alert operator
,'>='
,1 -- Public user group
),
(
(SELECT id FROM base.indicator WHERE name='example_freshness_indicator')
,(SELECT id FROM base.parameter_type WHERE id=2) -- Alert threshold
,'0'
,1 -- Public user group
),
(
(SELECT id FROM base.indicator WHERE name='example_freshness_indicator')
,(SELECT id FROM base.parameter_type WHERE id=3) -- Distribution list
,'[''contact.mobydq@gmail.com'']'
,1 -- Public user group
),
(
(SELECT id FROM base.indicator WHERE name='example_freshness_indicator')
,(SELECT id FROM base.parameter_type WHERE id=4) -- Dimension
,'[''name'']'
,1 -- Public user group
),
(
(SELECT id FROM base.indicator WHERE name='example_freshness_indicator')
,(SELECT id FROM base.parameter_type WHERE id=5) -- Measure
,'[''last_updated_date'']'
,1 -- Public user group
),
(
(SELECT id FROM base.indicator WHERE name='example_freshness_indicator')
,(SELECT id FROM base.parameter_type WHERE id=8) -- Target
,'example_mysql'
,1 -- Public user group
),
(
(SELECT id FROM base.indicator WHERE name='example_freshness_indicator')
,(SELECT id FROM base.parameter_type WHERE id=9) -- Target request
,'SELECT name, MAX(updated_date) FROM people WHERE name LIKE ''%Skywalker%'' GROUP BY name;'
,1 -- Public user group
);
/*Create latency indicator parameters*/
INSERT INTO base.parameter (indicator_id, parameter_type_id, value, user_group_id) VALUES
(
(SELECT id FROM base.indicator WHERE name='example_latency_indicator')
,(SELECT id FROM base.parameter_type WHERE id=1) -- Alert operator
,'>='
,1 -- Public user group
),
(
(SELECT id FROM base.indicator WHERE name='example_latency_indicator')
,(SELECT id FROM base.parameter_type WHERE id=2) -- Alert threshold
,'0'
,1 -- Public user group
),
(
(SELECT id FROM base.indicator WHERE name='example_latency_indicator')
,(SELECT id FROM base.parameter_type WHERE id=3) -- Distribution list
,'[''contact.mobydq@gmail.com'']'
,1 -- Public user group
),
(
(SELECT id FROM base.indicator WHERE name='example_latency_indicator')
,(SELECT id FROM base.parameter_type WHERE id=4) -- Dimension
,'[''name'']'
,1 -- Public user group
),
(
(SELECT id FROM base.indicator WHERE name='example_latency_indicator')
,(SELECT id FROM base.parameter_type WHERE id=5) -- Measure
,'[''last_updated_date'']'
,1 -- Public user group
),
(
(SELECT id FROM base.indicator WHERE name='example_latency_indicator')
,(SELECT id FROM base.parameter_type WHERE id=6) -- Source
,'example_postgresql'
,1 -- Public user group
),
(
(SELECT id FROM base.indicator WHERE name='example_latency_indicator')
,(SELECT id FROM base.parameter_type WHERE id=7) -- Source request
,'SELECT name, MAX(updated_date) FROM people WHERE name LIKE ''%Skywalker%'' GROUP BY name;'
,1 -- Public user group
),
(
(SELECT id FROM base.indicator WHERE name='example_latency_indicator')
,(SELECT id FROM base.parameter_type WHERE id=8) -- Target
,'example_mysql'
,1 -- Public user group
),
(
(SELECT id FROM base.indicator WHERE name='example_latency_indicator')
,(SELECT id FROM base.parameter_type WHERE id=9) -- Target request
,'SELECT name, MAX(updated_date) FROM people WHERE name LIKE ''%Skywalker%'' GROUP BY name;'
,1 -- Public user group
);
/*Create validity indicator parameters*/
INSERT INTO base.parameter (indicator_id, parameter_type_id, value, user_group_id) VALUES
(
(SELECT id FROM base.indicator WHERE name='example_validity_indicator')
,(SELECT id FROM base.parameter_type WHERE id=1) -- Alert operator
,'<'
,1 -- Public user group
),
(
(SELECT id FROM base.indicator WHERE name='example_validity_indicator')
,(SELECT id FROM base.parameter_type WHERE id=2) -- Alert threshold
,'1000000'
,1 -- Public user group
),
(
(SELECT id FROM base.indicator WHERE name='example_validity_indicator')
,(SELECT id FROM base.parameter_type WHERE id=3) -- Distribution list
,'[''contact.mobydq@gmail.com'']'
,1 -- Public user group
),
(
(SELECT id FROM base.indicator WHERE name='example_validity_indicator')
,(SELECT id FROM base.parameter_type WHERE id=4) -- Dimension
,'[''name'']'
,1 -- Public user group
),
(
(SELECT id FROM base.indicator WHERE name='example_validity_indicator')
,(SELECT id FROM base.parameter_type WHERE id=5) -- Measure
,'[''population'']'
,1 -- Public user group
),
(
(SELECT id FROM base.indicator WHERE name='example_validity_indicator')
,(SELECT id FROM base.parameter_type WHERE id=8) -- Target
,'example_postgresql'
,1 -- Public user group
),
(
(SELECT id FROM base.indicator WHERE name='example_validity_indicator')
,(SELECT id FROM base.parameter_type WHERE id=9) -- Target request
,'SELECT name, SUM(population) FROM planet WHERE climate=''temperate'' GROUP BY name;'
,1 -- Public user group
); | the_stack |
T_Var,
T_Const,
T_Case,
T_OpExpr,
T_ArrayExpr,
T_BoolenTest,
T_NullTest,
T_NULLIF,
T_BOOL (AND/OR/NOT)
********************************/
----
--- Create Table and Insert Data
----
drop schema if exists llvm_vecexpr_engine1 cascade ;
create schema llvm_vecexpr_engine1;
set current_schema = llvm_vecexpr_engine1;
set codegen_cost_threshold=0;
CREATE TABLE llvm_vecexpr_engine1.LLVM_VECEXPR_TABLE_01(
a int,
b int,
c int
) WITH (orientation=column);
COPY LLVM_VECEXPR_TABLE_01(a, b, c) FROM stdin;
1 1 1
1 1 2
1 \N 3
1 1 4
1 2 1
1 2 2
1 3 3
2 1 1
2 1 2
2 1 3
2 1 4
\N 2 1
2 2 2
2 2 3
2 2 4
2 \N 3
2 3 2
2 3 3
\N 3 \N
3 1 1
3 1 \N
3 1 3
3 1 4
3 2 3
3 2 1
4 0 0
\N \N \N
4 \N 3
2 2 \N
\N 1 3
\.
CREATE TABLE llvm_vecexpr_engine1.LLVM_VECEXPR_TABLE_02(
col_int int,
col_bigint bigint,
col_float float4,
col_float8 float8,
col_char char(10),
col_bpchar bpchar,
col_varchar varchar,
col_text1 text,
col_text2 text,
col_num1 numeric(10,2),
col_num2 numeric,
col_date date,
col_time time
)with(orientation=column);
COPY LLVM_VECEXPR_TABLE_02(col_int, col_bigint, col_float, col_float8, col_char, col_bpchar, col_varchar, col_text1, col_text2, col_num1, col_num2, col_date, col_time) FROM stdin;
1 256 3.1 3.25 beijing AaaA newcode myword myword1 3.25 3.6547 2011-11-01 00:00:00 2017-09-09 19:45:37
3 12400 2.6 3.64755 hebei BaaB knife sea car 1.62 3.64 2017-10-09 19:45:37 2017-10-09 21:45:37
5 25685 1.0 25 anhui CccC computer game game2 7 3.65 2012-11-02 00:00:00 2018-04-09 19:45:37
-16 1345971420 3.2 2.15 hubei AaaA phone pen computer 4.24 6.36 2012-11-04 00:00:00 2012-11-02 00:03:10
64 -2566 1.25 2.7 jilin DddD girl flower window 65 69.36 2012-11-03 00:00:00 2011-12-09 19:45:37
\N 256 3.1 4.25 anhui BbbB knife phone light 78.12 2.35684156 2017-10-09 19:45:37 1984-2-6 01:00:30
81 \N 4.8 3.65 luxi EeeE girl sea crow 145 56 2018-01-09 19:45:37 2018-01-09 19:45:37
25 365487 \N 3.12 lufei EeeE call you them 7.12 6.36848 2018-05-09 19:45:37 2018-05-09 19:45:37
36 5879 10.15 \N lefei GggG call you them 2.5 2.5648 2015-02-26 02:15:01 1984-2-6 02:15:01
27 256 4.25 63.27 \N FffF code throw away 2.1 25.65 2018-03-09 19:45:37 2017-09-09 14:20:00
9 -128 -2.4 56.123 jiangsu \N greate book boy 7 -1.23 2017-12-09 19:45:37 2012-11-02 14:20:25
1001 78956 1.25 2.568 hangzhou CccC \N away they 6.36 58.254 2017-10-09 19:45:37 1984-2-6 01:00:30
2005 12400 12.24 2.7 hangzhou AaaA flower \N car 12546 3.2546 2017-09-09 19:45:37 2012-11-02 00:03:10
8 5879 \N 1.36 luxi DeeD walet wall \N 2.58 3.54789 2000-01-01 2000-01-01 01:01:01
652 25489 8.88 1.365 hebei god piece sugar pow \N 2.1 2012-11-02 00:00:00 2012-11-02 00:00:00
417 2 9.19 0.256 jiangxi xizang walet bottle water 11.50 -1.01256 \N 1984-2-6 01:00:30
18 65 -0.125 78.96 henan PooP line black redline 24 3.1415926 2000-01-01 \N
\N \N \N \N \N \N \N \N \N \N \N \N \N
700 58964785 3.25 1.458 \N qingdao \N 2897 dog 9.36 \N \N 2017-10-09 20:45:37
505 1 3.24 \N \N BbbB \N myword pen 147 875 2000-01-01 01:01:01 2000-01-01 01:01:01
3 12400 2.6 3.64755 1.62 3.64 2017-10-09 19:45:37 2017-10-09 21:45:37
\.
create table llvm_vecexpr_engine1.LLVM_VECEXPR_TABLE_03
(
cjrq timestamp(0) without time zone,
cjxh character(10),
zqdh character(10),
bxwdh character(6),
bgddm character(10),
bhtxh character(10),
brzrq character(1),
bpcbz character(1),
sxwdh character(6),
sgddm character(10),
shtxh character(10),
srzrq character(1),
spcbz character(1),
cjgs numeric(9,0),
cjjg numeric(9,3),
cjsj numeric(8,0),
ywlb character(1),
mmlb character(1),
ebbz character(1),
filler character(1)
)WITH (orientation=column, compression=no);
insert into LLVM_VECEXPR_TABLE_03 (zqdh,cjrq,cjsj,cjgs) values ('233574','2015-05-02',9150000,1);
insert into LLVM_VECEXPR_TABLE_03 (zqdh,cjrq,cjsj,cjgs) values ('233574','2015-05-03',9150001,1);
insert into LLVM_VECEXPR_TABLE_03 (zqdh,cjrq,cjsj,cjgs) values ('233574','2015-05-04',9150002,1);
insert into LLVM_VECEXPR_TABLE_03 (zqdh,cjrq,cjsj,cjgs) values ('233574','2015-05-05',9150003,1);
insert into LLVM_VECEXPR_TABLE_03 (zqdh,cjrq,cjsj,cjgs) values ('233574','2015-05-06',9150004,1);
insert into LLVM_VECEXPR_TABLE_03 (zqdh,cjrq,cjsj,cjgs) values ('233574','2015-05-07',9150005,1);
analyze llvm_vecexpr_table_01;
analyze llvm_vecexpr_table_02;
analyze llvm_vecexpr_table_03;
----
--- case 1 : arithmetic operation
----
explain (verbose on, costs off) select * from llvm_vecexpr_table_01 where a = 1 and b = 3;
select * from llvm_vecexpr_table_01 where a = 1 and b = 3 order by 1, 2, 3;
select * from llvm_vecexpr_table_01 where a > 1 and a < 4 order by 1, 2, 3;
select * from llvm_vecexpr_table_01 where ((a + 1) * 2) -1 > 3 order by 1, 2, 3;
select * from llvm_vecexpr_table_01 where a + b - c > 2 order by 1, 2, 3;
----
--- case 2 : basic comparison operation
----
explain (verbose on, costs off)
select * from llvm_vecexpr_table_02 where col_char = 'beijing' order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where col_char = 'beijing' order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where 'beijing' = col_char order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where col_text1 = 'phone' order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where col_time = '19:45:37' order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where substr(col_char, 1, 2) = 'lu' order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where substr(col_text1, 1, 3) = 'you' order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where substr(col_text1, -2, 3) = 'me' order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where substr(col_text1, NULL, 2) = 'le' order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where btrim(col_char) = 'lufei' order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where btrim(col_char) != 'lufei' order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where col_char != 'lufei' order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where col_char != 'hangzhou ' order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where 'hebei ' != col_char order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where lpad(col_char,9,'ai') = 'aibeijing' order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where col_bigint > -1 order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where col_bigint >= 25689745 order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where col_bigint <= 25689745 order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where col_bigint != 25689745 order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where col_bigint = 128 order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where col_time + '06:00:00' > '01:01:01' order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where col_date + '1000 days 10:10:10' > '2016-12-30 00:00:00' order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where substr(col_text1, 5, 2) is not null order by 1, 2, 3, 4, 5, 6, 7;
select * from llvm_vecexpr_table_02 where substr(col_text1, 5, 0) is not null order by 1, 2, 3, 4, 5, 6, 7;
select * from llvm_vecexpr_table_02 where col_char = col_char order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where btrim(col_char) is null order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where btrim(col_varchar) is null order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where rtrim(col_bpchar) is null order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where rtrim(col_text1) is null order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where to_numeric(col_float8) = col_num1 order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where to_number(col_float8) = col_num1 order by 1, 2, 3, 4, 5;
---non-strict function
select * from llvm_vecexpr_table_02 where (col_num1 || col_text1) is not null order by 1, 2, 3, 4, 5;
---null test with different input types
select * from llvm_vecexpr_table_02 where col_float is null order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where col_float is not null order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where col_float8 is null order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where col_float8 is not null order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where col_num1 is null order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where col_num2 is not null order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where col_bpchar is null order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where col_char is not null order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where col_varchar is null order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where col_varchar is not null order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where col_text1 is null order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where col_text1 is not null order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where col_time is null order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where col_time is not null order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where (col_char||col_text1) is not null order by 1, 2, 3, 4, 5;
----
--- case 3 : Case Expr - int4eq, int8eq, float4eq, float8eq, texteq, bpchareq,
--- dateeq, time, timetzeq, timestampeq, timestamptzeq
----
explain (verbose on, costs off) select * from llvm_vecexpr_table_01 where
case
when a = 1 then 11
when a = 2 then 22
when a = 3 then 33
else 44
end = 22 order by 1, 2, 3;
select * from llvm_vecexpr_table_01 where case when a = 1 then 11
when a = 2 then 22
when a = 3 then 33
else 44
end = 22 order by 1, 2, 3;
select * from llvm_vecexpr_table_01 where case a when 1 then 11
when 2 then 22
when 3 then 33
else 44
end = 22 order by 1, 2, 3;
select * from llvm_vecexpr_table_01 where case a when 1 then 11
when 2 then 22
when 3 then 33
else 44
end = 44 order by 1, 2, 3;
select * from llvm_vecexpr_table_01 where case when a = 1 then
case when b = 1 then 11
when b = 2 then 12
else 13
end
when a = 2 then
case when b = 1 then 21
when b = 2 then 22
else 23
end
else 33 end = 12 order by 1, 2, 3;
select * from llvm_vecexpr_table_01 where case a when 1 then
case b when 1 then 11
when 2 then 12
else 13
end
when 2 then
case b when 1 then 21
when 2 then 22
else 23
end
else 33 end = 12 order by 1, 2, 3;
select * from llvm_vecexpr_table_02 where case when col_float < -10 then 1.0
when col_float < -3 then 0.0
when col_float < 3 then 2.0
when col_float < 10 then 0.0
else 1.0 end < 0.5 order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where case when col_bpchar = 'AaaA' then 2
when col_bpchar = 'DddD' then 4
else 6 end < 6 order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where case when col_bpchar = 'BbbB' then 2
when col_bpchar = 'GggG' then 4
else 6 end < 8 order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where case when col_char = 'beijing' then 'A'
when col_char = 'anhui' then 'B'
when col_char = 'hangzhou' then 'C'
else 'D' end = 'C' order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where case col_text1 when 'phone' then 'E'
when 'you' then 'F'
else 'H' end = 'H' order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where case when col_char = 'beijing' then
case when col_text2 = 'pen' then 'AA'
when col_text2 = 'them' then 'AB'
else 'AC' end
when col_char = 'hebei' then
case when col_text2 = 'game' then 'BB'
when col_text2 = 'away' then 'BC'
else 'BD' end
else 'CC' end = 'BB' order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where case col_char when 'beijing' then 'DD' when 'anhui' then 'EE' else 'FF' end = 'DD' order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where case col_varchar when 'call' then 'DD' when 'girl' then 'EE' else 'FF' end = 'DD' order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where case col_varchar when 'call' then 'DD' when 'girl' then 'EE' else NULL end = 'DD' order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where case col_varchar when 'call' then
case col_text2 when 'car' then 'DD'
when 'water' then 'DF'
else 'DH' end
when 'girl' then
case col_text2 when 'crow' then 'EE'
when 'light' then 'EL'
else 'EW' end
else 'TT' end = 'EE' order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where case when col_int < 10 then 'A' when col_int > 500 then 'C' else 'B' end = 'B' order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where case when substr(col_char, 1, 2) = 'lu' then 'A'
when substr(col_char, 1, 2) = 'an' then 'B'
else 'C' end = 'B' order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where case substr(col_text1, 1, 3) when 'you' then 'A' when 'sea' then 'B' else 'C' end = 'A' order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where case when substr(col_char, 1, 2) = 'lu' then
case when substr(col_text1, 1, 3) = 'you' then 'AA'
when substr(col_text1, 1, 3) = 'sea' then 'AB'
else 'AC' end
when substr(col_char, 1, 2) = 'an' then
case when substr(col_text1, 1, 3) = 'you' then 'BB'
when substr(col_text1, 1, 3) = 'sea' then 'BC'
else 'BD' end
else 'AA' end = 'AA' order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where case substr(col_char, 1, 2) when 'lu' then
case substr(col_text1, 1, 3) when 'you' then 'AA'
when 'sea' then 'AB'
else 'AC' end
when 'an' then
case substr(col_text1, 1, 3) when 'you' then 'BB'
when 'sea' then 'BC'
else 'BD' end
else 'AA' end = 'BC' order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where case when col_time < '6:00:00'::time then 0.0
when col_time < '12:00:00'::time then 1.0
when col_time < '20:00:00'::time then 1.0
else 0.0 end > 0.5 order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where case col_date when '2000-01-01 01:01:01' then 'A'
when '2018-05-09 19:45:37' then 'B'
else 'C' end = 'B' order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where case col_float8 when 2.15::float8 then 2.4::float8
when 2.7::float8 then 3.6::float8
else 4.8::float8 end = 2.4 order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where case col_num1 when 3.25 then 1.2 when 7.00 then 2.2 when 9.36 then 3.33 end > 1.2 order by 1, 2, 3;
----
--- case 4 : ArrayOp Expr - int4eq, int8eq, float4eq, float8eq, bpchareq, texteq, dateeq, substr with texteq, timetz
----
explain (verbose on, costs off) select * from llvm_vecexpr_table_02 where col_int in (2,3,8,16);
select * from llvm_vecexpr_table_02 where col_int in (2,3,8,16) order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where col_int in (NULL, 2, 4, 6, 4, 1001) order by 1, 2, 3, 4, 5;
select col_int, col_bigint, col_float, col_date from llvm_vecexpr_table_02 where col_bigint in (256, NULL, 5879, 365487) order by 1, 2, 3, 4;
select col_int, col_bigint, col_float, col_char, col_num1, col_date from llvm_vecexpr_table_02 where col_char in ('luxi', 'lufei', NULL, 'lufei') order by 1, 2, 3, 4, 5, 6;
select * from llvm_vecexpr_table_02 where col_text1 in ('phone', 'you', 'call', 'sea') order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where col_text1 in ('phone', 'you', NULL) order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where substr(col_char, 1, 3) in ('bei', 'han', 'hen', NULL) order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where substr(col_text1, 1, 3) in ('sea', 'you', 'ccc', 'boy', 'you', NULL) order by 1, 2, 3, 4, 5;
select col_int, col_bigint, col_float, col_char, col_date from llvm_vecexpr_table_02 where col_date in ('2011-11-01', '2000-01-01', '2017-10-09', NULL, '2012-11-03') order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where col_int = any(array[-16, 1, 79]) order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where col_bigint = any(array[-128, 256, 5879]) order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where col_float in( 1.0, 1.25, 2.25, 3.25, 4.25, 5.25 ) order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where col_text1 = any(array['window','pen']) order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where col_char = any(array['hangzhou', 'jiangsu', NULL]) order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where col_bpchar = any(array['AaaA', 'BbbB', 'DddD']) order by 1, 2, 3, 4, 5;
select col_float8, col_num1 from llvm_vecexpr_table_02 where col_float8 in (NULL, 3.25, 2.15, 2.7, 3.25, NULL) and col_num1 = any(array[3.25, 7.00, NULL, 65]) order by 1, 2;
----
--- case 5 : Nullif
----
select * from llvm_vecexpr_table_01 where nullif(a, b) is NULL order by 1, 2, 3;
select * from llvm_vecexpr_table_02 where nullif(col_int, 1) is NULL order by 1,2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where nullif(col_int, 1::int2) is NULL order by 1,2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where nullif(col_bigint, 256) is NULL order by 1,2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where nullif(col_bigint, 128::bigint) is NULL order by 1,2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where nullif(col_float8, 3.25) is NULL order by 1,2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where nullif(col_num1, col_num2) is NULL order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where nullif(col_bpchar, 'AaaA') is NULL order by 1,2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where nullif(col_text1, 'myword') is NULL order by 1,2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where nullif(col_date, '2011-11-01 00:00:00') is NULL order by 1,2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where nullif(col_time, '19:45:37') is NULL order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where nullif(col_int, col_bigint) is NULL order by 1,2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where nullif(col_char, 'beijing') is NULL order by 1,2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where nullif(col_varchar, 'flower') is NULL order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where nullif(substring(col_text1, 10, 2), 'AB') is NULL order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where nullif(substr(col_text1, 10, 2), 'AB') is NULL order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where nullif(col_num1, 2.45) is NULL order by 1, 2, 3, 4, 5;
----
--- case 6 : text like/text not like
----
select * from llvm_vecexpr_table_02 where col_text1 like '%e' order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where col_text1 like 'b%' order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where col_text1 like '%ow' order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where col_varchar like '%e' order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where col_text1 like '%ow_%' order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where col_text1 not like '%m' order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where col_text2 not like '%o%' order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where col_text2 not like 't%' order by 1, 2, 3, 4, 5;
----
--- case 7 : other cases
----
select * from llvm_vecexpr_table_02 where length(col_text1 || col_text2) + 2 > 5 order by 1, 2, 3, 4, 5;
select * from llvm_vecexpr_table_02 where (col_text1||' ') is not NULL order by 1, 2, 3, 4, 5;
----
--- case 8 : multi IR case
----
set enable_nestloop = off;
set enable_mergejoin = off;
select * from llvm_vecexpr_table_02 A join llvm_vecexpr_table_02 B on A.col_char = B.col_char and A.col_int = B.col_int where A.col_char = 'anhui' and A.col_int < 10 order by 1, 2, 3, 4, 5;
select A.col_int, A.col_bigint, A.col_float from llvm_vecexpr_table_02 A join llvm_vecexpr_table_02 B on A.col_num1 = B.col_num1 where A.col_text1 > B.col_text2 order by 1, 2, 3;
----
--- case 9: codegen_cost_threshold
----
set codegen_cost_threshold = 10000;
explain (verbose on, costs off, analyze on)
select * from llvm_vecexpr_table_02 where col_char = 'beijing' order by 1, 2, 3, 4, 5;
----
----
select zqdh, sum(cjgs), count(*) from llvm_vecexpr_table_03 where zqdh ='233574' and cjrq>='2015-05-02' and cjrq<='2015-06-12' and cjsj>= 9150000 and cjsj<=15300000 group by zqdh;
----
--- clean table and resource
----
drop schema llvm_vecexpr_engine1 cascade; | the_stack |
-- 2017-11-13T10:59:44.418
-- 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,53055,540531,TO_TIMESTAMP('2017-11-13 10:59:44','YYYY-MM-DD HH24:MI:SS'),100,'Y',20,TO_TIMESTAMP('2017-11-13 10:59:44','YYYY-MM-DD HH24:MI:SS'),100,'advanced edit')
;
-- 2017-11-13T10:59:44.437
-- 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=540531 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-13T10:59:47.457
-- 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,540707,540531,TO_TIMESTAMP('2017-11-13 10:59:47','YYYY-MM-DD HH24:MI:SS'),100,'Y',10,TO_TIMESTAMP('2017-11-13 10:59:47','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-11-13T11:00:03.316
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_ElementGroup SET AD_UI_Column_ID=540707, SeqNo=10,Updated=TO_TIMESTAMP('2017-11-13 11:00:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_ElementGroup_ID=540423
;
-- 2017-11-13T11:02:47.837
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_ElementGroup SET UIStyle='primary',Updated=TO_TIMESTAMP('2017-11-13 11:02:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_ElementGroup_ID=540426
;
-- 2017-11-13T11:03:17.283
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_ElementGroup SET UIStyle='',Updated=TO_TIMESTAMP('2017-11-13 11:03:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_ElementGroup_ID=540426
;
-- 2017-11-13T11:03:26.122
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_ElementGroup SET UIStyle='primary',Updated=TO_TIMESTAMP('2017-11-13 11:03:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_ElementGroup_ID=540423
;
-- 2017-11-13T11:21:04.990
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=540428, SeqNo=30,Updated=TO_TIMESTAMP('2017-11-13 11:21:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544262
;
-- 2017-11-13T11:21:11.200
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=544263
;
-- 2017-11-13T11:23:41.014
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='N', IsDisplayed='N',Updated=TO_TIMESTAMP('2017-11-13 11:23:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544262
;
-- 2017-11-13T11:44:30
-- 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,54195,0,53055,540427,549197,'F',TO_TIMESTAMP('2017-11-13 11:44:29','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Belegart',10,0,0,TO_TIMESTAMP('2017-11-13 11:44:29','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-11-13T11:46:52.295
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=540427, SeqNo=50,Updated=TO_TIMESTAMP('2017-11-13 11:46:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544306
;
-- 2017-11-13T11:47:08.621
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=549197
;
-- 2017-11-13T11:47:15.091
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=10,Updated=TO_TIMESTAMP('2017-11-13 11:47:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544306
;
-- 2017-11-13T11:47:46.486
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET Name='Nr.',Updated=TO_TIMESTAMP('2017-11-13 11:47:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544298
;
-- 2017-11-13T11:47:50.251
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET Name='Datum',Updated=TO_TIMESTAMP('2017-11-13 11:47:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544299
;
-- 2017-11-13T11:48:02.427
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Datum',Updated=TO_TIMESTAMP('2017-11-13 11:48:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=54197
;
-- 2017-11-13T11:51:56.701
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=540426, SeqNo=40,Updated=TO_TIMESTAMP('2017-11-13 11:51:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544301
;
-- 2017-11-13T11:52:51.156
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=10,Updated=TO_TIMESTAMP('2017-11-13 11:52:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544296
;
-- 2017-11-13T11:52:55.972
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=20,Updated=TO_TIMESTAMP('2017-11-13 11:52:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544301
;
-- 2017-11-13T11:52:58.572
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=30,Updated=TO_TIMESTAMP('2017-11-13 11:52:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544294
;
-- 2017-11-13T11:53:01.746
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=40,Updated=TO_TIMESTAMP('2017-11-13 11:53:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544295
;
-- 2017-11-13T11:56:41.651
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET DefaultValue='N ',Updated=TO_TIMESTAMP('2017-11-13 11:56:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=53897
;
-- 2017-11-13T11:56:45.712
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET DefaultValue='N',Updated=TO_TIMESTAMP('2017-11-13 11:56:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=53897
;
-- 2017-11-13T12:02:30.767
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SortNo=-1.000000000000,Updated=TO_TIMESTAMP('2017-11-13 12:02:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=54197
;
-- 2017-11-13T13:07:09.568
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y',Updated=TO_TIMESTAMP('2017-11-13 13:07:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=53884
;
-- 2017-11-13T13:07:28.218
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y',Updated=TO_TIMESTAMP('2017-11-13 13:07:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=53906
;
-- 2017-11-13T13:07:36.595
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', Name='Status',Updated=TO_TIMESTAMP('2017-11-13 13:07:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=53892
;
-- 2017-11-13T13:07:36.596
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Status', Description='The current status of the document', Help='The Document Status indicates the status of a document at this time. If you want to change the document status, use the Document Action field' WHERE AD_Column_ID=53892 AND IsCentrallyMaintained='Y'
;
-- 2017-11-13T13:08:08.797
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y',Updated=TO_TIMESTAMP('2017-11-13 13:08:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=53908
;
-- 2017-11-13T13:08:40.037
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=20,Updated=TO_TIMESTAMP('2017-11-13 13:08:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=53884
;
-- 2017-11-13T13:08:40.040
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=30,Updated=TO_TIMESTAMP('2017-11-13 13:08:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=53892
;
-- 2017-11-13T13:08:40.043
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=40,Updated=TO_TIMESTAMP('2017-11-13 13:08:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=53906
;
-- 2017-11-13T13:08:40.045
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=50,Updated=TO_TIMESTAMP('2017-11-13 13:08:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=53908
;
-- 2017-11-13T13:08:40.048
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=60,Updated=TO_TIMESTAMP('2017-11-13 13:08:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=53866
;
-- 2017-11-13T13:12:48.082
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=10,Updated=TO_TIMESTAMP('2017-11-13 13:12:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544306
;
-- 2017-11-13T13:12:48.084
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=20,Updated=TO_TIMESTAMP('2017-11-13 13:12:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544298
;
-- 2017-11-13T13:12:48.087
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=30,Updated=TO_TIMESTAMP('2017-11-13 13:12:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544299
;
-- 2017-11-13T13:12:48.089
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=40,Updated=TO_TIMESTAMP('2017-11-13 13:12:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544290
;
-- 2017-11-13T13:12:48.091
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=50,Updated=TO_TIMESTAMP('2017-11-13 13:12:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544291
;
-- 2017-11-13T13:12:48.093
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=60,Updated=TO_TIMESTAMP('2017-11-13 13:12:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544300
;
-- 2017-11-13T13:12:48.095
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=70,Updated=TO_TIMESTAMP('2017-11-13 13:12:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544296
;
-- 2017-11-13T13:12:48.097
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=80,Updated=TO_TIMESTAMP('2017-11-13 13:12:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544302
;
-- 2017-11-13T13:12:48.098
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=90,Updated=TO_TIMESTAMP('2017-11-13 13:12:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544293
;
-- 2017-11-13T13:12:48.100
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=100,Updated=TO_TIMESTAMP('2017-11-13 13:12:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544301
;
-- 2017-11-13T13:12:48.102
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=110,Updated=TO_TIMESTAMP('2017-11-13 13:12:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544303
;
-- 2017-11-13T13:12:48.108
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=120,Updated=TO_TIMESTAMP('2017-11-13 13:12:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544262
;
-- 2017-11-13T13:12:48.110
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=130,Updated=TO_TIMESTAMP('2017-11-13 13:12:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544304
;
-- 2017-11-13T13:17:00.102
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=110,Updated=TO_TIMESTAMP('2017-11-13 13:17:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544262
;
-- 2017-11-13T13:17:00.104
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=120,Updated=TO_TIMESTAMP('2017-11-13 13:17:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544303
;
-- 2017-11-13T13:17:14.820
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=110,Updated=TO_TIMESTAMP('2017-11-13 13:17:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544303
;
-- 2017-11-13T13:17:14.821
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=120,Updated=TO_TIMESTAMP('2017-11-13 13:17:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544262
;
-- 2017-11-13T13:19:55.306
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_ElementGroup SET UIStyle='primary',Updated=TO_TIMESTAMP('2017-11-13 13:19:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_ElementGroup_ID=540424
;
-- 2017-11-13T13:20:52.940
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2017-11-13 13:20:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544288
;
-- 2017-11-13T13:20:52.943
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2017-11-13 13:20:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544286
;
-- 2017-11-13T13:20:52.944
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2017-11-13 13:20:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544279
;
-- 2017-11-13T13:20:52.945
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2017-11-13 13:20:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544287
;
-- 2017-11-13T13:20:52.946
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2017-11-13 13:20:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544289
;
-- 2017-11-13T13:20:52.947
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2017-11-13 13:20:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544277
;
-- 2017-11-13T13:20:52.948
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2017-11-13 13:20:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544285
;
-- 2017-11-13T13:20:52.949
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2017-11-13 13:20:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544278
;
-- 2017-11-13T13:20:52.952
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2017-11-13 13:20:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544273
;
-- 2017-11-13T13:20:52.954
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2017-11-13 13:20:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544280
;
-- 2017-11-13T13:20:52.956
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=30,Updated=TO_TIMESTAMP('2017-11-13 13:20:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544274
;
-- 2017-11-13T13:20:52.957
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=40,Updated=TO_TIMESTAMP('2017-11-13 13:20:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544275
;
-- 2017-11-13T13:20:52.959
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=50,Updated=TO_TIMESTAMP('2017-11-13 13:20:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544276
;
-- 2017-11-13T13:20:52.959
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=60,Updated=TO_TIMESTAMP('2017-11-13 13:20:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544283
;
-- 2017-11-13T13:20:52.960
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=70,Updated=TO_TIMESTAMP('2017-11-13 13:20:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544281
;
-- 2017-11-13T13:20:52.961
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=80,Updated=TO_TIMESTAMP('2017-11-13 13:20:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544284
;
-- 2017-11-13T13:20:52.962
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=90,Updated=TO_TIMESTAMP('2017-11-13 13:20:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544282
;
-- 2017-11-13T13:21:05.895
-- 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,54005,0,53050,540424,549198,'F',TO_TIMESTAMP('2017-11-13 13:21:05','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Sektion',10,0,0,TO_TIMESTAMP('2017-11-13 13:21:05','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-11-13T13:21:14.771
-- 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,54021,0,53050,540424,549199,'F',TO_TIMESTAMP('2017-11-13 13:21:14','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Mandant',20,0,0,TO_TIMESTAMP('2017-11-13 13:21:14','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-11-13T13:21:44.213
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=100,Updated=TO_TIMESTAMP('2017-11-13 13:21:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=549198
;
-- 2017-11-13T13:22:16.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,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,554550,0,53050,540424,549200,'F',TO_TIMESTAMP('2017-11-13 13:22:16','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Packvorschrift',30,0,0,TO_TIMESTAMP('2017-11-13 13:22:16','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-11-13T13:22:27.353
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=40,Updated=TO_TIMESTAMP('2017-11-13 13:22:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=549200
;
-- 2017-11-13T13:22:27.354
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=50,Updated=TO_TIMESTAMP('2017-11-13 13:22:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544275
;
-- 2017-11-13T13:22:27.354
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=60,Updated=TO_TIMESTAMP('2017-11-13 13:22:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544276
;
-- 2017-11-13T13:22:27.355
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=70,Updated=TO_TIMESTAMP('2017-11-13 13:22:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544283
;
-- 2017-11-13T13:22:27.356
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=80,Updated=TO_TIMESTAMP('2017-11-13 13:22:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544281
;
-- 2017-11-13T13:22:27.357
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=90,Updated=TO_TIMESTAMP('2017-11-13 13:22:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544284
;
-- 2017-11-13T13:22:27.359
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=100,Updated=TO_TIMESTAMP('2017-11-13 13:22:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544282
;
-- 2017-11-13T13:22:27.360
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=110,Updated=TO_TIMESTAMP('2017-11-13 13:22:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=549198
;
-- 2017-11-13T13:23:07.720
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=0,Updated=TO_TIMESTAMP('2017-11-13 13:23:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=549199
;
-- 2017-11-13T13:23:09.323
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=10,Updated=TO_TIMESTAMP('2017-11-13 13:23:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544271
;
-- 2017-11-13T13:23:11.108
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=20,Updated=TO_TIMESTAMP('2017-11-13 13:23:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544272
;
-- 2017-11-13T13:23:12.812
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=30,Updated=TO_TIMESTAMP('2017-11-13 13:23:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544274
;
-- 2017-11-13T13:23:14.337
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=40,Updated=TO_TIMESTAMP('2017-11-13 13:23:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544275
;
-- 2017-11-13T13:23:15.763
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=50,Updated=TO_TIMESTAMP('2017-11-13 13:23:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=549200
;
-- 2017-11-13T13:23:17.331
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=60,Updated=TO_TIMESTAMP('2017-11-13 13:23:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544276
;
-- 2017-11-13T13:23:19.004
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=70,Updated=TO_TIMESTAMP('2017-11-13 13:23:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544283
;
-- 2017-11-13T13:23:20.493
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=80,Updated=TO_TIMESTAMP('2017-11-13 13:23:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544281
;
-- 2017-11-13T13:23:22.291
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=90,Updated=TO_TIMESTAMP('2017-11-13 13:23:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544284
;
-- 2017-11-13T13:23:24.612
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=100,Updated=TO_TIMESTAMP('2017-11-13 13:23:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544282
;
-- 2017-11-13T13:23:27.044
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=0,Updated=TO_TIMESTAMP('2017-11-13 13:23:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=549198
;
-- 2017-11-13T13:23:30.980
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=110,Updated=TO_TIMESTAMP('2017-11-13 13:23:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544280
;
-- 2017-11-13T13:23:34.124
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=120,Updated=TO_TIMESTAMP('2017-11-13 13:23:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544288
;
-- 2017-11-13T13:23:36.209
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=130,Updated=TO_TIMESTAMP('2017-11-13 13:23:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544277
;
-- 2017-11-13T13:23:38.469
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=140,Updated=TO_TIMESTAMP('2017-11-13 13:23:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544286
;
-- 2017-11-13T13:23:41.041
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=150,Updated=TO_TIMESTAMP('2017-11-13 13:23:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544279
;
-- 2017-11-13T13:23:43.261
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=160,Updated=TO_TIMESTAMP('2017-11-13 13:23:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544287
;
-- 2017-11-13T13:23:45.428
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=170,Updated=TO_TIMESTAMP('2017-11-13 13:23:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544289
;
-- 2017-11-13T13:23:48.093
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=180,Updated=TO_TIMESTAMP('2017-11-13 13:23:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544285
;
-- 2017-11-13T13:23:50.219
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=190,Updated=TO_TIMESTAMP('2017-11-13 13:23:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544278
;
-- 2017-11-13T13:23:54.222
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=200,Updated=TO_TIMESTAMP('2017-11-13 13:23:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544273
;
-- 2017-11-13T13:23:56.625
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=210,Updated=TO_TIMESTAMP('2017-11-13 13:23:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=549198
;
-- 2017-11-13T13:24:01.633
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=220,Updated=TO_TIMESTAMP('2017-11-13 13:24:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=549199
;
-- 2017-11-13T13:27:02.669
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Vertreter',Updated=TO_TIMESTAMP('2017-11-13 13:27:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=54196
;
-- 2017-11-13T13:27:07.891
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Datum gedruckt',Updated=TO_TIMESTAMP('2017-11-13 13:27:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=54210
;
-- 2017-11-13T13:27:15.638
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Distributionsauftrag',Updated=TO_TIMESTAMP('2017-11-13 13:27:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=54218
;
-- 2017-11-13T13:27:25.517
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Belegaktion',Updated=TO_TIMESTAMP('2017-11-13 13:27:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=54225
;
-- 2017-11-13T13:27:38.868
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Im Disput',Updated=TO_TIMESTAMP('2017-11-13 13:27:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=54174
;
-- 2017-11-13T13:28:11.830
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Produktion Freigabe erlauben',Updated=TO_TIMESTAMP('2017-11-13 13:28:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=555151
;
-- 2017-11-13T13:28:23.720
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Durch Materialdispo erstellt',Updated=TO_TIMESTAMP('2017-11-13 13:28:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=555150
;
-- 2017-11-13T13:28:36.413
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Verarbeiten',Updated=TO_TIMESTAMP('2017-11-13 13:28:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=54177
;
-- 2017-11-13T13:28:58.758
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Referenzierter Auftrag',Updated=TO_TIMESTAMP('2017-11-13 13:28:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=54173
;
-- 2017-11-13T13:29:10.928
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='wird gelöscht',Updated=TO_TIMESTAMP('2017-11-13 13:29:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=555432
;
-- 2017-11-13T13:29:17.409
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Transit Lager',Updated=TO_TIMESTAMP('2017-11-13 13:29:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=54205
;
-- 2017-11-13T13:29:34.222
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Bestellte Menge',Updated=TO_TIMESTAMP('2017-11-13 13:29:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=54035
;
-- 2017-11-13T13:29:41.226
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Menge in Transit',Updated=TO_TIMESTAMP('2017-11-13 13:29:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=54003
;
-- 2017-11-13T13:29:48.297
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Attribute',Updated=TO_TIMESTAMP('2017-11-13 13:29:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=54038
;
-- 2017-11-13T13:29:56.402
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Attribute nach',Updated=TO_TIMESTAMP('2017-11-13 13:29:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=54039
;
-- 2017-11-13T13:30:26.999
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Ziel Produktionsstätte beibehalten',Updated=TO_TIMESTAMP('2017-11-13 13:30:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=555160
;
-- 2017-11-13T13:30:42.545
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Forwärtsplanung zulassen',Updated=TO_TIMESTAMP('2017-11-13 13:30:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=554515
;
-- 2017-11-13T13:30:50.569
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Distributions Auftrag',Updated=TO_TIMESTAMP('2017-11-13 13:30:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=54025
;
-- 2017-11-13T13:31:00.084
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Distributionszeile',Updated=TO_TIMESTAMP('2017-11-13 13:31:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=54026
;
-- 2017-11-13T13:31:10.871
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Nur Beschreibung',Updated=TO_TIMESTAMP('2017-11-13 13:31:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=54014
;
-- 2017-11-13T13:31:23.033
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Kommissionierte Menge',Updated=TO_TIMESTAMP('2017-11-13 13:31:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=54027
;
-- 2017-11-13T13:36:42.423
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Wird gelöscht',Updated=TO_TIMESTAMP('2017-11-13 13:36:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=555432
;
-- 2017-11-13T13:36:47.505
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Andrucken',Updated=TO_TIMESTAMP('2017-11-13 13:36:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=54228
;
-- 2017-11-13T13:39:17.272
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-11-13 13:39:17','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Plant' WHERE AD_Field_ID=554184 AND AD_Language='en_US'
;
-- 2017-11-13T13:40:11.173
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-11-13 13:40:11','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Field_ID=555150 AND AD_Language='en_US'
;
-- 2017-11-13T13:40:16.725
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-11-13 13:40:16','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Field_ID=555151 AND AD_Language='en_US'
;
-- 2017-11-13T13:40:21.731
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-11-13 13:40:21','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Field_ID=555432 AND AD_Language='en_US'
;
-- 2017-11-13T13:41:56.296
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-11-13 13:41:56','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Qty TU' WHERE AD_Field_ID=554549 AND AD_Language='en_US'
;
-- 2017-11-13T13:42:25.933
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-11-13 13:42:25','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Is Delivered' WHERE AD_Field_ID=554088 AND AD_Language='en_US'
;
-- 2017-11-13T13:42:39.838
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-11-13 13:42:39','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Is Delivered Override' WHERE AD_Field_ID=555105 AND AD_Language='en_US'
;
-- 2017-11-13T13:43:02.853
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-11-13 13:43:02','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Plant from' WHERE AD_Field_ID=554520 AND AD_Language='en_US'
;
-- 2017-11-13T13:43:21.692
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-11-13 13:43:21','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Sales Orderline',Description='',Help='' WHERE AD_Field_ID=554189 AND AD_Language='en_US'
;
-- 2017-11-13T13:43:45.315
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-11-13 13:43:45','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Business Partner',Description='',Help='' WHERE AD_Field_ID=555144 AND AD_Language='en_US'
;
-- 2017-11-13T13:43:50.709
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-11-13 13:43:50','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Field_ID=554515 AND AD_Language='en_US'
;
-- 2017-11-13T13:43:55.172
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-11-13 13:43:55','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Field_ID=555160 AND AD_Language='en_US'
; | the_stack |
1. Database design
***********************************************************/
--CREATE DATABASE Bakery;
--GO
--USE Bakery;
CREATE TABLE Countries
(
Id INT IDENTITY,
Name NVARCHAR(50)
UNIQUE,
CONSTRAINT PK_Countries PRIMARY KEY(Id)
);
CREATE TABLE Customers
(
Id INT IDENTITY,
FirstName NVARCHAR(25),
LastName NVARCHAR(25),
Gender CHAR(1),
Age INT,
--PhoneNumber VARCHAR(10), -- Judge doesn't give points with this
PhoneNumber CHAR(10),
CountryId INT,
CONSTRAINT PK_Customers PRIMARY KEY(Id),
CONSTRAINT CK_Gender CHECK(Gender = 'M'
OR Gender = 'F'),
CONSTRAINT FK_Customers_Countries FOREIGN KEY(CountryId) REFERENCES Countries(Id)
);
CREATE TABLE Products
(
Id INT IDENTITY,
Name NVARCHAR(25)
UNIQUE,
[Description] NVARCHAR(250),
Recipe NVARCHAR(MAX),
--Price DECIMAL(15, 2), -- Judge doesn't give points with this
Price MONEY,
CONSTRAINT PK_Products PRIMARY KEY(Id),
CONSTRAINT CK_Price CHECK(Price >= 0)
);
CREATE TABLE Feedbacks
(
Id INT IDENTITY,
[Description] NVARCHAR(255),
Rate DECIMAL(4, 2),
ProductId INT,
CustomerId INT,
CONSTRAINT PK_Feedbacks PRIMARY KEY(Id),
CONSTRAINT CK_Rate CHECK(Rate >= 0
AND Rate <= 10),
CONSTRAINT FK_Feedbacks_Products FOREIGN KEY(ProductId) REFERENCES Products(Id),
CONSTRAINT FK_Feedbacks_Customers FOREIGN KEY(CustomerId) REFERENCES Customers(Id)
);
CREATE TABLE Distributors
(
Id INT IDENTITY,
[Name] NVARCHAR(25)
UNIQUE,
AddressText NVARCHAR(30),
Summary NVARCHAR(200),
CountryId INT,
CONSTRAINT PK_Distributors PRIMARY KEY(Id),
CONSTRAINT FK_Distributors_Countries FOREIGN KEY(CountryId) REFERENCES Countries(Id)
);
CREATE TABLE Ingredients
(
Id INT IDENTITY,
Name NVARCHAR(30),
[Description] NVARCHAR(200),
OriginCountryId INT,
DistributorId INT,
CONSTRAINT PK_Ingredients PRIMARY KEY(Id),
CONSTRAINT FK_Ingredients_Countries FOREIGN KEY(OriginCountryId) REFERENCES Countries(Id),
CONSTRAINT FK_Ingredients_Distributors FOREIGN KEY(DistributorId) REFERENCES Distributors(Id)
);
CREATE TABLE ProductsIngredients
(
ProductId INT,
IngredientId INT,
CONSTRAINT PK_ProductsIngredients PRIMARY KEY(ProductId, IngredientId),
CONSTRAINT FK_ProductsIngredients_Products FOREIGN KEY(ProductId) REFERENCES Products(Id),
CONSTRAINT FK_ProductsIngredients_Ingredients FOREIGN KEY(IngredientId) REFERENCES Ingredients(Id)
);
/* ********************************************************
Section 2. DML (15 pts)
***********************************************************/
/* ********************************************************
2. Insert
***********************************************************/
INSERT INTO Distributors([Name],
CountryId,
AddressText,
Summary
)
VALUES
(
'Deloitte & Touche',
2,
'6 Arch St #9757',
'Customizable neutral traveling'
),
(
'Congress Title',
13,
'58 Hancock St',
'Customer loyalty'
),
(
'Kitchen People',
1,
'3 E 31st St #77',
'Triple-buffered stable delivery'
),
(
'General Color Co Inc',
21,
'6185 Bohn St #72',
'Focus group'
),
(
'Beck Corporation',
23,
'21 E 64th Ave',
'Quality-focused 4th generation hardware'
);
INSERT INTO Customers(FirstName,
LastName,
Age,
Gender,
PhoneNumber,
CountryId
)
VALUES
(
'Francoise',
'Rautenstrauch',
15,
'M',
'0195698399',
5
),
(
'Kendra',
'Loud',
22,
'F',
'0063631526',
11
),
(
'Lourdes',
'Bauswell',
50,
'M',
'0139037043',
8
),
(
'Hannah',
'Edmison',
18,
'F',
'0043343686',
1
),
(
'Tom',
'Loeza',
31,
'M',
'0144876096',
23
),
(
'Queenie',
'Kramarczyk',
30,
'F',
'0064215793',
29
),
(
'Hiu',
'Portaro',
25,
'M',
'0068277755',
16
),
(
'Josefa',
'Opitz',
43,
'F',
'0197887645',
17
);
/* ********************************************************
3. Update
***********************************************************/
UPDATE Ingredients
SET
DistributorId = 35
WHERE Name IN('Bay Leaf', 'Paprika', 'Poppy');
UPDATE Ingredients
SET
OriginCountryId = 14
WHERE OriginCountryId = 8;
/* ********************************************************
4. Delete
***********************************************************/
DELETE FROM Feedbacks
WHERE CustomerId = 14
OR ProductId = 5;
/* ********************************************************
5. Products by Price
***********************************************************/
SELECT Name,
CONVERT(DECIMAL(18, 2), Price) AS Price,
Description
FROM Products
ORDER BY Price DESC,
Name;
/* ********************************************************
6. Ingredients
***********************************************************/
SELECT Name,
Description,
OriginCountryId
FROM Ingredients
WHERE OriginCountryId IN(1, 10, 20)
ORDER BY Id;
/* ********************************************************
7. Ingredients from Bulgaria and Greece
***********************************************************/
SELECT TOP (15) i.Name,
i.Description,
c.Name AS CountryName
FROM Ingredients AS i
JOIN Countries AS c ON c.Id = i.OriginCountryId
WHERE c.Name IN('Bulgaria', 'Greece')
ORDER BY i.Name,
c.Name;
/* ********************************************************
8. Best Rated Products
***********************************************************/
SELECT TOP (10) p.Name,
p.Description,
AVG(f.Rate) AS AverageRate,
COUNT(*) AS FeedbacksAmount
FROM Products AS p
JOIN Feedbacks AS f ON f.ProductId = p.Id
GROUP BY p.Name,
p.Description
ORDER BY AverageRate DESC,
FeedbacksAmount DESC;
/* ********************************************************
9. Negative Feedback
***********************************************************/
SELECT f.ProductId ProductId,
f.Rate,
f.Description,
cust.Id AS CustomerId,
cust.Age,
cust.Gender
FROM Feedbacks AS f
JOIN Customers AS cust ON cust.Id = f.CustomerId
WHERE f.Rate < 5
ORDER BY ProductId DESC,
f.Rate;
/* ********************************************************
10. Customers without Feedback
***********************************************************/
SELECT CONCAT(c.FirstName, ' '+c.LastName) AS CustomerName,
c.PhoneNumber,
c.Gender
FROM Customers AS c
LEFT JOIN Feedbacks AS f ON f.CustomerId = c.Id
WHERE f.CustomerId IS NULL
ORDER BY c.Id;
/* ********************************************************
11. Honorable Mentions
***********************************************************/
SELECT f.ProductId,
CONCAT(c.FirstName, ' '+c.LastName) AS CustomerName,
f.Description AS FeedbackDescription
FROM Feedbacks AS f
JOIN Customers AS c ON c.Id = f.CustomerId
WHERE f.CustomerId IN
(
SELECT CustomerId
FROM Feedbacks
GROUP BY CustomerId
HAVING COUNT(*) >= 3
)
ORDER BY f.ProductId,
CustomerName,
f.Id;
/* ********************************************************
12. Customers by Criteria
***********************************************************/
SELECT cus.FirstName,
cus.Age,
cus.PhoneNumber
FROM Customers AS cus
JOIN Countries AS cory ON cory.Id = cus.CountryId
WHERE(cus.FirstName LIKE '%an%'
AND cus.Age >= 21)
OR (RIGHT(cus.PhoneNumber, 2) = '38'
AND cory.Name != 'Greece')
ORDER BY cus.FirstName,
cus.Age DESC;
/* ********************************************************
13. Middle Range Distributors
***********************************************************/
SELECT d.Name AS DistributorName,
i.Name AS IngredientName,
p.Name AS ProductName,
AVG(f.Rate) AS AverageRate
FROM Distributors AS d
JOIN Ingredients AS i ON i.DistributorId = d.Id
JOIN ProductsIngredients AS pi ON pi.IngredientId = i.Id
JOIN Products AS p ON p.Id = pi.ProductId
JOIN Feedbacks AS f ON f.ProductId = p.Id
GROUP BY d.Name,
i.Name,
p.Name
HAVING AVG(f.Rate) BETWEEN 5 AND 8
ORDER BY DistributorName,
IngredientName,
ProductName;
/* ********************************************************
14. The Most Positive Country
***********************************************************/
SELECT TOP (1) WITH TIES cry.Name AS CountryName,
AVG(f.Rate) AS FeedbackRate
FROM Countries AS cry
JOIN Customers AS cus ON cus.CountryId = cry.Id
JOIN Feedbacks AS f ON f.CustomerId = cus.Id
GROUP BY cry.Name
ORDER BY FeedbackRate DESC;
/* ********************************************************
15. Country Representative
***********************************************************/
SELECT CountryName,
DisributorName
FROM
(
SELECT c.Name AS CountryName,
d.Name AS DisributorName,
COUNT(i.DistributorId) AS IngredientsByDistributor,
DENSE_RANK() OVER(PARTITION BY c.Name ORDER BY COUNT(i.DistributorId) DESC) AS Rank
FROM Countries AS c
LEFT JOIN Distributors AS d ON d.CountryId = c.Id
LEFT JOIN Ingredients AS i ON i.DistributorId = d.Id
GROUP BY c.Name,
d.Name
) AS ranked
WHERE Rank = 1
ORDER BY CountryName,
DisributorName;
/* ********************************************************
16. Customers with Countries
***********************************************************/
CREATE VIEW v_UserWithCountries
AS
SELECT concat(cmer.FirstName+' ', cmer.LastName) AS CustomerName,
cmer.Age,
cmer.Gender,
cry.Name AS CountryName
FROM Customers AS cmer
JOIN Countries AS cry ON cry.Id = cmer.CountryId;
/* ********************************************************
17. Feedback by Product Name
***********************************************************/
CREATE FUNCTION udf_GetRating
(
@productName NVARCHAR(25)
)
RETURNS VARCHAR(9)
AS
BEGIN
DECLARE @productRate DECIMAL(4, 2) =
(
SELECT AVG(f.Rate)
FROM Products AS p
JOIN Feedbacks AS f ON f.ProductId = p.Id
WHERE p.Name = @productName
);
IF(@productRate IS NULL)
BEGIN
RETURN 'No rating';
END;
IF(@productRate < 5)
BEGIN
RETURN 'Bad';
END;
IF(@productRate <= 8)
BEGIN
RETURN 'Average';
END;
RETURN 'Good';
END;
/* ********************************************************
18. Send Feedback
***********************************************************/
CREATE PROCEDURE usp_SendFeedback
(
@customerId INT,
@productId INT,
@rate DECIMAL(4, 2),
@description NVARCHAR(255)
)
AS
BEGIN
DECLARE @feedbacksFromThisCustomerForThisProduct INT=
(
SELECT COUNT(*)
FROM Feedbacks
WHERE CustomerId = @customerId
);
IF(@feedbacksFromThisCustomerForThisProduct >= 3)
BEGIN
RAISERROR('You are limited to only 3 feedbacks per product!', 16, 1);
END;
-- Insert the Feedback
INSERT INTO Feedbacks(CustomerId,
ProductId,
Rate,
Description
)
VALUES
(
@customerId,
@productId,
@rate,
@description
);
END;
/* ********************************************************
19. Delete Products
***********************************************************/
CREATE TRIGGER tr_DeleteProduct ON products
INSTEAD OF DELETE
AS
BEGIN
DECLARE @productId INT=
(
SELECT Id
FROM deleted
);
-- Delete Feedbacks
DELETE FROM Feedbacks
WHERE ProductId = @productId;
-- Delete ProductIngredient relations
DELETE FROM ProductsIngredients
WHERE ProductId = @productId;
-- Delete Product
DELETE FROM Products
WHERE Id = @productId;
END;
/* ********************************************************
20. Products by One Distributor
***********************************************************/
SELECT p.Name AS ProductName,
AVG(f.Rate) AS ProductAverageRate,
d.Name AS DistributorName,
c.Name AS DistributorCountry
FROM Products AS p
JOIN Feedbacks AS f ON f.ProductId = p.Id
JOIN ProductsIngredients AS pi ON pi.ProductId = p.Id
JOIN Ingredients AS i ON i.Id = pi.IngredientId
JOIN Distributors AS d ON d.Id = i.DistributorId
JOIN Countries AS c ON c.Id = d.CountryId
GROUP BY p.Name,
p.id,
d.Name,
c.Name
HAVING p.Id IN
(
SELECT p.Id
FROM Products AS p
JOIN ProductsIngredients AS pi ON pi.ProductId = p.Id
JOIN Ingredients AS i ON i.Id = pi.IngredientId
GROUP BY p.Name,
p.Id
HAVING COUNT(DISTINCT i.DistributorId) = 1
)
ORDER BY p.Id; | the_stack |
;
/*!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 `DevServerState`
--
DROP TABLE IF EXISTS `DevServerState`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `DevServerState` (
`IP` varchar(45) NOT NULL,
`State` varchar(16) DEFAULT NULL,
PRIMARY KEY (`IP`),
KEY `IP` (`IP`),
KEY `State` (`State`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `ForcedWhitelist`
--
DROP TABLE IF EXISTS `ForcedWhitelist`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ForcedWhitelist` (
`IP` varchar(45) NOT NULL,
`Comment` varchar(255) NOT NULL DEFAULT 'Unspecified user',
`ForceOnPublic` tinyint(4) NOT NULL DEFAULT '1',
`ForceOnWhitelist` tinyint(4) DEFAULT '0',
`ForceOnDev` tinyint(4) DEFAULT '0',
PRIMARY KEY (`IP`),
UNIQUE KEY `IP_UNIQUE` (`IP`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `ForumServerIpViewLog`
--
DROP TABLE IF EXISTS `ForumServerIpViewLog`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ForumServerIpViewLog` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`Date` datetime DEFAULT CURRENT_TIMESTAMP,
`ForumId` int(11) DEFAULT NULL,
`ViewedIp` varchar(45) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `FullSpectrumDevWhitelist`
--
DROP TABLE IF EXISTS `FullSpectrumDevWhitelist`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `FullSpectrumDevWhitelist` (
`IP` varchar(45) NOT NULL,
`State` varchar(20) DEFAULT NULL,
PRIMARY KEY (`IP`),
KEY `State` (`State`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `GroupMembership`
--
DROP TABLE IF EXISTS `GroupMembership`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `GroupMembership` (
`ForumId` int(11) NOT NULL,
`Group` int(11) NOT NULL,
PRIMARY KEY (`ForumId`,`Group`),
KEY `Group` (`Group`),
KEY `ForumId` (`ForumId`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `GtaAccounts`
--
DROP TABLE IF EXISTS `GtaAccounts`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `GtaAccounts` (
`GtaLicense` varchar(60) NOT NULL,
`UserForumId` int(11) DEFAULT NULL,
`IsBanned` tinyint(4) DEFAULT NULL,
`RowCreated` datetime DEFAULT CURRENT_TIMESTAMP,
`RowUpdated` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`BannedUntil` datetime DEFAULT '0001-01-01 00:00:00',
PRIMARY KEY (`GtaLicense`),
KEY `RowUpdated` (`RowUpdated`),
KEY `ForumId` (`UserForumId`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `IpAddresses`
--
DROP TABLE IF EXISTS `IpAddresses`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `IpAddresses` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`ForumId` int(11) DEFAULT NULL,
`IP` varchar(45) DEFAULT NULL,
`IsBanned` int(11) DEFAULT NULL,
`RowCreated` datetime DEFAULT NULL,
`RowUpdated` datetime DEFAULT NULL,
`BannedUntil` datetime DEFAULT '0001-01-01 00:00:00',
PRIMARY KEY (`id`),
KEY `IP` (`IP`),
KEY `RowUpdated` (`RowUpdated`),
KEY `IsBanned` (`IsBanned`)
) ENGINE=InnoDB AUTO_INCREMENT=27767 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `Log`
--
DROP TABLE IF EXISTS `Log`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `Log` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`Date` datetime DEFAULT NULL,
`AccountType` text,
`ChangeType` text,
`OldValue` text,
`NewValue` text,
`ForumId` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `Date` (`Date`),
KEY `ForumId` (`ForumId`)
) ENGINE=InnoDB AUTO_INCREMENT=102302 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `ParsedDiscordAccounts`
--
DROP TABLE IF EXISTS `ParsedDiscordAccounts`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ParsedDiscordAccounts` (
`DiscordId` varchar(20) NOT NULL,
`DiscordCreated` datetime DEFAULT NULL,
`RowCreated` datetime DEFAULT NULL,
`DiscordUsername` varchar(255) DEFAULT NULL,
`DiscordDiscriminator` varchar(10) DEFAULT NULL,
`RowUpdated` datetime DEFAULT NULL,
`IsParsed` int(1) DEFAULT NULL,
`IsBanned` int(1) DEFAULT NULL,
`ShouldParserIgnore` int(1) DEFAULT '0',
`BannedUntil` datetime DEFAULT '0001-01-01 00:00:00',
PRIMARY KEY (`DiscordId`),
KEY `IsParsed` (`IsParsed`),
KEY `ShouldParserIgnore` (`ShouldParserIgnore`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `ParsedSteamAccounts`
--
DROP TABLE IF EXISTS `ParsedSteamAccounts`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ParsedSteamAccounts` (
`SteamId` varchar(45) NOT NULL,
`IsParsed` int(11) NOT NULL DEFAULT '0',
`SteamName` varchar(255) DEFAULT NULL,
`SteamVisibility` varchar(45) DEFAULT NULL,
`SteamCreated` datetime DEFAULT NULL,
`RowCreated` datetime DEFAULT NULL,
`IsBanned` int(1) DEFAULT NULL,
`SteamBans` int(11) DEFAULT NULL,
`RowUpdated` datetime DEFAULT NULL,
`NumSteamFriends` int(11) DEFAULT NULL,
`ShouldParserIgnore` int(1) DEFAULT '0',
`BannedUntil` datetime DEFAULT '0001-01-01 00:00:00',
PRIMARY KEY (`SteamId`),
KEY `IsParsed` (`IsParsed`),
KEY `IsBanned` (`IsBanned`),
KEY `ShouldParserIgnore` (`ShouldParserIgnore`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `ParsedTwitchAccounts`
--
DROP TABLE IF EXISTS `ParsedTwitchAccounts`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ParsedTwitchAccounts` (
`TwitchId` int(11) NOT NULL,
`IsParsed` int(1) DEFAULT NULL,
`TwitchName` varchar(45) DEFAULT NULL,
`TwitchFollowerCount` int(11) DEFAULT NULL,
`TwitchCreated` datetime DEFAULT NULL,
`RowCreated` datetime DEFAULT NULL,
`RowUpdated` datetime DEFAULT NULL,
`IsBanned` int(1) DEFAULT NULL,
`ShouldParserIgnore` int(1) DEFAULT '0',
`BannedUntil` datetime DEFAULT '0001-01-01 00:00:00',
PRIMARY KEY (`TwitchId`),
KEY `IsParsed` (`IsParsed`),
KEY `ShouldParserIgnore` (`ShouldParserIgnore`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `PublicServerState`
--
DROP TABLE IF EXISTS `PublicServerState`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PublicServerState` (
`IP` varchar(45) NOT NULL,
`State` varchar(20) NOT NULL,
PRIMARY KEY (`IP`),
KEY `IP` (`IP`),
KEY `State` (`State`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `ServerWhitelistLog`
--
DROP TABLE IF EXISTS `ServerWhitelistLog`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ServerWhitelistLog` (
`Id` int(11) NOT NULL AUTO_INCREMENT,
`Date` datetime DEFAULT NULL,
`ActionType` varchar(45) DEFAULT NULL,
`Ip` varchar(45) DEFAULT NULL,
`WhitelistType` varchar(45) DEFAULT NULL,
PRIMARY KEY (`Id`),
KEY `Ip` (`Ip`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='ServerWhitelistLog (Date, ActionType, Ip)';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `Users`
--
DROP TABLE IF EXISTS `Users`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `Users` (
`ForumId` int(11) NOT NULL,
`SteamId` varchar(45) DEFAULT NULL,
`DiscordId` varchar(45) DEFAULT NULL,
`TwitchId` int(11) DEFAULT NULL,
`ForumBanned` int(11) DEFAULT NULL,
`ForumPostCount` int(11) DEFAULT NULL,
`ServerBanned` int(11) DEFAULT NULL,
`ForumPmCount` int(11) DEFAULT NULL,
`ForumGroups` varchar(45) DEFAULT NULL,
`IsAdmin` int(11) DEFAULT NULL,
`IsDev` int(11) DEFAULT NULL,
`IsPolice` int(11) DEFAULT NULL,
`IsEMS` int(11) DEFAULT NULL,
`IsFireDept` int(11) DEFAULT NULL,
`LastLoggedInForum` datetime DEFAULT NULL,
`LastLoggedInGame` datetime DEFAULT NULL,
`ForumDbRowChecksum` varchar(45) DEFAULT NULL,
`CurrentIP` varchar(45) DEFAULT NULL,
`RowUpdated` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
`RowCreated` datetime DEFAULT CURRENT_TIMESTAMP,
`GtaLicense` varchar(60) DEFAULT NULL,
`Email` varchar(320) DEFAULT NULL,
`BannedUntil` datetime DEFAULT '0001-01-01 00:00:00',
PRIMARY KEY (`ForumId`),
UNIQUE KEY `id_UNIQUE` (`ForumId`),
KEY `SteamId` (`SteamId`),
KEY `DiscordId` (`DiscordId`),
KEY `TwitchId` (`TwitchId`),
KEY `IP` (`CurrentIP`),
KEY `SteamId_idx` (`SteamId`),
KEY `TwitchId_idx` (`TwitchId`),
KEY `GtaLicense_idx` (`GtaLicense`),
KEY `IP_idx` (`CurrentIP`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='For all forum users';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `WhitelistServerState`
--
DROP TABLE IF EXISTS `WhitelistServerState`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `WhitelistServerState` (
`IP` varchar(45) NOT NULL,
`State` varchar(20) NOT NULL,
PRIMARY KEY (`IP`),
KEY `State` (`State`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping events for database 'FamilyRpServerAccess'
--
--
-- Dumping routines for database 'FamilyRpServerAccess'
--
/*!50003 DROP PROCEDURE IF EXISTS `BanUser` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
CREATE DEFINER=`myuser`@`%` PROCEDURE `BanUser`(IN SteamId VARCHAR(45))
BEGIN
UPDATE FamilyRpServerAccess.ParsedSteamAccounts AS psa SET IsBanned = 1 WHERE psa.SteamId = SteamId;
UPDATE FamilyRpServerAccess.Users AS us SET ServerBanned = 1 WHERE us.SteamId = SteamId;
UPDATE FamilyRpServerAccess.Users AS us
INNER JOIN FamilyRpServerAccess.ParsedDiscordAccounts AS pda ON us.DiscordId = pda.DiscordId
SET pda.IsBanned = 1 WHERE us.SteamId = SteamId;
UPDATE FamilyRpServerAccess.Users AS us
INNER JOIN FamilyRpServerAccess.ParsedTwitchAccounts AS pta ON us.TwitchId = pta.TwitchId
SET pta.IsBanned = 1 WHERE us.SteamId = SteamId;
UPDATE FamilyRpServerAccess.GtaAccounts AS gta
INNER JOIN FamilyRpServerAccess.Users AS us ON us.ForumId = gta.UserForumId
SET gta.IsBanned = 1
WHERE us.SteamId = SteamId;
UPDATE FamilyRpServerAccess.IpAddresses AS ipa
INNER JOIN FamilyRpServerAccess.Users AS us ON us.ForumId = ipa.ForumId
SET ipa.IsBanned = 1
WHERE us.SteamId = SteamId;
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP PROCEDURE IF EXISTS `BanUserForHours` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
CREATE DEFINER=`myuser`@`%` PROCEDURE `BanUserForHours`(IN SteamId VARCHAR(45), IN BanHours INT)
BEGIN
DECLARE BannedUntil DATETIME;
SET BannedUntil = NOW() + INTERVAL BanHours HOUR;
UPDATE FamilyRpServerAccess.ParsedSteamAccounts AS psa SET psa.BannedUntil = BannedUntil WHERE psa.SteamId = SteamId;
UPDATE FamilyRpServerAccess.Users AS us SET us.BannedUntil = BannedUntil WHERE us.SteamId = SteamId;
UPDATE FamilyRpServerAccess.Users AS us
INNER JOIN FamilyRpServerAccess.ParsedDiscordAccounts AS pda ON us.DiscordId = pda.DiscordId
SET pda.BannedUntil = BannedUntil WHERE us.SteamId = SteamId;
UPDATE FamilyRpServerAccess.Users AS us
INNER JOIN FamilyRpServerAccess.ParsedTwitchAccounts AS pta ON us.TwitchId = pta.TwitchId
SET pta.BannedUntil = BannedUntil WHERE us.SteamId = SteamId;
UPDATE FamilyRpServerAccess.GtaAccounts AS gta
INNER JOIN FamilyRpServerAccess.Users AS us ON us.ForumId = gta.UserForumId
SET gta.BannedUntil = BannedUntil
WHERE us.SteamId = SteamId;
UPDATE FamilyRpServerAccess.IpAddresses AS ipa
INNER JOIN FamilyRpServerAccess.Users AS us ON us.ForumId = ipa.ForumId
SET ipa.BannedUntil = BannedUntil
WHERE us.SteamId = SteamId;
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP PROCEDURE IF EXISTS `DeveloperProcedure` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
CREATE DEFINER=`myuser`@`%` PROCEDURE `DeveloperProcedure`()
BEGIN
CREATE TEMPORARY TABLE IF NOT EXISTS topTwoIps ENGINE = MEMORY
AS
SELECT ForumId, IP
FROM
(SELECT @prev := '', @n := 0) init
JOIN
(SELECT @n := if(ForumId != @prev, 1, @n + 1) AS n,
@prev := ForumId,
ForumId, IP, RowCreated
FROM FamilyRpServerAccess.IpAddresses
WHERE CHAR_LENGTH(IP) <= 16
ORDER BY
ForumId ASC,
RowCreated DESC
) x
WHERE n <= 2
ORDER BY ForumId, n;
CREATE TEMPORARY TABLE IF NOT EXISTS WhitelistIntermediateTableA ENGINE = MEMORY
(SELECT DISTINCT * FROM (SELECT DISTINCT tti.IP
FROM topTwoIps AS tti
INNER JOIN FamilyRpServerAccess.GroupMembership as gm ON tti.ForumId = gm.ForumId
INNER JOIN FamilyRpServerAccess.Users as us ON tti.ForumId = us.ForumId
WHERE
gm.Group NOT IN (16)
AND gm.Group IN (11)) AS u WHERE IP NOT IN (SELECT IP FROM IpAddresses WHERE IsBanned = TRUE));
# 8 - Endorsed Whitelisted
# 22 - Applied Whitelisted
# 16 - Banned on forum
-- Because MySQL does not allow the same temporary table to be used multiple times in one query
CREATE TEMPORARY TABLE IF NOT EXISTS WhitelistIntermediateTableB ENGINE = MEMORY
SELECT * FROM WhitelistIntermediateTableA;
CREATE TEMPORARY TABLE IF NOT EXISTS WhitelistJoined ENGINE = MEMORY
(SELECT * FROM (SELECT wit.IP AS WhitelistByForum, wss.IP AS WhitelistByServer, State
FROM WhitelistIntermediateTableA AS wit
LEFT OUTER JOIN FamilyRpServerAccess.FullSpectrumDevWhitelist AS wss ON wss.IP = wit.IP
UNION
SELECT wit.IP AS WhitelistByForum, wss.IP AS WhitelistByServer, State
FROM WhitelistIntermediateTableB AS wit
RIGHT OUTER JOIN FamilyRpServerAccess.FullSpectrumDevWhitelist AS wss ON wss.IP = wit.IP) AS t);
-- t alias is irrelevant; just required
INSERT INTO FamilyRpServerAccess.FullSpectrumDevWhitelist (IP, State)
SELECT WhitelistByForum, 'Add'
FROM WhitelistJoined AS wj
WHERE WhitelistByServer IS NULL;
UPDATE FamilyRpServerAccess.FullSpectrumDevWhitelist AS wss
INNER JOIN WhitelistJoined AS wj ON wj.WhitelistByServer = wss.IP
SET wss.State = 'Add'
WHERE WhitelistByForum IS NOT NULL AND wj.State = 'Remove';
UPDATE FamilyRpServerAccess.FullSpectrumDevWhitelist AS wss
INNER JOIN WhitelistJoined AS wj ON wj.WhitelistByServer = wss.IP
SET wss.State = 'Remove'
WHERE WhitelistByForum IS NULL AND wj.State <> 'Remove';
DELETE wss
FROM FamilyRpServerAccess.FullSpectrumDevWhitelist AS wss
INNER JOIN WhitelistJoined AS wj ON wj.WhitelistByServer = wss.IP
WHERE WhitelistByForum IS NULL AND wj.State = 'Add';
DROP TEMPORARY TABLE topTwoIps;
DROP TEMPORARY TABLE WhitelistIntermediateTableA;
DROP TEMPORARY TABLE WhitelistIntermediateTableB;
DROP TEMPORARY TABLE WhitelistJoined;
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP PROCEDURE IF EXISTS `DoesUserHaveAllAccountTypes` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
CREATE DEFINER=`myuser`@`%` PROCEDURE `DoesUserHaveAllAccountTypes`(IN SteamId VARCHAR(45))
BEGIN
SELECT CASE WHEN COUNT(1) > 0 THEN 1 ELSE 0 END AS IsAllowed
FROM FamilyRpServerAccess.Users as us
INNER JOIN FamilyRpServerAccess.GroupMembership as gm ON us.ForumId = gm.ForumId
# INNER JOIN FamilyRpServerAccess.ParsedDiscordAccounts as pda ON us.DiscordId = pda.DiscordId
INNER JOIN FamilyRpServerAccess.ParsedSteamAccounts as psa ON us.SteamId = psa.SteamId
# INNER JOIN FamilyRpServerAccess.ParsedTwitchAccounts as pta ON us.TwitchId = pta.TwitchId
LEFT JOIN FamilyRpServerAccess.GtaAccounts as ga ON us.ForumId = ga.UserForumId
LEFT JOIN FamilyRpServerAccess.IpAddresses as ips ON us.CurrentIP = ips.IP
WHERE
us.SteamId = SteamId
AND gm.Group NOT IN (16)
# AND us.DiscordId IS NOT NULL
# AND us.TwitchId IS NOT NULL
AND (psa.IsBanned = 0 OR psa.IsBanned IS NULL)
# AND (pta.IsBanned = 0 OR pta.IsBanned IS NULL)
# AND (pda.IsBanned = 0 OR pda.IsBanned IS NULL)
AND (ips.IsBanned = 0 OR ips.IsBanned IS NULL)
AND (ga.IsBanned = 0 OR ga.IsBanned IS NULL)
AND (psa.BannedUntil < NOW() OR psa.BannedUntil IS NULL)
# AND (pta.BannedUntil < NOW())
# AND (pda.BannedUntil < NOW())
AND (ips.BannedUntil < NOW() OR ips.BannedUntil IS NULL)
AND (ga.BannedUntil < NOW() OR ga.BannedUntil IS NULL);
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP PROCEDURE IF EXISTS `EnsureGtaLicenseRegistered` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
CREATE DEFINER=`myuser`@`%` PROCEDURE `EnsureGtaLicenseRegistered`(IN SteamId VARCHAR(45), IN GtaLicense VARCHAR(45))
BEGIN
SET @IsGtaLicenseRegistered = (SELECT
CASE WHEN COUNT(1) > 0 THEN 1 ELSE 0 END
FROM FamilyRpServerAccess.GtaAccounts AS gta
WHERE gta.GtaLicense = GtaLicense);
SELECT @IsGtaLicenseRegistered;
IF @IsGtaLicenseRegistered = 0 THEN
INSERT INTO FamilyRpServerAccess.GtaAccounts (GtaLicense, UserForumId)
SELECT GtaLicense, us.ForumId
FROM FamilyRpServerAccess.Users AS us
WHERE us.SteamId = SteamId
AND us.SteamId IS NOT NULL
ORDER BY us.ForumId DESC
LIMIT 1;
END IF;
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP PROCEDURE IF EXISTS `IsForumUserAllowedToViewPublicIp` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
CREATE DEFINER=`myuser`@`%` PROCEDURE `IsForumUserAllowedToViewPublicIp`(IN ForumId INT)
BEGIN
SELECT CASE WHEN COUNT(1) > 0 THEN 1 ELSE 0 END AS IsAllowed
FROM FamilyRpServerAccess.Users as us
INNER JOIN FamilyRpServerAccess.GroupMembership as gm ON us.ForumId = gm.ForumId
INNER JOIN FamilyRpServerAccess.ParsedDiscordAccounts as pda ON us.DiscordId = pda.DiscordId
INNER JOIN FamilyRpServerAccess.ParsedSteamAccounts as psa ON us.SteamId = psa.SteamId
INNER JOIN FamilyRpServerAccess.ParsedTwitchAccounts as pta ON us.TwitchId = pta.TwitchId
LEFT JOIN FamilyRpServerAccess.GtaAccounts as ga ON us.ForumId = ga.UserForumId
LEFT JOIN FamilyRpServerAccess.IpAddresses as ips ON us.CurrentIP = ips.IP
WHERE
us.ForumId = ForumId
AND gm.Group NOT IN (16)
AND us.DiscordId IS NOT NULL
AND us.TwitchId IS NOT NULL
AND (us.ServerBanned = 0 OR us.ServerBanned IS NULL)
AND (psa.IsBanned = 0 OR psa.IsBanned IS NULL)
AND (pta.IsBanned = 0 OR pta.IsBanned IS NULL)
AND (pda.IsBanned = 0 OR pda.IsBanned IS NULL)
AND (ips.IsBanned = 0 OR ips.IsBanned IS NULL)
AND (ga.IsBanned = 0 OR ga.IsBanned IS NULL)
AND (psa.BannedUntil < NOW())
AND (pta.BannedUntil < NOW())
AND (pda.BannedUntil < NOW())
AND (ips.BannedUntil < NOW())
AND (ga.BannedUntil < NOW());
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP PROCEDURE IF EXISTS `IsForumUserAllowedToViewWhitelistIp` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
CREATE DEFINER=`myuser`@`%` PROCEDURE `IsForumUserAllowedToViewWhitelistIp`(IN ForumId INT)
BEGIN
SELECT CASE WHEN COUNT(1) > 0 THEN 1 ELSE 0 END AS IsWhitelisted
FROM FamilyRpServerAccess.Users AS us
INNER JOIN FamilyRpServerAccess.GroupMembership as gm ON us.ForumId = gm.ForumId
WHERE gm.Group IN (8, 22) AND gm.Group NOT IN (16) AND us.ForumId = ForumId;
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP PROCEDURE IF EXISTS `IsUserAdmin` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
CREATE DEFINER=`myuser`@`%` PROCEDURE `IsUserAdmin`(IN SteamId VARCHAR(45))
BEGIN
SELECT
CASE WHEN COUNT(1) > 0 THEN 1 ELSE 0 END AS IsAdmin
FROM FamilyRpServerAccess.Users AS us
INNER JOIN FamilyRpServerAccess.GroupMembership as gm ON us.ForumId = gm.ForumId
WHERE gm.Group IN (4, 10, 11, 19) AND gm.Group NOT IN (16) AND us.SteamId = SteamId;
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP PROCEDURE IF EXISTS `IsUserPriority` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
CREATE DEFINER=`myuser`@`%` PROCEDURE `IsUserPriority`(IN SteamId VARCHAR(45))
BEGIN
SELECT
CASE WHEN COUNT(1) > 0 THEN 1 ELSE 0 END AS IsPriority
FROM FamilyRpServerAccess.Users AS us
WHERE (us.IsEMS = 1 OR us.IsFireDept = 1 OR us.IsPolice = 1) AND us.SteamId = SteamId;
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP PROCEDURE IF EXISTS `IsUserWhitelisted` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
CREATE DEFINER=`myuser`@`%` PROCEDURE `IsUserWhitelisted`(IN SteamId VARCHAR(45))
BEGIN
SELECT
CASE WHEN COUNT(1) > 0 THEN 1 ELSE 0 END AS IsWhitelisted
FROM FamilyRpServerAccess.Users AS us
INNER JOIN FamilyRpServerAccess.GroupMembership as gm ON us.ForumId = gm.ForumId
WHERE gm.Group IN (8, 22) AND gm.Group NOT IN (16) AND us.SteamId = SteamId;
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP PROCEDURE IF EXISTS `LogForumIpView` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
CREATE DEFINER=`myuser`@`%` PROCEDURE `LogForumIpView`(IN ForumId INT, IN ViewedIP VARCHAR(45))
BEGIN
INSERT INTO ForumServerIpViewLog (ForumId, ViewedIp) VALUES (ForumId, ViewedIp);
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP PROCEDURE IF EXISTS `ProcessPrivateSteamIds` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
CREATE DEFINER=`myuser`@`%` PROCEDURE `ProcessPrivateSteamIds`()
BEGIN
UPDATE FamilyRpServerAccess.ParsedSteamAccounts AS psa
SET psa.SteamCreated =
(SELECT SteamCreated FROM
(SELECT * FROM FamilyRpServerAccess.ParsedSteamAccounts WHERE SteamCreated <> '0001-01-01') AS psaSub
WHERE psaSub.SteamId <= psa.SteamId ORDER BY SteamId DESC LIMIT 1)
WHERE psa.SteamCreated = '0001-01-01';
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP PROCEDURE IF EXISTS `PublicProcedure` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
CREATE DEFINER=`myuser`@`%` PROCEDURE `PublicProcedure`()
BEGIN
CREATE TEMPORARY TABLE IF NOT EXISTS topTwoIps ENGINE = MEMORY
AS
SELECT ForumId, IP
FROM
(SELECT @prev := '', @n := 0) init
JOIN
(SELECT @n := if(ForumId != @prev, 1, @n + 1) AS n,
@prev := ForumId,
ForumId, IP, RowCreated
FROM FamilyRpServerAccess.IpAddresses
WHERE CHAR_LENGTH(IP) <= 16
ORDER BY
ForumId ASC,
RowCreated DESC
) x
WHERE n <= 2
ORDER BY ForumId, n;
CREATE TEMPORARY TABLE IF NOT EXISTS WhitelistIntermediateTableA ENGINE = MEMORY
(SELECT DISTINCT * FROM (SELECT DISTINCT tti.IP
FROM topTwoIps AS tti
INNER JOIN FamilyRpServerAccess.GroupMembership as gm ON tti.ForumId = gm.ForumId
INNER JOIN FamilyRpServerAccess.Users as us ON tti.ForumId = us.ForumId
INNER JOIN FamilyRpServerAccess.ParsedDiscordAccounts as pda ON us.DiscordId = pda.DiscordId
INNER JOIN FamilyRpServerAccess.ParsedSteamAccounts as psa ON us.SteamId = psa.SteamId
INNER JOIN FamilyRpServerAccess.ParsedTwitchAccounts as pta ON us.TwitchId = pta.TwitchId
LEFT JOIN FamilyRpServerAccess.GtaAccounts as ga ON us.ForumId = ga.UserForumId
LEFT JOIN FamilyRpServerAccess.IpAddresses as ips ON us.CurrentIP = ips.IP
WHERE gm.Group NOT IN (16)
AND us.SteamId IS NOT NULL
AND us.DiscordId IS NOT NULL
AND us.TwitchId IS NOT NULL
AND (psa.IsBanned = 0 OR psa.IsBanned IS NULL)
AND (pta.IsBanned = 0 OR pta.IsBanned IS NULL)
AND (pda.IsBanned = 0 OR pda.IsBanned IS NULL)
AND (ips.IsBanned = 0 OR ips.IsBanned IS NULL)
AND (ga.IsBanned = 0 OR ga.IsBanned IS NULL)
UNION
SELECT IP FROM FamilyRpServerAccess.ForcedWhitelist WHERE ForceOnPublic = TRUE) AS u WHERE IP NOT IN (SELECT IP FROM IpAddresses WHERE IsBanned = TRUE));
# 8 - Endorsed Whitelisted
# 22 - Applied Whitelisted
# 16 - Banned on forum
-- Because MySQL does not allow the same temporary table to be used multiple times in one query
CREATE TEMPORARY TABLE IF NOT EXISTS WhitelistIntermediateTableB ENGINE = MEMORY
SELECT * FROM WhitelistIntermediateTableA;
CREATE TEMPORARY TABLE IF NOT EXISTS WhitelistJoined ENGINE = MEMORY
(SELECT * FROM (SELECT wit.IP AS WhitelistByForum, wss.IP AS WhitelistByServer, State
FROM WhitelistIntermediateTableA AS wit
LEFT OUTER JOIN FamilyRpServerAccess.PublicServerState AS wss ON wss.IP = wit.IP
UNION
SELECT wit.IP AS WhitelistByForum, wss.IP AS WhitelistByServer, State
FROM WhitelistIntermediateTableB AS wit
RIGHT OUTER JOIN FamilyRpServerAccess.PublicServerState AS wss ON wss.IP = wit.IP) AS t);
-- t alias is irrelevant; just required
INSERT INTO FamilyRpServerAccess.PublicServerState (IP, State)
SELECT WhitelistByForum, 'Add'
FROM WhitelistJoined AS wj
WHERE WhitelistByServer IS NULL;
UPDATE FamilyRpServerAccess.PublicServerState AS wss
INNER JOIN WhitelistJoined AS wj ON wj.WhitelistByServer = wss.IP
SET wss.State = 'Add'
WHERE WhitelistByForum IS NOT NULL AND wj.State = 'Remove';
UPDATE FamilyRpServerAccess.PublicServerState AS wss
INNER JOIN WhitelistJoined AS wj ON wj.WhitelistByServer = wss.IP
SET wss.State = 'Remove'
WHERE WhitelistByForum IS NULL AND wj.State <> 'Remove';
DELETE wss
FROM FamilyRpServerAccess.PublicServerState AS wss
INNER JOIN WhitelistJoined AS wj ON wj.WhitelistByServer = wss.IP
WHERE WhitelistByForum IS NULL AND wj.State = 'Add';
DROP TEMPORARY TABLE topTwoIps;
DROP TEMPORARY TABLE WhitelistIntermediateTableA;
DROP TEMPORARY TABLE WhitelistIntermediateTableB;
DROP TEMPORARY TABLE WhitelistJoined;
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP PROCEDURE IF EXISTS `RetrievePublicServerPublicIp` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
CREATE DEFINER=`myuser`@`%` PROCEDURE `RetrievePublicServerPublicIp`(IN ForumId INT)
BEGIN
SELECT '255.255.255.255';
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP PROCEDURE IF EXISTS `RetrievePublicServerWhitelistIp` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
CREATE DEFINER=`myuser`@`%` PROCEDURE `RetrievePublicServerWhitelistIp`(IN ForumId INT)
BEGIN
SELECT '1.1.1.1';
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP PROCEDURE IF EXISTS `TesterProcedure` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
CREATE DEFINER=`myuser`@`%` PROCEDURE `TesterProcedure`()
BEGIN
CREATE TEMPORARY TABLE IF NOT EXISTS topTwoIps ENGINE = MEMORY
AS
SELECT ForumId, IP
FROM
(SELECT @prev := '', @n := 0) init
JOIN
(SELECT @n := if(ForumId != @prev, 1, @n + 1) AS n,
@prev := ForumId,
ForumId, IP, RowCreated
FROM FamilyRpServerAccess.IpAddresses
WHERE CHAR_LENGTH(IP) <= 16
ORDER BY
ForumId ASC,
RowCreated DESC
) x
WHERE n <= 2
ORDER BY ForumId, n;
CREATE TEMPORARY TABLE IF NOT EXISTS WhitelistIntermediateTableA ENGINE = MEMORY
(SELECT DISTINCT * FROM (SELECT DISTINCT tti.IP
FROM topTwoIps AS tti
INNER JOIN FamilyRpServerAccess.GroupMembership as gm ON tti.ForumId = gm.ForumId
INNER JOIN FamilyRpServerAccess.Users as us ON tti.ForumId = us.ForumId
WHERE
gm.Group NOT IN (16)
AND gm.Group IN (10, 11, 17, 19)
UNION
SELECT IP FROM FamilyRpServerAccess.ForcedWhitelist WHERE ForceOnDev = TRUE) AS u WHERE IP NOT IN (SELECT IP FROM IpAddresses WHERE IsBanned = TRUE));
# 8 - Endorsed Whitelisted
# 22 - Applied Whitelisted
# 16 - Banned on forum
-- Because MySQL does not allow the same temporary table to be used multiple times in one query
CREATE TEMPORARY TABLE IF NOT EXISTS WhitelistIntermediateTableB ENGINE = MEMORY
SELECT * FROM WhitelistIntermediateTableA;
CREATE TEMPORARY TABLE IF NOT EXISTS WhitelistJoined ENGINE = MEMORY
(SELECT * FROM (SELECT wit.IP AS WhitelistByForum, wss.IP AS WhitelistByServer, State
FROM WhitelistIntermediateTableA AS wit
LEFT OUTER JOIN FamilyRpServerAccess.DevServerState AS wss ON wss.IP = wit.IP
UNION
SELECT wit.IP AS WhitelistByForum, wss.IP AS WhitelistByServer, State
FROM WhitelistIntermediateTableB AS wit
RIGHT OUTER JOIN FamilyRpServerAccess.DevServerState AS wss ON wss.IP = wit.IP) AS t);
-- t alias is irrelevant; just required
INSERT INTO FamilyRpServerAccess.DevServerState (IP, State)
SELECT WhitelistByForum, 'Add'
FROM WhitelistJoined AS wj
WHERE WhitelistByServer IS NULL;
UPDATE FamilyRpServerAccess.DevServerState AS wss
INNER JOIN WhitelistJoined AS wj ON wj.WhitelistByServer = wss.IP
SET wss.State = 'Add'
WHERE WhitelistByForum IS NOT NULL AND wj.State = 'Remove';
UPDATE FamilyRpServerAccess.DevServerState AS wss
INNER JOIN WhitelistJoined AS wj ON wj.WhitelistByServer = wss.IP
SET wss.State = 'Remove'
WHERE WhitelistByForum IS NULL AND wj.State <> 'Remove';
DELETE wss
FROM FamilyRpServerAccess.DevServerState AS wss
INNER JOIN WhitelistJoined AS wj ON wj.WhitelistByServer = wss.IP
WHERE WhitelistByForum IS NULL AND wj.State = 'Add';
DROP TEMPORARY TABLE topTwoIps;
DROP TEMPORARY TABLE WhitelistIntermediateTableA;
DROP TEMPORARY TABLE WhitelistIntermediateTableB;
DROP TEMPORARY TABLE WhitelistJoined;
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP PROCEDURE IF EXISTS `WhitelistProcedure` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
CREATE DEFINER=`myuser`@`%` PROCEDURE `WhitelistProcedure`()
BEGIN
CREATE TEMPORARY TABLE IF NOT EXISTS topTwoIps ENGINE = MEMORY
AS
SELECT ForumId, n, IP
FROM
(SELECT @prev := '', @n := 0) init
JOIN
(SELECT @n := if(ForumId != @prev, 1, @n + 1) AS n,
@prev := ForumId,
ForumId, IP, RowCreated
FROM FamilyRpServerAccess.IpAddresses
WHERE CHAR_LENGTH(IP) <= 16
ORDER BY
ForumId ASC,
RowUpdated DESC
) x
WHERE n <= 2
ORDER BY ForumId, n;
CREATE TEMPORARY TABLE IF NOT EXISTS WhitelistIntermediateTableA ENGINE = MEMORY
(SELECT DISTINCT * FROM (SELECT tti.IP
FROM topTwoIps AS tti
INNER JOIN FamilyRpServerAccess.GroupMembership as gm ON tti.ForumId = gm.ForumId
WHERE gm.Group IN (8, 22) AND gm.Group NOT IN (16)
UNION
SELECT IP FROM FamilyRpServerAccess.ForcedWhitelist WHERE ForceOnWhitelist = TRUE) AS u WHERE IP NOT IN (SELECT IP FROM IpAddresses WHERE IsBanned = TRUE));
# 8 - Endorsed Whitelisted
# 22 - Applied Whitelisted
# 16 - Banned on forum
-- Because MySQL does not allow the same temporary table to be used multiple times in one query
CREATE TEMPORARY TABLE IF NOT EXISTS WhitelistIntermediateTableB ENGINE = MEMORY
SELECT * FROM WhitelistIntermediateTableA;
CREATE TEMPORARY TABLE IF NOT EXISTS WhitelistJoined ENGINE = MEMORY
(SELECT * FROM (SELECT wit.IP AS WhitelistByForum, wss.IP AS WhitelistByServer, State
FROM WhitelistIntermediateTableA AS wit
LEFT OUTER JOIN FamilyRpServerAccess.WhitelistServerState AS wss ON wss.IP = wit.IP
UNION
SELECT wit.IP AS WhitelistByForum, wss.IP AS WhitelistByServer, State
FROM WhitelistIntermediateTableB AS wit
RIGHT OUTER JOIN FamilyRpServerAccess.WhitelistServerState AS wss ON wss.IP = wit.IP) AS t);
-- t alias is irrelevant; just required
INSERT INTO FamilyRpServerAccess.WhitelistServerState (IP, State)
SELECT WhitelistByForum, 'Add'
FROM WhitelistJoined AS wj
WHERE WhitelistByServer IS NULL AND (wj.State <> 'Add' OR wj.State IS NULL);
UPDATE FamilyRpServerAccess.WhitelistServerState AS wss
INNER JOIN WhitelistJoined AS wj ON wj.WhitelistByServer = wss.IP
SET wss.State = 'Remove'
WHERE WhitelistByForum IS NULL AND (wj.State <> 'Remove' OR wj.State IS NULL);
DELETE FROM FamilyRpServerAccess.WhitelistServerState WHERE State = 'Remove';
DROP TEMPORARY TABLE topTwoIps;
DROP TEMPORARY TABLE WhitelistIntermediateTableA;
DROP TEMPORARY TABLE WhitelistIntermediateTableB;
DROP TEMPORARY TABLE WhitelistJoined;
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!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 */; | the_stack |
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "ALTER EXTENSION btree_gist UPDATE TO '1.6'" to load this file. \quit
-- This upgrade script marks all btree_gist functions as parallel safe.
-- Input/output functions for GiST key types (gbtreekey*)
ALTER FUNCTION gbtreekey4_in(cstring) PARALLEL SAFE;
ALTER FUNCTION gbtreekey4_out(gbtreekey4) PARALLEL SAFE;
ALTER FUNCTION gbtreekey8_in(cstring) PARALLEL SAFE;
ALTER FUNCTION gbtreekey8_out(gbtreekey8) PARALLEL SAFE;
ALTER FUNCTION gbtreekey16_in(cstring) PARALLEL SAFE;
ALTER FUNCTION gbtreekey16_out(gbtreekey16) PARALLEL SAFE;
ALTER FUNCTION gbtreekey32_in(cstring) PARALLEL SAFE;
ALTER FUNCTION gbtreekey32_out(gbtreekey32) PARALLEL SAFE;
ALTER FUNCTION gbtreekey_var_in(cstring) PARALLEL SAFE;
ALTER FUNCTION gbtreekey_var_out(gbtreekey_var) PARALLEL SAFE;
-- Functions, which implement distance operators (<->)
ALTER FUNCTION cash_dist(money, money) PARALLEL SAFE;
ALTER FUNCTION date_dist(date, date) PARALLEL SAFE;
ALTER FUNCTION float4_dist(real, real) PARALLEL SAFE;
ALTER FUNCTION float8_dist(double precision, double precision) PARALLEL SAFE;
ALTER FUNCTION int2_dist(smallint, smallint) PARALLEL SAFE;
ALTER FUNCTION int4_dist(integer, integer) PARALLEL SAFE;
ALTER FUNCTION int8_dist(bigint, bigint) PARALLEL SAFE;
ALTER FUNCTION interval_dist(interval, interval) PARALLEL SAFE;
ALTER FUNCTION oid_dist(oid, oid) PARALLEL SAFE;
ALTER FUNCTION time_dist(time without time zone, time without time zone) PARALLEL SAFE;
ALTER FUNCTION ts_dist(timestamp without time zone, timestamp without time zone) PARALLEL SAFE;
ALTER FUNCTION tstz_dist(timestamp with time zone, timestamp with time zone) PARALLEL SAFE;
-- GiST support methods
ALTER FUNCTION gbt_oid_consistent(internal, oid, smallint, oid, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_oid_distance(internal, oid, smallint, oid, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_oid_fetch(internal) PARALLEL SAFE;
ALTER FUNCTION gbt_oid_compress(internal) PARALLEL SAFE;
ALTER FUNCTION gbt_decompress(internal) PARALLEL SAFE;
ALTER FUNCTION gbt_var_decompress(internal) PARALLEL SAFE;
ALTER FUNCTION gbt_var_fetch(internal) PARALLEL SAFE;
ALTER FUNCTION gbt_oid_penalty(internal, internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_oid_picksplit(internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_oid_union(internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_oid_same(gbtreekey8, gbtreekey8, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_int2_consistent(internal, smallint, smallint, oid, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_int2_distance(internal, smallint, smallint, oid, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_int2_compress(internal) PARALLEL SAFE;
ALTER FUNCTION gbt_int2_fetch(internal) PARALLEL SAFE;
ALTER FUNCTION gbt_int2_penalty(internal, internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_int2_picksplit(internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_int2_union(internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_int2_same(gbtreekey4, gbtreekey4, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_int4_consistent(internal, integer, smallint, oid, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_int4_distance(internal, integer, smallint, oid, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_int4_compress(internal) PARALLEL SAFE;
ALTER FUNCTION gbt_int4_fetch(internal) PARALLEL SAFE;
ALTER FUNCTION gbt_int4_penalty(internal, internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_int4_picksplit(internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_int4_union(internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_int4_same(gbtreekey8, gbtreekey8, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_int8_consistent(internal, bigint, smallint, oid, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_int8_distance(internal, bigint, smallint, oid, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_int8_compress(internal) PARALLEL SAFE;
ALTER FUNCTION gbt_int8_fetch(internal) PARALLEL SAFE;
ALTER FUNCTION gbt_int8_penalty(internal, internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_int8_picksplit(internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_int8_union(internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_int8_same(gbtreekey16, gbtreekey16, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_float4_consistent(internal, real, smallint, oid, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_float4_distance(internal, real, smallint, oid, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_float4_compress(internal) PARALLEL SAFE;
ALTER FUNCTION gbt_float4_fetch(internal) PARALLEL SAFE;
ALTER FUNCTION gbt_float4_penalty(internal, internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_float4_picksplit(internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_float4_union(internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_float4_same(gbtreekey8, gbtreekey8, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_float8_consistent(internal, double precision, smallint, oid, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_float8_distance(internal, double precision, smallint, oid, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_float8_compress(internal) PARALLEL SAFE;
ALTER FUNCTION gbt_float8_fetch(internal) PARALLEL SAFE;
ALTER FUNCTION gbt_float8_penalty(internal, internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_float8_picksplit(internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_float8_union(internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_float8_same(gbtreekey16, gbtreekey16, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_ts_consistent(internal, timestamp without time zone, smallint, oid, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_ts_distance(internal, timestamp without time zone, smallint, oid, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_tstz_consistent(internal, timestamp with time zone, smallint, oid, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_tstz_distance(internal, timestamp with time zone, smallint, oid, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_ts_compress(internal) PARALLEL SAFE;
ALTER FUNCTION gbt_tstz_compress(internal) PARALLEL SAFE;
ALTER FUNCTION gbt_ts_fetch(internal) PARALLEL SAFE;
ALTER FUNCTION gbt_ts_penalty(internal, internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_ts_picksplit(internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_ts_union(internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_ts_same(gbtreekey16, gbtreekey16, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_time_consistent(internal, time without time zone, smallint, oid, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_time_distance(internal, time without time zone, smallint, oid, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_timetz_consistent(internal, time with time zone, smallint, oid, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_time_compress(internal) PARALLEL SAFE;
ALTER FUNCTION gbt_timetz_compress(internal) PARALLEL SAFE;
ALTER FUNCTION gbt_time_fetch(internal) PARALLEL SAFE;
ALTER FUNCTION gbt_time_penalty(internal, internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_time_picksplit(internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_time_union(internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_time_same(gbtreekey16, gbtreekey16, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_date_consistent(internal, date, smallint, oid, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_date_distance(internal, date, smallint, oid, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_date_compress(internal) PARALLEL SAFE;
ALTER FUNCTION gbt_date_fetch(internal) PARALLEL SAFE;
ALTER FUNCTION gbt_date_penalty(internal, internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_date_picksplit(internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_date_union(internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_date_same(gbtreekey8, gbtreekey8, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_intv_consistent(internal, interval, smallint, oid, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_intv_distance(internal, interval, smallint, oid, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_intv_compress(internal) PARALLEL SAFE;
ALTER FUNCTION gbt_intv_decompress(internal) PARALLEL SAFE;
ALTER FUNCTION gbt_intv_fetch(internal) PARALLEL SAFE;
ALTER FUNCTION gbt_intv_penalty(internal, internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_intv_picksplit(internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_intv_union(internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_intv_same(gbtreekey32, gbtreekey32, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_cash_consistent(internal, money, smallint, oid, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_cash_distance(internal, money, smallint, oid, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_cash_compress(internal) PARALLEL SAFE;
ALTER FUNCTION gbt_cash_fetch(internal) PARALLEL SAFE;
ALTER FUNCTION gbt_cash_penalty(internal, internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_cash_picksplit(internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_cash_union(internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_cash_same(gbtreekey16, gbtreekey16, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_macad_consistent(internal, macaddr, smallint, oid, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_macad_compress(internal) PARALLEL SAFE;
ALTER FUNCTION gbt_macad_fetch(internal) PARALLEL SAFE;
ALTER FUNCTION gbt_macad_penalty(internal, internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_macad_picksplit(internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_macad_union(internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_macad_same(gbtreekey16, gbtreekey16, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_text_consistent(internal, text, smallint, oid, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_bpchar_consistent(internal, character, smallint, oid, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_text_compress(internal) PARALLEL SAFE;
ALTER FUNCTION gbt_bpchar_compress(internal) PARALLEL SAFE;
ALTER FUNCTION gbt_text_penalty(internal, internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_text_picksplit(internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_text_union(internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_text_same(gbtreekey_var, gbtreekey_var, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_bytea_consistent(internal, bytea, smallint, oid, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_bytea_compress(internal) PARALLEL SAFE;
ALTER FUNCTION gbt_bytea_penalty(internal, internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_bytea_picksplit(internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_bytea_union(internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_bytea_same(gbtreekey_var, gbtreekey_var, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_numeric_consistent(internal, numeric, smallint, oid, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_numeric_compress(internal) PARALLEL SAFE;
ALTER FUNCTION gbt_numeric_penalty(internal, internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_numeric_picksplit(internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_numeric_union(internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_numeric_same(gbtreekey_var, gbtreekey_var, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_bit_consistent(internal, bit, smallint, oid, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_bit_compress(internal) PARALLEL SAFE;
ALTER FUNCTION gbt_bit_penalty(internal, internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_bit_picksplit(internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_bit_union(internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_bit_same(gbtreekey_var, gbtreekey_var, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_inet_consistent(internal, inet, smallint, oid, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_inet_compress(internal) PARALLEL SAFE;
ALTER FUNCTION gbt_inet_penalty(internal, internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_inet_picksplit(internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_inet_union(internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_inet_same(gbtreekey16, gbtreekey16, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_uuid_consistent(internal, uuid, smallint, oid, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_uuid_fetch(internal) PARALLEL SAFE;
ALTER FUNCTION gbt_uuid_compress(internal) PARALLEL SAFE;
ALTER FUNCTION gbt_uuid_penalty(internal, internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_uuid_picksplit(internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_uuid_union(internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_uuid_same(gbtreekey32, gbtreekey32, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_macad8_consistent(internal, macaddr8, smallint, oid, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_macad8_compress(internal) PARALLEL SAFE;
ALTER FUNCTION gbt_macad8_fetch(internal) PARALLEL SAFE;
ALTER FUNCTION gbt_macad8_penalty(internal, internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_macad8_picksplit(internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_macad8_union(internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_macad8_same(gbtreekey16, gbtreekey16, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_enum_consistent(internal, anyenum, smallint, oid, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_enum_compress(internal) PARALLEL SAFE;
ALTER FUNCTION gbt_enum_fetch(internal) PARALLEL SAFE;
ALTER FUNCTION gbt_enum_penalty(internal, internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_enum_picksplit(internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_enum_union(internal, internal) PARALLEL SAFE;
ALTER FUNCTION gbt_enum_same(gbtreekey8, gbtreekey8, internal) PARALLEL SAFE; | the_stack |
-- 2019-06-26T11:48:46.666
-- 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,576870,0,'CustomsTariff',TO_TIMESTAMP('2019-06-26 11:48:46','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Customs Tariff','Customs Tariff',TO_TIMESTAMP('2019-06-26 11:48:46','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-06-26T11:48:46.727
-- 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=576870 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)
;
-- 2019-06-26T11:49:15.456
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y', Name='Zolltarifnummer', PrintName='Zolltarifnummer',Updated=TO_TIMESTAMP('2019-06-26 11:49:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=576870 AND AD_Language='de_DE'
;
-- 2019-06-26T11:49:15.528
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(576870,'de_DE')
;
-- 2019-06-26T11:49:15.568
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_ad_element_on_ad_element_trl_update(576870,'de_DE')
;
-- 2019-06-26T11:49:15.572
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName='CustomsTariff', Name='Zolltarifnummer', Description=NULL, Help=NULL WHERE AD_Element_ID=576870
;
-- 2019-06-26T11:49:15.573
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='CustomsTariff', Name='Zolltarifnummer', Description=NULL, Help=NULL, AD_Element_ID=576870 WHERE UPPER(ColumnName)='CUSTOMSTARIFF' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2019-06-26T11:49:15.575
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='CustomsTariff', Name='Zolltarifnummer', Description=NULL, Help=NULL WHERE AD_Element_ID=576870 AND IsCentrallyMaintained='Y'
;
-- 2019-06-26T11:49:15.576
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Zolltarifnummer', Description=NULL, Help=NULL WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=576870) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 576870)
;
-- 2019-06-26T11:49:15.628
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_PrintFormatItem pi SET PrintName='Zolltarifnummer', Name='Zolltarifnummer' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=576870)
;
-- 2019-06-26T11:49:15.630
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET Name='Zolltarifnummer', Description=NULL, Help=NULL, CommitWarning = NULL WHERE AD_Element_ID = 576870
;
-- 2019-06-26T11:49:15.632
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_WINDOW SET Name='Zolltarifnummer', Description=NULL, Help=NULL WHERE AD_Element_ID = 576870
;
-- 2019-06-26T11:49:15.633
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu SET Name = 'Zolltarifnummer', Description = NULL, WEBUI_NameBrowse = NULL, WEBUI_NameNew = NULL, WEBUI_NameNewBreadcrumb = NULL WHERE AD_Element_ID = 576870
;
-- 2019-06-26T11:49:28.323
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y', Name='Zolltarifnummer', PrintName='Zolltarifnummer',Updated=TO_TIMESTAMP('2019-06-26 11:49:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=576870 AND AD_Language='de_CH'
;
-- 2019-06-26T11:49:28.327
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(576870,'de_CH')
;
-- 2019-06-26T11:51:07.363
-- 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,ColumnName,Created,CreatedBy,DDL_NoForeignKey,EntityType,FieldLength,IsActive,IsAdvancedText,IsAllowLogging,IsAlwaysUpdateable,IsAutoApplyValidationRule,IsAutocomplete,IsCalculated,IsDimension,IsDLMPartitionBoundary,IsEncrypted,IsForceIncludeInGeneratedModel,IsGenericZoomKeyColumn,IsGenericZoomOrigin,IsIdentifier,IsKey,IsLazyLoading,IsMandatory,IsParent,IsRangeFilter,IsSelectionColumn,IsShowFilterIncrementButtons,IsStaleable,IsSyncDatabase,IsTranslated,IsUpdateable,IsUseDocSequence,Name,SelectionColumnSeqNo,SeqNo,Updated,UpdatedBy,Version) VALUES (0,568324,576870,0,12,208,'CustomsTariff',TO_TIMESTAMP('2019-06-26 11:51:07','YYYY-MM-DD HH24:MI:SS'),100,'N','D',14,'Y','N','Y','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','Y','N','Zolltarifnummer',0,0,TO_TIMESTAMP('2019-06-26 11:51:07','YYYY-MM-DD HH24:MI:SS'),100,0)
;
-- 2019-06-26T11:51:07.369
-- 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=568324 AND NOT EXISTS (SELECT 1 FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 2019-06-26T11:51:07.377
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_Column_Translation_From_AD_Element(576870)
;
-- 2019-06-26T11:53:16.098
-- 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,568324,582016,0,180,0,TO_TIMESTAMP('2019-06-26 11:53:15','YYYY-MM-DD HH24:MI:SS'),100,0,'D',0,'Y','Y','Y','N','N','N','N','N','Zolltarifnummer',410,440,0,1,1,TO_TIMESTAMP('2019-06-26 11:53:15','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-06-26T11:53:16.105
-- 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=582016 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)
;
-- 2019-06-26T11:53:16.130
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(576870)
;
-- 2019-06-26T11:53:16.163
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=582016
;
-- 2019-06-26T11:53:16.179
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Field(582016)
;
-- 2019-06-26T11:54:40.886
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_ElementGroup SET SeqNo=10,Updated=TO_TIMESTAMP('2019-06-26 11:54:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_ElementGroup_ID=542064
;
-- 2019-06-26T11:54:43.138
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_ElementGroup SET SeqNo=20,Updated=TO_TIMESTAMP('2019-06-26 11:54:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_ElementGroup_ID=1000040
;
-- 2019-06-26T11:54:46.414
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_ElementGroup SET SeqNo=30,Updated=TO_TIMESTAMP('2019-06-26 11:54:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_ElementGroup_ID=542175
;
-- 2019-06-26T11:55:01.964
-- 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,1000025,542658,TO_TIMESTAMP('2019-06-26 11:55:01','YYYY-MM-DD HH24:MI:SS'),100,'Y','customs',40,TO_TIMESTAMP('2019-06-26 11:55:01','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-06-26T11:55:36.670
-- 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_Element_ID,AD_UI_ElementGroup_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayed_SideList,IsDisplayedGrid,IsMultiLine,MultiLine_LinesCount,Name,SeqNo,SeqNo_SideList,SeqNoGrid,Updated,UpdatedBy) VALUES (0,582016,0,180,560016,542658,'F',TO_TIMESTAMP('2019-06-26 11:55:36','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','N',0,'customs tariff',10,0,0,TO_TIMESTAMP('2019-06-26 11:55:36','YYYY-MM-DD HH24:MI:SS'),100)
;
-------------------------
-- 2019-06-26T15:33:16.841
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Reference_ID=10, FieldLength=250,Updated=TO_TIMESTAMP('2019-06-26 15:33:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=568324
; | the_stack |
-- 2019-11-26T17:32:31.560Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
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,IsTableRecordIdTarget,Name,Role_Source,Role_Target,Updated,UpdatedBy) VALUES (0,0,540060,540059,540233,TO_TIMESTAMP('2019-11-26 19:32:31','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.swat','Y','N','N','C_Element <-> C_Eleemnt_Value','','',TO_TIMESTAMP('2019-11-26 19:32:31','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-11-26T17:32:35.735Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_RelationType SET EntityType='D',Updated=TO_TIMESTAMP('2019-11-26 19:32:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_RelationType_ID=540233
;
-- 2019-11-26T17:32:54.902Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Window SET EntityType='D',Updated=TO_TIMESTAMP('2019-11-26 19:32:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Window_ID=540761
;
-- 2019-11-26T17:32:59.971Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET EntityType='D',Updated=TO_TIMESTAMP('2019-11-26 19:32:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=542127
;
-- 2019-11-26T17:33:35.097Z
-- 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,Description,EntityType,IsActive,IsOrderByValue,Name,Updated,UpdatedBy,ValidationType) VALUES (0,0,541081,TO_TIMESTAMP('2019-11-26 19:33:34','YYYY-MM-DD HH24:MI:SS'),100,'','D','Y','N','RelType C_Element -> C_Element_Value',TO_TIMESTAMP('2019-11-26 19:33:34','YYYY-MM-DD HH24:MI:SS'),100,'T')
;
-- 2019-11-26T17:33:35.103Z
-- 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=541081 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)
;
-- 2019-11-26T17:34:15.740Z
-- 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,466,0,541081,142,TO_TIMESTAMP('2019-11-26 19:34:15','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','N',TO_TIMESTAMP('2019-11-26 19:34:15','YYYY-MM-DD HH24:MI:SS'),100,'C_Element_ID = @C_Element_ID@')
;
-- 2019-11-26T17:34:25.745Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_RelationType SET AD_Reference_Source_ID=541081,Updated=TO_TIMESTAMP('2019-11-26 19:34:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_RelationType_ID=540233
;
-- 2019-11-26T17:34:50.215Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_RelationType SET AD_Reference_Target_ID=NULL,Updated=TO_TIMESTAMP('2019-11-26 19:34:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_RelationType_ID=540233
;
-- 2019-11-26T17:35:14.361Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_Table SET AD_Window_ID=540761,Updated=TO_TIMESTAMP('2019-11-26 19:35:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=541081
;
-- 2019-11-26T17:37:29.018Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_Table SET AD_Display=1135, AD_Key=1137, AD_Table_ID=188, IsValueDisplayed='Y',Updated=TO_TIMESTAMP('2019-11-26 19:37:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=541081
;
-- 2019-11-27T12:38:35.832Z
-- 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,Description,EntityType,IsActive,IsOrderByValue,Name,Updated,UpdatedBy,ValidationType) VALUES (0,0,541082,TO_TIMESTAMP('2019-11-27 14:38:35','YYYY-MM-DD HH24:MI:SS'),100,'','D','Y','N','RelType C_Element_Value -> C_Element',TO_TIMESTAMP('2019-11-27 14:38:35','YYYY-MM-DD HH24:MI:SS'),100,'T')
;
-- 2019-11-27T12:38:35.846Z
-- 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=541082 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)
;
-- 2019-11-27T12:38:58.557Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
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) VALUES (0,466,464,0,541082,142,TO_TIMESTAMP('2019-11-27 14:38:58','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','N',TO_TIMESTAMP('2019-11-27 14:38:58','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-11-27T12:40:22.523Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_Table SET WhereClause='C_Element_ID = @C_Element_ID@',Updated=TO_TIMESTAMP('2019-11-27 14:40:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=541082
;
-- 2019-11-27T12:40:38.825Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_RelationType SET AD_Reference_Target_ID=541082,Updated=TO_TIMESTAMP('2019-11-27 14:40:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_RelationType_ID=540233
;
-- 2019-11-27T12:43:06.448Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_RelationType SET AD_Reference_Source_ID=541082, AD_Reference_Target_ID=541081,Updated=TO_TIMESTAMP('2019-11-27 14:43:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_RelationType_ID=540233
;
----------------------
-- 2019-11-27T12:47:45.759Z
-- 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,Description,EntityType,IsActive,IsOrderByValue,Name,Updated,UpdatedBy,ValidationType) VALUES (0,0,541083,TO_TIMESTAMP('2019-11-27 14:47:45','YYYY-MM-DD HH24:MI:SS'),100,'','D','Y','N','RelType C_Element_Value -> Fact_acct',TO_TIMESTAMP('2019-11-27 14:47:45','YYYY-MM-DD HH24:MI:SS'),100,'T')
;
-- 2019-11-27T12:47:45.763Z
-- 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=541083 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)
;
-- 2019-11-27T12:48:41.512Z
-- 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,3001,0,541083,270,TO_TIMESTAMP('2019-11-27 14:48:41','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','N',TO_TIMESTAMP('2019-11-27 14:48:41','YYYY-MM-DD HH24:MI:SS'),100,'Account_id = @C_Element_Value_ID@')
;
-- 2019-11-27T12:52:46.493Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
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,IsTableRecordIdTarget,Name,Role_Source,Role_Target,Updated,UpdatedBy) VALUES (0,0,541083,541081,540234,TO_TIMESTAMP('2019-11-27 14:52:46','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.swat','Y','N','N','RelType C_Element_Value <-> Fact_acct','','',TO_TIMESTAMP('2019-11-27 14:52:46','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-11-27T12:55:01.603Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_RelationType SET EntityType='D',Updated=TO_TIMESTAMP('2019-11-27 14:55:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_RelationType_ID=540234
;
-- 2019-11-27T12:55:19.133Z
-- 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,Description,EntityType,IsActive,IsOrderByValue,Name,Updated,UpdatedBy,ValidationType) VALUES (0,0,541084,TO_TIMESTAMP('2019-11-27 14:55:18','YYYY-MM-DD HH24:MI:SS'),100,'','D','Y','N','RelType Fact_acct -> C_Element_Value',TO_TIMESTAMP('2019-11-27 14:55:18','YYYY-MM-DD HH24:MI:SS'),100,'T')
;
-- 2019-11-27T12:55:19.137Z
-- 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=541084 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)
;
-- 2019-11-27T12:56:17.715Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
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,1135,1125,0,541084,188,TO_TIMESTAMP('2019-11-27 14:56:17','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Y',TO_TIMESTAMP('2019-11-27 14:56:17','YYYY-MM-DD HH24:MI:SS'),100,'C_ElementValue_ID = @Account_ID@')
;
-- 2019-11-27T12:56:27.021Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_Table SET WhereClause='Account_id = @C_ElementValue_ID@',Updated=TO_TIMESTAMP('2019-11-27 14:56:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=541083
;
-- 2019-11-27T12:56:48.548Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_RelationType SET AD_Reference_Target_ID=541084,Updated=TO_TIMESTAMP('2019-11-27 14:56:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_RelationType_ID=540234
;
-- 2019-11-27T13:01:00.582Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_Table SET WhereClause='account_id = @C_ElementValue_ID@',Updated=TO_TIMESTAMP('2019-11-27 15:01:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=541083
;
-- 2019-11-27T13:01:34.355Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_RelationType SET AD_Reference_Source_ID=541084, AD_Reference_Target_ID=541083,Updated=TO_TIMESTAMP('2019-11-27 15:01:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_RelationType_ID=540234
;
-- 2019-11-27T13:02:47.899Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_Table SET AD_Display=NULL, IsValueDisplayed='N',Updated=TO_TIMESTAMP('2019-11-27 15:02:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=541084
;
-- 2019-11-27T13:03:04.409Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_Table SET AD_Window_ID=540761,Updated=TO_TIMESTAMP('2019-11-27 15:03:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=541084
;
-- 2019-11-27T13:04:00.788Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_Table SET AD_Window_ID=162, WhereClause='Account_ID = @C_ElementValue_ID@',Updated=TO_TIMESTAMP('2019-11-27 15:04:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=541083
;
-- 2019-11-27T13:04:30.261Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_RelationType SET AD_Reference_Source_ID=541083, AD_Reference_Target_ID=541084,Updated=TO_TIMESTAMP('2019-11-27 15:04:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_RelationType_ID=540234
;
-- 2019-11-27T13:04:42.522Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_RelationType SET AD_Reference_Target_ID=NULL,Updated=TO_TIMESTAMP('2019-11-27 15:04:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_RelationType_ID=540234
;
-- 2019-11-27T13:09:51.701Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_RelationType SET AD_Reference_Target_ID=541084,Updated=TO_TIMESTAMP('2019-11-27 15:09:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_RelationType_ID=540234
;
-- 2019-11-27T13:14:28.584Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_RelationType SET AD_Reference_Source_ID=541084, AD_Reference_Target_ID=541083,Updated=TO_TIMESTAMP('2019-11-27 15:14:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_RelationType_ID=540234
;
-- 2019-11-27T13:14:36.813Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_Table SET WhereClause='',Updated=TO_TIMESTAMP('2019-11-27 15:14:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=541084
;
-- 2019-11-27T15:07:01.165Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET AD_Name_ID=574111, Description='Kontenelemente verwalten', Help='Das Fenster "Kontenelement" dient zur Verwaltung von Kontenelementen und nutzerdefinierten Elementen. Eines der Kontensegmente ist Ihr Basiskontensegment (Kontenplan). Sie können Kontenelemente hinzufügen, um weitere Berichte zu erstellen oder für nutzerdefinierte Buchführungssegmente.', Name='Kontenrahmen',Updated=TO_TIMESTAMP('2019-11-27 17:07:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=591953
;
-- 2019-11-27T15:07:01.168Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(574111)
;
-- 2019-11-27T15:07:01.208Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=591953
;
-- 2019-11-27T15:07:01.221Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Field(591953)
;
-- 2019-11-27T15:08:58.973Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_Table SET AD_Window_ID=540761,Updated=TO_TIMESTAMP('2019-11-27 17:08:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=132
; | the_stack |
-- This file should undo anything in `up.sql`
CREATE OR REPLACE FUNCTION project_service_api.project(data json)
RETURNS json
LANGUAGE plpgsql
AS $function$
declare
_platform platform_service.platforms;
_user community_service.users;
_result json;
_permalink text;
_refined jsonb;
_project project_service.projects;
_version project_service.project_versions;
_is_creating boolean default true;
_external_id text;
begin
-- ensure that roles come from any permitted
perform core.force_any_of_roles('{platform_user,scoped_user}');
-- get project if id on json
if ($1->>'id')::uuid is not null then
select * from project_service.projects
where id = ($1->>'id')::uuid
and platform_id = core.current_platform_id()
into _project;
-- check if user has permission to handle on project
if _project.id is null then
raise 'project not found';
end if;
if not core.is_owner_or_admin(_project.user_id) then
raise insufficient_privilege;
end if;
_is_creating := false;
end if;
-- select and check if user is on same platform
select * from community_service.users cu
where cu.id = (case when current_role = 'platform_user' then
coalesce(_project.user_id, ($1->>'user_id')::uuid)
else core.current_user_id() end)
and cu.platform_id = core.current_platform_id()
into _user;
if _user.id is null or not core.is_owner_or_admin(_user.id) then
raise exception 'invalid user';
end if;
-- check if permalink is provided
if core_validator.is_empty($1->>'permalink'::text) then
_permalink := unaccent(replace(lower($1->>'name'),' ','_'));
else
_permalink := unaccent(replace(lower($1->>'permalink'),' ','_'));
end if;
-- put first status on project
select jsonb_set($1::jsonb, '{status}'::text[], to_jsonb('draft'::text))
into _refined;
-- put generated permalink into refined json
select jsonb_set(_refined, '{permalink}'::text[], to_jsonb(_permalink::text))
into _refined;
-- put current request ip into refined json
select jsonb_set(_refined, '{current_ip}'::text[], to_jsonb(core.request_ip_address()))
into _refined;
-- check if is mode is provided and update when draft
if not core_validator.is_empty($1->>'mode'::text) and _project.status = 'draft' then
_refined := jsonb_set(_refined, '{mode}'::text[], to_jsonb($1->>'mode'::text));
end if;
if _is_creating then
-- redefined refined json with project basic serializer
select project_service._serialize_project_basic_data(_refined::json)::jsonb
into _refined;
if current_role = 'platform_user' then
_external_id := ($1->>'external_id')::text;
end if;
-- insert project
insert into project_service.projects (
external_id, platform_id, user_id, permalink, name, mode, data
) values (_external_id, core.current_platform_id(), _user.id, _permalink, ($1 ->> 'name')::text, ($1 ->> 'mode')::project_service.project_mode, _refined)
returning * into _project;
-- insert first version of project
insert into project_service.project_versions (
project_id, data
) values (_project.id, row_to_json(_project)::jsonb)
returning * into _version;
else
-- generate basic struct with given data
_refined := project_service._serialize_project_basic_data(_refined::json, _project.data::json)::jsonb;
-- insert old version of project on new version
insert into project_service.project_versions(project_id, data)
values (_project.id, row_to_json(_project)::jsonb)
returning * into _version;
-- update project with new generated data
update project_service.projects
set mode = (_refined ->> 'mode')::project_service.project_mode,
name = (_refined ->> 'name')::text,
permalink = (_refined ->> 'permalink')::text,
data = _refined
where id = _project.id
returning * into _project;
end if;
select json_build_object(
'id', _project.id,
'old_version_id', _version.id,
'permalink', _project.permalink,
'mode', _project.mode,
'status', _project.status,
'data', _project.data
) into _result;
return _result;
end;
$function$
;
CREATE OR REPLACE FUNCTION payment_service_api.pay(data json) RETURNS json
LANGUAGE plpgsql
AS $_$
declare
_result json;
_payment payment_service.catalog_payments;
_user_id uuid;
_user community_service.users;
_version payment_service.catalog_payment_versions;
_credit_card payment_service.credit_cards;
_subscription payment_service.subscriptions;
_reward project_service.rewards;
_refined jsonb;
_external_id text;
begin
-- ensure that roles come from any permitted
perform core.force_any_of_roles('{platform_user, scoped_user}');
-- check roles to define how user_id is set
if current_role = 'platform_user' then
_user_id := ($1 ->> 'user_id')::uuid;
_external_id := ($1 ->> 'external_id')::uuid;
else
_user_id := core.current_user_id();
end if;
-- check if project exists on platform
if ($1->>'project_id')::uuid is null
OR not core.project_exists_on_platform(($1->>'project_id')::uuid, core.current_platform_id()) then
raise exception 'project not found on platform';
end if;
-- set user into variable
select *
from community_service.users
where id = _user_id
and platform_id = core.current_platform_id()
into _user;
-- check if user exists on current platform
if _user.id is null then
raise exception 'missing user';
end if;
-- get and check if reward exists
if ($1->>'reward_id')::uuid is not null then
select * from project_service.rewards
where project_id = ($1->>'project_id')::uuid
and id = ($1->>'project_id')::uuid
into _reward;
if _reward.id is null then
raise 'reward not found';
end if;
if ($1->>'amount'::decimal) < (_reward.data->>'minimum_value')::decimal then
raise 'payment amount is bellow of reward minimum %', (_reward.data->>'minimum_value')::decimal;
end if;
end if;
-- fill ip address to received params
_refined := jsonb_set(($1)::jsonb, '{current_ip}'::text[], to_jsonb(core.force_ip_address()::text));
-- if user already has filled document_number/name/email should use then
if not core_validator.is_empty((_user.data->>'name')::text) then
_refined := jsonb_set(_refined, '{customer,name}', to_jsonb(_user.data->>'name'::text));
else
update community_service.users
set name = ($1->'customer'->>'name')::text
where id = _user.id;
end if;
if not core_validator.is_empty((_user.data->>'email')::text) then
_refined := jsonb_set(_refined, '{customer,email}', to_jsonb(_user.data->>'email'::text));
end if;
if not core_validator.is_empty((_user.data->>'document_number')::text) then
_refined := jsonb_set(_refined, '{customer,document_number}', to_jsonb(_user.data->>'document_number'::text));
else
select * from community_service.users;
update community_service.users
set data = jsonb_set(data, '{document_number}'::text[], ($1->'customer'->>'document_number'))
where id = _user.id;
end if;
-- fill with anonymous
_refined := jsonb_set(_refined, '{anonymous}'::text[], to_jsonb(coalesce(($1->>'anonymous')::boolean, false)));
-- generate a base structure to payment json
_refined := (payment_service._serialize_payment_basic_data((_refined)::json))::jsonb;
-- if payment_method is credit_card should check for card_hash or card_id
if _refined->>'payment_method'::text = 'credit_card' then
-- fill with credit_card_owner_document
_refined := jsonb_set(_refined, '{credit_card_owner_document}'::text[], to_jsonb(coalesce(($1->>'credit_card_owner_document')::text, '')));
-- fill with is_international
_refined := jsonb_set(_refined, '{is_international}'::text[], to_jsonb(coalesce(($1->>'is_international')::boolean, false)));
-- fill with save_card
_refined := jsonb_set(_refined, '{save_card}'::text[], to_jsonb(coalesce(($1->>'save_card')::boolean, false)));
-- check if card_hash or card_id is present
if core_validator.is_empty((($1)->>'card_hash')::text)
and core_validator.is_empty((($1)->>'card_id')::text) then
raise 'missing card_hash or card_id';
end if;
-- if has card_id check if user is card owner
if not core_validator.is_empty((($1)->>'card_id')::text) then
select cc.* from payment_service.credit_cards cc
where cc.user_id = _user_id and cc.id = (($1)->>'card_id')::uuid
into _credit_card;
if _credit_card.id is null then
raise 'invalid card_id';
end if;
_refined := jsonb_set(_refined, '{card_id}'::text[], to_jsonb(_credit_card.id::text));
elsif not core_validator.is_empty((($1)->>'card_hash')::text) then
_refined := jsonb_set(_refined, '{card_hash}'::text[], to_jsonb($1->>'card_hash'::text));
end if;
end if;
-- insert payment in table
insert into payment_service.catalog_payments (
external_i, platform_id, project_id, user_id, reward_id, data, gateway
) values (
_external_id,
core.current_platform_id(),
($1->>'project_id')::uuid,
_user_id,
_reward.id,
_refined,
coalesce(($1->>'gateway')::text, 'pagarme')
) returning * into _payment;
-- insert first payment version
insert into payment_service.catalog_payment_versions (
catalog_payment_id, data
) values ( _payment.id, _payment.data )
returning * into _version;
-- check if payment is a subscription to create one
if ($1->>'subscription') is not null and ($1->>'subscription')::boolean then
insert into payment_service.subscriptions (
platform_id, project_id, user_id, checkout_data
) values (_payment.platform_id, _payment.project_id, _payment.user_id, payment_service._serialize_subscription_basic_data(_payment.data::json)::jsonb)
returning * into _subscription;
update payment_service.catalog_payments
set subscription_id = _subscription.id
where id = _payment.id;
end if;
-- build result json with payment_id and subscription_id
select json_build_object(
'id', _payment.id,
'subscription_id', _subscription.id,
'old_version_id', _version.id
) into _result;
-- notify to backend processor via listen
PERFORM pg_notify('process_payments_channel',
json_build_object(
'id', _payment.id,
'subscription_id', _subscription.id,
'created_at', _payment.created_at::timestamp
)::text
);
return _result;
end;
$_$; | the_stack |
--views
CREATE VIEW adbmgr.host AS
SELECT
hostname AS name,
hostuser AS user,
hostport AS port,
CASE hostproto
WHEN 's' THEN 'ssh'::text
WHEN 't' THEN 'telnet'::text
END AS protocol,
hostagentport AS agentport,
hostaddr AS address,
hostadbhome AS adbhome
FROM pg_catalog.mgr_host order by 1;
CREATE VIEW adbmgr.parm AS
SELECT
parmtype AS type,
parmname AS name,
parmvalue AS value,
parmcontext AS context,
parmvartype AS vartype,
parmunit AS unit,
parmminval AS minval,
parmmaxval AS maxval,
parmenumval AS enumval
FROM pg_catalog.mgr_parm;
CREATE VIEW adbmgr.updateparm AS
SELECT
updateparmnodename AS nodename,
CASE updateparmnodetype
WHEN 'c' THEN 'coordinator master'::text
WHEN 's' THEN 'coordinator slave'::text
WHEN 'd' THEN 'datanode master'::text
WHEN 'b' THEN 'datanode slave'::text
WHEN 'g' THEN 'gtmcoord master'::text
WHEN 'p' THEN 'gtmcoord slave'::text
WHEN 'G' THEN 'gtmcoord master|slave'::text
WHEN 'C' THEN 'coordinator master|slave'::text
WHEN 'D' THEN 'datanode master|slave'::text
END AS nodetype,
updateparmkey AS key,
updateparmvalue AS value
FROM pg_catalog.mgr_updateparm order by 1,2,3;
CREATE VIEW adbmgr.node AS
SELECT * FROM(
SELECT
mgrnode.nodename AS name,
hostname AS host,
CASE mgrnode.nodetype
WHEN 'g' THEN 'gtmcoord master'::text
WHEN 'p' THEN 'gtmcoord slave'::text
WHEN 'c' THEN 'coordinator master'::text
WHEN 's' THEN 'coordinator slave'::text
WHEN 'd' THEN 'datanode master'::text
WHEN 'b' THEN 'datanode slave'::text
END AS type,
node_alise.nodename AS mastername,
mgrnode.nodeport AS port,
mgrnode.nodesync AS sync_state,
mgrnode.nodepath AS path,
mgrnode.nodeinited AS initialized,
mgrnode.nodeincluster AS incluster,
mgrnode.nodezone AS zone
FROM pg_catalog.mgr_node AS mgrnode LEFT JOIN pg_catalog.mgr_host ON mgrnode.nodehost = pg_catalog.mgr_host.oid
LEFT JOIN pg_catalog.mgr_node AS node_alise ON node_alise.oid = mgrnode.nodemasternameoid) AS node_tb
order by (case type
when 'gtmcoord master' then 0
when 'gtmcoord slave' then 1
when 'coordinator master' then 2
when 'coordinator slave' then 2
when 'datanode master' then 3
when 'datanode slave' then 4
End) ASC, mastername ASC, sync_state DESC;
CREATE VIEW adbmgr.job AS
SELECT
oid AS joboid,
name,
next_time AS nexttime,
interval,
status,
command,
description
FROM pg_catalog.monitor_job order by 2;
CREATE VIEW adbmgr.jobitem AS
SELECT
jobitem_itemname AS item,
jobitem_path AS path,
jobitem_desc AS description
FROM pg_catalog.monitor_jobitem order by 1;
CREATE VIEW adbmgr.ha as
SELECT * FROM mgr_monitor_ha() order by 2 asc, 1 desc;
--monitor all
CREATE VIEW adbmgr.monitor_all AS
select * from mgr_monitor_all() order by nodezone,
(case nodetype
when 'gtmcoord master' then 0
when 'gtmcoord slave' then 1
when 'coordinator master' then 2
when 'coordinator slave' then 3
when 'datanode master' then 4
when 'datanode slave' then 5
End) ASC;
--boottime all
CREATE VIEW adbmgr.boottime_all AS
select * from mgr_boottime_all() order by 1,
(case nodetype
when 'gtmcoord master' then 0
when 'gtmcoord slave' then 1
when 'coordinator master' then 2
when 'coordinator slave' then 3
when 'datanode master' then 4
when 'datanode slave' then 5
End) ASC;
--list hba
CREATE VIEW adbmgr.hba AS
select CASE mgr_node.nodetype
WHEN 'g' THEN 'gtmcoord'
WHEN 'p' THEN 'gtmcoord'
WHEN 'c' THEN 'coordinator'
WHEN 's' THEN 'coordinator'
WHEN 'd' THEN 'datanode'
WHEN 'b' THEN 'datanode'
END AS nodetype,
mgr_hba.nodename,
mgr_hba.hbavalue
from mgr_hba inner join mgr_node ON mgr_hba.nodename=mgr_node.nodename;
--init all
CREATE VIEW adbmgr.initall AS
SELECT 'init gtmcoord master' AS "operation type",* FROM mgr_init_gtmcoord_master()
UNION ALL
SELECT 'start gtmcoord master' AS "operation type", * FROM mgr_start_gtmcoord_master(NULL)
UNION ALL
SELECT 'init gtmcoord slave' AS "operation type",* FROM mgr_init_start_gtmcoord_slave_all()
UNION ALL
SELECT 'init coordinator master' AS "operation type",* FROM mgr_init_cn_master(NULL)
UNION ALL
SELECT 'start coordinator master' AS "operation type", * FROM mgr_start_cn_master(NULL)
UNION ALL
SELECT 'init coordinator slave' AS "operation type",* FROM mgr_init_cn_slave()
UNION ALL
SELECT 'start coordinator slave' AS "operation type", * FROM mgr_start_cn_slave(NULL)
UNION ALL
SELECT 'init datanode master' AS "operation type", * FROM mgr_init_dn_master(NULL)
UNION ALL
SELECT 'start datanode master' AS "operation type", * FROM mgr_start_dn_master(NULL)
UNION ALL
SELECT 'init datanode slave' AS "operation type", * FROM mgr_init_start_dn_slave_all()
UNION ALL
SELECT 'config gtmcoord and coordinator' AS "operation type", * FROM mgr_configure_nodes_all(NULL);
--start gtmcoord all
CREATE VIEW adbmgr.start_gtmcoord_all AS
SELECT 'start gtmcoord master' AS "operation type", * FROM mgr_start_gtmcoord_master(NULL)
UNION all
SELECT 'start gtmcoord slave' AS "operation type", * FROM mgr_start_gtmcoord_slave(NULL);
--stop gtmcoord all
CREATE VIEW adbmgr.stop_gtmcoord_all AS
SELECT 'stop gtmcoord slave' AS "operation type", * FROM mgr_stop_gtmcoord_slave('smart', NULL)
UNION all
SELECT 'stop gtmcoord master' AS "operation type", * FROM mgr_stop_gtmcoord_master('smart', NULL);
--stop gtmcoord all -m f
CREATE VIEW adbmgr.stop_gtmcoord_all_f AS
SELECT 'stop gtmcoord slave' AS "operation type", * FROM mgr_stop_gtmcoord_slave('fast', NULL)
UNION all
SELECT 'stop gtmcoord master' AS "operation type", * FROM mgr_stop_gtmcoord_master('fast', NULL);
--stop gtmcoord all -m i
CREATE VIEW adbmgr.stop_gtmcoord_all_i AS
SELECT 'stop gtmcoord slave' AS "operation type", * FROM mgr_stop_gtmcoord_slave('immediate', NULL)
UNION all
SELECT 'stop gtmcoord master' AS "operation type", * FROM mgr_stop_gtmcoord_master('immediate', NULL);
--init datanode all
CREATE VIEW adbmgr.initdatanodeall AS
SELECT 'init datanode master' AS "operation type",* FROM mgr_init_dn_master(NULL)
UNION all
SELECT 'init datanode slave' AS "operation type", * FROM mgr_init_dn_slave_all();
--boottime all
--boottime coordinator all
CREATE VIEW adbmgr.boottime_nodetype_all AS
SELECT 'coordinator master' AS "operation type", * FROM mgr_boottime_nodetype_all(NULL);
--start datanode all
CREATE VIEW adbmgr.start_datanode_all AS
SELECT 'start datanode master' AS "operation type", * FROM mgr_start_dn_master(NULL)
UNION all
SELECT 'start datanode slave' AS "operation type", * FROM mgr_start_dn_slave(NULL);
--start coordinator all
CREATE VIEW adbmgr.start_coordinator_all AS
SELECT 'start coordinator master' AS "operation type", * FROM mgr_start_cn_master(NULL)
UNION all
SELECT 'start coordinator slave' AS "operation type", * FROM mgr_start_cn_slave(NULL);
--start all
CREATE VIEW adbmgr.startall AS
SELECT 'start gtmcoord master' AS "operation type", * FROM mgr_start_gtmcoord_master(NULL)
UNION all
SELECT 'start gtmcoord slave' AS "operation type", * FROM mgr_start_gtmcoord_slave(NULL)
UNION all
SELECT 'start coordinator master' AS "operation type", * FROM mgr_start_cn_master(NULL)
UNION all
SELECT 'start coordinator slave' AS "operation type", * FROM mgr_start_cn_slave(NULL)
UNION all
SELECT 'start datanode master' AS "operation type", * FROM mgr_start_dn_master(NULL)
UNION all
SELECT 'start datanode slave' AS "operation type", * FROM mgr_start_dn_slave(NULL);
--stop coordinator all
CREATE VIEW adbmgr.stop_coordinator_all AS
SELECT 'stop coordinator slave' AS "operation type", * FROM mgr_stop_cn_slave('smart', NULL)
UNION all
SELECT 'stop coordinator master' AS "operation type", * FROM mgr_stop_cn_master('smart', NULL);
CREATE VIEW adbmgr.stop_coordinator_all_f AS
SELECT 'stop coordinator slave' AS "operation type", * FROM mgr_stop_cn_slave('fast', NULL)
UNION all
SELECT 'stop coordinator master' AS "operation type", * FROM mgr_stop_cn_master('fast', NULL);
CREATE VIEW adbmgr.stop_coordinator_all_i AS
SELECT 'stop coordinator slave' AS "operation type", * FROM mgr_stop_cn_slave('immediate', NULL)
UNION all
SELECT 'stop coordinator master' AS "operation type", * FROM mgr_stop_cn_master('immediate', NULL);
--stop coordinator master all
CREATE VIEW adbmgr.stop_coordinator_master_all AS
SELECT 'stop coordinator master' AS "operation type", * FROM mgr_stop_cn_master('smart', NULL);
CREATE VIEW adbmgr.stop_coordinator_master_all_f AS
SELECT 'stop coordinator master' AS "operation type", * FROM mgr_stop_cn_master('fast', NULL);
CREATE VIEW adbmgr.stop_coordinator_master_all_i AS
SELECT 'stop coordinator master' AS "operation type", * FROM mgr_stop_cn_master('immediate', NULL);
--stop coordinator slave all
CREATE VIEW adbmgr.stop_coordinator_slave_all AS
SELECT 'stop coordinator slave' AS "operation type", * FROM mgr_stop_cn_slave('smart', NULL);
CREATE VIEW adbmgr.stop_coordinator_slave_all_f AS
SELECT 'stop coordinator slave' AS "operation type", * FROM mgr_stop_cn_slave('fast', NULL);
CREATE VIEW adbmgr.stop_coordinator_slave_all_i AS
SELECT 'stop coordinator slave' AS "operation type", * FROM mgr_stop_cn_slave('immediate', NULL);
--stop datanode all
CREATE VIEW adbmgr.stop_datanode_all AS
SELECT 'stop datanode slave' AS "operation type", * FROM mgr_stop_dn_slave('smart', NULL)
UNION all
SELECT 'stop datanode master' AS "operation type", * FROM mgr_stop_dn_master('smart', NULL);
CREATE VIEW adbmgr.stop_datanode_all_f AS
SELECT 'stop datanode slave' AS "operation type", * FROM mgr_stop_dn_slave('fast', NULL)
UNION all
SELECT 'stop datanode master' AS "operation type", * FROM mgr_stop_dn_master('fast', NULL);
CREATE VIEW adbmgr.stop_datanode_all_i AS
SELECT 'stop datanode slave' AS "operation type", * FROM mgr_stop_dn_slave('immediate', NULL)
UNION all
SELECT 'stop datanode master' AS "operation type", * FROM mgr_stop_dn_master('immediate', NULL);
--stop all
CREATE VIEW adbmgr.stopall AS
SELECT 'stop datanode slave' AS "operation type", * FROM mgr_stop_dn_slave('smart', NULL)
UNION all
SELECT 'stop datanode master' AS "operation type", * FROM mgr_stop_dn_master('smart', NULL)
UNION all
SELECT 'stop coordinator master' AS "operation type", * FROM mgr_stop_cn_master('smart', NULL)
UNION all
SELECT 'stop coordinator slave' AS "operation type", * FROM mgr_stop_cn_slave('smart', NULL)
UNION all
SELECT 'stop gtmcoord slave' AS "operation type", * FROM mgr_stop_gtmcoord_slave('smart', NULL)
UNION all
SELECT 'stop gtmcoord master' AS "operation type", * FROM mgr_stop_gtmcoord_master('smart', NULL);
CREATE VIEW adbmgr.stopall_f AS
SELECT 'stop datanode slave' AS "operation type", * FROM mgr_stop_dn_slave('fast', NULL)
UNION all
SELECT 'stop datanode master' AS "operation type", * FROM mgr_stop_dn_master('fast', NULL)
UNION all
SELECT 'stop coordinator master' AS "operation type", * FROM mgr_stop_cn_master('fast', NULL)
UNION all
SELECT 'stop coordinator slave' AS "operation type", * FROM mgr_stop_cn_slave('fast', NULL)
UNION all
SELECT 'stop gtmcoord slave' AS "operation type", * FROM mgr_stop_gtmcoord_slave('fast', NULL)
UNION all
SELECT 'stop gtmcoord master' AS "operation type", * FROM mgr_stop_gtmcoord_master('fast', NULL);
CREATE VIEW adbmgr.stopall_i AS
SELECT 'stop datanode slave' AS "operation type", * FROM mgr_stop_dn_slave('immediate', NULL)
UNION all
SELECT 'stop datanode master' AS "operation type", * FROM mgr_stop_dn_master('immediate', NULL)
UNION all
SELECT 'stop coordinator master' AS "operation type", * FROM mgr_stop_cn_master('immediate', NULL)
UNION all
SELECT 'stop coordinator slave' AS "operation type", * FROM mgr_stop_cn_slave('immediate', NULL)
UNION all
SELECT 'stop gtmcoord slave' AS "operation type", * FROM mgr_stop_gtmcoord_slave('immediate', NULL)
UNION all
SELECT 'stop gtmcoord master' AS "operation type", * FROM mgr_stop_gtmcoord_master('immediate', NULL);
-- for ADB monitor host page: get all host various parameters.
CREATE VIEW adbmgr.get_all_host_parm AS
select
mgh.hostname AS hostName,
mgh.hostaddr AS ip,
nh.mh_cpu_core_available AS cpu,
round(c.mc_cpu_usage::numeric, 1) AS cpuRate,
round((m.mm_total/1024.0/1024.0/1024.0)::numeric, 1) AS mem,
round(m.mm_usage::numeric, 1) AS memRate,
round((d.md_total/1024.0/1024.0/1024.0)::numeric, 1) AS disk,
round(((d.md_used/d.md_total::float) * 100)::numeric, 1) AS diskRate,
mtc.mt_emergency_threshold AS cpu_threshold,
mtm.mt_emergency_threshold AS mem_threshold,
mtd.mt_emergency_threshold AS disk_threshold
from
mgr_host mgh,
(
select * from (
select *, (ROW_NUMBER()OVER(PARTITION BY T.hostname ORDER BY T.mc_timestamptz desc)) as rm
from monitor_cpu t
) tt where tt.rm = 1
) c,
(
select * from (
select *,(ROW_NUMBER()OVER(PARTITION BY T.hostname ORDER BY T.mm_timestamptz desc)) as rm
from monitor_mem t
) tt where tt.rm =1
) m,
(
select * from (
select *, (ROW_NUMBER()OVER(PARTITION BY T.hostname ORDER BY T.md_timestamptz desc)) as rm
from monitor_disk t
) tt where tt.rm = 1
) d,
(
select * from (
select *, (ROW_NUMBER()OVER(PARTITION BY T.hostname ORDER BY T.mh_current_time desc)) as rm
from monitor_host t
) tt where tt.rm = 1
) nh,
(
select * from monitor_host_threshold where mt_type = 1
) mtc,
(
select * from monitor_host_threshold where mt_type = 2
) mtm,
(
select * from monitor_host_threshold where mt_type = 3
)mtd
where mgh.hostname = c.hostname and
c.hostname = m.hostname and
m.hostname = d.hostname and
d.hostname = nh.hostname;
-- for ADB monitor host page: get specific host various parameters.
CREATE VIEW adbmgr.get_spec_host_parm AS
select mgh.hostname as hostname,
mgh.hostaddr as ip,
mh.mh_system as os,
mh.mh_cpu_core_available as cpu,
round((mm.mm_total/1024.0/1024.0/1024.0)::numeric, 1) as mem,
round((md.md_total/1024.0/1024.0/1024.0)::numeric, 1) as disk,
mh.mh_current_time - (mh.mh_seconds_since_boot || 'sec')::interval as createtime,
mh_run_state as state,
round(mc.mc_cpu_usage::numeric, 1) as cpurate,
round(mm.mm_usage::numeric, 1) as memrate,
round(((md.md_used/md.md_total::float) * 100)::numeric, 1) as diskRate,
round((md.md_io_read_bytes/1024.0/1024.0)/(md.md_io_read_time/1000.0), 1) as ioreadps,
round((md.md_io_write_bytes/1024.0/1024.0)/(md.md_io_write_time/1000.0), 1) as iowriteps,
round(mn.mn_recv/1024.0,1) as netinps,
round(mn.mn_sent/1024.0,1) as netoutps,
mh.mh_seconds_since_boot as runtime
from mgr_host mgh,
(
select * from (
select *, (ROW_NUMBER()OVER(PARTITION BY t.hostname ORDER BY t.mh_current_time desc)) as rm
from monitor_host t
) tt where tt.rm = 1
) mh,
(
select * from (
select *,(ROW_NUMBER()OVER(PARTITION BY t.hostname ORDER BY t.mc_timestamptz desc)) as rm
from monitor_cpu t
) tt where tt.rm = 1
) mc,
(
select * from (
select *,(ROW_NUMBER()OVER(PARTITION BY t.hostname ORDER BY t.mm_timestamptz desc)) as rm
from monitor_mem t
) tt where tt.rm =1
) mm,
(
select * from (
select *, (ROW_NUMBER()OVER(PARTITION BY t.hostname ORDER BY t.md_timestamptz desc)) as rm
from monitor_disk t
) tt where tt.rm = 1
) md,
(
select * from (
select *, (ROW_NUMBER()OVER(PARTITION BY t.hostname ORDER BY t.mn_timestamptz desc)) as rm
from monitor_net t
) tt where tt.rm = 1
) mn
where mgh.hostname = mh.hostname and
mh.hostname = mc.hostname and
mc.hostname = mm.hostname and
mm.hostname = md.hostname and
md.hostname = mn.hostname;
-- for ADB monitor host page: get cpu, memory, i/o and net info for specific time period.
CREATE OR REPLACE FUNCTION pg_catalog.get_host_history_usage(hostname text, i int)
RETURNS table
(
recordtimes timestamptz,
cpuuseds numeric,
memuseds numeric,
ioreadps numeric,
iowriteps numeric,
netinps numeric,
netoutps numeric
)
AS
$$
select c.mc_timestamptz as recordtimes,
round(c.mc_cpu_usage::numeric, 1) as cpuuseds,
round(m.mm_usage::numeric, 1) as memuseds,
round((d.md_io_read_bytes/1024.0/1024.0)/(d.md_io_read_time/1000.0), 1) as ioreadps,
round((d.md_io_write_bytes/1024.0/1024.0)/(d.md_io_write_time/1000.0), 1) as iowriteps,
round(n.mn_recv/1024.0,1) as netinps,
round(n.mn_sent/1024.0,1) as netoutps
from monitor_cpu c left join monitor_mem m on(c.hostname = m.hostname and c.mc_timestamptz = m.mm_timestamptz)
left join monitor_disk d on(c.hostname = d.hostname and c.mc_timestamptz = d.md_timestamptz)
left join monitor_net n on(c.hostname = n.hostname and c.mc_timestamptz = n.mn_timestamptz)
left join monitor_host h on(c.hostname = h.hostname and c.mc_timestamptz = h.mh_current_time)
left join mgr_host mgr on(c.hostname = mgr.hostname),
(select mh.hostname, mh.mh_current_time
from monitor_host mh
order by mh.mh_current_time desc
limit 1) as temp
where c.mc_timestamptz > temp.mh_current_time - case $2
when 0 then interval '1 hour'
when 1 then interval '1 day'
when 2 then interval '7 day'
end and
mgr.hostname = $1
order by 1 asc;
$$
LANGUAGE SQL
IMMUTABLE
RETURNS NULL ON NULL INPUT;
-- for ADB monitor host page: get cpu, memory, i/o and net info for specific time period.
CREATE OR REPLACE FUNCTION pg_catalog.get_host_history_usage_by_time_period(hostname text, starttime timestamptz, endtime timestamptz)
RETURNS table
(
recordtimes timestamptz,
cpuuseds numeric,
memuseds numeric,
ioreadps numeric,
iowriteps numeric,
netinps numeric,
netoutps numeric
)
AS
$$
select c.mc_timestamptz as recordtimes,
round(c.mc_cpu_usage::numeric, 1) as cpuuseds,
round(m.mm_usage::numeric, 1) as memuseds,
round((d.md_io_read_bytes/1024.0/1024.0)/(d.md_io_read_time/1000.0), 1) as ioreadps,
round((d.md_io_write_bytes/1024.0/1024.0)/(d.md_io_write_time/1000.0), 1) as iowriteps,
round(n.mn_recv/1024.0,1) as netinps,
round(n.mn_sent/1024.0,1) as netoutps
from monitor_cpu c left join monitor_mem m on(c.hostname = m.hostname and c.mc_timestamptz = m.mm_timestamptz)
left join monitor_disk d on(c.hostname = d.hostname and c.mc_timestamptz = d.md_timestamptz)
left join monitor_net n on(c.hostname = n.hostname and c.mc_timestamptz = n.mn_timestamptz)
left join monitor_host h on(c.hostname = h.hostname and c.mc_timestamptz = h.mh_current_time)
left join mgr_host mgr on(c.hostname = mgr.hostname),
(select mh.hostname, mh.mh_current_time
from monitor_host mh
order by mh.mh_current_time desc
limit 1) as temp
where c.mc_timestamptz between $2 and $3
and mgr.hostname = $1
order by 1 asc;
$$
LANGUAGE SQL
IMMUTABLE
RETURNS NULL ON NULL INPUT;
-- for ADB monitor host page: The names of all the nodes on a host
CREATE OR REPLACE FUNCTION pg_catalog.get_all_nodename_in_spec_host(hostname text)
RETURNS table
(
nodename name,
nodetype text,
nodesync name
)
AS
$$
select
nodename,
case nodetype
when 'g' then 'gtmcoord master'
when 'p' then 'gtmcoord slave'
when 'c' then 'coordinator'
when 's' then 'coordinator slave'
when 'd' then 'datanode master'
when 'b' then 'datanode slave'
end as nodetype,
nodesync
from mgr_node
where nodehost = (select oid from mgr_host where hostname = $1);
$$
LANGUAGE SQL
IMMUTABLE
RETURNS NULL ON NULL INPUT;
--make view for 12 hours data for tps, qps, connectnum, dbsize, indexsize
CREATE VIEW adbmgr.monitor_12hours_tpsqps_v AS
select time, tps,qps from (SELECT monitor_databasetps_time::timestamptz(0) as time, sum(monitor_databasetps_tps) AS tps ,
sum(monitor_databasetps_qps) AS qps , row_number() over (PARTITION BY 1) FROM (SELECT
distinct(monitor_databasetps_dbname), monitor_databasetps_time, monitor_databasetps_tps,
monitor_databasetps_qps, monitor_databasetps_runtime FROM monitor_databasetps WHERE
monitor_databasetps_time > (SELECT now() - interval '12 hour' ) ORDER BY 2 ASC)AS a GROUP BY
monitor_databasetps_time) AS a;
CREATE VIEW adbmgr.monitor_12hours_connect_dbsize_indexsize_v AS
select time, connectnum, dbsize, indexsize from (SELECT monitor_databaseitem_time::timestamptz(0) as time, sum(
monitor_databaseitem_connectnum) AS connectnum,
(sum(monitor_databaseitem_dbsize)/1024.0)::numeric(18,2) AS dbsize , (sum(monitor_databaseitem_indexsize)/1024.0)::
numeric(18,2) AS indexsize, row_number() over (PARTITION BY 1) FROM (SELECT
distinct(monitor_databaseitem_dbname), monitor_databaseitem_time, monitor_databaseitem_connectnum,
monitor_databaseitem_dbsize, monitor_databaseitem_indexsize FROM monitor_databaseitem WHERE monitor_databaseitem_time
> (SELECT now() - interval '12 hour' ) ORDER BY 2 ASC) AS b GROUP BY monitor_databaseitem_time ) AS b;
--get first page first line values
CREATE VIEW adbmgr.monitor_cluster_firstline_v
AS
SELECT * from
(SELECT monitor_databasetps_time::timestamptz(0) AS time, sum(monitor_databasetps_tps) AS tps , sum(monitor_databasetps_qps) AS qps,
sum(monitor_databaseitem_connectnum) AS connectnum , (sum(monitor_databaseitem_dbsize)/1024.0)::numeric(18,2) AS dbsize, (sum(monitor_databaseitem_indexsize)/1024.0)::numeric(18,2) AS indexsize, max(monitor_databasetps_runtime) as runtime
FROM
(SELECT tps.monitor_databasetps_time, tps.monitor_databasetps_tps, tps.monitor_databasetps_qps, tps.monitor_databasetps_runtime,
b.monitor_databaseitem_connectnum , b.monitor_databaseitem_dbsize, b.monitor_databaseitem_indexsize
FROM (SELECT * ,(ROW_NUMBER()OVER(PARTITION BY monitor_databasetps_dbname ORDER BY
monitor_databasetps_time desc ))AS tc
FROM monitor_databasetps
)AS tps
JOIN
(SELECT monitor_databaseitem_dbname,
monitor_databaseitem_connectnum, monitor_databaseitem_dbsize, monitor_databaseitem_indexsize
FROM (SELECT * ,(ROW_NUMBER()OVER(PARTITION BY monitor_databaseitem_dbname ORDER BY
monitor_databaseitem_time desc ))AS tc FROM monitor_databaseitem)AS item WHERE item.tc =1
) AS b
on tps.monitor_databasetps_dbname = b.monitor_databaseitem_dbname
WHERE tps.tc =1
) AS c
GROUP BY monitor_databasetps_time
ORDER BY monitor_databasetps_time DESC LIMIT 1
) AS d
join
( SELECT (sum(md_total/1024.0/1024)/1024)::numeric(18,2) AS md_total FROM (SELECT hostname,md_timestamptz, md_total, (ROW_NUMBER()OVER(PARTITION BY hostname ORDER BY md_timestamptz desc ))AS tc from monitor_disk) AS d WHERE tc =1
) AS e
on 1=1;
--make function to get tps and qps for given dbname time and time interval
CREATE OR REPLACE FUNCTION pg_catalog.monitor_databasetps_func(in text, in timestamptz, in int)
RETURNS TABLE
(
recordtime timestamptz(0),
tps bigint,
qps bigint
)
AS
$$
SELECT monitor_databasetps_time::timestamptz(0) AS recordtime,
monitor_databasetps_tps AS tps,
monitor_databasetps_qps AS qps
FROM
monitor_databasetps
WHERE monitor_databasetps_dbname = $1 and monitor_databasetps_time >= $2 and monitor_databasetps_time <= $2 + case $3
when 0 then interval '1 hour'
when 1 then interval '24 hour'
end
ORDER BY 1;
$$
LANGUAGE SQL
IMMUTABLE
RETURNS NULL ON NULL INPUT;
--make function to get tps and qps for given dbname time and start time and end time
CREATE OR REPLACE FUNCTION pg_catalog.monitor_databasetps_func_by_time_period(dbname text, starttime timestamptz, endtime timestamptz)
RETURNS TABLE
(
recordtime timestamptz(0),
tps bigint,
qps bigint
)
AS $$
SELECT monitor_databasetps_time::timestamptz(0) AS recordtime,
monitor_databasetps_tps AS tps,
monitor_databasetps_qps AS qps
FROM
monitor_databasetps
WHERE monitor_databasetps_dbname = $1 and
monitor_databasetps_time between $2 and $3
ORDER BY 1;
$$
LANGUAGE SQL
IMMUTABLE
RETURNS NULL ON NULL INPUT;
--to show all database tps, qps, runtime at current_time
CREATE VIEW adbmgr.monitor_all_dbname_tps_qps_runtime_v
AS
SELECT distinct(monitor_databasetps_dbname) as databasename, monitor_databasetps_tps as tps, monitor_databasetps_qps as qps, monitor_databasetps_runtime as runtime FROM monitor_databasetps WHERE monitor_databasetps_time=(SELECT max(monitor_databasetps_time) FROM monitor_databasetps) ORDER BY 1 ASC;
--show cluster summary at current_time
CREATE VIEW adbmgr.monitor_cluster_summary_v
AS
SELECT (SUM(monitor_databaseitem_dbsize)/1024.0)::numeric(18,2) AS dbsize,
CASE AVG(monitor_databaseitem_archivemode::int)
WHEN 0 THEN false
ELSE true
END AS archivemode,
CASE AVG(monitor_databaseitem_autovacuum::int)
WHEN 0 THEN false
ELSE true
END AS autovacuum,
AVG(monitor_databaseitem_heaphitrate)::numeric(18,2) AS heaphitrate,
AVG(monitor_databaseitem_commitrate)::numeric(18,2) AS commitrate,
MAX(monitor_databaseitem_dbage)::int AS dbage,
SUM(monitor_databaseitem_connectnum) AS connectnum,
AVG(monitor_databaseitem_standbydelay)::int AS standbydelay,
SUM(monitor_databaseitem_locksnum) AS locksnum,
SUM(monitor_databaseitem_longtransnum) AS longtransnum,
SUM(monitor_databaseitem_idletransnum) AS idletransnum,
SUM(monitor_databaseitem_preparenum) AS preparenum,
SUM(monitor_databaseitem_unusedindexnum) AS unusedindexnum
from (SELECT * from monitor_databaseitem where monitor_databaseitem_time=(SELECT MAX(monitor_databaseitem_time) from monitor_databaseitem)) AS a;
--show database summary at current_time for given name
CREATE OR REPLACE FUNCTION pg_catalog.monitor_databasesummary_func(in name)
RETURNS TABLE
(
dbsize numeric(18,2),
archivemode bool,
autovacuum bool,
heaphitrate numeric(18,2),
commitrate numeric(18,2),
dbage bigint,
connectnum bigint,
standbydelay bigint,
locksnum bigint,
longtransnum bigint,
idletransnum bigint,
preparenum bigint,
unusedindexnum bigint
)
AS
$$
SELECT (monitor_databaseitem_dbsize/1024.0)::numeric(18,2) AS dbsize,
monitor_databaseitem_archivemode AS archivemode,
monitor_databaseitem_autovacuum AS autovacuum,
monitor_databaseitem_heaphitrate::numeric(18,2) AS heaphitrate,
monitor_databaseitem_commitrate::numeric(18,2) AS commitrate,
monitor_databaseitem_dbage AS dbage,
monitor_databaseitem_connectnum AS connectnum,
monitor_databaseitem_standbydelay AS standbydelay,
monitor_databaseitem_locksnum AS locksnum,
monitor_databaseitem_longtransnum AS longtransum,
monitor_databaseitem_idletransnum AS idletransum,
monitor_databaseitem_preparenum AS preparenum,
monitor_databaseitem_unusedindexnum AS unusedindexnum
from (SELECT * from monitor_databaseitem where monitor_databaseitem_time=(SELECT
MAX(monitor_databaseitem_time) from monitor_databaseitem) and monitor_databaseitem_dbname = $1) AS a
$$
LANGUAGE SQL
IMMUTABLE
RETURNS NULL ON NULL INPUT;
CREATE OR REPLACE FUNCTION pg_catalog.monitor_slowlog_count_func(in name, in timestamptz, in timestamptz)
RETURNS bigint
AS
$$
SELECT count(*)
FROM
monitor_slowlog
WHERE slowlogdbname = $1 and slowlogtime >= $2 and slowlogtime < $3;
$$
LANGUAGE SQL
IMMUTABLE
RETURNS NULL ON NULL INPUT;
CREATE OR REPLACE FUNCTION pg_catalog.monitor_slowlog_func_page(in name, in timestamptz, in timestamptz, in int, in int)
RETURNS TABLE
(
query text,
dbuser name,
singletime float4,
totalnum int,
queryplan text
)
AS
$$
SELECT slowlogquery AS query,
slowloguser AS dbuser,
slowlogsingletime AS singletime,
slowlogtotalnum AS totalnum,
slowlogqueryplan AS queryplan
FROM
monitor_slowlog
WHERE slowlogdbname = $1 and slowlogtime >= $2 and slowlogtime < $3 order by slowlogtime desc limit $4 offset $5;
$$
LANGUAGE SQL
IMMUTABLE
RETURNS NULL ON NULL INPUT;
--for cluster warning, monitor_dbthreshold systbl, see "typedef enum DbthresholdObject"
-- in monitor_dbthreshold.c
--heaphitrate
insert into pg_catalog.monitor_host_threshold values(11, 0, 98, 95, 90);
insert into pg_catalog.monitor_host_threshold values(21, 0, 98, 95, 90);
--commitrate
insert into pg_catalog.monitor_host_threshold values(12, 0, 95, 90, 85);
insert into pg_catalog.monitor_host_threshold values(22, 0, 95, 90, 85);
--standbydelay
insert into pg_catalog.monitor_host_threshold values(13, 1, 200, 250, 300);
insert into pg_catalog.monitor_host_threshold values(23, 1, 1000, 2000, 3000);
--locks num
insert into pg_catalog.monitor_host_threshold values(14, 1, 40, 50, 60);
insert into pg_catalog.monitor_host_threshold values(24, 1, 50, 80, 120);
--connect num
insert into pg_catalog.monitor_host_threshold values(15, 1, 400, 500, 800);
insert into pg_catalog.monitor_host_threshold values(25, 1, 500, 800, 1500);
--long transaction, idle transaction
insert into pg_catalog.monitor_host_threshold values(16, 1, 25, 30, 50);
insert into pg_catalog.monitor_host_threshold values(26, 1, 30, 60, 80);
--unused index num
insert into pg_catalog.monitor_host_threshold values(17, 1, 0, 0, 0);
insert into pg_catalog.monitor_host_threshold values(27, 1, 100, 150, 200);
--tps timeinterval
insert into pg_catalog.monitor_host_threshold values(31, 1, 3, 0, 0);
--long transactions min time
insert into pg_catalog.monitor_host_threshold values(32, 1, 100, 0, 0);
--slow query min time
insert into pg_catalog.monitor_host_threshold values(33, 1, 2, 0, 0);
--get limit num slowlog from database cluster once time
insert into pg_catalog.monitor_host_threshold values(34, 1, 100, 0, 0);
-- for ADB monitor the topology in home page : get datanode node topology
CREATE VIEW adbmgr.get_datanode_node_topology AS
select '{'|| ARRAY_TO_STRING || '}' as datanode_result
from (
select ARRAY_TO_STRING(
array(
select case f.nodetype
when 'd' then '"master"'
when 'b' then '"slave"'
end
|| ':' || '{' || '"node_name"' || ':' || '"' || f.nodename || '"' || ','
|| '"node_port"' || ':' || f.nodeport || ','
|| '"node_ip"' || ':' || '"' || f.hostaddr || '"' || ','
|| '"sync_state"'|| ':' || '"' || f.nodesync || '"' ||
'}'
from(
select n.nodename,n.oid,n.nodetype,n.nodesync,n.nodeport,n.nodemasternameoid, h.hostaddr
from mgr_node n, mgr_host h
where n.nodemasternameoid = '0' and
n.nodename = x.nodename and
n.nodetype = 'd' and
h.oid = n.nodehost and
n.nodeincluster = true and
n.nodeinited = true
union all
select t2.nodename,t2.oid,t2.nodetype,t2.nodesync,t2.nodeport,t2.nodemasternameoid,t2.hostaddr
from (
select n.nodename,n.oid,n.nodetype,n.nodeport,n.nodemasternameoid,h.hostaddr
from mgr_node n,mgr_host h
where n.nodemasternameoid = '0' and
n.nodename = x.nodename and
n.nodetype = 'd' and
h.oid = n.nodehost and
n.nodeincluster = true and
n.nodeinited = true
) t1
left join
(
select n.nodename,n.oid,n.nodetype,n.nodesync,n.nodeport,n.nodemasternameoid,h.hostaddr
from mgr_node n,mgr_host h
where h.oid = n.nodehost and
n.nodeincluster = true and
n.nodeinited = true
) t2
on t1.oid = t2.nodemasternameoid and t2.nodetype in ('b','n')
) as f
), ','
) from (select nodename from mgr_node where nodetype = 'd') x
) r;
-- for ADB monitor the topology in home page : get coordinator node topology
CREATE VIEW adbmgr.get_coordinator_node_topology AS
select n.nodename AS node_name,
n.nodeport AS node_port,
h.hostaddr AS node_ip
from mgr_node n, mgr_host h
where n.nodeincluster = true and
n.nodeinited = true and
n.nodehost = h.oid and
n.nodetype = 'c';
-- for ADB monitor the topology in home page : get agtm node topology
CREATE VIEW adbmgr.get_agtm_node_topology AS
select '{'|| ARRAY_TO_STRING || '}' as agtm_result
from(
select ARRAY_TO_STRING(
array(
select case f.nodetype
when 'g' then '"master"'
when 'p' then '"slave"'
end
|| ':' || '{' || '"node_name"' || ':' || '"' || f.nodename || '"' || ','
|| '"node_port"' || ':' || f.nodeport || ','
|| '"node_ip"' || ':' || '"' || f.hostaddr || '"' || ','
|| '"sync_state"'|| ':' || '"' || f.nodesync || '"' ||
'}'
from(
select n.nodename,n.oid,n.nodetype,n.nodesync,n.nodeport,n.nodemasternameoid, h.hostaddr
from mgr_node n, mgr_host h
where n.nodeincluster = true and
n.nodeinited = true and
n.nodehost = h.oid and
n.nodetype in ('g', 'p', 'e')
) f
) -- end array
, ','
) -- end ARRAY_TO_STRING
) r;
-- insert default values into monitor_host_threthold.
insert into pg_catalog.monitor_host_threshold values (1, 1, 90, 95, 99);
insert into pg_catalog.monitor_host_threshold values (2, 1, 85, 90, 95);
insert into pg_catalog.monitor_host_threshold values (3, 1, 80, 85, 90);
insert into pg_catalog.monitor_host_threshold values (4, 1, 2000, 3000, 4000);
insert into pg_catalog.monitor_host_threshold values (5, 1, 2000, 3000, 4000);
insert into pg_catalog.monitor_host_threshold values (6, 1, 3000, 4000, 5000);
-- update threshold value by type
create or replace function pg_catalog.update_threshold_value(type int, value1 int, value2 int, value3 int)
returns void
as $$
update pg_catalog.monitor_host_threshold
set mt_warning_threshold = $2, mt_critical_threshold = $3, mt_emergency_threshold = $4
where mt_type = $1;
$$ language sql
VOLATILE
returns null on null input;
--get the threshold for specific type
create or replace function pg_catalog.get_threshold_type(type int)
returns text
as $$
select '{' || row_string || '}' as show_threshold
from (
select case $1
when 1 then '"cpu_usage"'
when 2 then '"mem_usage"'
when 3 then '"disk_usage"'
when 4 then '"sent_net"'
when 5 then '"recv_net"'
when 6 then '"IOPS"'
when 11 then '"node_heaphit_rate"'
when 21 then '"cluster_heaphit_rate"'
when 12 then '"node_commit/rollback_rate"'
when 22 then '"cluster_commit/rollback_rate"'
when 13 then '"node_standy_delay"'
when 23 then '"cluster_standy_delay"'
when 14 then '"node_wait_locks"'
when 24 then '"cluster_wait_locks"'
when 15 then '"node_connect"'
when 25 then '"cluster_connect"'
when 16 then '"node_longtrnas/idletrans"'
when 26 then '"cluster_longtrnas/idletrans"'
when 27 then '"cluster_unused_indexs"'
END
|| ':' || row_to_json as row_string
from (
select row_to_json(t)
from (
select
mt_warning_threshold AS "warning",
mt_critical_threshold AS "critical",
mt_emergency_threshold AS "emergency"
from monitor_host_threshold
where mt_type = $1
) t
)y
)s;
$$
language sql
IMMUTABLE
RETURNS NULL ON NULL INPUT;
--get the threshlod for all type
CREATE VIEW adbmgr.get_threshold_all_type AS
select mt_type as type, mt_direction as direction, mt_warning_threshold as warning, mt_critical_threshold as critical, mt_emergency_threshold as emergency
from pg_catalog.monitor_host_threshold
where mt_type in (1,2,3,4,5,6)
order by 1 asc;
--get the threshlod for all type
CREATE VIEW adbmgr.get_db_threshold_all_type
as
select tt1.mt_type as type, tt1.mt_direction as direction, tt1.mt_warning_threshold as node_warning, tt1.mt_critical_threshold as node_critical,
tt1.mt_emergency_threshold as node_emergency,tt2.mt_warning_threshold as cluster_warning,
tt2.mt_critical_threshold as cluster_critical, tt2.mt_emergency_threshold as cluster_emergency
from (select * from pg_catalog.monitor_host_threshold where mt_type in (11,12,13,14,15,16,17))as tt1
join (select * from pg_catalog.monitor_host_threshold where mt_type in (21,22,23,24,25,26,27)) tt2 on tt1.mt_type +10 =tt2.mt_type
order by 1 asc;
-- get all alarm info (host and DB)
create or replace FUNCTION pg_catalog.get_alarm_info_asc(starttime timestamp ,
endtime timestamp ,
search_text text default '',
alarm_level int default 0,
alarm_type int default 0,
alarm_status int default 0,
alarm_limit int default 20,
alarm_offset int default 0)
returns TABLE (
alarm_level smallint,
alarm_text text,
alarm_type smallint,
alarm_id oid,
alarm_source text,
alarm_time timestamptz,
alarm_status smallint,
alarm_resolve_timetz timestamptz,
alarm_solution text)
as $$
select a.ma_alarm_level AS alarm_level,
a.ma_alarm_text AS alarm_text,
a.ma_alarm_type AS alarm_type,
a.oid AS alarm_id,
a.ma_alarm_source AS alarm_source,
a.ma_alarm_timetz AS alarm_time,
a.ma_alarm_status AS alarm_status,
r.mr_resolve_timetz AS alarm_resolve_timetz,
r.mr_solution AS alarm_solution
from monitor_alarm a left join monitor_resolve r on(a.oid = r.mr_alarm_oid)
where case $4 when 0 then 1::boolean else a.ma_alarm_level = $4 end and
case $5 when 0 then 1::boolean else a.ma_alarm_type = $5 end and
case $6 when 0 then 1::boolean else a.ma_alarm_status = $6 end and
a.ma_alarm_text ~ $3 and
a.ma_alarm_timetz between $1 and $2
order by a.ma_alarm_timetz asc limit $7 offset $8
$$ LANGUAGE SQL
IMMUTABLE
RETURNS NULL ON NULL INPUT;
-- get all alarm info (host and DB)
create or replace FUNCTION pg_catalog.get_alarm_info_desc(starttime timestamp ,
endtime timestamp ,
search_text text default '',
alarm_level int default 0,
alarm_type int default 0,
alarm_status int default 0,
alarm_limit int default 20,
alarm_offset int default 0)
returns TABLE (
alarm_level smallint,
alarm_text text,
alarm_type smallint,
alarm_id oid,
alarm_source text,
alarm_time timestamptz,
alarm_status smallint,
alarm_resolve_timetz timestamptz,
alarm_solution text)
as $$
select a.ma_alarm_level AS alarm_level,
a.ma_alarm_text AS alarm_text,
a.ma_alarm_type AS alarm_type,
a.oid AS alarm_id,
a.ma_alarm_source AS alarm_source,
a.ma_alarm_timetz AS alarm_time,
a.ma_alarm_status AS alarm_status,
r.mr_resolve_timetz AS alarm_resolve_timetz,
r.mr_solution AS alarm_solution
from monitor_alarm a left join monitor_resolve r on(a.oid = r.mr_alarm_oid)
where case $4 when 0 then 1::boolean else a.ma_alarm_level = $4 end and
case $5 when 0 then 1::boolean else a.ma_alarm_type = $5 end and
case $6 when 0 then 1::boolean else a.ma_alarm_status = $6 end and
a.ma_alarm_text ~ $3 and
a.ma_alarm_timetz between $1 and $2
order by a.ma_alarm_timetz desc limit $7 offset $8
$$ LANGUAGE SQL
IMMUTABLE
RETURNS NULL ON NULL INPUT;
create or replace FUNCTION pg_catalog.get_alarm_info_count(starttime timestamp ,
endtime timestamp ,
search_text text default '',
alarm_level int default 0,
alarm_type int default 0,
alarm_status int default 0)
returns bigint
as $$
select count(*)
from monitor_alarm a left join monitor_resolve r on(a.oid = r.mr_alarm_oid)
where case $4 when 0 then 1::boolean else a.ma_alarm_level = $4 end and
case $5 when 0 then 1::boolean else a.ma_alarm_type = $5 end and
case $6 when 0 then 1::boolean else a.ma_alarm_status = $6 end and
a.ma_alarm_text ~ $3 and
a.ma_alarm_timetz between $1 and $2
$$ LANGUAGE SQL
IMMUTABLE
RETURNS NULL ON NULL INPUT;
-- save resolve alarm log
create or replace function pg_catalog.resolve_alarm(alarm_id int, resolve_time timestamp, resolve_text text)
returns void as
$$
insert into monitor_resolve (mr_alarm_oid, mr_resolve_timetz, mr_solution)
values ($1, $2, $3);
update monitor_alarm set ma_alarm_status = 2 where oideq(oid,$1)
$$
LANGUAGE SQL
VOLATILE
RETURNS NULL ON NULL INPUT;
--insert into monitor_user, as default value: 1: ordinary users, 2: db manager
insert into monitor_user values(pg_nextoid('monitor_user', 'oid', 'monitor_user_oid_index'), 'adbmonitor', 2, '2016-01-01','2050-01-01', '12345678901',
'userdba@asiainfo.com', '亚信', '数据库', '数据库研发工程师', 'ISMvKXpXpadDiUoOSoAfww==','系统管理员');
--check user name/password
CREATE OR REPLACE FUNCTION pg_catalog.monitor_checkuser_func(in Name, in Name)
RETURNS oid AS $$
select oid from pg_catalog.monitor_user where username=$1 and userpassword=$2;
$$ LANGUAGE sql IMMUTABLE STRICT;
--show user info
create or replace function pg_catalog.monitor_getuserinfo_func(in int)
returns TABLE
(
username Name, /*the user name*/
usertype int,
userstarttime timestamptz,
userendtime timestamptz,
usertel Name,
useremail Name,
usercompany Name,
userdepart Name,
usertitle Name,
userdesc text
)
as
$$
select username, usertype, userstarttime, userendtime, usertel, useremail
, usercompany, userdepart, usertitle, userdesc from pg_catalog.monitor_user where oid=$1;
$$
LANGUAGE SQL
IMMUTABLE
RETURNS NULL ON NULL INPUT;
--update user info
create or replace function pg_catalog.monitor_updateuserinfo_func(in int, in Name, in Name, in Name, in Name, in Name, in text)
returns int
as
$$
update pg_catalog.monitor_user set username=$2, usertel=$3, useremail=$4, usertitle=$5, usercompany=$6, userdesc=$7 where oid=$1 returning 0;
$$
LANGUAGE SQL
VOLATILE
RETURNS NULL ON NULL INPUT;
--check user oldpassword
create or replace function pg_catalog.monitor_checkuserpassword_func(in int, in Name)
returns bigint
as
$$
select count(*) -1 from pg_catalog.monitor_user where oid=$1 and userpassword=$2;
$$
LANGUAGE SQL
VOLATILE
RETURNS NULL ON NULL INPUT;
--update user password
create or replace function pg_catalog.monitor_updateuserpassword_func(in int, in Name)
returns int
as
$$
update pg_catalog.monitor_user set userpassword=$2 where oid=$1 returning 0;
$$
LANGUAGE SQL
VOLATILE
RETURNS NULL ON NULL INPUT;
--for ADB manager command : grant and revoke
grant usage on schema adbmgr to public;
-- clean
revoke execute on function mgr_clean_all() from public;
revoke execute on function mgr_clean_node("any") from public;
revoke execute on function monitor_delete_data_interval_days(int) from public;
-- failover
revoke execute on function mgr_failover_gtm(cstring, bool, cstring), mgr_failover_one_dn(cstring, bool, cstring) from public;
-- show
revoke execute on function mgr_show_var_param( "any") from public;
revoke execute on function mgr_show_hba_all("any") from public;
-- append
revoke execute on function
mgr_append_dnmaster(cstring),
mgr_append_dnslave(cstring),
mgr_append_coordmaster(cstring),
mgr_append_agtmslave(cstring),
mgr_append_coord_to_coord(cstring,cstring),
mgr_append_activate_coord(cstring)
from public;
-- monitor
revoke execute on function
mgr_monitor_agent_all(),
mgr_monitor_agent_hostlist(text[]),
mgr_monitor_gtmcoord_all(),
mgr_monitor_datanode_all(),
mgr_monitor_nodetype_namelist(bigint, "any"),
mgr_monitor_nodetype_all(bigint),
mgr_monitor_zone_all(cstring),
mgr_monitor_ha_zone(cstring),
mgr_monitor_ha()
from public;
--boottime
revoke execute on function
mgr_boottime_gtmcoord_all(),
mgr_boottime_datanode_all(),
mgr_boottime_coordinator_all(),
mgr_boottime_all(),
mgr_boottime_nodetype_namelist(bigint, "any"),
mgr_boottime_nodetype_all(bigint)
from public;
--switchover
revoke execute on function
mgr_switchover_func(int, cstring, int, int)
from public;
revoke execute on function mgr_priv_manage(bigint,text[],text[]) from public;
revoke execute on function mgr_list_acl_all()from public;
revoke execute on function mgr_priv_list_to_all(bigint,text[]) from public;
revoke execute on function mgr_priv_all_to_username(bigint,text[]) from public;
--list
revoke execute on function mgr_list_hba_by_name("any") from public;
--start
revoke execute on function
mgr_start_agent_all(cstring),
mgr_start_agent_hostnamelist(cstring,text[]),
mgr_start_gtmcoord_master("any"),
mgr_start_gtmcoord_slave("any"),
mgr_start_cn_master("any"),
mgr_start_dn_master("any"),
mgr_start_dn_slave("any")
from public;
--add
revoke execute on function
mgr_add_host_func(boolean,cstring,"any"),
mgr_add_node_func(boolean,"char",cstring,cstring,"any")
from public;
--drop
revoke execute on function
mgr_drop_host_func(boolean,"any"),
mgr_drop_node_func("char","any")
from public;
--alter
revoke execute on function
mgr_alter_host_func(boolean, cstring, "any"),
mgr_alter_node_func("char", cstring, "any")
from public;
--set
revoke execute on function
mgr_add_updateparm_func("char", cstring, "char", boolean, "any"),
mgr_set_init_cluster()
from public;
--reset
revoke execute on function
mgr_reset_updateparm_func("char", cstring, "char", boolean, "any")
from public;
--deploy
revoke execute on function
mgr_deploy_all(cstring),
mgr_deploy_hostnamelist(cstring, text[])
from public;
--stop
revoke execute on function
mgr_stop_agent_all(),
mgr_stop_agent_hostnamelist(text[]),
mgr_stop_gtmcoord_master("any"),
mgr_stop_gtmcoord_slave("any"),
mgr_stop_cn_master("any"),
mgr_stop_dn_master("any"),
mgr_stop_dn_slave("any")
from public;
--flush host
revoke execute on function mgr_flush_host() from public;
--add primary key for table:monitor_host_threshold,monitor_user and monitor_job
alter table pg_catalog.monitor_host_threshold add primary key (mt_type);
alter table pg_catalog.monitor_user add primary key (username);
alter table pg_catalog.monitor_job add primary key (name);
--expand
revoke execute on function mgr_expand_dnmaster(cstring, cstring) from public;
revoke execute on function mgr_expand_activate_dnmaster() from public;
--expand
revoke execute on function
mgr_expand_show_status(),
mgr_expand_check_status(),
mgr_checkout_dnslave_status(),
mgr_expand_dnmaster(cstring, cstring),
mgr_expand_recover_backup_fail(cstring, cstring),
mgr_expand_recover_backup_suc(cstring, cstring),
mgr_expand_activate_dnmaster(),
mgr_expand_activate_recover_promote_suc(cstring),
mgr_expand_clean()
from public;
--doctor
revoke execute on function
mgr_doctor_start(),
mgr_doctor_stop(),
mgr_doctor_param(),
mgr_doctor_list()
from public;
create extension adb_doctor; | the_stack |
alter table ACT_RE_PROCDEF add column ENGINE_VERSION_ varchar(255);
update ACT_RE_PROCDEF set ENGINE_VERSION_ = 'v5';
alter table ACT_RE_DEPLOYMENT add column ENGINE_VERSION_ varchar(255);
update ACT_RE_DEPLOYMENT set ENGINE_VERSION_ = 'v5';
alter table ACT_RU_EXECUTION add column ROOT_PROC_INST_ID_ varchar(64);
create index ACT_IDX_EXEC_ROOT on ACT_RU_EXECUTION(ROOT_PROC_INST_ID_);
alter table ACT_RU_EXECUTION add column IS_MI_ROOT_ bit;
create table ACT_RU_TIMER_JOB (
ID_ varchar(64) NOT NULL,
REV_ integer,
TYPE_ varchar(255) NOT NULL,
LOCK_EXP_TIME_ timestamp,
LOCK_OWNER_ varchar(255),
EXCLUSIVE_ boolean,
EXECUTION_ID_ varchar(64),
PROCESS_INSTANCE_ID_ varchar(64),
PROC_DEF_ID_ varchar(64),
RETRIES_ integer,
EXCEPTION_STACK_ID_ varchar(64),
EXCEPTION_MSG_ varchar(4000),
DUEDATE_ timestamp,
REPEAT_ varchar(255),
HANDLER_TYPE_ varchar(255),
HANDLER_CFG_ varchar(4000),
TENANT_ID_ varchar(255) default '',
primary key (ID_)
);
create table ACT_RU_SUSPENDED_JOB (
ID_ varchar(64) NOT NULL,
REV_ integer,
TYPE_ varchar(255) NOT NULL,
EXCLUSIVE_ boolean,
EXECUTION_ID_ varchar(64),
PROCESS_INSTANCE_ID_ varchar(64),
PROC_DEF_ID_ varchar(64),
RETRIES_ integer,
EXCEPTION_STACK_ID_ varchar(64),
EXCEPTION_MSG_ varchar(4000),
DUEDATE_ timestamp,
REPEAT_ varchar(255),
HANDLER_TYPE_ varchar(255),
HANDLER_CFG_ varchar(4000),
TENANT_ID_ varchar(255) default '',
primary key (ID_)
);
create table ACT_RU_DEADLETTER_JOB (
ID_ varchar(64) NOT NULL,
REV_ integer,
TYPE_ varchar(255) NOT NULL,
EXCLUSIVE_ boolean,
EXECUTION_ID_ varchar(64),
PROCESS_INSTANCE_ID_ varchar(64),
PROC_DEF_ID_ varchar(64),
EXCEPTION_STACK_ID_ varchar(64),
EXCEPTION_MSG_ varchar(4000),
DUEDATE_ timestamp,
REPEAT_ varchar(255),
HANDLER_TYPE_ varchar(255),
HANDLER_CFG_ varchar(4000),
TENANT_ID_ varchar(255) default '',
primary key (ID_)
);
alter table ACT_RU_JOB
add constraint ACT_FK_JOB_EXECUTION
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION;
alter table ACT_RU_JOB
add constraint ACT_FK_JOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
references ACT_RU_EXECUTION;
alter table ACT_RU_JOB
add constraint ACT_FK_JOB_PROC_DEF
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF;
alter table ACT_RU_TIMER_JOB
add constraint ACT_FK_TIMER_JOB_EXECUTION
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION;
alter table ACT_RU_TIMER_JOB
add constraint ACT_FK_TIMER_JOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
references ACT_RU_EXECUTION;
alter table ACT_RU_TIMER_JOB
add constraint ACT_FK_TIMER_JOB_PROC_DEF
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF;
alter table ACT_RU_TIMER_JOB
add constraint ACT_FK_TIMER_JOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
references ACT_GE_BYTEARRAY;
alter table ACT_RU_SUSPENDED_JOB
add constraint ACT_FK_SUSPENDED_JOB_EXECUTION
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION;
alter table ACT_RU_SUSPENDED_JOB
add constraint ACT_FK_SUSPENDED_JOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
references ACT_RU_EXECUTION;
alter table ACT_RU_SUSPENDED_JOB
add constraint ACT_FK_SUSPENDED_JOB_PROC_DEF
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF;
alter table ACT_RU_SUSPENDED_JOB
add constraint ACT_FK_SUSPENDED_JOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
references ACT_GE_BYTEARRAY;
alter table ACT_RU_DEADLETTER_JOB
add constraint ACT_FK_DEADLETTER_JOB_EXECUTION
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION;
alter table ACT_RU_DEADLETTER_JOB
add constraint ACT_FK_DEADLETTER_JOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
references ACT_RU_EXECUTION;
alter table ACT_RU_DEADLETTER_JOB
add constraint ACT_FK_DEADLETTER_JOB_PROC_DEF
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF;
alter table ACT_RU_DEADLETTER_JOB
add constraint ACT_FK_DEADLETTER_JOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
references ACT_GE_BYTEARRAY;
-- Moving jobs with retries <= 0 to ACT_RU_DEADLETTER_JOB
INSERT INTO ACT_RU_DEADLETTER_JOB (ID_, REV_, TYPE_, EXCLUSIVE_, EXECUTION_ID_, PROCESS_INSTANCE_ID_, PROC_DEF_ID_,
EXCEPTION_STACK_ID_, EXCEPTION_MSG_, DUEDATE_, REPEAT_, HANDLER_TYPE_, HANDLER_CFG_, TENANT_ID_)
(SELECT ID_, REV_, TYPE_, EXCLUSIVE_, EXECUTION_ID_, PROCESS_INSTANCE_ID_, PROC_DEF_ID_,
EXCEPTION_STACK_ID_, EXCEPTION_MSG_, DUEDATE_, REPEAT_, HANDLER_TYPE_, HANDLER_CFG_, TENANT_ID_
from ACT_RU_JOB WHERE RETRIES_ <= 0);
DELETE FROM ACT_RU_JOB
WHERE RETRIES_ <= 0;
-- Moving suspended jobs to ACT_RU_SUSPENDED_JOB
INSERT INTO ACT_RU_SUSPENDED_JOB (ID_, REV_, TYPE_, EXCLUSIVE_, EXECUTION_ID_, PROCESS_INSTANCE_ID_, PROC_DEF_ID_,
RETRIES_, EXCEPTION_STACK_ID_, EXCEPTION_MSG_, DUEDATE_, REPEAT_, HANDLER_TYPE_, HANDLER_CFG_, TENANT_ID_)
(SELECT job.ID_, job.REV_, job.TYPE_, job.EXCLUSIVE_, job.EXECUTION_ID_, job.PROCESS_INSTANCE_ID_, job.PROC_DEF_ID_,
job.RETRIES_, job.EXCEPTION_STACK_ID_, job.EXCEPTION_MSG_, job.DUEDATE_, job.REPEAT_, job.HANDLER_TYPE_, job.HANDLER_CFG_, job.TENANT_ID_
from ACT_RU_JOB job INNER JOIN ACT_RU_EXECUTION execution on execution.ID_ = job.PROCESS_INSTANCE_ID_ where execution.SUSPENSION_STATE_ = 2);
DELETE FROM ACT_RU_JOB
WHERE PROCESS_INSTANCE_ID_ IN (SELECT ID_ FROM ACT_RU_EXECUTION execution WHERE execution.PARENT_ID_ is null and execution.SUSPENSION_STATE_ = 2);
-- Moving timer jobs to ACT_RU_TIMER_JOB
INSERT INTO ACT_RU_TIMER_JOB (ID_, REV_, TYPE_, LOCK_EXP_TIME_, LOCK_OWNER_, EXCLUSIVE_, EXECUTION_ID_, PROCESS_INSTANCE_ID_,
PROC_DEF_ID_, RETRIES_, EXCEPTION_STACK_ID_, EXCEPTION_MSG_, DUEDATE_, REPEAT_, HANDLER_TYPE_, HANDLER_CFG_, TENANT_ID_)
(SELECT ID_, REV_, TYPE_, LOCK_EXP_TIME_, LOCK_OWNER_, EXCLUSIVE_, EXECUTION_ID_, PROCESS_INSTANCE_ID_,
PROC_DEF_ID_, RETRIES_, EXCEPTION_STACK_ID_, EXCEPTION_MSG_, DUEDATE_, REPEAT_, HANDLER_TYPE_, HANDLER_CFG_, TENANT_ID_
from ACT_RU_JOB WHERE (HANDLER_TYPE_ = 'activate-processdefinition' or HANDLER_TYPE_ = 'suspend-processdefinition'
or HANDLER_TYPE_ = 'timer-intermediate-transition' or HANDLER_TYPE_ = 'timer-start-event' or HANDLER_TYPE_ = 'timer-transition') and LOCK_EXP_TIME_ is null);
DELETE FROM ACT_RU_JOB
WHERE (HANDLER_TYPE_ = 'activate-processdefinition'
or HANDLER_TYPE_ = 'suspend-processdefinition'
or HANDLER_TYPE_ = 'timer-intermediate-transition'
or HANDLER_TYPE_ = 'timer-start-event'
or HANDLER_TYPE_ = 'timer-transition')
and LOCK_EXP_TIME_ is null;
alter table ACT_RU_EXECUTION add column START_TIME_ timestamp;
alter table ACT_RU_EXECUTION add column START_USER_ID_ varchar(255);
alter table ACT_RU_TASK add column CLAIM_TIME_ timestamp;
alter table ACT_RE_DEPLOYMENT add column KEY_ varchar(255);
-- Upgrade added in upgradestep.52001.to.52002.engine, which is not applied when already on beta2
update ACT_RU_EVENT_SUBSCR set PROC_DEF_ID_ = CONFIGURATION_ where EVENT_TYPE_ = 'message' and PROC_INST_ID_ is null and EXECUTION_ID_ is null and PROC_DEF_ID_ is null;
-- Adding count columns for execution relationship count feature
alter table ACT_RU_EXECUTION add column IS_COUNT_ENABLED_ bit;
alter table ACT_RU_EXECUTION add column EVT_SUBSCR_COUNT_ integer;
alter table ACT_RU_EXECUTION add column TASK_COUNT_ integer;
alter table ACT_RU_EXECUTION add column JOB_COUNT_ integer;
alter table ACT_RU_EXECUTION add column TIMER_JOB_COUNT_ integer;
alter table ACT_RU_EXECUTION add column SUSP_JOB_COUNT_ integer;
alter table ACT_RU_EXECUTION add column DEADLETTER_JOB_COUNT_ integer;
alter table ACT_RU_EXECUTION add column VAR_COUNT_ integer;
alter table ACT_RU_EXECUTION add column ID_LINK_COUNT_ integer;
alter table ACT_RU_TASK add column IS_COUNT_ENABLED_ bit;
alter table ACT_RU_TASK add column VAR_COUNT_ integer;
alter table ACT_RU_TASK add column ID_LINK_COUNT_ integer;
update ACT_GE_PROPERTY set VALUE_ = '6.0.0.5' where NAME_ = 'schema.version';
create table ACT_ID_PROPERTY (
NAME_ varchar(64),
VALUE_ varchar(300),
REV_ integer,
primary key (NAME_)
);
insert into ACT_ID_PROPERTY
values ('schema.version', '6.0.0.5', 1);
create table ACT_ID_BYTEARRAY (
ID_ varchar(64),
REV_ integer,
NAME_ varchar(255),
BYTES_ longvarbinary,
primary key (ID_)
);
create table ACT_ID_TOKEN (
ID_ varchar(64) not null,
REV_ integer,
TOKEN_VALUE_ varchar(255),
TOKEN_DATE_ timestamp,
IP_ADDRESS_ varchar(255),
USER_AGENT_ varchar(255),
USER_ID_ varchar(255),
TOKEN_DATA_ varchar(2000),
primary key (ID_)
);
create table ACT_ID_PRIV (
ID_ varchar(64) not null,
NAME_ varchar(255),
primary key (ID_)
);
create table ACT_ID_PRIV_MAPPING (
ID_ varchar(64) not null,
PRIV_ID_ varchar(64) not null,
USER_ID_ varchar(255),
GROUP_ID_ varchar(255),
primary key (ID_)
);
alter table ACT_ID_PRIV_MAPPING
add constraint ACT_FK_PRIV_MAPPING
foreign key (PRIV_ID_)
references ACT_ID_PRIV (ID_);
create index ACT_IDX_PRIV_USER on ACT_ID_PRIV_MAPPING(USER_ID_);
create index ACT_IDX_PRIV_GROUP on ACT_ID_PRIV_MAPPING(GROUP_ID_);
CREATE TABLE ACT_DMN_DATABASECHANGELOGLOCK (ID INT NOT NULL, LOCKED BOOLEAN NOT NULL, LOCKGRANTED TIMESTAMP, LOCKEDBY VARCHAR(255), CONSTRAINT PK_ACT_DMN_DATABASECHANGELOGLOCK PRIMARY KEY (ID));
DELETE FROM ACT_DMN_DATABASECHANGELOGLOCK;
INSERT INTO ACT_DMN_DATABASECHANGELOGLOCK (ID, LOCKED) VALUES (1, FALSE);
UPDATE ACT_DMN_DATABASECHANGELOGLOCK SET LOCKED = TRUE, LOCKEDBY = '192.168.1.5 (192.168.1.5)', LOCKGRANTED = '2019-03-14 14:47:03.574' WHERE ID = 1 AND LOCKED = FALSE;
CREATE TABLE ACT_DMN_DATABASECHANGELOG (ID VARCHAR(255) NOT NULL, AUTHOR VARCHAR(255) NOT NULL, FILENAME VARCHAR(255) NOT NULL, DATEEXECUTED TIMESTAMP NOT NULL, ORDEREXECUTED INT NOT NULL, EXECTYPE VARCHAR(10) NOT NULL, MD5SUM VARCHAR(35), DESCRIPTION VARCHAR(255), COMMENTS VARCHAR(255), TAG VARCHAR(255), LIQUIBASE VARCHAR(20), CONTEXTS VARCHAR(255), LABELS VARCHAR(255), DEPLOYMENT_ID VARCHAR(10));
CREATE TABLE ACT_DMN_DEPLOYMENT (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), CATEGORY_ VARCHAR(255), DEPLOY_TIME_ TIMESTAMP, TENANT_ID_ VARCHAR(255), PARENT_DEPLOYMENT_ID_ VARCHAR(255), CONSTRAINT PK_ACT_DMN_DEPLOYMENT PRIMARY KEY (ID_));
CREATE TABLE ACT_DMN_DEPLOYMENT_RESOURCE (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), RESOURCE_BYTES_ BLOB, CONSTRAINT PK_ACT_DMN_DEPLOYMENT_RESOURCE PRIMARY KEY (ID_));
CREATE TABLE ACT_DMN_DECISION_TABLE (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), VERSION_ INT, KEY_ VARCHAR(255), CATEGORY_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), PARENT_DEPLOYMENT_ID_ VARCHAR(255), TENANT_ID_ VARCHAR(255), RESOURCE_NAME_ VARCHAR(255), DESCRIPTION_ VARCHAR(255), CONSTRAINT PK_ACT_DMN_DECISION_TABLE PRIMARY KEY (ID_));
INSERT INTO ACT_DMN_DATABASECHANGELOG (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('1', 'activiti', 'org/flowable/dmn/db/liquibase/flowable-dmn-db-changelog.xml', NOW(), 1, '7:d878c2672ead57b5801578fd39c423af', 'createTable tableName=ACT_DMN_DEPLOYMENT; createTable tableName=ACT_DMN_DEPLOYMENT_RESOURCE; createTable tableName=ACT_DMN_DECISION_TABLE', '', 'EXECUTED', NULL, NULL, '3.5.3', '2571223649');
UPDATE ACT_DMN_DATABASECHANGELOGLOCK SET LOCKED = FALSE, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1;
CREATE TABLE ACT_FO_DATABASECHANGELOGLOCK (ID INT NOT NULL, LOCKED BOOLEAN NOT NULL, LOCKGRANTED TIMESTAMP, LOCKEDBY VARCHAR(255), CONSTRAINT PK_ACT_FO_DATABASECHANGELOGLOCK PRIMARY KEY (ID));
DELETE FROM ACT_FO_DATABASECHANGELOGLOCK;
INSERT INTO ACT_FO_DATABASECHANGELOGLOCK (ID, LOCKED) VALUES (1, FALSE);
UPDATE ACT_FO_DATABASECHANGELOGLOCK SET LOCKED = TRUE, LOCKEDBY = '192.168.1.5 (192.168.1.5)', LOCKGRANTED = '2019-03-14 14:47:03.750' WHERE ID = 1 AND LOCKED = FALSE;
CREATE TABLE ACT_FO_DATABASECHANGELOG (ID VARCHAR(255) NOT NULL, AUTHOR VARCHAR(255) NOT NULL, FILENAME VARCHAR(255) NOT NULL, DATEEXECUTED TIMESTAMP NOT NULL, ORDEREXECUTED INT NOT NULL, EXECTYPE VARCHAR(10) NOT NULL, MD5SUM VARCHAR(35), DESCRIPTION VARCHAR(255), COMMENTS VARCHAR(255), TAG VARCHAR(255), LIQUIBASE VARCHAR(20), CONTEXTS VARCHAR(255), LABELS VARCHAR(255), DEPLOYMENT_ID VARCHAR(10));
CREATE TABLE ACT_FO_FORM_DEPLOYMENT (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), CATEGORY_ VARCHAR(255), DEPLOY_TIME_ TIMESTAMP, TENANT_ID_ VARCHAR(255), PARENT_DEPLOYMENT_ID_ VARCHAR(255), CONSTRAINT PK_ACT_FO_FORM_DEPLOYMENT PRIMARY KEY (ID_));
CREATE TABLE ACT_FO_FORM_RESOURCE (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), RESOURCE_BYTES_ BLOB, CONSTRAINT PK_ACT_FO_FORM_RESOURCE PRIMARY KEY (ID_));
CREATE TABLE ACT_FO_FORM_DEFINITION (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), VERSION_ INT, KEY_ VARCHAR(255), CATEGORY_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), PARENT_DEPLOYMENT_ID_ VARCHAR(255), TENANT_ID_ VARCHAR(255), RESOURCE_NAME_ VARCHAR(255), DESCRIPTION_ VARCHAR(255), CONSTRAINT PK_ACT_FO_FORM_DEFINITION PRIMARY KEY (ID_));
CREATE TABLE ACT_FO_FORM_INSTANCE (ID_ VARCHAR(255) NOT NULL, FORM_DEFINITION_ID_ VARCHAR(255) NOT NULL, TASK_ID_ VARCHAR(255), PROC_INST_ID_ VARCHAR(255), PROC_DEF_ID_ VARCHAR(255), SUBMITTED_DATE_ TIMESTAMP, SUBMITTED_BY_ VARCHAR(255), FORM_VALUES_ID_ VARCHAR(255), TENANT_ID_ VARCHAR(255), CONSTRAINT PK_ACT_FO_FORM_INSTANCE PRIMARY KEY (ID_));
INSERT INTO ACT_FO_DATABASECHANGELOG (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('1', 'activiti', 'org/flowable/form/db/liquibase/flowable-form-db-changelog.xml', NOW(), 1, '7:252bd5cb28cf86685ed67eb15d910118', 'createTable tableName=ACT_FO_FORM_DEPLOYMENT; createTable tableName=ACT_FO_FORM_RESOURCE; createTable tableName=ACT_FO_FORM_DEFINITION; createTable tableName=ACT_FO_FORM_INSTANCE', '', 'EXECUTED', NULL, NULL, '3.5.3', '2571223782');
UPDATE ACT_FO_DATABASECHANGELOGLOCK SET LOCKED = FALSE, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1;
CREATE TABLE ACT_CO_DATABASECHANGELOGLOCK (ID INT NOT NULL, LOCKED BOOLEAN NOT NULL, LOCKGRANTED TIMESTAMP, LOCKEDBY VARCHAR(255), CONSTRAINT PK_ACT_CO_DATABASECHANGELOGLOCK PRIMARY KEY (ID));
DELETE FROM ACT_CO_DATABASECHANGELOGLOCK;
INSERT INTO ACT_CO_DATABASECHANGELOGLOCK (ID, LOCKED) VALUES (1, FALSE);
UPDATE ACT_CO_DATABASECHANGELOGLOCK SET LOCKED = TRUE, LOCKEDBY = '192.168.1.5 (192.168.1.5)', LOCKGRANTED = '2019-03-14 14:47:03.871' WHERE ID = 1 AND LOCKED = FALSE;
CREATE TABLE ACT_CO_DATABASECHANGELOG (ID VARCHAR(255) NOT NULL, AUTHOR VARCHAR(255) NOT NULL, FILENAME VARCHAR(255) NOT NULL, DATEEXECUTED TIMESTAMP NOT NULL, ORDEREXECUTED INT NOT NULL, EXECTYPE VARCHAR(10) NOT NULL, MD5SUM VARCHAR(35), DESCRIPTION VARCHAR(255), COMMENTS VARCHAR(255), TAG VARCHAR(255), LIQUIBASE VARCHAR(20), CONTEXTS VARCHAR(255), LABELS VARCHAR(255), DEPLOYMENT_ID VARCHAR(10));
CREATE TABLE ACT_CO_CONTENT_ITEM (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255) NOT NULL, MIME_TYPE_ VARCHAR(255), TASK_ID_ VARCHAR(255), PROC_INST_ID_ VARCHAR(255), CONTENT_STORE_ID_ VARCHAR(255), CONTENT_STORE_NAME_ VARCHAR(255), FIELD_ VARCHAR(400), CONTENT_AVAILABLE_ BOOLEAN DEFAULT FALSE, CREATED_ TIMESTAMP, CREATED_BY_ VARCHAR(255), LAST_MODIFIED_ TIMESTAMP, LAST_MODIFIED_BY_ VARCHAR(255), CONTENT_SIZE_ BIGINT DEFAULT 0, TENANT_ID_ VARCHAR(255), CONSTRAINT PK_ACT_CO_CONTENT_ITEM PRIMARY KEY (ID_));
CREATE INDEX idx_contitem_taskid ON ACT_CO_CONTENT_ITEM(TASK_ID_);
CREATE INDEX idx_contitem_procid ON ACT_CO_CONTENT_ITEM(PROC_INST_ID_);
INSERT INTO ACT_CO_DATABASECHANGELOG (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('1', 'activiti', 'org/flowable/content/db/liquibase/flowable-content-db-changelog.xml', NOW(), 1, '7:a17df43ed0c96adfef5271e1781aaed2', 'createTable tableName=ACT_CO_CONTENT_ITEM; createIndex indexName=idx_contitem_taskid, tableName=ACT_CO_CONTENT_ITEM; createIndex indexName=idx_contitem_procid, tableName=ACT_CO_CONTENT_ITEM', '', 'EXECUTED', NULL, NULL, '3.5.3', '2571223897');
UPDATE ACT_CO_DATABASECHANGELOGLOCK SET LOCKED = FALSE, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1; | the_stack |
create schema nodegroup_multigroup_test;
set current_schema = nodegroup_multigroup_test;
create node group ngroup1 with (datanode1, datanode3, datanode5, datanode7);
create node group ngroup2 with (datanode2, datanode4, datanode6, datanode8, datanode10, datanode12);
create node group ngroup3 with (datanode1, datanode2, datanode3, datanode4, datanode5, datanode6);
-- insert select
create table t1ng1(c1 int, c2 int) distribute by hash(c1) to group ngroup1;
create table t1ng2(c1 int, c2 int) distribute by hash(c1) to group ngroup2;
create table t1ng3(c1 int, c2 int) distribute by hash(c1) to group ngroup3;
insert into t1ng1 select v,v from generate_series(1,30) as v;
insert into t1ng2 select * from t1ng1;
insert into t1ng3 select * from t1ng2;
set enable_nodegroup_explain = on;
-- test Hash Join
set enable_hashjoin=true;
set enable_mergejoin=false;
set enable_nestloop=false;
set expected_computing_nodegroup='group1';
-- T1's distribution key join T2's distribution key
explain (costs off) select * from t1ng1 as t1 join t1ng2 as t2 on t1.c1 = t2.c1 order by 1;
select * from t1ng1 as t1 join t1ng2 as t2 on t1.c1 = t2.c1 order by 1;
-- T1's distribution key join T2's none-distribution key
explain (costs off) select * from t1ng1 as t1 join t1ng2 as t2 on t1.c1 = t2.c2 order by 1;
select * from t1ng1 as t1 join t1ng2 as t2 on t1.c1 = t2.c2 order by 1;
-- T1's none-distribution key join T2's distribution key
explain (costs off) select * from t1ng1 as t1 join t1ng2 as t2 on t1.c2 = t2.c1 order by 1;
select * from t1ng1 as t1 join t1ng2 as t2 on t1.c2 = t2.c1 order by 1;
-- T1's none-distribution key join T2's none-distribution key
explain (costs off) select * from t1ng1 as t1 join t1ng2 as t2 on t1.c2 = t2.c2 order by 1;
select * from t1ng1 as t1 join t1ng2 as t2 on t1.c2 = t2.c2 order by 1;
set expected_computing_nodegroup='ngroup1';
-- T1's distribution key join T2's distribution key
explain (costs off) select * from t1ng1 as t1 join t1ng2 as t2 on t1.c1 = t2.c1 order by 1;
select * from t1ng1 as t1 join t1ng2 as t2 on t1.c1 = t2.c1 order by 1;
-- T1's distribution key join T2's none-distribution key
explain (costs off) select * from t1ng1 as t1 join t1ng2 as t2 on t1.c1 = t2.c2 order by 1;
select * from t1ng1 as t1 join t1ng2 as t2 on t1.c1 = t2.c2 order by 1;
-- T1's none-distribution key join T2's distribution key
explain (costs off) select * from t1ng1 as t1 join t1ng2 as t2 on t1.c2 = t2.c1 order by 1;
select * from t1ng1 as t1 join t1ng2 as t2 on t1.c2 = t2.c1 order by 1;
-- T1's none-distribution key join T2's none-distribution key
explain (costs off) select * from t1ng1 as t1 join t1ng2 as t2 on t1.c2 = t2.c2 order by 1;
select * from t1ng1 as t1 join t1ng2 as t2 on t1.c2 = t2.c2 order by 1;
-- T2's for update in multi-group
explain (costs off) select * from t1ng2 where c2 in (select c2 from t1ng1) order by 1 for update;
select * from t1ng2 where c2 in (select c2 from t1ng1) order by 1 for update;
set expected_computing_nodegroup='ngroup2';
-- T1's distribution key join T2's distribution key
explain (costs off) select * from t1ng1 as t1 join t1ng2 as t2 on t1.c1 = t2.c1 order by 1;
select * from t1ng1 as t1 join t1ng2 as t2 on t1.c1 = t2.c1 order by 1;
-- T1's distribution key join T2's none-distribution key
explain (costs off) select * from t1ng1 as t1 join t1ng2 as t2 on t1.c1 = t2.c2 order by 1;
select * from t1ng1 as t1 join t1ng2 as t2 on t1.c1 = t2.c2 order by 1;
-- T1's none-distribution key join T2's distribution key
explain (costs off) select * from t1ng1 as t1 join t1ng2 as t2 on t1.c2 = t2.c1 order by 1;
select * from t1ng1 as t1 join t1ng2 as t2 on t1.c2 = t2.c1 order by 1;
-- T1's none-distribution key join T2's none-distribution key
explain (costs off) select * from t1ng1 as t1 join t1ng2 as t2 on t1.c2 = t2.c2 order by 1;
select * from t1ng1 as t1 join t1ng2 as t2 on t1.c2 = t2.c2 order by 1;
--T1's for update in multi-group
explain (costs off) select * from t1ng1 where c2 in (select c2 from t1ng2) order by 1 for update;
select * from t1ng1 where c2 in (select c2 from t1ng2) order by 1 for update;
-- test MergeJoin
set enable_hashjoin=false;
set enable_mergejoin=true;
set enable_nestloop=false;
set expected_computing_nodegroup='group1';
-- T1's distribution key join T2's distribution key
explain (costs off) select * from t1ng1 as t1 join t1ng2 as t2 on t1.c1 = t2.c1 order by 1;
select * from t1ng1 as t1 join t1ng2 as t2 on t1.c1 = t2.c1 order by 1;
-- T1's distribution key join T2's none-distribution key
explain (costs off) select * from t1ng1 as t1 join t1ng2 as t2 on t1.c1 = t2.c2 order by 1;
select * from t1ng1 as t1 join t1ng2 as t2 on t1.c1 = t2.c2 order by 1;
-- T1's none-distribution key join T2's distribution key
explain (costs off) select * from t1ng1 as t1 join t1ng2 as t2 on t1.c2 = t2.c1 order by 1;
select * from t1ng1 as t1 join t1ng2 as t2 on t1.c2 = t2.c1 order by 1;
-- T1's none-distribution key join T2's none-distribution key
explain (costs off) select * from t1ng1 as t1 join t1ng2 as t2 on t1.c2 = t2.c2 order by 1;
select * from t1ng1 as t1 join t1ng2 as t2 on t1.c2 = t2.c2 order by 1;
set expected_computing_nodegroup='ngroup1';
-- T1's distribution key join T2's distribution key
explain (costs off) select * from t1ng1 as t1 join t1ng2 as t2 on t1.c1 = t2.c1 order by 1;
select * from t1ng1 as t1 join t1ng2 as t2 on t1.c1 = t2.c1 order by 1;
-- T1's distribution key join T2's none-distribution key
explain (costs off) select * from t1ng1 as t1 join t1ng2 as t2 on t1.c1 = t2.c2 order by 1;
select * from t1ng1 as t1 join t1ng2 as t2 on t1.c1 = t2.c2 order by 1;
-- T1's none-distribution key join T2's distribution key
explain (costs off) select * from t1ng1 as t1 join t1ng2 as t2 on t1.c2 = t2.c1 order by 1;
select * from t1ng1 as t1 join t1ng2 as t2 on t1.c2 = t2.c1 order by 1;
-- T1's none-distribution key join T2's none-distribution key
explain (costs off) select * from t1ng1 as t1 join t1ng2 as t2 on t1.c2 = t2.c2 order by 1;
select * from t1ng1 as t1 join t1ng2 as t2 on t1.c2 = t2.c2 order by 1;
set expected_computing_nodegroup='ngroup2';
-- T1's distribution key join T2's distribution key
explain (costs off) select * from t1ng1 as t1 join t1ng2 as t2 on t1.c1 = t2.c1 order by 1;
select * from t1ng1 as t1 join t1ng2 as t2 on t1.c1 = t2.c1 order by 1;
-- T1's distribution key join T2's none-distribution key
explain (costs off) select * from t1ng1 as t1 join t1ng2 as t2 on t1.c1 = t2.c2 order by 1;
select * from t1ng1 as t1 join t1ng2 as t2 on t1.c1 = t2.c2 order by 1;
-- T1's none-distribution key join T2's distribution key
explain (costs off) select * from t1ng1 as t1 join t1ng2 as t2 on t1.c2 = t2.c1 order by 1;
select * from t1ng1 as t1 join t1ng2 as t2 on t1.c2 = t2.c1 order by 1;
-- T1's none-distribution key join T2's none-distribution key
explain (costs off) select * from t1ng1 as t1 join t1ng2 as t2 on t1.c2 = t2.c2 order by 1;
select * from t1ng1 as t1 join t1ng2 as t2 on t1.c2 = t2.c2 order by 1;
drop table t1ng1;
drop table t1ng2;
drop table t1ng3;
reset expected_computing_nodegroup;
drop node group ngroup1;
drop node group ngroup2;
drop node group ngroup3;
/*
* Test BROADCAST can work with REDISTRIBUTION
* proposed by Yonghua
*/
create node group ng1 with(datanode2, datanode3);
create node group ng2 with(datanode1, datanode4);
create node group ng3 with(datanode1, datanode2, datanode3, datanode4, datanode5, datanode6, datanode7, datanode8);
create table t1ng1(c1 int, c2 int) distribute by hash(c1) to group ng1;
create table t1ng2(c1 int, c2 int) distribute by hash(c1) to group ng2;
insert into t1ng1 select v,v%5 from generate_series(1,10) as v;
insert into t1ng2 select v,v%5 from generate_series(1,10) as v;
-- TODO, fix me as we have some issues support ANALYZE nodegorup table, so just hack statistics
update pg_class set reltuples = 500000 where relname = 't1ng2';
update pg_class set relpages = 500000 where relname = 't1ng2';
/* Verify HashJoin */
set enable_hashjoin=on;
set enable_mergejoin=off;
set enable_nestloop=off;
set expected_computing_nodegroup = 'group1';
explain (costs off) select * from t1ng1 as t1, t1ng2 as t2 where t1.c2 = t2.c2;
select * from t1ng1 as t1, t1ng2 as t2 where t1.c2 = t2.c2 order by 1,2,3,4 limit 5;
-- also verify distribution-key
explain (costs off) select * from t1ng1 as t1, t1ng2 as t2 where t1.c1 = t2.c1;
select * from t1ng1 as t1, t1ng2 as t2 where t1.c2 = t2.c1 order by 1,2,3,4 limit 5;
set expected_computing_nodegroup = 'ng1';
explain (costs off) select * from t1ng1 as t1, t1ng2 as t2 where t1.c2 = t2.c2;
select * from t1ng1 as t1, t1ng2 as t2 where t1.c2 = t2.c2 order by 1,2,3,4 limit 5;
-- also verify distribution-key
explain (costs off) select * from t1ng1 as t1, t1ng2 as t2 where t1.c1 = t2.c1;
select * from t1ng1 as t1, t1ng2 as t2 where t1.c2 = t2.c1 order by 1,2,3,4 limit 5;
set expected_computing_nodegroup = 'ng2';
explain (costs off) select * from t1ng1 as t1, t1ng2 as t2 where t1.c2 = t2.c2;
select * from t1ng1 as t1, t1ng2 as t2 where t1.c2 = t2.c2 order by 1,2,3,4 limit 5;
-- also verify distribution-key
explain (costs off) select * from t1ng1 as t1, t1ng2 as t2 where t1.c1 = t2.c1;
select * from t1ng1 as t1, t1ng2 as t2 where t1.c2 = t2.c1 order by 1,2,3,4 limit 5;
set expected_computing_nodegroup = 'ng3';
explain (costs off) select * from t1ng1 as t1, t1ng2 as t2 where t1.c2 = t2.c2;
select * from t1ng1 as t1, t1ng2 as t2 where t1.c2 = t2.c2 order by 1,2,3,4 limit 5;
-- also verify distribution-key
explain (costs off) select * from t1ng1 as t1, t1ng2 as t2 where t1.c1 = t2.c1;
select * from t1ng1 as t1, t1ng2 as t2 where t1.c2 = t2.c1 order by 1,2,3,4 limit 5;
/* Verify MergeJoin */
set enable_hashjoin=off;
set enable_mergejoin=on;
set enable_nestloop=off;
set expected_computing_nodegroup = 'group1';
explain (costs off) select * from t1ng1 as t1, t1ng2 as t2 where t1.c2 = t2.c2;
select * from t1ng1 as t1, t1ng2 as t2 where t1.c2 = t2.c2 order by 1,2,3,4 limit 5;
-- also verify distribution-key
explain (costs off) select * from t1ng1 as t1, t1ng2 as t2 where t1.c1 = t2.c1;
select * from t1ng1 as t1, t1ng2 as t2 where t1.c2 = t2.c1 order by 1,2,3,4 limit 5;
set expected_computing_nodegroup = 'ng1';
explain (costs off) select * from t1ng1 as t1, t1ng2 as t2 where t1.c2 = t2.c2;
select * from t1ng1 as t1, t1ng2 as t2 where t1.c2 = t2.c2 order by 1,2,3,4 limit 5;
-- also verify distribution-key
explain (costs off) select * from t1ng1 as t1, t1ng2 as t2 where t1.c1 = t2.c1;
select * from t1ng1 as t1, t1ng2 as t2 where t1.c2 = t2.c1 order by 1,2,3,4 limit 5;
set expected_computing_nodegroup = 'ng2';
explain (costs off) select * from t1ng1 as t1, t1ng2 as t2 where t1.c2 = t2.c2;
select * from t1ng1 as t1, t1ng2 as t2 where t1.c2 = t2.c2 order by 1,2,3,4 limit 5;
-- also verify distribution-key
explain (costs off) select * from t1ng1 as t1, t1ng2 as t2 where t1.c1 = t2.c1;
select * from t1ng1 as t1, t1ng2 as t2 where t1.c2 = t2.c1 order by 1,2,3,4 limit 5;
set expected_computing_nodegroup = 'ng3';
explain (costs off) select * from t1ng1 as t1, t1ng2 as t2 where t1.c2 = t2.c2;
select * from t1ng1 as t1, t1ng2 as t2 where t1.c2 = t2.c2 order by 1,2,3,4 limit 5;
-- also verify distribution-key
explain (costs off) select * from t1ng1 as t1, t1ng2 as t2 where t1.c1 = t2.c1;
select * from t1ng1 as t1, t1ng2 as t2 where t1.c2 = t2.c1 order by 1,2,3,4 limit 5;
/* Verify Nestloop */
set enable_hashjoin=off;
set enable_mergejoin=off;
set enable_nestloop=on;
set expected_computing_nodegroup = 'group1';
explain (costs off) select * from t1ng1 as t1, t1ng2 as t2 where t1.c2 = t2.c2;
select * from t1ng1 as t1, t1ng2 as t2 where t1.c2 = t2.c2 order by 1,2,3,4 limit 5;
-- also verify distribution-key
explain (costs off) select * from t1ng1 as t1, t1ng2 as t2 where t1.c1 = t2.c1;
select * from t1ng1 as t1, t1ng2 as t2 where t1.c2 = t2.c1 order by 1,2,3,4 limit 5;
set expected_computing_nodegroup = 'ng1';
explain (costs off) select * from t1ng1 as t1, t1ng2 as t2 where t1.c2 = t2.c2;
select * from t1ng1 as t1, t1ng2 as t2 where t1.c2 = t2.c2 order by 1,2,3,4 limit 5;
-- also verify distribution-key
explain (costs off) select * from t1ng1 as t1, t1ng2 as t2 where t1.c1 = t2.c1;
select * from t1ng1 as t1, t1ng2 as t2 where t1.c2 = t2.c1 order by 1,2,3,4 limit 5;
set expected_computing_nodegroup = 'ng2';
explain (costs off) select * from t1ng1 as t1, t1ng2 as t2 where t1.c2 = t2.c2;
select * from t1ng1 as t1, t1ng2 as t2 where t1.c2 = t2.c2 order by 1,2,3,4 limit 5;
-- also verify distribution-key
explain (costs off) select * from t1ng1 as t1, t1ng2 as t2 where t1.c1 = t2.c1;
select * from t1ng1 as t1, t1ng2 as t2 where t1.c2 = t2.c1 order by 1,2,3,4 limit 5;
set expected_computing_nodegroup = 'ng3';
explain (costs off) select * from t1ng1 as t1, t1ng2 as t2 where t1.c2 = t2.c2;
select * from t1ng1 as t1, t1ng2 as t2 where t1.c2 = t2.c2 order by 1,2,3,4 limit 5;
-- also verify distribution-key
explain (costs off) select * from t1ng1 as t1, t1ng2 as t2 where t1.c1 = t2.c1;
select * from t1ng1 as t1, t1ng2 as t2 where t1.c2 = t2.c1 order by 1,2,3,4 limit 5;
set expected_computing_nodegroup=optimal;
select c1, count(c2) from t1ng1 group by 1 order by 1,2;
drop table t1ng1;
drop table t1ng2;
/* Verify FORCE mode */
create table create_columnar_table_012 ( c_smallint smallint null,c_double_precision double precision,c_time_without_time_zone time without time zone null,c_time_with_time_zone time with time zone,c_integer integer default 23423,c_bigint bigint default 923423432,c_decimal decimal(19) default 923423423,c_real real,c_numeric numeric(18,12) null,c_varchar varchar(19),c_char char(57) null,c_timestamp_with_timezone timestamp with time zone,c_char2 char default '0',c_text text null,c_varchar2 varchar2(20),c_timestamp_without_timezone timestamp without time zone,c_date date,c_varchar22 varchar2(11621),c_numeric2 numeric null ) distribute by hash(c_date) to group ng1;
create index idx_smallint on create_columnar_table_012(c_smallint);
set enable_seqscan=off;
--AP function
explain (costs off) select c_smallint, c_integer from create_columnar_table_012 group by rollup(c_smallint,c_integer);
explain (costs off) select c_smallint, c_integer from create_columnar_table_012 group by cube(c_integer,c_smallint);
explain (costs off) select c_bigint, c_integer from create_columnar_table_012 group by GROUPING SETS(c_bigint,c_integer);
explain (costs off) select sum(c_bigint) from create_columnar_table_012 group by GROUPING SETS(());
--Group by
explain (costs off) select c_text, avg(c_integer) from create_columnar_table_012 group by c_text;
--Order by
explain (costs off) select c_bigint, c_integer from create_columnar_table_012 order by c_text;
--Window agg
explain (costs off) select c_smallint, c_integer, rank() OVER(PARTITION BY c_text ORDER BY c_date) from create_columnar_table_012;
explain (costs off) select c_smallint, c_integer, rank() OVER(ORDER BY c_date) from create_columnar_table_012;
explain (costs off) select c_smallint, c_integer, rank() OVER(PARTITION BY c_text ORDER BY c_date), row_number() OVER(PARTITION BY c_bigint ORDER BY c_text) from create_columnar_table_012;
explain (costs off) select rank() OVER(PARTITION BY c_date ORDER BY c_text) from create_columnar_table_012;
explain (costs off) select c_smallint, rank() OVER(PARTITION BY c_text ORDER BY c_date) from create_columnar_table_012 order by c_integer;
explain (costs off) select rank() OVER(PARTITION BY c_integer ORDER BY c_text) from create_columnar_table_012 group by c_text, c_integer;
--Limit/Offset
explain (costs off) select * from create_columnar_table_012 order by c_text limit 10;
explain (costs off) select * from create_columnar_table_012 order by c_text offset 10;
--Force mode
set expected_computing_nodegroup='ng2';
set enable_nodegroup_debug=on;
--AP function:y
explain (costs off) select c_smallint, c_integer from create_columnar_table_012 group by rollup(c_smallint,c_integer);
explain (costs off) select c_smallint, c_integer from create_columnar_table_012 group by cube(c_integer,c_smallint);
explain (costs off) select c_bigint, c_integer from create_columnar_table_012 group by GROUPING SETS(c_bigint,c_integer);
explain (costs off) select sum(c_bigint) from create_columnar_table_012 group by GROUPING SETS(());
--Group by:y
explain (costs off) select c_text, avg(c_integer) from create_columnar_table_012 group by c_text;
--Order by:y
explain (costs off) select c_bigint, c_integer from create_columnar_table_012 order by c_text;
--Window agg:y
explain (costs off) select c_smallint, c_integer, rank() OVER(PARTITION BY c_text ORDER BY c_date) from create_columnar_table_012;
explain (costs off) select c_smallint, c_integer, rank() OVER(ORDER BY c_date) from create_columnar_table_012;
explain (costs off) select c_smallint, c_integer, rank() OVER(PARTITION BY c_text ORDER BY c_date), row_number() OVER(PARTITION BY c_bigint ORDER BY c_text) from create_columnar_table_012;
explain (costs off) select rank() OVER(PARTITION BY c_date ORDER BY c_text) from create_columnar_table_012;
explain (costs off) select c_smallint, rank() OVER(PARTITION BY c_text ORDER BY c_date) from create_columnar_table_012 order by c_integer;
explain (costs off) select rank() OVER(PARTITION BY c_integer ORDER BY c_text) from create_columnar_table_012 group by c_text, c_integer;
--Limit/Offset:n
explain (costs off) select * from create_columnar_table_012 order by c_text limit 10;
explain (costs off) select * from create_columnar_table_012 order by c_text offset 10;
insert into create_columnar_table_012 (c_smallint, c_integer) values (1, 1), (1, 1);
explain (costs off) select rank() OVER(PARTITION BY c_integer ORDER BY c_text) from create_columnar_table_012;
select rank() OVER(PARTITION BY c_integer ORDER BY c_text) from create_columnar_table_012;
explain (costs off) select rank() OVER(ORDER BY c_text) from create_columnar_table_012;
select rank() OVER(ORDER BY c_text) from create_columnar_table_012;
explain (costs off) select rank() OVER(PARTITION BY sum(c_integer)) from create_columnar_table_012;
select rank() OVER(PARTITION BY sum(c_integer)) from create_columnar_table_012;
drop table create_columnar_table_012 cascade;
CREATE TABLE t1(a int);
INSERT INTO t1 VALUES (generate_series(1, 10));
CREATE INDEX idx ON t1(a);
SET enable_nodegroup_debug = on;
SET expected_computing_nodegroup = 'ng2';
SET enable_seqscan = off;
EXPLAIN (VERBOSE ON, COSTS OFF)SELECT * FROM t1 ORDER BY a;
/* Clean up */
reset expected_computing_nodegroup;
drop node group ng1;
drop node group ng2;
drop node group ng3;
drop schema nodegroup_multigroup_test cascade; | the_stack |
CREATE PROCEDURE CLEANUP_SESSION_DATA AS
BEGIN
-- ------------------------------------------
-- DECLARE VARIABLES
-- ------------------------------------------
DECLARE @deletedSessions INT;
DECLARE @deletedUserSessionMappings INT;
DECLARE @deletedOperationalUserSessionMappings INT;
DECLARE @deletedSessionAppInfo INT;
DECLARE @deletedOperationalSessionAppInfo INT;
DECLARE @deletedSessionMetadata INT;
DECLARE @deletedOperationalSessionMetadata INT;
DECLARE @deletedStoreOperations INT;
DECLARE @deletedDeleteOperations INT;
DECLARE @sessionCleanupCount INT;
DECLARE @sessionMappingsCleanupCount INT;
DECLARE @operationalSessionMappingsCleanupCount INT;
DECLARE @sessionAppInfoCleanupCount INT;
DECLARE @operationalSessionAppInfoCleanupCount INT;
DECLARE @sessionMetadataCleanupCount INT;
DECLARE @operationalSessionMetadataCleanupCount INT;
DECLARE @operationCleanupCount INT;
DECLARE @tracingEnabled INT;
DECLARE @sleepTime AS VARCHAR(12);
DECLARE @batchSize INT;
DECLARE @chunkLimit INT;
DECLARE @sessionCleanUpTempTableCount INT;
DECLARE @operationCleanUpTempTableCount INT;
DECLARE @cleanUpCompleted INT;
DECLARE @autocommit INT;
DECLARE @sessionCleanupTime bigint;
DECLARE @operationCleanupTime bigint;
DECLARE @OLD_SQL_SAFE_UPDATES INT;
DECLARE @SQL_SAFE_UPDATES INT;
-- ------------------------------------------
-- CONFIGURABLE VARIABLES
-- ------------------------------------------
SET @batchSize = 5000;
-- This defines the number of entries from IDN_AUTH_SESSION_STORE that are taken into a SNAPSHOT
SET @chunkLimit=1000000;
SET @deletedSessions = 0;
SET @deletedUserSessionMappings = 0;
SET @deletedOperationalUserSessionMappings = 0;
SET @deletedSessionAppInfo = 0;
SET @deletedOperationalSessionAppInfo = 0;
SET @deletedSessionMetadata = 0;
SET @deletedOperationalSessionMetadata = 0;
SET @deletedStoreOperations = 0;
SET @deletedDeleteOperations = 0;
SET @sessionCleanupCount = 1;
SET @sessionMappingsCleanupCount = 1;
SET @operationalSessionMappingsCleanupCount = 1;
SET @sessionAppInfoCleanupCount = 1;
SET @operationalSessionAppInfoCleanupCount = 1;
SET @sessionMetadataCleanupCount = 1;
SET @operationalSessionMetadataCleanupCount = 1;
SET @operationCleanupCount = 1;
SET @tracingEnabled = 1; -- SET IF TRACE LOGGING IS ENABLED [DEFAULT : FALSE]
SET @sleepTime = '00:00:02.000'; -- Sleep time in seconds.
SET @autocommit = 0;
SET @sessionCleanUpTempTableCount = 1;
SET @operationCleanUpTempTableCount = 1;
SET @cleanUpCompleted = 1;
-- Session data older than 20160 minutes(14 days) will be removed.
SET @sessionCleanupTime = cast((DATEDIFF_BIG(millisecond, '1970-01-01 00:00:00', GETUTCDATE()) - (1209600000))AS DECIMAL) * 1000000
-- Operational data older than 720 minutes(12 h) will be removed.
SET @operationCleanupTime = cast((DATEDIFF_BIG(millisecond, '1970-01-01 00:00:00', GETUTCDATE()) - (720*60000))AS DECIMAL) * 1000000
SET @SQL_SAFE_UPDATES = 0;
SET @OLD_SQL_SAFE_UPDATES=@SQL_SAFE_UPDATES;
-- ------------------------------------------
-- REMOVE SESSION DATA
-- ------------------------------------------
SELECT 'CLEANUP_SESSION_DATA() STARTED .... !' AS 'INFO LOG',GETUTCDATE() AS 'STARTING TIMESTAMP';
-- CLEANUP ANY EXISTING TEMP TABLES
DROP TABLE IF EXISTS IDN_AUTH_SESSION_STORE_TMP;
DROP TABLE IF EXISTS TEMP_SESSION_BATCH;
-- RUN UNTILL
WHILE (@sessionCleanUpTempTableCount > 0)
BEGIN
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[IDN_AUTH_SESSION_STORE_TMP]') AND TYPE IN (N'U'))
BEGIN
CREATE TABLE IDN_AUTH_SESSION_STORE_TMP( SESSION_ID VARCHAR (100));
INSERT INTO IDN_AUTH_SESSION_STORE_TMP (SESSION_ID) SELECT TOP (@chunkLimit) SESSION_ID FROM IDN_AUTH_SESSION_STORE where TIME_CREATED < @sessionCleanupTime;
CREATE INDEX idn_auth_session_tmp_idx on IDN_AUTH_SESSION_STORE_TMP (SESSION_ID)
END
SELECT @sessionCleanUpTempTableCount = COUNT(1) FROM IDN_AUTH_SESSION_STORE_TMP;
SELECT 'TEMPORARY SESSION CLEANUP TASK SNAPSHOT TABLE CREATED...!!' AS 'INFO LOG', @sessionCleanUpTempTableCount;
SET @sessionCleanupCount = 1;
WHILE (@sessionCleanupCount > 0)
BEGIN
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[TEMP_SESSION_BATCH]') AND TYPE IN (N'U'))
BEGIN
CREATE TABLE TEMP_SESSION_BATCH( SESSION_ID VARCHAR (100));
INSERT INTO TEMP_SESSION_BATCH (SESSION_ID) SELECT TOP (@batchSize) SESSION_ID FROM IDN_AUTH_SESSION_STORE_TMP;
END
DELETE A
FROM IDN_AUTH_SESSION_STORE AS A
INNER JOIN TEMP_SESSION_BATCH AS B ON A.SESSION_ID = B.SESSION_ID;
SET @sessionCleanupCount = @@ROWCOUNT;
SELECT 'DELETED SESSION COUNT...!!' AS 'INFO LOG', @sessionCleanupCount;
-- Deleting user-session mappings from 'IDN_AUTH_USER_SESSION_MAPPING' table
IF (EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'IDN_AUTH_USER_SESSION_MAPPING'))
BEGIN
DELETE A
FROM IDN_AUTH_USER_SESSION_MAPPING AS A
INNER JOIN TEMP_SESSION_BATCH AS B ON A.SESSION_ID = B.SESSION_ID;
SET @sessionMappingsCleanupCount = @@ROWCOUNT;
SELECT 'DELETED USER-SESSION MAPPINGS ...!!' AS 'INFO LOG', @sessionMappingsCleanupCount;
IF (@tracingEnabled=1)
BEGIN
SET @deletedUserSessionMappings = @deletedUserSessionMappings + @sessionMappingsCleanupCount;
SELECT 'REMOVED USER-SESSION MAPPINGS: ' AS 'INFO LOG', @deletedUserSessionMappings AS 'NO OF DELETED ENTRIES', GETUTCDATE() AS 'TIMESTAMP';
END;
END
-- Deleting session app info from 'IDN_AUTH_SESSION_APP_INFO' table
IF (EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'IDN_AUTH_SESSION_APP_INFO'))
BEGIN
DELETE A
FROM IDN_AUTH_SESSION_APP_INFO AS A
INNER JOIN TEMP_SESSION_BATCH AS B ON A.SESSION_ID = B.SESSION_ID;
SET @sessionAppInfoCleanupCount = @@ROWCOUNT;
SELECT 'DELETED SESSION APP INFO ...!!' AS 'INFO LOG', @sessionAppInfoCleanupCount;
IF (@tracingEnabled=1)
BEGIN
SET @deletedSessionAppInfo = @deletedSessionAppInfo + @sessionAppInfoCleanupCount;
SELECT 'REMOVED SESSION APP INFO: ' AS 'INFO LOG', @deletedSessionAppInfo AS 'NO OF DELETED ENTRIES', GETUTCDATE() AS 'TIMESTAMP';
END;
END
-- Deleting session metadata from 'IDN_AUTH_SESSION_META_DATA' table
IF (EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'IDN_AUTH_SESSION_META_DATA'))
BEGIN
DELETE A
FROM IDN_AUTH_SESSION_META_DATA AS A
INNER JOIN TEMP_SESSION_BATCH AS B ON A.SESSION_ID = B.SESSION_ID;
SET @sessionMetadataCleanupCount = @@ROWCOUNT;
SELECT 'DELETED SESSION METADATA ...!!' AS 'INFO LOG', @sessionMetadataCleanupCount;
IF (@tracingEnabled=1)
BEGIN
SET @deletedSessionMetadata = @deletedSessionMetadata + @sessionMetadataCleanupCount;
SELECT 'REMOVED SESSION METADATA: ' AS 'INFO LOG', @deletedSessionMetadata AS 'NO OF DELETED ENTRIES', GETUTCDATE() AS 'TIMESTAMP';
END;
END
DELETE A
FROM IDN_AUTH_SESSION_STORE_TMP AS A
INNER JOIN TEMP_SESSION_BATCH AS B
ON A.SESSION_ID = B.SESSION_ID;
SELECT 'END CLEANING UP IDS FROM TEMP SESSION DATA SNAPSHOT TABLE...!!' AS 'INFO LOG';
DROP TABLE TEMP_SESSION_BATCH;
IF (@tracingEnabled=1)
BEGIN
SET @deletedSessions = @deletedSessions + @sessionCleanupCount;
SELECT 'REMOVED SESSIONS: ' AS 'INFO LOG', @deletedSessions AS 'NO OF DELETED ENTRIES', GETUTCDATE() AS 'TIMESTAMP';
END;
END;
-- Sleep for some time letting other threads to run.
WAITFOR DELAY @sleepTime;
END;
-- DROP THE CHUNK TO MOVE ON TO THE NEXT CHUNK IN THE SNAPSHOT TABLE.
DROP TABLE IF EXISTS IDN_AUTH_SESSION_STORE_TMP;
IF (@tracingEnabled=1)
BEGIN
SELECT 'SESSION RECORDS REMOVED FROM IDN_AUTH_SESSION_STORE: ' AS 'INFO LOG', @deletedSessions AS 'TOTAL NO OF DELETED ENTRIES', GETUTCDATE() AS 'COMPLETED_TIMESTAMP';
SELECT 'SESSION RECORDS REMOVED FROM IDN_AUTH_USER_SESSION_MAPPING: ' AS 'INFO LOG', @deletedUserSessionMappings AS 'TOTAL NO OF DELETED ENTRIES',GETUTCDATE() AS 'COMPLETED_TIMESTAMP';
SELECT 'SESSION RECORDS REMOVED FROM IDN_AUTH_SESSION_APP_INFO: ' AS 'INFO LOG', @deletedSessionAppInfo AS 'TOTAL NO OF DELETED ENTRIES',GETUTCDATE() AS 'COMPLETED_TIMESTAMP';
SELECT 'SESSION RECORDS REMOVED FROM IDN_AUTH_SESSION_META_DATA: ' AS 'INFO LOG', @deletedSessionMetadata AS 'TOTAL NO OF DELETED ENTRIES',GETUTCDATE() AS 'COMPLETED_TIMESTAMP';
END;
SELECT 'SESSION_CLEANUP_TASK ENDED .... !' AS 'INFO LOG';
-- --------------------------------------------
-- REMOVE OPERATIONAL DATA
-- --------------------------------------------
SELECT 'OPERATION_CLEANUP_TASK STARTED .... !' AS 'INFO LOG', GETUTCDATE() AS 'STARTING TIMESTAMP';
SELECT 'BATCH DELETE STARTED .... ' AS 'INFO LOG';
DROP TABLE IF EXISTS IDN_AUTH_SESSION_STORE_TMP;
DROP TABLE IF EXISTS TEMP_SESSION_BATCH;
-- RUN UNTILL
WHILE (@operationCleanUpTempTableCount > 0)
BEGIN
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[IDN_AUTH_SESSION_STORE_TMP]') AND TYPE IN (N'U'))
BEGIN
CREATE TABLE IDN_AUTH_SESSION_STORE_TMP( SESSION_ID VARCHAR (100), SESSION_TYPE VARCHAR(100));
INSERT INTO IDN_AUTH_SESSION_STORE_TMP (SESSION_ID,SESSION_TYPE) SELECT TOP (@chunkLimit) SESSION_ID,SESSION_TYPE FROM IDN_AUTH_SESSION_STORE WHERE OPERATION = 'DELETE' AND TIME_CREATED < @operationCleanupTime;
CREATE INDEX idn_auth_session_tmp_idx on IDN_AUTH_SESSION_STORE_TMP (SESSION_ID)
END
SELECT @operationCleanUpTempTableCount = COUNT(1) FROM IDN_AUTH_SESSION_STORE_TMP;
SELECT 'TEMPORARY SESSION CLEANUP TASK SNAPSHOT TABLE CREATED...!!' AS 'INFO LOG', @operationCleanUpTempTableCount;
SET @operationCleanupCount = 1;
WHILE (@operationCleanupCount > 0)
BEGIN
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[TEMP_SESSION_BATCH]') AND TYPE IN (N'U'))
BEGIN
CREATE TABLE TEMP_SESSION_BATCH( SESSION_ID VARCHAR (100),SESSION_TYPE VARCHAR(100));
INSERT INTO TEMP_SESSION_BATCH (SESSION_ID,SESSION_TYPE) SELECT TOP (@batchSize) SESSION_ID,SESSION_TYPE FROM IDN_AUTH_SESSION_STORE_TMP;
END
DELETE A
FROM IDN_AUTH_SESSION_STORE AS A
INNER JOIN TEMP_SESSION_BATCH AS B
ON A.SESSION_ID = B.SESSION_ID AND A.SESSION_TYPE = B.SESSION_TYPE;;
SET @operationCleanupCount = @@ROWCOUNT;
SELECT 'DELETED STORE OPERATIONS COUNT...!!' AS 'INFO LOG', @operationCleanupCount;
-- Deleting session app info from 'IDN_AUTH_USER_SESSION_MAPPING' table
IF (EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'IDN_AUTH_USER_SESSION_MAPPING'))
BEGIN
DELETE A
FROM IDN_AUTH_USER_SESSION_MAPPING AS A
INNER JOIN TEMP_SESSION_BATCH AS B ON A.SESSION_ID = B.SESSION_ID;
SET @operationalSessionMappingsCleanupCount = @@ROWCOUNT;
SELECT 'DELETED OPERATION RELATED USER-SESSION MAPPINGS ...!!' AS 'INFO LOG', @operationalSessionMappingsCleanupCount;
IF (@tracingEnabled=1)
BEGIN
SET @deletedOperationalUserSessionMappings = @operationalSessionMappingsCleanupCount + @deletedOperationalUserSessionMappings;
SELECT 'REMOVED USER-SESSION MAPPING RECORDS: ' AS 'INFO LOG', @deletedOperationalUserSessionMappings AS 'NO OF DELETED STORE ENTRIES', GETUTCDATE() AS 'TIMESTAMP';
END;
END
-- Deleting session app info from 'IDN_AUTH_SESSION_APP_INFO' table
IF (EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'IDN_AUTH_SESSION_APP_INFO'))
BEGIN
DELETE A
FROM IDN_AUTH_SESSION_APP_INFO AS A
INNER JOIN TEMP_SESSION_BATCH AS B ON A.SESSION_ID = B.SESSION_ID;
SET @operationalSessionAppInfoCleanupCount = @@ROWCOUNT;
SELECT 'DELETED SESSION APP INFO ...!!' AS 'INFO LOG', @operationalSessionAppInfoCleanupCount;
IF (@tracingEnabled=1)
BEGIN
SET @deletedOperationalSessionAppInfo = @operationalSessionAppInfoCleanupCount + @deletedOperationalSessionAppInfo;
SELECT 'REMOVED SESSION APP INFO RECORDS: ' AS 'INFO LOG', @deletedOperationalSessionAppInfo AS 'NO OF DELETED STORE ENTRIES', GETUTCDATE() AS 'TIMESTAMP';
END;
END
-- Deleting session metadata from 'IDN_AUTH_SESSION_META_DATA' table
IF (EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'IDN_AUTH_SESSION_META_DATA'))
BEGIN
DELETE A
FROM IDN_AUTH_SESSION_META_DATA AS A
INNER JOIN TEMP_SESSION_BATCH AS B ON A.SESSION_ID = B.SESSION_ID;
SET @operationalSessionMetadataCleanupCount = @@ROWCOUNT;
SELECT 'DELETED SESSION METADATA ...!!' AS 'INFO LOG', @operationalSessionMetadataCleanupCount;
IF (@tracingEnabled=1)
BEGIN
SET @deletedOperationalSessionMetadata = @operationalSessionMetadataCleanupCount + @deletedOperationalSessionMetadata;
SELECT 'REMOVED SESSION METADATA RECORDS: ' AS 'INFO LOG', @deletedOperationalSessionMetadata AS 'NO OF DELETED STORE ENTRIES', GETUTCDATE() AS 'TIMESTAMP';
END;
END
IF (@tracingEnabled=1)
BEGIN
SET @deletedDeleteOperations = @operationCleanupCount + @deletedDeleteOperations;
SELECT 'REMOVED DELETE OPERATION RECORDS: ' AS 'INFO LOG', @deletedDeleteOperations AS 'NO OF DELETED DELETE ENTRIES', GETUTCDATE() AS 'TIMESTAMP';
END;
DELETE A
FROM IDN_AUTH_SESSION_STORE_TMP AS A
INNER JOIN TEMP_SESSION_BATCH AS B
ON A.SESSION_ID = B.SESSION_ID AND A.SESSION_TYPE = B.SESSION_TYPE;;
SELECT 'ENDED CLEANING UP IDS FROM TEMP OPERATIONAL DATA SNAPSHOT TABLE...!!' AS 'INFO LOG';
IF (@tracingEnabled=1)
BEGIN
SET @deletedStoreOperations = @operationCleanupCount + @deletedStoreOperations;
SELECT 'REMOVED STORE OPERATION RECORDS: ' AS 'INFO LOG', @deletedStoreOperations AS 'NO OF DELETED STORE ENTRIES', GETUTCDATE() AS 'TIMESTAMP';
END;
DROP TABLE TEMP_SESSION_BATCH;
END;
-- Sleep for some time letting other threads to run.
WAITFOR DELAY @sleepTime;
END;
DROP TABLE IF EXISTS IDN_AUTH_SESSION_STORE_TMP;
SELECT 'FLAG SET TO INDICATE END OF CLEAN UP TASK...!!' AS 'INFO LOG';
IF (@tracingEnabled=1)
BEGIN
SELECT 'STORE OPERATION RECORDS REMOVED FROM IDN_AUTH_SESSION_STORE: ' AS 'INFO LOG', @deletedStoreOperations AS 'TOTAL NO OF DELETED STORE ENTRIES', GETUTCDATE() AS 'COMPLETED_TIMESTAMP';
SELECT 'DELETE OPERATION RECORDS REMOVED FROM IDN_AUTH_SESSION_STORE: ' AS 'INFO LOG', @deletedDeleteOperations AS 'TOTAL NO OF DELETED DELETE ENTRIES', GETUTCDATE() AS 'COMPLETED_TIMESTAMP';
SELECT 'DELETE OPERATION RELATED SESSION RECORDS REMOVED FROM IDN_AUTH_USER_SESSION_MAPPING: ' AS 'INFO LOG', @deletedOperationalUserSessionMappings AS 'TOTAL NO OF DELETED DELETE ENTRIES', GETUTCDATE() AS 'COMPLETED_TIMESTAMP';
SELECT 'DELETE OPERATION RELATED SESSION RECORDS REMOVED FROM IDN_AUTH_SESSION_APP_INFO: ' AS 'INFO LOG', @deletedOperationalSessionAppInfo AS 'TOTAL NO OF DELETED DELETE ENTRIES', GETUTCDATE() AS 'COMPLETED_TIMESTAMP';
SELECT 'DELETE OPERATION RELATED SESSION RECORDS REMOVED FROM IDN_AUTH_SESSION_META_DATA: ' AS 'INFO LOG', @deletedOperationalSessionMetadata AS 'TOTAL NO OF DELETED DELETE ENTRIES', GETUTCDATE() AS 'COMPLETED_TIMESTAMP';
END;
SET @SQL_SAFE_UPDATES = @OLD_SQL_SAFE_UPDATES;
SELECT 'CLEANUP_SESSION_DATA() ENDED .... !' AS 'INFO LOG',GETUTCDATE() AS 'ENDING TIMESTAMP';
END; | the_stack |
-- -----------------------------------------------------
-- Table `notes`
-- -----------------------------------------------------
CREATE TABLE `notes` (
`notes1` TEXT NULL,
`notes2` TEXT NOT NULL,
`notes3` TEXT NULL,
`notes4` TEXT NOT NULL);
-- -----------------------------------------------------
-- Table `item`
-- -----------------------------------------------------
CREATE TABLE `item` (
`name` VARCHAR(45) NOT NULL,
`description` TEXT NULL,
`image` VARCHAR(255) NULL);
-- -----------------------------------------------------
-- Table `user`
-- -----------------------------------------------------
CREATE TABLE `user` (
`firstname` VARCHAR(45) NOT NULL,
`lastname` VARCHAR(45) NULL,
`created_at` DATETIME NOT NULL,
`updated_at` DATETIME NOT NULL);
-- -----------------------------------------------------
-- Table `purchase`
-- -----------------------------------------------------
CREATE TABLE `purchase` (
`item_id` INT NOT NULL,
`user_id` INT NULL,
`cache` DECIMAL(6,2) NOT NULL,
`date` DATE NULL,
`deleted` TINYINT(1) NULL,
`deleted_at` DATETIME NULL,
CONSTRAINT `fk_purchase_item`
FOREIGN KEY (`item_id`)
REFERENCES `item` (`rowid`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_purchase_user1`
FOREIGN KEY (`user_id`)
REFERENCES `user` (`rowid`)
ON DELETE NO ACTION
ON UPDATE NO ACTION);
-- -----------------------------------------------------
-- Table `recipe`
-- -----------------------------------------------------
CREATE TABLE `recipe` (
`name` VARCHAR(45) NOT NULL);
-- -----------------------------------------------------
-- Table `recipe_type`
-- -----------------------------------------------------
CREATE TABLE `recipe_type` (
`title` VARCHAR(45) NOT NULL);
-- -----------------------------------------------------
-- Table `recipe_method`
-- -----------------------------------------------------
CREATE TABLE `recipe_method` (
`title` VARCHAR(45) NOT NULL);
-- -----------------------------------------------------
-- Table `recipe_has_recipe_types`
-- -----------------------------------------------------
CREATE TABLE `recipe_has_recipe_types` (
`recipe_id` INT NOT NULL,
`recipe_type_id` INT NOT NULL,
CONSTRAINT `fk_recipe_has_recipe_type_recipe1`
FOREIGN KEY (`recipe_id`)
REFERENCES `recipe` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_recipe_has_recipe_type_recipe_type1`
FOREIGN KEY (`recipe_type_id`)
REFERENCES `recipe_type` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION);
-- -----------------------------------------------------
-- Table `recipe_has_recipe_methods`
-- -----------------------------------------------------
CREATE TABLE `recipe_has_recipe_methods` (
`recipe_id` INT NOT NULL,
`recipe_method_id` INT NOT NULL,
CONSTRAINT `fk_recipe_has_recipe_methods_recipe1`
FOREIGN KEY (`recipe_id`)
REFERENCES `recipe` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_recipe_has_recipe_methods_recipe_method1`
FOREIGN KEY (`recipe_method_id`)
REFERENCES `recipe_method` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION);
-- -----------------------------------------------------
-- Table `address`
-- -----------------------------------------------------
CREATE TABLE `address` (
`user_id` INT NOT NULL,
`street` VARCHAR(45) NOT NULL,
CONSTRAINT `fk_address_user1`
FOREIGN KEY (`user_id`)
REFERENCES `user` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION);
-- -----------------------------------------------------
-- Table `phone`
-- -----------------------------------------------------
CREATE TABLE `phone` (
`user_id` INT NOT NULL,
`mobile` VARCHAR(45) NOT NULL,
CONSTRAINT `fk_phone_user1`
FOREIGN KEY (`user_id`)
REFERENCES `user` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION);
-- -----------------------------------------------------
-- Table `car`
-- -----------------------------------------------------
CREATE TABLE `car` (
`model` VARCHAR(45) NOT NULL);
-- -----------------------------------------------------
-- Table `repair`
-- -----------------------------------------------------
CREATE TABLE `repair` (
`car_id` INT NOT NULL,
`date` DATE NOT NULL,
CONSTRAINT `fk_repair_car1`
FOREIGN KEY (`car_id`)
REFERENCES `car` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION);
-- -----------------------------------------------------
-- Table `driver`
-- -----------------------------------------------------
CREATE TABLE `driver` (
`car_id` INT NOT NULL,
`name` VARCHAR(45) NOT NULL,
CONSTRAINT `fk_driver_car1`
FOREIGN KEY (`car_id`)
REFERENCES `car` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION);
-- -----------------------------------------------------
-- Table `controls_otm_single`
-- -----------------------------------------------------
CREATE TABLE `controls_otm_single` (
`name` VARCHAR(45) NOT NULL);
-- -----------------------------------------------------
-- Table `controls_otm_multiple`
-- -----------------------------------------------------
CREATE TABLE `controls_otm_multiple` (
`first` VARCHAR(45) NOT NULL,
`last` VARCHAR(45) NULL);
-- -----------------------------------------------------
-- Table `controls`
-- -----------------------------------------------------
CREATE TABLE `controls` (
`controls_otm_single_id` INT NULL,
`controls_otm_multiple_id` INT NULL,
`static` VARCHAR(45) NULL,
`text` VARCHAR(45) NULL,
`boolean` TINYINT(1) NULL,
`bigint` BIGINT NULL,
`double` DOUBLE NULL,
`upload` VARCHAR(45) NULL,
`binary` BLOB NULL,
`date` DATE NULL,
`time` TIME NULL,
`datetime` DATETIME NULL,
`year` YEAR NULL,
`textarea` TEXT NULL,
CONSTRAINT `fk_controls_controls_otm_single1`
FOREIGN KEY (`controls_otm_single_id`)
REFERENCES `controls_otm_single` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_controls_controls_otm_multiple1`
FOREIGN KEY (`controls_otm_multiple_id`)
REFERENCES `controls_otm_multiple` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION);
-- -----------------------------------------------------
-- Table `controls_mtm_single`
-- -----------------------------------------------------
CREATE TABLE `controls_mtm_single` (
`name` VARCHAR(45) NOT NULL);
-- -----------------------------------------------------
-- Table `controls_mtm_multiple`
-- -----------------------------------------------------
CREATE TABLE `controls_mtm_multiple` (
`first` VARCHAR(45) NOT NULL,
`last` VARCHAR(45) NULL);
-- -----------------------------------------------------
-- Table `controls_has_controls_mtm_single`
-- -----------------------------------------------------
CREATE TABLE `controls_has_controls_mtm_single` (
`controls_id` INT NOT NULL,
`controls_mtm_single_id` INT NOT NULL,
CONSTRAINT `fk_controls_has_controls_mtm_single_controls1`
FOREIGN KEY (`controls_id`)
REFERENCES `controls` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_controls_has_controls_mtm_single_controls_mtm_single1`
FOREIGN KEY (`controls_mtm_single_id`)
REFERENCES `controls_mtm_single` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION);
-- -----------------------------------------------------
-- Table `controls_has_controls_mtm_multiple`
-- -----------------------------------------------------
CREATE TABLE `controls_has_controls_mtm_multiple` (
`controls_id` INT NOT NULL,
`controls_mtm_multiple_id` INT NOT NULL,
CONSTRAINT `fk_controls_has_controls_mtm_multiple_controls1`
FOREIGN KEY (`controls_id`)
REFERENCES `controls` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_controls_has_controls_mtm_multiple_controls_mtm_multiple1`
FOREIGN KEY (`controls_mtm_multiple_id`)
REFERENCES `controls_mtm_multiple` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION);
-- -----------------------------------------------------
-- Table `controls_inline_otm_single`
-- -----------------------------------------------------
CREATE TABLE `controls_inline_otm_single` (
`name` VARCHAR(45) NOT NULL);
-- -----------------------------------------------------
-- Table `controls_inline_otm_multiple`
-- -----------------------------------------------------
CREATE TABLE `controls_inline_otm_multiple` (
`first` VARCHAR(45) NOT NULL,
`last` VARCHAR(45) NULL);
-- -----------------------------------------------------
-- Table `controls_inline`
-- -----------------------------------------------------
CREATE TABLE `controls_inline` (
`controls_id` INT NOT NULL,
`controls_inline_otm_single_id` INT NOT NULL,
`controls_inline_otm_multiple_id` INT NOT NULL,
`static` VARCHAR(45) NOT NULL,
`text` VARCHAR(45) NOT NULL,
`boolean` TINYINT(1) NOT NULL,
`bigint` BIGINT NOT NULL,
`double` DOUBLE NOT NULL,
`upload` VARCHAR(45) NOT NULL,
`binary` BLOB NOT NULL,
`date` DATE NOT NULL,
`time` TIME NOT NULL,
`datetime` DATETIME NOT NULL,
`year` YEAR NOT NULL,
`textarea` TEXT NOT NULL,
CONSTRAINT `fk_controls_inline_controls_inline_otm_single1`
FOREIGN KEY (`controls_inline_otm_single_id`)
REFERENCES `controls_inline_otm_single` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_controls_inline_controls_inline_otm_multiple1`
FOREIGN KEY (`controls_inline_otm_multiple_id`)
REFERENCES `controls_inline_otm_multiple` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_controls_inline_controls1`
FOREIGN KEY (`controls_id`)
REFERENCES `controls` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION);
-- -----------------------------------------------------
-- Table `controls_inline_mtm_single`
-- -----------------------------------------------------
CREATE TABLE `controls_inline_mtm_single` (
`name` VARCHAR(45) NOT NULL);
-- -----------------------------------------------------
-- Table `controls_inline_mtm_multiple`
-- -----------------------------------------------------
CREATE TABLE `controls_inline_mtm_multiple` (
`first` VARCHAR(45) NOT NULL,
`last` VARCHAR(45) NULL);
-- -----------------------------------------------------
-- Table `controls_inline_has_controls_inline_mtm_single`
-- -----------------------------------------------------
CREATE TABLE `controls_inline_has_controls_inline_mtm_single` (
`controls_inline_id` INT NOT NULL,
`controls_inline_mtm_single_id` INT NOT NULL,
CONSTRAINT `fk_controls_inline_has_controls_inline_mtm_single_controls_in1`
FOREIGN KEY (`controls_inline_id`)
REFERENCES `controls_inline` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_controls_inline_has_controls_inline_mtm_single_controls_in2`
FOREIGN KEY (`controls_inline_mtm_single_id`)
REFERENCES `controls_inline_mtm_single` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION);
-- -----------------------------------------------------
-- Table `controls_inline_has_controls_inline_mtm_multiple`
-- -----------------------------------------------------
CREATE TABLE `controls_inline_has_controls_inline_mtm_multiple` (
`controls_inline_id` INT NOT NULL,
`controls_inline_mtm_multiple_id` INT NOT NULL,
CONSTRAINT `fk_controls_inline_has_controls_inline_mtm_multiple_controls_1`
FOREIGN KEY (`controls_inline_id`)
REFERENCES `controls_inline` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_controls_inline_has_controls_inline_mtm_multiple_controls_2`
FOREIGN KEY (`controls_inline_mtm_multiple_id`)
REFERENCES `controls_inline_mtm_multiple` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION); | the_stack |
IF OBJECT_ID('dbo.Metaphone','FN') IS NOT NULL --drop any existing metaphone function
DROP FUNCTION dbo.Metaphone
go
CREATE FUNCTION dbo.Metaphone
/**
summary: >
The Metaphone phonetic algorithm was devised by Lawrence Philips in 1990.
It reduces words to their basic sounds, but produces a more accurate encoding,
than Soundex for matching words that sound similar.
Metaphone is a built-in operator in a number of systems such as PHP but there
seemed to be no available SQL Version until I wrote this. It is merely
a reverse engineering of the original published algorithm but tweaked to ensure
that it gave the same result as the PHP version.
Author: Phil Factor
Revision: 1.0
date: 21 Jan 2017
example: >
Select dbo.Metaphone ('opportunities')
--OPRTNTS
Parameters:
-- @String (a word -all punctuation will be stripped out)
A string representing the Metaphone equivalent of the word.
**/
(
@String VARCHAR(30)
)
RETURNS VARCHAR(10)
AS
BEGIN
DECLARE @New BIT, @ii INT, @Metaphone VARCHAR(28), @Len INT, @where INT;
DECLARE @This CHAR, @Next CHAR, @Following CHAR, @Previous CHAR, @silent BIT;
SELECT @String = UPPER(LTRIM(COALESCE(@String, ''))); --trim and upper case
SELECT @where= PATINDEX ('%[^A-Z]%',@String COLLATE Latin1_General_CI_AI )
WHILE @where>0 --strip out all non-alphabetic characters!(Edited. Thanks Ros Presser)
BEGIN
SELECT @String=STUFF(@string,@where,1,'')
SELECT @where=PATINDEX ('%[^A-Z]%',@String COLLATE Latin1_General_CI_AI )
END
IF(LEN(@String) < 2) RETURN @String
--do the start of string stuff first.
--If the word begins with 'KN', 'GN', 'PN', 'AE', 'WR', drop the first letter.
-- "Aebersold", "Gnagy", "Knuth", "Pniewski", "Wright"
IF SUBSTRING(@String, 1, 2) IN ( 'KN', 'GN', 'PN', 'AE', 'WR' )
SELECT @String = STUFF(@String, 1, 1, '');
-- Beginning of word: "x" change to "s" as in "Deng Xiaopeng"
IF SUBSTRING(@String, 1, 1) = 'X'
SELECT @String = STUFF(@String, 1, 1, 'S');
-- Beginning of word: "wh-" change to "w" as in "Whatsoever"
IF @String LIKE 'WH%'
SELECT @String = STUFF(@String, 1, 1, 'W');
-- Set up for While loop
SELECT @Len = LEN(@String), @Metaphone = '', -- Initialize the main variable
@New = 1, -- this variable only used next 10 lines!!!
@ii = 1; --Position counter
--
WHILE((LEN(@Metaphone) <= 8) AND (@ii <= @Len))
BEGIN --SET up the 'pointers' for this loop-around }
SELECT @Previous =
CASE WHEN @ii > 1 THEN SUBSTRING(@String, @ii - 1, 1) ELSE '' END,
-- originally a nul terminated string }
@This = SUBSTRING(@String, @ii, 1),
@Next =
CASE WHEN @ii < @Len THEN SUBSTRING(@String, @ii + 1, 1) ELSE '' END,
@Following =
CASE WHEN((@ii + 1) < @Len) THEN SUBSTRING(@String, @ii + 2, 1) ELSE
'' END
-- 'CC' inside word
--SELECT @Previous,@this,@Next,@Following,@New,@ii,@Len,@Metaphone
/* Drop duplicate adjacent letters, except for C.*/
IF @This=@Previous AND @This<> 'C'
BEGIN
--we do nothing
SELECT @New=0
END
/*Drop all vowels unless it is the beginning.*/
ELSE IF @This IN ( 'A', 'E', 'I', 'O', 'U' )
BEGIN
IF @ii = 1 --vowel at the beginning
SELECT @Metaphone = @This;
/* B -> B unless at the end of word after "m", as in "dumb", "Comb" */
END;
ELSE IF @This = 'B' AND NOT ((@ii = @Len) AND (@Previous = 'M'))
BEGIN
SELECT @Metaphone = @Metaphone + 'B';
END;
-- -mb is silent
/*'C' transforms to 'X' if followed by 'IA' or 'H' (unless in latter case, it is part of '-SCH-',
in which case it transforms to 'K'). 'C' transforms to 'S' if followed by 'I', 'E', or 'Y'.
Otherwise, 'C' transforms to 'K'.*/
ELSE IF @This = 'C'
BEGIN -- -sce, i, y = silent
IF NOT (@Previous= 'S') AND (@Next IN ( 'H', 'E', 'I', 'Y' )) --front vowel set
BEGIN
IF(@Next = 'I') AND (@Following = 'A')
SELECT @Metaphone = @Metaphone + 'X'; -- -cia-
ELSE IF(@Next IN ( 'E', 'I', 'Y' ))
SELECT @Metaphone = @Metaphone + 'S'; -- -ce, i, y = 'S' }
ELSE IF(@Next = 'H') AND (@Previous = 'S')
SELECT @Metaphone = @Metaphone + 'K'; -- -sch- = 'K' }
ELSE IF(@Next = 'H')
BEGIN
IF(@ii = 1) AND ((@ii + 2) <= @Len)
AND NOT(@Following IN ( 'A', 'E', 'I', 'O', 'U' ))
SELECT @Metaphone = @Metaphone + 'K';
ELSE
SELECT @Metaphone = @Metaphone + 'X';
END
End
ELSE
SELECT @Metaphone = @Metaphone +CASE WHEN @Previous= 'S' THEN '' else 'K' end;
-- Else silent
END; -- Case C }
/*'D' transforms to 'J' if followed by 'GE', 'GY', or 'GI'. Otherwise, 'D'
transforms to 'T'.*/
ELSE IF @This = 'D'
BEGIN
SELECT @Metaphone = @Metaphone
+ CASE WHEN(@Next = 'G') AND (@Following IN ( 'E', 'I', 'Y' )) --front vowel set
THEN 'J' ELSE 'T' END;
END;
ELSE IF @This = 'G'
/*Drop 'G' if followed by 'H' and 'H' is not at the end or before a vowel. Drop 'G'
if followed by 'N' or 'NED' and is at the end.
'G' transforms to 'J' if before 'I', 'E', or 'Y', and it is not in 'GG'.
Otherwise, 'G' transforms to 'K'.*/
BEGIN
SELECT @silent =
CASE WHEN (@Next = 'H') AND (@Following IN ('A','E','I','O','U'))
AND (@ii > 1) AND (((@ii+1) = @Len) OR ((@Next = 'n') AND
(@Following = 'E') AND SUBSTRING(@String,@ii+3,1) = 'D') AND ((@ii+3) = @Len))
-- Terminal -gned
AND (@Previous = 'i') AND (@Next = 'n')
THEN 1
-- if not start and near -end or -gned.)
WHEN (@ii > 1) AND (@Previous = 'D')-- gnuw
AND (@Next IN ('E','I','Y')) --front vowel set
THEN 1 -- -dge, i, y
ELSE 0 END
IF NOT (@silent=1)
SELECT @Metaphone = @Metaphone
+ CASE WHEN (@Next IN ('E','I','Y')) --front vowel set
THEN 'J' ELSE 'K' END
END
/*Drop 'H' if after vowel and not before a vowel.
or the second char of "-ch-", "-sh-", "-ph-", "-th-", "-gh-"*/
ELSE IF @This = 'H'
BEGIN
IF NOT ( (@ii= @Len) OR (@Previous IN ( 'C', 'S', 'T', 'G' )))
AND (@Next IN ( 'A', 'E', 'I', 'O', 'U' ) )
SELECT @Metaphone = @Metaphone + 'H';
-- else silent (vowel follows) }
END;
ELSE IF @This IN --some get no substitution
( 'F', 'J', 'L', 'M', 'N', 'R' )
BEGIN
SELECT @Metaphone = @Metaphone + @This;
END;
/*'CK' transforms to 'K'.*/
ELSE IF @This = 'K'
BEGIN
IF(@Previous <> 'C')
SELECT @Metaphone = @Metaphone + 'K';
END;
/*'PH' transforms to 'F'.*/
ELSE IF @This = 'P'
BEGIN
IF(@Next = 'H') SELECT @Metaphone = @Metaphone + 'F', @ii = @ii + 1;
-- Skip the 'H'
ELSE
SELECT @Metaphone = @Metaphone + 'P';
END;
/*'Q' transforms to 'K'.*/
ELSE IF @This = 'Q'
BEGIN
SELECT @Metaphone = @Metaphone + 'K';
END;
/*'S' transforms to 'X' if followed by 'H', 'IO', or 'IA'.*/
ELSE IF @This = 'S'
BEGIN
SELECT @Metaphone = @Metaphone +
CASE
WHEN(@Next = 'H')
OR( (@ii> 1) AND (@Next = 'i')
AND (@Following IN ( 'O', 'A' ) )
)
THEN 'X' ELSE 'S' END;
END;
/*'T' transforms to 'X' if followed by 'IA' or 'IO'. 'TH' transforms
to '0'. Drop 'T' if followed by 'CH'.*/
ELSE IF @This = 'T'
BEGIN
SELECT @Metaphone = @Metaphone
+ CASE
WHEN(@ii = 1) AND (@Next = 'H') AND (@Following = 'O')
THEN 'T' -- Initial Tho- }
WHEN(@ii > 1) AND (@Next = 'i')
AND (@Following IN ( 'O', 'A' ))
THEN 'X'
WHEN(@Next = 'H') THEN '0'
WHEN NOT((@Next = 'C') AND (@Following = 'H'))
THEN 'T'
ELSE '' END;
-- -tch = silent }
END;
/*'V' transforms to 'F'.*/
ELSE IF @This = 'V'
BEGIN
SELECT @Metaphone = @Metaphone + 'F';
END;
/*'WH' transforms to 'W' if at the beginning. Drop 'W' if not followed by a vowel.*/
/*Drop 'Y' if not followed by a vowel.*/
ELSE IF @This IN ( 'W', 'Y' )
BEGIN
IF @Next IN ( 'A', 'E', 'I', 'O', 'U' )
SELECT @Metaphone = @Metaphone + @This;
--else silent
/*'X' transforms to 'S' if at the beginning. Otherwise, 'X' transforms to 'KS'.*/
END;
ELSE IF @This = 'X'
BEGIN
SELECT @Metaphone = @Metaphone + 'KS';
END;
/*'Z' transforms to 'S'.*/
ELSE IF @This = 'Z'
BEGIN
SELECT @Metaphone = @Metaphone + 'S';
END;
ELSE
RETURN 'error with '''+ @This+ '''';
-- end
SELECT @ii = @ii + 1;
END; -- While
return @Metaphone
END
GO
/*
Check against the PHP implementation*/
SELECT * FROM
(SELECT dbo.Metaphone ('craven') AS Attempt,'craven' AS original ,'KRFN' AS canonical
UNION ALL SELECT dbo.Metaphone ('platitudinous'),'platitudinous','PLTTTNS'
UNION ALL SELECT dbo.Metaphone ('woodcarvings'),'woodcarvings','WTKRFNKS'
UNION ALL SELECT dbo.Metaphone ('overlaid'),'overlaid','OFRLT'
UNION ALL SELECT dbo.Metaphone ('solitaries'),'solitaries','SLTRS'
UNION ALL SELECT dbo.Metaphone ('beatific'),'beatific', 'BTFK'
UNION ALL SELECT dbo.Metaphone ('plaza'),'plaza','PLS'
UNION ALL SELECT dbo.Metaphone ('paramilitary'),'paramilitary','PRMLTR'
UNION ALL SELECT dbo.Metaphone ('synod'),'synod','SNT'
UNION ALL SELECT dbo.Metaphone ('marinas'),'marinas','MRNS'
UNION ALL SELECT dbo.Metaphone ('hyperventilation'),'hyperventilation','PRFNTLXN'
UNION ALL SELECT dbo.Metaphone ('celebrant'),'celebrant','SLBRNT'
UNION ALL SELECT dbo.Metaphone ('pipsqueaks'),'pipsqueaks','PPSKKS'
UNION ALL SELECT dbo.Metaphone ('dazzles'),'dazzles', 'TSLS'
UNION ALL SELECT dbo.Metaphone ('bloodbaths'),'bloodbaths','BLTB0S'
UNION ALL SELECT dbo.Metaphone ('lotion'),'lotion','LXN'
UNION ALL SELECT dbo.Metaphone ('agreeable'),'agreeable','AKRBL'
UNION ALL SELECT dbo.Metaphone ('shariah'),'shariah','XR'
UNION ALL SELECT dbo.Metaphone ('direction'),'direction','TRKXN'
UNION ALL SELECT dbo.Metaphone ('constricts'),'constricts','KNSTRKTS'
UNION ALL SELECT dbo.Metaphone ('avowedly'),'avowedly','AFWTL'
UNION ALL SELECT dbo.Metaphone ('exorcisms'),'exorcisms','EKSRSSMS'
UNION ALL SELECT dbo.Metaphone ('starches'),'starches','STRXS'
UNION ALL SELECT dbo.Metaphone ('poses'),'poses','PSS'
UNION ALL SELECT dbo.Metaphone ('levies'),'levies','LFS'
UNION ALL SELECT dbo.Metaphone ('clicks'),'clicks','KLKS'
UNION ALL SELECT dbo.Metaphone ('minstrels'),'minstrels','MNSTRLS'
UNION ALL SELECT dbo.Metaphone ('propounding'),'propounding','PRPNTNK'
UNION ALL SELECT dbo.Metaphone ('opalescent'),'opalescent','OPLSNT'
UNION ALL SELECT dbo.Metaphone ('hotline'),'hotline','HTLN'
UNION ALL SELECT dbo.Metaphone ('soporifically'),'soporifically','SPRFKL'
UNION ALL SELECT dbo.Metaphone ('python'),'python','P0N'
UNION ALL SELECT dbo.Metaphone ('drab'),'drab','TRB'
UNION ALL SELECT dbo.Metaphone ('appraised'),'appraised','APRST'
UNION ALL SELECT dbo.Metaphone ('commotions'),'commotions','KMXNS'
UNION ALL SELECT dbo.Metaphone ('defeatists'),'defeatists','TFTSTS'
UNION ALL SELECT dbo.Metaphone ('dispensations'),'dispensations','TSPNSXNS'
UNION ALL SELECT dbo.Metaphone ('downfall'),'downfall','TNFL'
UNION ALL SELECT dbo.Metaphone ('naturalising'),'naturalising','NTRLSNK')k
WHERE attempt <> canonical
IF @@RowCount>0 RAISERROR( 'As you can see, there was a problem somewhere',16,1); | the_stack |
begin
if new.roomno != old.roomno then
update WSlot set roomno = new.roomno where roomno = old.roomno;
end if;
return new;
end;
begin
delete from WSlot where roomno = old.roomno;
return old;
end;
begin
if new.name != old.name then
update PSlot set pfname = new.name where pfname = old.name;
end if;
return new;
end;
begin
delete from PSlot where pfname = old.name;
return old;
end;
declare
pfrec record;
ps alias for new;
begin
select into pfrec * from PField where name = ps.pfname;
if not found then
raise exception $$Patchfield "%" does not exist$$, ps.pfname;
end if;
return ps;
end;
begin
if new.name != old.name then
update IFace set sysname = new.name where sysname = old.name;
end if;
return new;
end;
declare
sname text;
sysrec record;
begin
select into sysrec * from system where name = new.sysname;
if not found then
raise exception $q$system "%" does not exist$q$, new.sysname;
end if;
sname := 'IF.' || new.sysname;
sname := sname || '.';
sname := sname || new.ifname;
if length(sname) > 20 then
raise exception 'IFace slotname "%" too long (20 char max)', sname;
end if;
new.slotname := sname;
return new;
end;
declare
hname text;
dummy integer;
begin
if tg_op = 'INSERT' then
dummy := tg_hub_adjustslots(new.name, 0, new.nslots);
return new;
end if;
if tg_op = 'UPDATE' then
if new.name != old.name then
update HSlot set hubname = new.name where hubname = old.name;
end if;
dummy := tg_hub_adjustslots(new.name, old.nslots, new.nslots);
return new;
end if;
if tg_op = 'DELETE' then
dummy := tg_hub_adjustslots(old.name, old.nslots, 0);
return old;
end if;
end;
begin
if newnslots = oldnslots then
return 0;
end if;
if newnslots < oldnslots then
delete from HSlot where hubname = hname and slotno > newnslots;
return 0;
end if;
for i in oldnslots + 1 .. newnslots loop
insert into HSlot (slotname, hubname, slotno, slotlink)
values ('HS.dummy', hname, i, '');
end loop;
return 0;
end;
declare
sname text;
xname HSlot.slotname%TYPE;
hubrec record;
begin
select into hubrec * from Hub where name = new.hubname;
if not found then
raise exception 'no manual manipulation of HSlot';
end if;
if new.slotno < 1 or new.slotno > hubrec.nslots then
raise exception 'no manual manipulation of HSlot';
end if;
if tg_op = 'UPDATE' and new.hubname != old.hubname then
/* if count(*) > 0 from Hub where name = old.hubname then
raise exception 'no manual manipulation of HSlot';
end if;*/
end if;
sname := 'HS.' || trim(new.hubname);
sname := sname || '.';
sname := sname || new.slotno::text;
if length(sname) > 20 then
raise exception 'HSlot slotname "%" too long (20 char max)', sname;
end if;
new.slotname := sname;
return new;
end;
declare
hubrec record;
begin
select into hubrec * from Hub where name = old.hubname;
if not found then
return old;
end if;
if old.slotno > hubrec.nslots then
return old;
end if;
raise exception 'no manual manipulation of HSlot';
end;
begin
if substr(new.slotname, 1, 2) != tg_argv[0] then
raise exception 'slotname must begin with %', tg_argv[0];
end if;
return new;
end;
begin
if new.slotlink isnull then
new.slotlink := '';
end if;
return new;
end;
begin
if new.backlink isnull then
new.backlink := '';
end if;
return new;
end;
begin
if new.slotname != old.slotname then
delete from PSlot where slotname = old.slotname;
insert into PSlot (
slotname,
pfname,
slotlink,
backlink
) values (
new.slotname,
new.pfname,
new.slotlink,
new.backlink
);
return null;
end if;
return new;
end;
begin
if new.slotname != old.slotname then
delete from WSlot where slotname = old.slotname;
insert into WSlot (
slotname,
roomno,
slotlink,
backlink
) values (
new.slotname,
new.roomno,
new.slotlink,
new.backlink
);
return null;
end if;
return new;
end;
begin
if new.slotname != old.slotname then
delete from PLine where slotname = old.slotname;
insert into PLine (
slotname,
phonenumber,
comment,
backlink
) values (
new.slotname,
new.phonenumber,
new.comment,
new.backlink
);
return null;
end if;
return new;
end;
begin
if new.slotname != old.slotname then
delete from IFace where slotname = old.slotname;
insert into IFace (
slotname,
sysname,
ifname,
slotlink
) values (
new.slotname,
new.sysname,
new.ifname,
new.slotlink
);
return null;
end if;
return new;
end;
begin
if new.slotname != old.slotname or new.hubname != old.hubname then
delete from HSlot where slotname = old.slotname;
insert into HSlot (
slotname,
hubname,
slotno,
slotlink
) values (
new.slotname,
new.hubname,
new.slotno,
new.slotlink
);
return null;
end if;
return new;
end;
begin
if new.slotname != old.slotname then
delete from PHone where slotname = old.slotname;
insert into PHone (
slotname,
comment,
slotlink
) values (
new.slotname,
new.comment,
new.slotlink
);
return null;
end if;
return new;
end;
declare
dummy integer;
begin
if tg_op = 'INSERT' then
if new.backlink != '' then
dummy := tg_backlink_set(new.backlink, new.slotname);
end if;
return new;
end if;
if tg_op = 'UPDATE' then
if new.backlink != old.backlink then
if old.backlink != '' then
dummy := tg_backlink_unset(old.backlink, old.slotname);
end if;
if new.backlink != '' then
dummy := tg_backlink_set(new.backlink, new.slotname);
end if;
else
if new.slotname != old.slotname and new.backlink != '' then
dummy := tg_slotlink_set(new.backlink, new.slotname);
end if;
end if;
return new;
end if;
if tg_op = 'DELETE' then
if old.backlink != '' then
dummy := tg_backlink_unset(old.backlink, old.slotname);
end if;
return old;
end if;
end;
declare
mytype char(2);
link char(4);
rec record;
begin
mytype := substr(myname, 1, 2);
link := mytype || substr(blname, 1, 2);
if link = 'PLPL' then
raise exception
'backlink between two phone lines does not make sense';
end if;
if link in ('PLWS', 'WSPL') then
raise exception
'direct link of phone line to wall slot not permitted';
end if;
if mytype = 'PS' then
select into rec * from PSlot where slotname = myname;
if not found then
raise exception '% does not exist', myname;
end if;
if rec.backlink != blname then
update PSlot set backlink = blname where slotname = myname;
end if;
return 0;
end if;
if mytype = 'WS' then
select into rec * from WSlot where slotname = myname;
if not found then
raise exception '% does not exist', myname;
end if;
if rec.backlink != blname then
update WSlot set backlink = blname where slotname = myname;
end if;
return 0;
end if;
if mytype = 'PL' then
select into rec * from PLine where slotname = myname;
if not found then
raise exception '% does not exist', myname;
end if;
if rec.backlink != blname then
update PLine set backlink = blname where slotname = myname;
end if;
return 0;
end if;
raise exception 'illegal backlink beginning with %', mytype;
end;
declare
myname alias for $1;
blname alias for $2;
mytype char(2);
rec record;
begin
mytype := substr(myname, 1, 2);
if mytype = 'PS' then
select into rec * from PSlot where slotname = myname;
if not found then
return 0;
end if;
if rec.backlink = blname then
update PSlot set backlink = '' where slotname = myname;
end if;
return 0;
end if;
if mytype = 'WS' then
select into rec * from WSlot where slotname = myname;
if not found then
return 0;
end if;
if rec.backlink = blname then
update WSlot set backlink = '' where slotname = myname;
end if;
return 0;
end if;
if mytype = 'PL' then
select into rec * from PLine where slotname = myname;
if not found then
return 0;
end if;
if rec.backlink = blname then
update PLine set backlink = '' where slotname = myname;
end if;
return 0;
end if;
end;
declare
dummy integer;
begin
if tg_op = 'INSERT' then
if new.slotlink != '' then
dummy := tg_slotlink_set(new.slotlink, new.slotname);
end if;
return new;
end if;
if tg_op = 'UPDATE' then
if new.slotlink != old.slotlink then
if old.slotlink != '' then
dummy := tg_slotlink_unset(old.slotlink, old.slotname);
end if;
if new.slotlink != '' then
dummy := tg_slotlink_set(new.slotlink, new.slotname);
end if;
else
if new.slotname != old.slotname and new.slotlink != '' then
dummy := tg_slotlink_set(new.slotlink, new.slotname);
end if;
end if;
return new;
end if;
if tg_op = 'DELETE' then
if old.slotlink != '' then
dummy := tg_slotlink_unset(old.slotlink, old.slotname);
end if;
return old;
end if;
end;
declare
myname alias for $1;
blname alias for $2;
mytype char(2);
link char(4);
rec record;
begin
mytype := substr(myname, 1, 2);
link := mytype || substr(blname, 1, 2);
if link = 'PHPH' then
raise exception
'slotlink between two phones does not make sense';
end if;
if link in ('PHHS', 'HSPH') then
raise exception
'link of phone to hub does not make sense';
end if;
if link in ('PHIF', 'IFPH') then
raise exception
'link of phone to hub does not make sense';
end if;
if link in ('PSWS', 'WSPS') then
raise exception
'slotlink from patchslot to wallslot not permitted';
end if;
if mytype = 'PS' then
select into rec * from PSlot where slotname = myname;
if not found then
raise exception '% does not exist', myname;
end if;
if rec.slotlink != blname then
update PSlot set slotlink = blname where slotname = myname;
end if;
return 0;
end if;
if mytype = 'WS' then
select into rec * from WSlot where slotname = myname;
if not found then
raise exception '% does not exist', myname;
end if;
if rec.slotlink != blname then
update WSlot set slotlink = blname where slotname = myname;
end if;
return 0;
end if;
if mytype = 'IF' then
select into rec * from IFace where slotname = myname;
if not found then
raise exception '% does not exist', myname;
end if;
if rec.slotlink != blname then
update IFace set slotlink = blname where slotname = myname;
end if;
return 0;
end if;
if mytype = 'HS' then
select into rec * from HSlot where slotname = myname;
if not found then
raise exception '% does not exist', myname;
end if;
if rec.slotlink != blname then
update HSlot set slotlink = blname where slotname = myname;
end if;
return 0;
end if;
if mytype = 'PH' then
select into rec * from PHone where slotname = myname;
if not found then
raise exception '% does not exist', myname;
end if;
if rec.slotlink != blname then
update PHone set slotlink = blname where slotname = myname;
end if;
return 0;
end if;
raise exception 'illegal slotlink beginning with %', mytype;
end;
declare
myname alias for $1;
blname alias for $2;
mytype char(2);
rec record;
begin
mytype := substr(myname, 1, 2);
if mytype = 'PS' then
select into rec * from PSlot where slotname = myname;
if not found then
return 0;
end if;
if rec.slotlink = blname then
update PSlot set slotlink = '' where slotname = myname;
end if;
return 0;
end if;
if mytype = 'WS' then
select into rec * from WSlot where slotname = myname;
if not found then
return 0;
end if;
if rec.slotlink = blname then
update WSlot set slotlink = '' where slotname = myname;
end if;
return 0;
end if;
if mytype = 'IF' then
select into rec * from IFace where slotname = myname;
if not found then
return 0;
end if;
if rec.slotlink = blname then
update IFace set slotlink = '' where slotname = myname;
end if;
return 0;
end if;
if mytype = 'HS' then
select into rec * from HSlot where slotname = myname;
if not found then
return 0;
end if;
if rec.slotlink = blname then
update HSlot set slotlink = '' where slotname = myname;
end if;
return 0;
end if;
if mytype = 'PH' then
select into rec * from PHone where slotname = myname;
if not found then
return 0;
end if;
if rec.slotlink = blname then
update PHone set slotlink = '' where slotname = myname;
end if;
return 0;
end if;
end;
declare
rec record;
bltype char(2);
retval text;
begin
select into rec * from PSlot where slotname = $1;
if not found then
return '';
end if;
if rec.backlink = '' then
return '-';
end if;
bltype := substr(rec.backlink, 1, 2);
if bltype = 'PL' then
declare
rec record;
begin
select into rec * from PLine where slotname = "outer".rec.backlink;
retval := 'Phone line ' || trim(rec.phonenumber);
if rec.comment != '' then
retval := retval || ' (';
retval := retval || rec.comment;
retval := retval || ')';
end if;
return retval;
end;
end if;
if bltype = 'WS' then
select into rec * from WSlot where slotname = rec.backlink;
retval := trim(rec.slotname) || ' in room ';
retval := retval || trim(rec.roomno);
retval := retval || ' -> ';
return retval || wslot_slotlink_view(rec.slotname);
end if;
return rec.backlink;
end;
declare
psrec record;
sltype char(2);
retval text;
begin
select into psrec * from PSlot where slotname = $1;
if not found then
return '';
end if;
if psrec.slotlink = '' then
return '-';
end if;
sltype := substr(psrec.slotlink, 1, 2);
if sltype = 'PS' then
retval := trim(psrec.slotlink) || ' -> ';
return retval || pslot_backlink_view(psrec.slotlink);
end if;
if sltype = 'HS' then
retval := comment from Hub H, HSlot HS
where HS.slotname = psrec.slotlink
and H.name = HS.hubname;
retval := retval || ' slot ';
retval := retval || slotno::text from HSlot
where slotname = psrec.slotlink;
return retval;
end if;
return psrec.slotlink;
end;
declare
rec record;
sltype char(2);
retval text;
begin
select into rec * from WSlot where slotname = $1;
if not found then
return '';
end if;
if rec.slotlink = '' then
return '-';
end if;
sltype := substr(rec.slotlink, 1, 2);
if sltype = 'PH' then
select into rec * from PHone where slotname = rec.slotlink;
retval := 'Phone ' || trim(rec.slotname);
if rec.comment != '' then
retval := retval || ' (';
retval := retval || rec.comment;
retval := retval || ')';
end if;
return retval;
end if;
if sltype = 'IF' then
declare
syrow System%RowType;
ifrow IFace%ROWTYPE;
begin
select into ifrow * from IFace where slotname = rec.slotlink;
select into syrow * from System where name = ifrow.sysname;
retval := syrow.name || ' IF ';
retval := retval || ifrow.ifname;
if syrow.comment != '' then
retval := retval || ' (';
retval := retval || syrow.comment;
retval := retval || ')';
end if;
return retval;
end;
end if;
return rec.slotlink;
end;
DECLARE rslt text;
BEGIN
IF $1 <= 0 THEN
rslt = CAST($2 AS TEXT);
ELSE
rslt = CAST($1 AS TEXT) || ',' || recursion_test($1 - 1, $2);
END IF;
RETURN rslt;
END;
declare
begin
insert into found_test_tbl values (1);
if FOUND then
insert into found_test_tbl values (2);
end if;
update found_test_tbl set a = 100 where a = 1;
if FOUND then
insert into found_test_tbl values (3);
end if;
delete from found_test_tbl where a = 9999; -- matches no rows
if not FOUND then
insert into found_test_tbl values (4);
end if;
for i in 1 .. 10 loop
-- no need to do anything
end loop;
if FOUND then
insert into found_test_tbl values (5);
end if;
-- never executes the loop
for i in 2 .. 1 loop
-- no need to do anything
end loop;
if not FOUND then
insert into found_test_tbl values (6);
end if;
return true;
end;
DECLARE
rec RECORD;
BEGIN
FOR rec IN select * from found_test_tbl LOOP
RETURN NEXT rec;
END LOOP;
RETURN;
END;
DECLARE
row found_test_tbl%ROWTYPE;
BEGIN
FOR row IN select * from found_test_tbl LOOP
RETURN NEXT row;
END LOOP;
RETURN;
END;
DECLARE
i int;
BEGIN
FOR i IN $1 .. $2 LOOP
RETURN NEXT i + 1;
END LOOP;
RETURN;
END;
DECLARE
retval RECORD;
BEGIN
IF $1 > 10 THEN
SELECT INTO retval 5, 10, 15;
RETURN NEXT retval;
RETURN NEXT retval;
ELSE
SELECT INTO retval 50, 5::numeric, 'xxx'::text;
RETURN NEXT retval;
RETURN NEXT retval;
END IF;
RETURN;
END;
DECLARE
retval RECORD;
BEGIN
IF $1 > 10 THEN
SELECT INTO retval 5, 10, 15;
RETURN retval;
ELSE
SELECT INTO retval 50, 5::numeric, 'xxx'::text;
RETURN retval;
END IF;
END;
BEGIN
IF $1 < 20 THEN
INSERT INTO perform_test VALUES ($1, $1 + 10);
RETURN TRUE;
ELSE
RETURN FALSE;
END IF;
END;
BEGIN
IF FOUND then
INSERT INTO perform_test VALUES (100, 100);
END IF;
PERFORM perform_simple_func(5);
IF FOUND then
INSERT INTO perform_test VALUES (100, 100);
END IF;
PERFORM perform_simple_func(50);
IF FOUND then
INSERT INTO perform_test VALUES (100, 100);
END IF;
RETURN;
END;
declare x int;
sx smallint;
begin
begin -- start a subtransaction
raise notice 'should see this';
x := 100 / $1;
raise notice 'should see this only if % <> 0', $1;
sx := $1;
raise notice 'should see this only if % fits in smallint', $1;
if $1 < 0 then
raise exception '% is less than zero', $1;
end if;
exception
when division_by_zero then
raise notice 'caught division_by_zero';
x := -1;
when NUMERIC_VALUE_OUT_OF_RANGE then
raise notice 'caught numeric_value_out_of_range';
x := -2;
end;
return x;
end;
declare x int;
sx smallint;
y int;
begin
begin -- start a subtransaction
x := 100 / $1;
sx := $1;
select into y unique1 from tenk1 where unique2 =
(select unique2 from tenk1 b where ten = $1);
exception
when data_exception then -- category match
raise notice 'caught data_exception';
x := -1;
when NUMERIC_VALUE_OUT_OF_RANGE OR CARDINALITY_VIOLATION then
raise notice 'caught numeric_value_out_of_range or cardinality_violation';
x := -2;
end;
return x;
end;
declare x int;
begin
x := 1;
insert into foo values(x);
begin
x := x + 1;
insert into foo values(x);
raise exception 'inner';
exception
when others then
x := x * 10;
end;
insert into foo values(x);
return x;
end;
begin
declare x int;
begin
-- we assume this will take longer than 2 seconds:
select count(*) into x from tenk1 a, tenk1 b, tenk1 c;
exception
when others then
raise notice 'caught others?';
when query_canceled then
raise notice 'nyeah nyeah, cant stop me';
end;
-- Abort transaction to abandon the statement_timeout setting. Otherwise,
-- the next top-level statement would be vulnerable to the timeout.
raise exception 'end of function';
end;
declare x text;
begin
x := '1234';
begin
x := x || '5678';
-- force error inside subtransaction SPI context
perform trap_zero_divide(-100);
exception
when others then
x := x || '9012';
end;
return x;
end;
begin
begin -- start a subtransaction
insert into slave values($1);
exception
when foreign_key_violation then
raise notice 'caught foreign_key_violation';
return 0;
end;
return 1;
end;
begin
begin -- start a subtransaction
set constraints all immediate;
exception
when foreign_key_violation then
raise notice 'caught foreign_key_violation';
return 0;
end;
return 1;
end;
declare x int;
begin
select into x id from users where login = a_login;
if found then return x; end if;
return 0;
end;
declare my_id_user int;
begin
my_id_user = sp_id_user( a_login );
IF my_id_user > 0 THEN
RETURN -1; -- error code for existing user
END IF;
INSERT INTO users ( login ) VALUES ( a_login );
my_id_user = sp_id_user( a_login );
IF my_id_user = 0 THEN
RETURN -2; -- error code for insertion failure
END IF;
RETURN my_id_user;
end;
declare
rc refcursor;
begin
open rc for select a from rc_test;
return rc;
end;
declare
rc refcursor;
x record;
begin
rc := return_unnamed_refcursor();
fetch next from rc into x;
return x.a;
end;
begin
open rc for select a from rc_test;
return rc;
end;
begin
perform return_refcursor($1);
return $1;
end;
declare
c1 cursor (param1 int, param2 int) for select * from rc_test where a > param1 and b > param2;
nonsense record;
begin
open c1($1, $2);
fetch c1 into nonsense;
close c1;
if found then
return true;
else
return false;
end if;
end;
declare
c1 cursor (param1 int, param12 int) for select * from rc_test where a > param1 and b > param12;
nonsense record;
begin
open c1(param12 := $2, param1 := $1);
fetch c1 into nonsense;
close c1;
if found then
return true;
else
return false;
end if;
end;
declare
c1 cursor (param1 int, param2 int) for select * from rc_test where a > param1 and b > param2;
nonsense record;
begin
open c1(param1 := $1, $2);
fetch c1 into nonsense;
close c1;
if found then
return true;
else
return false;
end if;
end;
declare
c1 cursor (param1 int, param2 int) for select * from rc_test where a > param1 and b > param2;
begin
open c1(param2 := 20, 21);
end;
declare
c1 cursor (param1 int, param2 int) for select * from rc_test where a > param1 and b > param2;
begin
open c1(20, param1 := 21);
end;
declare
c1 cursor (p1 int, p2 int) for
select * from tenk1 where thousand = p1 and tenthous = p2;
begin
open c1 (p2 := 77, p2 := 42);
end;
declare
c1 cursor (p1 int, p2 int) for
select * from tenk1 where thousand = p1 and tenthous = p2;
begin
open c1 (p2 := 77);
end;
declare
c1 cursor (p1 int, p2 int) for
select * from tenk1 where thousand = p1 and tenthous = p2;
begin
open c1 (p2 := 77, p1 := 42/0);
end;
declare
c1 cursor (p1 int, p2 int) for
select count(*) from tenk1 where thousand = p1 and tenthous = p2;
n int4;
begin
open c1 (77 -- test
, 42);
fetch c1 into n;
return n;
end;
declare
c1 cursor (p1 int, p2 int, debug int) for
select count(*) from tenk1 where thousand = p1 and tenthous = p2
and four = debug;
p2 int4 := 1006;
n int4;
begin
open c1 (p1 := p1, p2 := p2, debug := 2);
fetch c1 into n;
return n;
end;
begin
raise notice 'This message has too many parameters!', $1;
return $1;
end;
begin
raise notice 'This message has too few parameters: %, %, %', $1, $1;
return $1;
end;
begin
raise notice 'This message has no parameters (despite having %% signs in it)!';
return $1;
end;
BEGIN
BEGIN
RAISE syntax_error;
EXCEPTION
WHEN syntax_error THEN
BEGIN
raise notice 'exception % thrown in inner block, reraising', sqlerrm;
RAISE;
EXCEPTION
WHEN OTHERS THEN
raise notice 'RIGHT - exception % caught in inner block', sqlerrm;
END;
END;
EXCEPTION
WHEN OTHERS THEN
raise notice 'WRONG - exception % caught in outer block', sqlerrm;
END;
declare
_r record;
_rt eifoo%rowtype;
_v eitype;
i int;
j int;
k int;
begin
execute 'insert into '||$1||' values(10,15)';
execute 'select (row).* from (select row(10,1)::eifoo) s' into _r;
raise notice '% %', _r.i, _r.y;
execute 'select * from '||$1||' limit 1' into _rt;
raise notice '% %', _rt.i, _rt.y;
execute 'select *, 20 from '||$1||' limit 1' into i, j, k;
raise notice '% % %', i, j, k;
execute 'select 1,2' into _v;
return _v;
end;
begin
raise notice '% %', sqlstate, sqlerrm;
end;
begin
begin
begin
raise notice '% %', sqlstate, sqlerrm;
end;
end;
end;
begin
begin
raise exception 'user exception';
exception when others then
raise notice 'caught exception % %', sqlstate, sqlerrm;
begin
raise notice '% %', sqlstate, sqlerrm;
perform 10/0;
exception
when substring_error then
-- this exception handler shouldn't be invoked
raise notice 'unexpected exception: % %', sqlstate, sqlerrm;
when division_by_zero then
raise notice 'caught exception % %', sqlstate, sqlerrm;
end;
raise notice '% %', sqlstate, sqlerrm;
end;
end;
begin
begin perform 1/0;
exception when others then return sqlerrm; end;
end;
declare
a integer[] = '{10,20,30}';
c varchar = 'xyz';
i integer;
begin
i := 2;
raise notice '%; %; %; %; %; %', a, a[i], c, (select c || 'abc'), row(10,'aaa',NULL,30), NULL;
end;
declare
x int;
y int;
begin
select into x,y unique1/p1, unique1/$1 from tenk1 group by unique1/p1;
return x = y;
end;
declare x record;
begin
-- should work
insert into foo values(5,6) returning * into x;
raise notice 'x.f1 = %, x.f2 = %', x.f1, x.f2;
end;
declare x record;
begin
-- should fail due to implicit strict
insert into foo values(7,8),(9,10) returning * into x;
raise notice 'x.f1 = %, x.f2 = %', x.f1, x.f2;
end;
declare x record;
begin
-- should work
execute 'insert into foo values(5,6) returning *' into x;
raise notice 'x.f1 = %, x.f2 = %', x.f1, x.f2;
end;
declare x record;
begin
-- this should work since EXECUTE isn't as picky
execute 'insert into foo values(7,8),(9,10) returning *' into x;
raise notice 'x.f1 = %, x.f2 = %', x.f1, x.f2;
end;
declare x record;
begin
-- should work
select * from foo where f1 = 3 into strict x;
raise notice 'x.f1 = %, x.f2 = %', x.f1, x.f2;
end;
declare x record;
begin
-- should fail, no rows
select * from foo where f1 = 0 into strict x;
raise notice 'x.f1 = %, x.f2 = %', x.f1, x.f2;
end;
declare x record;
begin
-- should fail, too many rows
select * from foo where f1 > 3 into strict x;
raise notice 'x.f1 = %, x.f2 = %', x.f1, x.f2;
end;
declare x record;
begin
-- should work
execute 'select * from foo where f1 = 3' into strict x;
raise notice 'x.f1 = %, x.f2 = %', x.f1, x.f2;
end;
declare x record;
begin
-- should fail, no rows
execute 'select * from foo where f1 = 0' into strict x;
raise notice 'x.f1 = %, x.f2 = %', x.f1, x.f2;
end;
declare x record;
begin
-- should fail, too many rows
execute 'select * from foo where f1 > 3' into strict x;
raise notice 'x.f1 = %, x.f2 = %', x.f1, x.f2;
end;
declare
x record;
p1 int := 2;
p3 text := 'foo';
begin
-- no rows
select * from foo where f1 = p1 and f1::text = p3 into strict x;
raise notice 'x.f1 = %, x.f2 = %', x.f1, x.f2;
end;
declare
x record;
p1 int := 2;
p3 text := 'foo';
begin
select * from foo where f1 > p1 or f1::text = p3 into strict x;
raise notice 'x.f1 = %, x.f2 = %', x.f1, x.f2;
end;
declare x record;
begin
select * from foo where f1 > 3 into strict x;
raise notice 'x.f1 = %, x.f2 = %', x.f1, x.f2;
end;
declare x record;
begin
execute 'select * from foo where f1 = $1 or f1::text = $2' using 0, 'foo' into strict x;
raise notice 'x.f1 = %, x.f2 = %', x.f1, x.f2;
end;
declare x record;
begin
execute 'select * from foo where f1 > $1' using 1 into strict x;
raise notice 'x.f1 = %, x.f2 = %', x.f1, x.f2;
end;
declare x record;
begin
execute 'select * from foo where f1 > 3' into strict x;
raise notice 'x.f1 = %, x.f2 = %', x.f1, x.f2;
end;
#print_strict_params off
declare
x record;
p1 int := 2;
p3 text := 'foo';
begin
select * from foo where f1 > p1 or f1::text = p3 into strict x;
raise notice 'x.f1 = %, x.f2 = %', x.f1, x.f2;
end;
#print_strict_params on
declare
x record;
p1 int := 2;
p3 text := 'foo';
begin
select * from foo where f1 > p1 or f1::text = p3 into strict x;
raise notice 'x.f1 = %, x.f2 = %', x.f1, x.f2;
end;
declare
in1 int;
out1 int;
begin
end;
declare
in1 int;
out1 int;
begin
end;
declare
f1 int;
begin
declare
f1 int;
begin
end;
end;
declare
in1 int;
begin
declare
in1 int;
begin
end;
end;
declare
f1 int;
c1 cursor (f1 int) for select 1;
begin
end;
declare f1 int; begin return 1; end;
declare
c scroll cursor for select f1 from int4_tbl;
x integer;
begin
open c;
fetch last from c into x;
while found loop
return next x;
fetch prior from c into x;
end loop;
close c;
end;
declare
c no scroll cursor for select f1 from int4_tbl;
x integer;
begin
open c;
fetch last from c into x;
while found loop
return next x;
fetch prior from c into x;
end loop;
close c;
end;
declare
c refcursor;
x integer;
begin
open c scroll for select f1 from int4_tbl;
fetch last from c into x;
while found loop
return next x;
fetch prior from c into x;
end loop;
close c;
end;
declare
c refcursor;
x integer;
begin
open c scroll for execute 'select f1 from int4_tbl';
fetch last from c into x;
while found loop
return next x;
fetch relative -2 from c into x;
end loop;
close c;
end;
declare
c refcursor;
x integer;
begin
open c scroll for execute 'select f1 from int4_tbl';
fetch last from c into x;
while found loop
return next x;
move backward 2 from c;
fetch relative -1 from c into x;
end loop;
close c;
end;
declare
c cursor for select * from generate_series(1, 10);
x integer;
begin
open c;
loop
move relative 2 in c;
if not found then
exit;
end if;
fetch next from c into x;
if found then
return next x;
end if;
end loop;
close c;
end;
declare
c cursor for select * from generate_series(1, 10);
x integer;
begin
open c;
move forward all in c;
fetch backward from c into x;
if found then
return next x;
end if;
close c;
end;
<<outerblock>>
declare
param1 int := 1;
begin
<<innerblock>>
declare
param1 int := 2;
begin
raise notice 'param1 = %', param1;
raise notice 'pl_qual_names.param1 = %', pl_qual_names.param1;
raise notice 'outerblock.param1 = %', outerblock.param1;
raise notice 'innerblock.param1 = %', innerblock.param1;
end;
end;
begin
$1 := -1;
$2 := -2;
return next;
return query select x + 1, x * 10 from generate_series(0, 10) s (x);
return next;
end;
begin
return query select md5(s.x::text), s.x, s.x > 0
from generate_series(-8, lim) s (x) where s.x % 2 = 0;
end;
declare i int;
begin
for i in execute 'select * from generate_series(1,$1)' using $1+1 loop
raise notice '%', i;
end loop;
execute 'select $2 + $2*3 + length($1)' into i using $2,$1;
return i;
end;
declare
c refcursor;
i int;
begin
open c for execute 'select * from generate_series(1,$1)' using $1+1;
loop
fetch c into i;
exit when not found;
raise notice '%', i;
end loop;
close c;
return;
end;
declare
c cursor(r1 integer, r2 integer)
for select * from generate_series(r1,r2) i;
c2 cursor
for select * from generate_series(41,43) i;
begin
for r in c(5,7) loop
raise notice '% from %', r.i, c;
end loop;
-- again, to test if cursor was closed properly
for r in c(9,10) loop
raise notice '% from %', r.i, c;
end loop;
-- and test a parameterless cursor
for r in c2 loop
raise notice '% from %', r.i, c2;
end loop;
-- and try it with a hand-assigned name
raise notice 'after loop, c2 = %', c2;
c2 := 'special_name';
for r in c2 loop
raise notice '% from %', r.i, c2;
end loop;
raise notice 'after loop, c2 = %', c2;
-- and try it with a generated name
-- (which we can't show in the output because it's variable)
c2 := null;
for r in c2 loop
raise notice '%', r.i;
end loop;
raise notice 'after loop, c2 = %', c2;
return;
end;
declare
c cursor for select * from forc_test;
begin
for r in c loop
raise notice '%, %', r.i, r.j;
update forc_test set i = i * 100, j = r.j * 2 where current of c;
end loop;
end;
declare
c refcursor := 'fooled_ya';
r record;
begin
open c for select * from forc_test;
loop
fetch c into r;
exit when not found;
raise notice '%, %', r.i, r.j;
update forc_test set i = i * 100, j = r.j * 2 where current of c;
end loop;
end;
declare
c refcursor;
begin
for r in c loop
raise notice '%', r.i;
end loop;
end;
begin
return query execute 'select * from (values(10),(20)) f';
return query execute 'select * from (values($1),($2)) f' using 40,50;
end;
begin
return query select * from tabwithcols;
return query execute 'select * from tabwithcols';
end;
declare
v compostype;
begin
v := (1, 'hello');
return v;
end;
declare
v record;
begin
v := (1, 'hello'::varchar);
return v;
end;
begin
return (1, 'hello'::varchar);
end;
begin
return (1, 'hello');
end;
begin
return (1, 'hello')::compostype;
end;
declare
v record;
begin
v := (1, 'hello');
return v;
end;
begin
for i in 1 .. 3
loop
return next (1, 'hello'::varchar);
end loop;
return next null::compostype;
return next (2, 'goodbye')::compostype;
end;
begin
return 1 + 1;
end;
declare x int := 42;
begin
return x;
end;
declare
v compostype;
begin
v := (1, 'hello');
return v;
end;
begin
return (1, 'hello')::compostype;
end;
begin
raise notice '% % %', 1, 2, 3
using errcode = '55001', detail = 'some detail info', hint = 'some hint';
raise '% % %', 1, 2, 3
using errcode = 'division_by_zero', detail = 'some detail info';
end;
begin
raise 'check me'
using errcode = 'division_by_zero', detail = 'some detail info';
exception
when others then
raise notice 'SQLSTATE: % SQLERRM: %', sqlstate, sqlerrm;
raise;
end;
begin
raise 'check me'
using errcode = '1234F', detail = 'some detail info';
exception
when others then
raise notice 'SQLSTATE: % SQLERRM: %', sqlstate, sqlerrm;
raise;
end;
begin
raise 'check me'
using errcode = '1234F', detail = 'some detail info';
exception
when sqlstate '1234F' then
raise notice 'SQLSTATE: % SQLERRM: %', sqlstate, sqlerrm;
raise;
end;
begin
raise division_by_zero using detail = 'some detail info';
exception
when others then
raise notice 'SQLSTATE: % SQLERRM: %', sqlstate, sqlerrm;
raise;
end;
begin
raise division_by_zero;
end;
begin
raise sqlstate '1234F';
end;
begin
raise division_by_zero using message = 'custom' || ' message';
end;
begin
raise using message = 'custom' || ' message', errcode = '22012';
end;
begin
raise notice 'some message' using message = 'custom' || ' message', errcode = '22012';
end;
begin
raise division_by_zero using message = 'custom' || ' message', errcode = '22012';
end;
begin
raise;
end;
declare v int := 0;
begin
return 10 / v;
end;
begin
raise exception 'custom exception'
using detail = 'some detail of custom exception',
hint = 'some hint related to custom exception';
end;
declare _sqlstate text;
_message text;
_context text;
begin
perform zero_divide();
exception when others then
get stacked diagnostics
_sqlstate = returned_sqlstate,
_message = message_text,
_context = pg_exception_context;
raise notice 'sqlstate: %, message: %, context: [%]',
_sqlstate, _message, replace(_context, E'\n', ' <- ');
end;
declare _detail text;
_hint text;
_message text;
begin
perform raise_test();
exception when others then
get stacked diagnostics
_message = message_text,
_detail = pg_exception_detail,
_hint = pg_exception_hint;
raise notice 'message: %, detail: %, hint: %', _message, _detail, _hint;
end;
declare _detail text;
_hint text;
_message text;
begin
get stacked diagnostics
_message = message_text,
_detail = pg_exception_detail,
_hint = pg_exception_hint;
raise notice 'message: %, detail: %, hint: %', _message, _detail, _hint;
end;
begin
perform 1/0;
exception
when sqlstate '22012' then
raise notice using message = sqlstate;
raise sqlstate '22012' using message = 'substitute message';
end;
declare _column_name text;
_constraint_name text;
_datatype_name text;
_table_name text;
_schema_name text;
begin
raise exception using
column = '>>some column name<<',
constraint = '>>some constraint name<<',
datatype = '>>some datatype name<<',
table = '>>some table name<<',
schema = '>>some schema name<<';
exception when others then
get stacked diagnostics
_column_name = column_name,
_constraint_name = constraint_name,
_datatype_name = pg_datatype_name,
_table_name = table_name,
_schema_name = schema_name;
raise notice 'column %, constraint %, type %, table %, schema %',
_column_name, _constraint_name, _datatype_name, _table_name, _schema_name;
end;
begin
for i in array_lower($1,1) .. array_upper($1,1) loop
raise notice '%', $1[i];
end loop; end;
declare aux numeric = $1[array_lower($1,1)];
begin
for i in array_lower($1,1)+1 .. array_upper($1,1) loop
if $1[i] < aux then aux := $1[i]; end if;
end loop;
return aux;
end;
begin
raise notice 'non-variadic function called';
return $1;
end;
begin
return query select $1, $1+i from generate_series(1,5) g(i);
end;
begin
a := a1; b := a1 + 1;
return next;
a := a1 * 10; b := a1 * 10 + 1;
return next;
end;
declare rc int;
rca int[];
begin
return query values(10),(20);
get diagnostics rc = row_count;
raise notice '% %', found, rc;
return query select * from (values(10),(20)) f(a) where false;
get diagnostics rc = row_count;
raise notice '% %', found, rc;
return query execute 'values(10),(20)';
-- just for fun, let's use array elements as targets
get diagnostics rca[1] = row_count;
raise notice '% %', found, rca[1];
return query execute 'select * from (values(10),(20)) f(a) where false';
get diagnostics rca[2] = row_count;
raise notice '% %', found, rca[2];
end;
DECLARE
v_var INTEGER;
BEGIN
BEGIN
v_var := (leaker_2(fail)).error_code;
EXCEPTION
WHEN others THEN RETURN 0;
END;
RETURN 1;
END;
BEGIN
IF fail THEN
RAISE EXCEPTION 'fail ...';
END IF;
error_code := 1;
new_id := 1;
RETURN;
END;
DECLARE
arr text[];
lr text;
i integer;
BEGIN
arr := array[array['foo','bar'], array['baz', 'quux']];
lr := 'fool';
i := 1;
-- use sub-SELECTs to make expressions non-simple
arr[(SELECT i)][(SELECT i+1)] := (SELECT lr);
RETURN arr;
END;
declare
i integer NOT NULL := 0;
begin
begin
i := (SELECT NULL::integer); -- should throw error
exception
WHEN OTHERS THEN
i := (SELECT 1::integer);
end;
return i;
end;
begin
if ($1 > 0) then
return sql_recurse($1 - 1);
else
return $1;
end if;
end;
begin
return error1(p_name_table);
end;
begin
return $1;
end;
begin
do $$ declare x text[]; begin x := '{1.23, 4.56}'::numeric[]; end $$;
do $$ declare x text[]; begin x := '{1.23, 4.56}'::numeric[]; end $$;
end;
begin
return 1/0;
end;
begin
raise notice 'foo\\bar\041baz';
return 'foo\\bar\041baz';
end;
begin
raise notice E'foo\\bar\041baz';
return E'foo\\bar\041baz';
end;
begin
raise notice 'foo\\bar\041baz\';
return 'foo\\bar\041baz\';
end;
begin
raise notice E'foo\\bar\041baz';
return E'foo\\bar\041baz';
end;
DECLARE r record;
BEGIN
FOR r IN SELECT rtrim(roomno) AS roomno, comment FROM Room ORDER BY roomno
LOOP
RAISE NOTICE '%, %', r.roomno, r.comment;
END LOOP;
END;
DECLARE r record;
BEGIN
FOR r IN SELECT rtrim(roomno) AS roomno, foo FROM Room ORDER BY roomno
LOOP
RAISE NOTICE '%, %', r.roomno, r.comment;
END LOOP;
END;
declare x int := 42;
begin
declare y int := x + 1;
x int := x + 2;
begin
return x * 100 + y;
end;
end;
declare r record;
q1 bigint := 42;
begin
for r in select q1,q2 from int8_tbl loop
return next r;
end loop;
end;
#variable_conflict use_variable
declare r record;
q1 bigint := 42;
begin
for r in select q1,q2 from int8_tbl loop
return next r;
end loop;
end;
#variable_conflict use_column
declare r record;
q1 bigint := 42;
begin
for r in select q1,q2 from int8_tbl loop
return next r;
end loop;
end;
declare
forward int := 21;
begin
forward := forward * 2;
return forward;
end;
declare
return int := 42;
begin
return := return + 1;
return return;
end;
declare
comment int := 21;
begin
comment := comment * 2;
comment on function unreserved_test() is 'this is a test';
return comment;
end;
declare x int;
begin
foreach x in array $1
loop
raise notice '%', x;
end loop;
end;
declare x int;
begin
foreach x slice 1 in array $1
loop
raise notice '%', x;
end loop;
end;
declare x int[];
begin
foreach x slice 1 in array $1
loop
raise notice '%', x;
end loop;
end;
declare x int[];
begin
foreach x slice 2 in array $1
loop
raise notice '%', x;
end loop;
end;
declare r record;
begin
foreach r in array $1
loop
raise notice '%', r;
end loop;
end;
declare x int; y int;
begin
foreach x, y in array $1
loop
raise notice 'x = %, y = %', x, y;
end loop;
end;
declare x xy_tuple[];
begin
foreach x slice 1 in array $1
loop
raise notice '%', x;
end loop;
end;
declare
r record;
begin
r := row(12, '{foo,bar,baz}')::rtype;
r.ar[2] := 'replace';
return r.ar;
end;
declare res orderedarray;
begin
res := array[x1, x2];
res[2] := x3;
return res;
end;
declare r int[]; begin r := array[$1, $1]; return r; end;
begin return $1[1]; end;
declare a int[] := array[1,2];
begin
a := a || 3;
raise notice 'a = %', a;
end;
declare _context text;
begin
get diagnostics _context = pg_context;
raise notice '***%***', _context;
-- lets do it again, just for fun..
get diagnostics _context = pg_context;
raise notice '***%***', _context;
raise notice 'lets make sure we didnt break anything';
return 2 * $1;
end;
declare
myresult int;
begin
raise notice 'calling down into inner_func()';
myresult := inner_func($1);
raise notice 'inner_func() done';
return myresult;
end;
declare
myresult int;
begin
raise notice 'calling down into outer_func()';
myresult := outer_func($1);
raise notice 'outer_func() done';
return myresult;
end;
declare
_context text;
sx int := 5;
begin
begin
perform sx / 0;
exception
when division_by_zero then
get diagnostics _context = pg_context;
raise notice '***%***', _context;
end;
-- lets do it again, just for fun..
get diagnostics _context = pg_context;
raise notice '***%***', _context;
raise notice 'lets make sure we didnt break anything';
return 2 * $1;
end;
declare
myresult int;
begin
raise notice 'calling down into inner_func()';
myresult := inner_func($1);
raise notice 'inner_func() done';
return myresult;
end;
declare
myresult int;
begin
raise notice 'calling down into outer_func()';
myresult := outer_func($1);
raise notice 'outer_func() done';
return myresult;
end;
begin
assert 1=0, 'unhandled assertion';
exception when others then
null; -- do nothing
end;
begin return val > 0; end;
declare v_test plpgsql_domain;
begin
v_test := 1;
end;
declare v_test plpgsql_domain := 1;
begin
v_test := 0; -- fail
end;
begin return val[1] > 0; end;
begin
v_test := array[1];
v_test := v_test || 2;
end;
declare v_test plpgsql_arr_domain := array[1];
begin
v_test := 0 || v_test; -- fail
end;
DECLARE
t text;
l text;
BEGIN
t = '';
FOR l IN EXECUTE
$q$
EXPLAIN (TIMING off, COSTS off, VERBOSE on)
SELECT * FROM newtable
$q$ LOOP
t = t || l || E'\n';
END LOOP;
RAISE INFO '%', t;
RETURN new;
END;
DECLARE
t text;
l text;
BEGIN
t = '';
FOR l IN EXECUTE
$q$
EXPLAIN (TIMING off, COSTS off, VERBOSE on)
SELECT * FROM oldtable ot FULL JOIN newtable nt USING (id)
$q$ LOOP
t = t || l || E'\n';
END LOOP;
RAISE INFO '%', t;
RETURN new;
END;
DECLARE n bigint;
BEGIN
--PERFORM FROM p JOIN transition_table_level2 c ON c.parent_no = p.level1_no;
IF FOUND THEN
RAISE EXCEPTION 'RI error';
END IF;
RETURN NULL;
END;
DECLARE
x int;
BEGIN
WITH p AS (SELECT level1_no, sum(delta) cnt
FROM (SELECT level1_no, 1 AS delta FROM i
UNION ALL
SELECT level1_no, -1 AS delta FROM d) w
GROUP BY level1_no
HAVING sum(delta) < 0)
SELECT level1_no
FROM p JOIN transition_table_level2 c ON c.parent_no = p.level1_no
INTO x;
IF FOUND THEN
RAISE EXCEPTION 'RI error';
END IF;
RETURN NULL;
END;
BEGIN
INSERT INTO dx VALUES (1000000, 1000000, 'x');
RETURN NULL;
END;
BEGIN
RAISE WARNING 'old table = %, new table = %',
(SELECT string_agg(id || '=' || name, ',') FROM d),
(SELECT string_agg(id || '=' || name, ',') FROM i);
RAISE NOTICE 'one = %', (SELECT 1 FROM alter_table_under_transition_tables LIMIT 1);
RETURN NULL;
END;
BEGIN
RAISE NOTICE 'count = %', (SELECT COUNT(*) FROM new_test);
RAISE NOTICE 'count union = %',
(SELECT COUNT(*)
FROM (SELECT * FROM new_test UNION ALL SELECT * FROM new_test) ss);
RETURN NULL;
END;
DECLARE
a_val partitioned_table.a%TYPE;
result partitioned_table%ROWTYPE;
BEGIN
a_val := $1;
SELECT * INTO result FROM partitioned_table WHERE a = a_val;
RETURN result;
END;
DECLARE
row partitioned_table%ROWTYPE;
a_val partitioned_table.a%TYPE;
BEGIN
FOR row IN SELECT * FROM partitioned_table ORDER BY a LOOP
a_val := row.a;
RETURN NEXT a_val;
END LOOP;
RETURN;
END;
BEGIN
GET DIAGNOSTICS x = ROW_COUNT;
RETURN;
END;
DECLARE
first TEXT ARRAY;
BEGIN
LISTEN virtual;
NOTIFY virtual;
UNLISTEN *;
ANALYZE VERBOSE public.t2;
LOCK public.t1;
CHECKPOINT;
RESET ALL;
REASSIGN OWNED BY SESSION_USER TO CURRENT_USER;
REFRESH MATERIALIZED VIEW public.mv1 WITH DATA;
COPY (SELECT 1) TO STDOUT;
EXPLAIN SELECT 1;
CLUSTER public.t1;
DEALLOCATE ALL;
REINDEX TABLE public.t1;
return DISTINCT c2 FROM public.t1 LIMIT 1;
END;
declare
i text;
begin
show DateStyle into i;
raise notice 'DateStyle is %', i;
show search_path into i;
raise notice 'search_path is %', i;
show plpgsql.print_strict_params into i;
raise notice 'plpgsql.print_strict_params is %', i;
end;
declare
_id int;
_count int;
begin
if _count <> coalesce (array_length (_id, 1), 0) then
raise warning 'some text '
'more text '
' and parameters: '
'% %',
_count,
coalesce (array_length (_id, 1));
end if;
end;
/*
DECLARE n bigint = c1 from public.t1 limit 1;
BEGIN
PERFORM FROM public.t1 p JOIN public.t2 c ON c.c1 = p.c2;
IF FOUND THEN
RAISE NOTICE 'RI error';
END IF;
END;
begin
for q in 1 .. 5 loop
RAISE notice 'Duplicate user ID: %', c1 from public.t1 limit 1 USING SCHEMA = c2 from public.t1 limit 1;
end loop;
end;
begin
case
WHEN c1 > 0 FROM public.t1 limit 1 THEN
raise notice 'positive';
end case;
end;
begin
case c1 FROM public.t1 limit 1
WHEN 1 THEN
raise notice 'positive';
end case;
end;
begin
if c1 > 0 FROM public.t1 limit 1 THEN
raise notice 'positive';
elsif c1 < 0 FROM public.t2 limit 1 THEN
raise notice 'negative';
end IF;
end;
begin
for q in c1 FROM public.t1 limit 1 .. c1 FROM public.t2 limit 1 by c1 FROM public.t3 limit 1 LOOP
-- do nothing
end LOOP;
end;
begin
while c1> 0 FROM public.t1 limit 1 LOOP
exit;
end LOOP;
end;
begin
foreach q in array ARRAY[c1,2] from public.t1 limit 1 loop
exit;
end LOOP;
end;
declare
q integer;
begin
execute 'select 1' into q using c1 from public.t1 limit 1;
raise notice 'val = %', q;
end;
begin
for q in 1 .. 5 loop
exit when c1 > 0 from public.t1 limit 1;
end loop;
end;
begin
if count(*) = 0 from Room where roomno = new.roomno then
raise exception 'Room % does not exist', new.roomno;
end if;
return new;
end;
BEGIN
PERFORM FROM i
LEFT JOIN transition_table_level1 p
ON p.level1_no IS NOT NULL AND p.level1_no = i.parent_no
WHERE p.level1_no IS NULL;
IF FOUND THEN
RAISE EXCEPTION 'RI error';
END IF;
RETURN NULL;
END;
*/
DECLARE
rc refcursor;
r record;
BEGIN
open rc for explain analyze values (1);
close rc;
open rc for SHOW ALL;
close rc;
open rc for select 1 from public.t1;
close rc;
open rc for insert into public.t1 (c1) select 5 returning *;
close rc;
open rc for update public.t1 set c1 = 6 where c1 = 5 returning *;
close rc;
open rc for DELETE from public.t1 where c1 = 6 returning *;
close rc;
FOR r IN show time zone loop
raise notice 'var is %', r;
end loop;
return query explain insert into public.t1 (c1) values (1) returning c1;
END; | the_stack |
-- Apr 8, 2016 9:37 AM
-- URL zum Konzept
INSERT INTO AD_Process (AccessLevel,AD_Client_ID,AD_Org_ID,AD_Process_ID,AllowProcessReRun,Classname,CopyFromProcess,Created,CreatedBy,Description,EntityType,Help,IsActive,IsBetaFunctionality,IsDirectPrint,IsOneInstanceOnly,IsReport,IsServerProcess,LockWaitTimeout,Name,RefreshAllAfterExecution,ShowHelp,SQLStatement,Statistic_Count,Statistic_Seconds,Type,Updated,UpdatedBy,Value) VALUES ('7',0,0,540679,'Y','de.metas.adempiere.process.ExecuteUpdateSQL','N',TO_TIMESTAMP('2016-04-08 09:37:48','YYYY-MM-DD HH24:MI:SS'),100,'Identifies, logs and reenqueues invoice candidates that need to be updated','de.metas.invoicecandidate','Under the hood it selects from the view de_metas_invoicecandidate.C_Invoice_Candidate_Failed_To_Update_v.<br>
It then inserts the found records into the table de_metas_invoicecandidate.C_Invoice_Candidate_Failed_To_Update and also reenqueues them to be updated.<br>
From the table de_metas_invoicecandidate.C_Invoice_Candidate_Failed_To_Update we can see which were the problematic ICs.<br>
Each problematic IC might be listed multiple times.<br>
Also see issue .FRESH-93','Y','N','N','N','N','N',0,'C_Invoice_Candidate_Failed_To_Update_Find_Log_Fix','N','Y','select X_MRP_ProductInfo_Detail_Insert_Fallback( (now() + interval ''10 days'')::date);',0,0,'SQL',TO_TIMESTAMP('2016-04-08 09:37:48','YYYY-MM-DD HH24:MI:SS'),100,'C_Invoice_Candidate_Failed_To_Update_Find_Log_Fix')
;
-- Apr 8, 2016 9:37 AM
-- 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) 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=540679 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)
;
-- Apr 8, 2016 9:40 AM
-- URL zum Konzept
UPDATE AD_Process SET AllowProcessReRun='N',Updated=TO_TIMESTAMP('2016-04-08 09:40:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=540679
;
-- Apr 8, 2016 9:42 AM
-- URL zum Konzept
INSERT INTO AD_Scheduler (AD_Client_ID,AD_Org_ID,AD_Process_ID,AD_Role_ID,AD_Scheduler_ID,Created,CreatedBy,Description,EntityType,Frequency,FrequencyType,IsActive,IsIgnoreProcessingTime,KeepLogDays,ManageScheduler,Name,Processing,SchedulerProcessType,ScheduleType,Status,Supervisor_ID,Updated,UpdatedBy) VALUES (0,0,540679,0,550036,TO_TIMESTAMP('2016-04-08 09:42:25','YYYY-MM-DD HH24:MI:SS'),100,'See the process doc for infos','de.metas.i',1,'H','Y','N',7,'N','C_Invoice_Candidate_Failed_To_Update_Find_Log_Fix','N','P','F','NEW',0,TO_TIMESTAMP('2016-04-08 09:42:25','YYYY-MM-DD HH24:MI:SS'),100)
;
-- Apr 8, 2016 9:43 AM
-- URL zum Konzept
INSERT INTO AD_Table_Process (AD_Client_ID,AD_Org_ID,AD_Process_ID,AD_Table_ID,Created,CreatedBy,EntityType,IsActive,Updated,UpdatedBy) VALUES (0,0,540679,540270,TO_TIMESTAMP('2016-04-08 09:43:11','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.invoicecandidate','Y',TO_TIMESTAMP('2016-04-08 09:43:11','YYYY-MM-DD HH24:MI:SS'),100)
;
-- Apr 8, 2016 9:44 AM
-- URL zum Konzept
UPDATE AD_Process SET Name='Find, log and reenqueue ICs that failed to update',Updated=TO_TIMESTAMP('2016-04-08 09:44:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=540679
;
-- Apr 8, 2016 9:44 AM
-- URL zum Konzept
UPDATE AD_Process_Trl SET IsTranslated='N' WHERE AD_Process_ID=540679
;
UPDATE AD_Process SET SqlStatement='SELECT de_metas_invoicecandidate.C_Invoice_Candidate_Failed_To_Update_Find_Log_Fix();' WHERE AD_Process_ID=540679;
------------------
-- DDL
CREATE SCHEMA de_metas_invoicecandidate;
-- ICs that reference only an inoutLine (no orderline)
CREATE OR REPLACE VIEW de_metas_invoicecandidate.C_Invoice_Candidate_Wrong_QtyDelivered_iol_v AS
SELECT ic.C_Invoice_Candidate_ID, ic.Created, ic.Updated, dt.Name, COALESCE(DateToInvoice_Override, DateToInvoice),
ic.QtyDelivered,
SUM(iol.MovementQty)
FROM C_Invoice_Candidate ic
JOIN C_DocType dt ON dt.C_DocType_ID=ic.C_DocTypeInvoice_ID
JOIN C_InvoiceCandidate_InOutLine ic_iol ON ic_iol.C_Invoice_Candidate_ID=ic.C_Invoice_Candidate_ID
JOIN M_InOutLine iol ON iol.M_InOutLine_ID=ic_iol.M_InOutLine_ID
JOIN M_InOut io ON io.M_InOut_ID=iol.M_InOut_ID
LEFT JOIN C_OrderLine ol ON ol.C_OrderLine_ID=ic.C_OrderLine_ID
LEFT JOIN C_Invoice_Candidate_Recompute icr ON icr.C_Invoice_Candidate_ID=ic.C_Invoice_Candidate_ID
WHERE true
AND ic.Updated + interval '10 minutes' < now() -- were updated at least 10 minutes ago
AND COALESCE(ic.Processed_Override, ic.Processed)='N'
AND icr.C_Invoice_Candidate_ID IS NULL -- not recomputation
AND ol.C_OrderLine_ID IS NULL -- inoutline-handler
AND io.DocStatus IN ('CO','CL')
GROUP BY ic.C_Invoice_Candidate_ID, ic.Created, ic.Updated, dt.Name, COALESCE(DateToInvoice_Override, DateToInvoice), ic.QtyDelivered
HAVING ABS(ic.QtyDelivered)!=ABS(SUM(iol.MovementQty))
ORDER BY COALESCE(DateToInvoice_Override, DateToInvoice)
;
COMMENT ON VIEW de_metas_invoicecandidate.C_Invoice_Candidate_Wrong_QtyDelivered_iol_v IS
'ICs that do not reference a C_OrderLine, have an inconsistend QtyDelivered value and were created/updated more than 10 minutes ago.
Issue FRESH-93'
;
-- ICs that do reference an orderline
CREATE OR REPLACE VIEW de_metas_invoicecandidate.C_Invoice_Candidate_Wrong_QtyDelivered_ol_v AS
SELECT ic.C_Invoice_Candidate_ID, ic.Created, ic.Updated,
ic.QtyOrdered, ol.QtyOrdered as ol_qtyOrdered,
ic.QtyDelivered, ol.QtyDelivered as ol_qtyDelivered
FROM C_Invoice_Candidate ic
JOIN C_OrderLine ol ON ol.C_OrderLine_ID=ic.C_OrderLine_ID
JOIN C_Order o ON o.C_Order_ID=ol.C_Order_ID
LEFT JOIN C_Invoice_Candidate_Recompute icr ON icr.C_Invoice_Candidate_ID=ic.C_Invoice_Candidate_ID
WHERE true
AND ic.Updated + interval '10 minutes' < now() -- were updated at least 10 minutes ago
AND COALESCE(ic.Processed_Override, ic.Processed)='N'
AND icr.C_Invoice_Candidate_ID IS NULL -- not recomputed
AND o.DocStatus IN ('CO','CL')
AND (
ic.QtyDelivered!=ol.QtyDelivered
OR ic.QtyOrdered!=ol.QtyOrdered
);
COMMENT ON VIEW de_metas_invoicecandidate.C_Invoice_Candidate_Wrong_QtyDelivered_ol_v IS
'ICs that reference a C_OrderLine, have an inconsistend QtyDelivered value and were created/updated more than 10 minutes ago.
Issue FRESH-93'
;
CREATE OR REPLACE VIEW de_metas_invoicecandidate.C_Invoice_Candidate_Stale_QtyInvoiced_v AS
SELECT ic.C_Invoice_Candidate_ID, ic.QtyInvoiced, SUM(ila.QtyInvoiced)
FROM C_Invoice_Candidate ic
JOIN C_Invoice_Line_Alloc ila ON ic.C_Invoice_Candidate_ID=ila.C_Invoice_Candidate_ID
WHERE ic.Processed='N'
AND ic.Updated + interval '10 minutes' < now() -- were updated at least 10 minutes ago
GROUP BY ic.C_Invoice_Candidate_ID, ic.QtyInvoiced
HAVING ic.QtyInvoiced!=SUM(ila.QtyInvoiced)
;
COMMENT ON VIEW de_metas_invoicecandidate.C_Invoice_Candidate_Stale_QtyInvoiced_v IS
'ICs that have an inconsistend QtyInvoiced value and were created/updated more than 10 minutes ago.
Issue FRESH-93'
;
-- ICs that don't yet have an aggregation group
CREATE OR REPLACE VIEW de_metas_invoicecandidate.C_Invoice_Candidate_Missing_Aggregation_Group_v AS
SELECT ic.C_Invoice_Candidate_ID, ic.Created, ic.Updated
FROM C_Invoice_Candidate ic
WHERE ic.C_Invoice_Candidate_Headeraggregation_Effective_ID IS NULL AND ic.Processed='N' AND IsToClear='N'
AND ic.Updated + interval '10 minutes' < now() -- were updated at least 10 minutes ago
ORDER BY Updated desc
;
COMMENT ON VIEW de_metas_invoicecandidate.C_Invoice_Candidate_Missing_Aggregation_Group_v IS
'ICs that don''t yet have an aggregation group, but were created/updated more than 10 minutes ago.
Issue FRESH-93'
;
-- union all views into one
drop view if exists de_metas_invoicecandidate.C_Invoice_Candidate_Failed_To_Update_v ;
CREATE OR REPLACE VIEW de_metas_invoicecandidate.C_Invoice_Candidate_Failed_To_Update_v AS
SELECT
now()::timestamp with time zone as found,
null::timestamp with time zone as reenqueued,
'N'::character(1) AS IsErrorAcknowledged,
'C_Invoice_Candidate_Wrong_QtyDelivered_iol_v' as problem_found_by,
ic.*
FROM C_Invoice_Candidate ic
WHERE ic.C_Invoice_Candidate_ID IN (select C_Invoice_Candidate_ID from de_metas_invoicecandidate.C_Invoice_Candidate_Wrong_QtyDelivered_iol_v)
UNION
SELECT
now(),
null,
'N',
'C_Invoice_Candidate_Wrong_QtyDelivered_ol_v',
ic.*
FROM C_Invoice_Candidate ic
WHERE ic.C_Invoice_Candidate_ID IN (select C_Invoice_Candidate_ID from de_metas_invoicecandidate.C_Invoice_Candidate_Wrong_QtyDelivered_ol_v)
UNION
SELECT
now(),
null,
'N',
'C_Invoice_Candidate_Stale_QtyInvoiced_v',
ic.*
FROM C_Invoice_Candidate ic
WHERE ic.C_Invoice_Candidate_ID IN (select C_Invoice_Candidate_ID from de_metas_invoicecandidate.C_Invoice_Candidate_Stale_QtyInvoiced_v)
UNION
SELECT
now(),
null,
'N',
'C_Invoice_Candidate_Missing_Aggregation_Group_v',
ic.*
FROM C_Invoice_Candidate ic
WHERE ic.C_Invoice_Candidate_ID IN (select C_Invoice_Candidate_ID from de_metas_invoicecandidate.C_Invoice_Candidate_Missing_Aggregation_Group_v)
;
COMMENT ON VIEW de_metas_invoicecandidate.C_Invoice_Candidate_Failed_To_Update_v IS
'Union that selects all invoice candidates which were idientified by one of the individual views.
Issue FRESH-93'
;
DROP TABLE IF EXISTS de_metas_invoicecandidate.C_Invoice_Candidate_Failed_To_Update;
CREATE TABLE de_metas_invoicecandidate.C_Invoice_Candidate_Failed_To_Update AS
SELECT *
FROM de_metas_invoicecandidate.C_Invoice_Candidate_Failed_To_Update_v
LIMIT 0;
COMMENT ON TABLE de_metas_invoicecandidate.C_Invoice_Candidate_Failed_To_Update IS
'Serves as a log for ICs that failed to update due to different reasons.
Issue FRESH-93'
;
CREATE OR REPLACE FUNCTION de_metas_invoicecandidate.C_Invoice_Candidate_Failed_To_Update_Find_Log_Fix() RETURNS VOID AS
$BODY$
INSERT INTO de_metas_invoicecandidate.C_Invoice_Candidate_Failed_To_Update
SELECT * FROM de_metas_invoicecandidate.C_Invoice_Candidate_Failed_To_Update_v;
--select * from de_metas_invoicecandidate.C_Invoice_Candidate_Failed_To_Update
WITH source as (
UPDATE de_metas_invoicecandidate.C_Invoice_Candidate_Failed_To_Update
SET reenqueued=now()
WHERE reenqueued is null
RETURNING C_Invoice_Candidate_ID
)
INSERT INTO C_Invoice_Candidate_Recompute
SELECT C_Invoice_Candidate_ID
FROM source;
$BODY$
LANGUAGE sql VOLATILE;
COMMENT ON FUNCTION de_metas_invoicecandidate.C_Invoice_Candidate_Failed_To_Update_Find_Log_Fix() IS
'Executes the view de_metas_invoicecandidate.C_Invoice_Candidate_Failed_To_Update_v and inserts the results into the table de_metas_invoicecandidate.C_Invoice_Candidate_Failed_To_Update.
Then it inserts the problematic ICs'' C_Invoice_Candidate_IDs into C_Invoice_Candidate_Recompute
Issue FRESH-93'; | 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.
--;
-- Schema upgrade from 4.10.0.0 to 4.11.0.0
--;
--;
-- Stored procedure to do idempotent column add;
--;
DROP PROCEDURE IF EXISTS `cloud`.`IDEMPOTENT_ADD_COLUMN`;
CREATE PROCEDURE `cloud`.`IDEMPOTENT_ADD_COLUMN` (
IN in_table_name VARCHAR(200)
, IN in_column_name VARCHAR(200)
, IN in_column_definition VARCHAR(1000)
)
BEGIN
DECLARE CONTINUE HANDLER FOR 1060 BEGIN END; SET @ddl = CONCAT('ALTER TABLE ', in_table_name); SET @ddl = CONCAT(@ddl, ' ', 'ADD COLUMN') ; SET @ddl = CONCAT(@ddl, ' ', in_column_name); SET @ddl = CONCAT(@ddl, ' ', in_column_definition); PREPARE stmt FROM @ddl; EXECUTE stmt; DEALLOCATE PREPARE stmt; END;
DROP PROCEDURE IF EXISTS `cloud`.`IDEMPOTENT_DROP_FOREIGN_KEY`;
CREATE PROCEDURE `cloud`.`IDEMPOTENT_DROP_FOREIGN_KEY` (
IN in_table_name VARCHAR(200)
, IN in_foreign_key_name VARCHAR(200)
)
BEGIN
DECLARE CONTINUE HANDLER FOR 1091 BEGIN END; SET @ddl = CONCAT('ALTER TABLE ', in_table_name); SET @ddl = CONCAT(@ddl, ' ', ' DROP FOREIGN KEY '); SET @ddl = CONCAT(@ddl, ' ', in_foreign_key_name); PREPARE stmt FROM @ddl; EXECUTE stmt; DEALLOCATE PREPARE stmt; END;
DROP PROCEDURE IF EXISTS `cloud`.`IDEMPOTENT_DROP_INDEX`;
CREATE PROCEDURE `cloud`.`IDEMPOTENT_DROP_INDEX` (
IN in_index_name VARCHAR(200)
, IN in_table_name VARCHAR(200)
)
BEGIN
DECLARE CONTINUE HANDLER FOR 1091 BEGIN END; SET @ddl = CONCAT('DROP INDEX ', in_index_name); SET @ddl = CONCAT(@ddl, ' ', ' ON ') ; SET @ddl = CONCAT(@ddl, ' ', in_table_name); PREPARE stmt FROM @ddl; EXECUTE stmt; DEALLOCATE PREPARE stmt; END;
DROP PROCEDURE IF EXISTS `cloud`.`IDEMPOTENT_CREATE_UNIQUE_INDEX`;
CREATE PROCEDURE `cloud`.`IDEMPOTENT_CREATE_UNIQUE_INDEX` (
IN in_index_name VARCHAR(200)
, IN in_table_name VARCHAR(200)
, IN in_index_definition VARCHAR(1000)
)
BEGIN
DECLARE CONTINUE HANDLER FOR 1061 BEGIN END; SET @ddl = CONCAT('CREATE UNIQUE INDEX ', in_index_name); SET @ddl = CONCAT(@ddl, ' ', ' ON ') ; SET @ddl = CONCAT(@ddl, ' ', in_table_name); SET @ddl = CONCAT(@ddl, ' ', in_index_definition); PREPARE stmt FROM @ddl; EXECUTE stmt; DEALLOCATE PREPARE stmt; END;
-- Add For VPC flag
CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.network_offerings','for_vpc', 'INT(1) NOT NULL DEFAULT 0');
UPDATE cloud.network_offerings o
SET for_vpc = 1
where
o.conserve_mode = 0
and o.guest_type = 'Isolated'
and exists(
SELECT id
from cloud.ntwk_offering_service_map
where network_offering_id = o.id and (
provider in ('VpcVirtualRouter', 'InternalLbVm', 'JuniperContrailVpcRouter')
or service in ('NetworkACL')
)
);
UPDATE `cloud`.`configuration` SET value = '600', default_value = '600' WHERE category = 'Advanced' AND name = 'router.aggregation.command.each.timeout';
-- CA framework changes
DELETE from `cloud`.`configuration` where name='ssl.keystore';
-- Certificate Revocation List
CREATE TABLE IF NOT EXISTS `cloud`.`crl` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`serial` varchar(255) UNIQUE NOT NULL COMMENT 'certificate\'s serial number as hex string',
`cn` varchar(255) COMMENT 'certificate\'s common name',
`revoker_uuid` varchar(40) COMMENT 'revoker user account uuid',
`revoked` datetime COMMENT 'date of revocation',
PRIMARY KEY (`id`),
KEY (`serial`),
UNIQUE KEY (`serial`, `cn`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Host HA feature
CREATE TABLE IF NOT EXISTS `cloud`.`ha_config` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`resource_id` bigint(20) unsigned DEFAULT NULL COMMENT 'id of the resource',
`resource_type` varchar(255) NOT NULL COMMENT 'the type of the resource',
`enabled` int(1) unsigned DEFAULT '0' COMMENT 'is HA enabled for the resource',
`ha_state` varchar(255) DEFAULT 'Disabled' COMMENT 'HA state',
`provider` varchar(255) DEFAULT NULL COMMENT 'HA provider',
`update_count` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT 'state based incr-only counter for atomic ha_state updates',
`update_time` datetime COMMENT 'last ha_state update datetime',
`mgmt_server_id` bigint(20) unsigned DEFAULT NULL COMMENT 'management server id that is responsible for the HA for the resource',
PRIMARY KEY (`id`),
KEY `i_ha_config__enabled` (`enabled`),
KEY `i_ha_config__ha_state` (`ha_state`),
KEY `i_ha_config__mgmt_server_id` (`mgmt_server_id`),
UNIQUE KEY (`resource_id`, `resource_type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DELETE from `cloud`.`configuration` where name='outofbandmanagement.sync.interval';
-- Annotations specifc changes following
CREATE TABLE IF NOT EXISTS `cloud`.`annotations` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`uuid` varchar(40) UNIQUE,
`annotation` text,
`entity_uuid` varchar(40),
`entity_type` varchar(32),
`user_uuid` varchar(40),
`created` datetime COMMENT 'date of creation',
`removed` datetime COMMENT 'date of removal',
PRIMARY KEY (`id`),
KEY (`uuid`),
KEY `i_entity` (`entity_uuid`, `entity_type`, `created`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP VIEW IF EXISTS `cloud`.`last_annotation_view`;
CREATE VIEW `cloud`.`last_annotation_view` AS
SELECT
`annotations`.`uuid` AS `uuid`,
`annotations`.`annotation` AS `annotation`,
`annotations`.`entity_uuid` AS `entity_uuid`,
`annotations`.`entity_type` AS `entity_type`,
`annotations`.`user_uuid` AS `user_uuid`,
`annotations`.`created` AS `created`,
`annotations`.`removed` AS `removed`
FROM
`annotations`
WHERE
`annotations`.`created` IN (SELECT
MAX(`annotations`.`created`)
FROM
`annotations`
WHERE
`annotations`.`removed` IS NULL
GROUP BY `annotations`.`entity_uuid`);
-- Host HA changes:
DROP VIEW IF EXISTS `cloud`.`host_view`;
CREATE VIEW `cloud`.`host_view` AS
SELECT
host.id,
host.uuid,
host.name,
host.status,
host.disconnected,
host.type,
host.private_ip_address,
host.version,
host.hypervisor_type,
host.hypervisor_version,
host.capabilities,
host.last_ping,
host.created,
host.removed,
host.resource_state,
host.mgmt_server_id,
host.cpu_sockets,
host.cpus,
host.speed,
host.ram,
cluster.id cluster_id,
cluster.uuid cluster_uuid,
cluster.name cluster_name,
cluster.cluster_type,
data_center.id data_center_id,
data_center.uuid data_center_uuid,
data_center.name data_center_name,
data_center.networktype data_center_type,
host_pod_ref.id pod_id,
host_pod_ref.uuid pod_uuid,
host_pod_ref.name pod_name,
host_tags.tag,
guest_os_category.id guest_os_category_id,
guest_os_category.uuid guest_os_category_uuid,
guest_os_category.name guest_os_category_name,
mem_caps.used_capacity memory_used_capacity,
mem_caps.reserved_capacity memory_reserved_capacity,
cpu_caps.used_capacity cpu_used_capacity,
cpu_caps.reserved_capacity cpu_reserved_capacity,
async_job.id job_id,
async_job.uuid job_uuid,
async_job.job_status job_status,
async_job.account_id job_account_id,
oobm.enabled AS `oobm_enabled`,
oobm.power_state AS `oobm_power_state`,
ha_config.enabled AS `ha_enabled`,
ha_config.ha_state AS `ha_state`,
ha_config.provider AS `ha_provider`,
`last_annotation_view`.`annotation` AS `annotation`,
`last_annotation_view`.`created` AS `last_annotated`,
`user`.`username` AS `username`
FROM
`cloud`.`host`
LEFT JOIN
`cloud`.`cluster` ON host.cluster_id = cluster.id
LEFT JOIN
`cloud`.`data_center` ON host.data_center_id = data_center.id
LEFT JOIN
`cloud`.`host_pod_ref` ON host.pod_id = host_pod_ref.id
LEFT JOIN
`cloud`.`host_details` ON host.id = host_details.host_id
AND host_details.name = 'guest.os.category.id'
LEFT JOIN
`cloud`.`guest_os_category` ON guest_os_category.id = CONVERT ( host_details.value, UNSIGNED )
LEFT JOIN
`cloud`.`host_tags` ON host_tags.host_id = host.id
LEFT JOIN
`cloud`.`op_host_capacity` mem_caps ON host.id = mem_caps.host_id
AND mem_caps.capacity_type = 0
LEFT JOIN
`cloud`.`op_host_capacity` cpu_caps ON host.id = cpu_caps.host_id
AND cpu_caps.capacity_type = 1
LEFT JOIN
`cloud`.`async_job` ON async_job.instance_id = host.id
AND async_job.instance_type = 'Host'
AND async_job.job_status = 0
LEFT JOIN
`cloud`.`oobm` ON oobm.host_id = host.id
left join
`cloud`.`ha_config` ON ha_config.resource_id=host.id
and ha_config.resource_type='Host'
LEFT JOIN
`cloud`.`last_annotation_view` ON `last_annotation_view`.`entity_uuid` = `host`.`uuid`
LEFT JOIN
`cloud`.`user` ON `user`.`uuid` = `last_annotation_view`.`user_uuid`;
-- End Of Annotations specific changes
-- Out-of-band management driver for nested-cloudstack
ALTER TABLE `cloud`.`oobm` MODIFY COLUMN port VARCHAR(255);
-- CLOUDSTACK-9902: Console proxy SSL toggle
INSERT IGNORE INTO `cloud`.`configuration` (`category`, `instance`, `component`, `name`, `value`, `description`, `default_value`, `is_dynamic`) VALUES ('Console Proxy', 'DEFAULT', 'AgentManager', 'consoleproxy.sslEnabled', 'false', 'Enable SSL for console proxy', 'false', 0);
-- CLOUDSTACK-9859: Retirement of midonet plugin (final removal)
delete from `cloud`.`configuration` where name in ('midonet.apiserver.address', 'midonet.providerrouter.id');
-- CLOUDSTACK-9972: Enhance listVolumes API
INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Premium', 'DEFAULT', 'management-server', 'volume.stats.interval', '600000', 'Interval (in seconds) to report volume statistics', '600000', now(), NULL, NULL);
DROP VIEW IF EXISTS `cloud`.`volume_view`;
CREATE VIEW `cloud`.`volume_view` AS
SELECT
volumes.id,
volumes.uuid,
volumes.name,
volumes.device_id,
volumes.volume_type,
volumes.provisioning_type,
volumes.size,
volumes.min_iops,
volumes.max_iops,
volumes.created,
volumes.state,
volumes.attached,
volumes.removed,
volumes.display_volume,
volumes.format,
volumes.path,
volumes.chain_info,
account.id account_id,
account.uuid account_uuid,
account.account_name account_name,
account.type account_type,
domain.id domain_id,
domain.uuid domain_uuid,
domain.name domain_name,
domain.path domain_path,
projects.id project_id,
projects.uuid project_uuid,
projects.name project_name,
data_center.id data_center_id,
data_center.uuid data_center_uuid,
data_center.name data_center_name,
data_center.networktype data_center_type,
vm_instance.id vm_id,
vm_instance.uuid vm_uuid,
vm_instance.name vm_name,
vm_instance.state vm_state,
vm_instance.vm_type,
user_vm.display_name vm_display_name,
volume_store_ref.size volume_store_size,
volume_store_ref.download_pct,
volume_store_ref.download_state,
volume_store_ref.error_str,
volume_store_ref.created created_on_store,
disk_offering.id disk_offering_id,
disk_offering.uuid disk_offering_uuid,
disk_offering.name disk_offering_name,
disk_offering.display_text disk_offering_display_text,
disk_offering.use_local_storage,
disk_offering.system_use,
disk_offering.bytes_read_rate,
disk_offering.bytes_write_rate,
disk_offering.iops_read_rate,
disk_offering.iops_write_rate,
disk_offering.cache_mode,
storage_pool.id pool_id,
storage_pool.uuid pool_uuid,
storage_pool.name pool_name,
cluster.id cluster_id,
cluster.name cluster_name,
cluster.uuid cluster_uuid,
cluster.hypervisor_type,
vm_template.id template_id,
vm_template.uuid template_uuid,
vm_template.extractable,
vm_template.type template_type,
vm_template.name template_name,
vm_template.display_text template_display_text,
iso.id iso_id,
iso.uuid iso_uuid,
iso.name iso_name,
iso.display_text iso_display_text,
resource_tags.id tag_id,
resource_tags.uuid tag_uuid,
resource_tags.key tag_key,
resource_tags.value tag_value,
resource_tags.domain_id tag_domain_id,
resource_tags.account_id tag_account_id,
resource_tags.resource_id tag_resource_id,
resource_tags.resource_uuid tag_resource_uuid,
resource_tags.resource_type tag_resource_type,
resource_tags.customer tag_customer,
async_job.id job_id,
async_job.uuid job_uuid,
async_job.job_status job_status,
async_job.account_id job_account_id,
host_pod_ref.id pod_id,
host_pod_ref.uuid pod_uuid,
host_pod_ref.name pod_name,
resource_tag_account.account_name tag_account_name,
resource_tag_domain.uuid tag_domain_uuid,
resource_tag_domain.name tag_domain_name
from
`cloud`.`volumes`
inner join
`cloud`.`account` ON volumes.account_id = account.id
inner join
`cloud`.`domain` ON volumes.domain_id = domain.id
left join
`cloud`.`projects` ON projects.project_account_id = account.id
left join
`cloud`.`data_center` ON volumes.data_center_id = data_center.id
left join
`cloud`.`vm_instance` ON volumes.instance_id = vm_instance.id
left join
`cloud`.`user_vm` ON user_vm.id = vm_instance.id
left join
`cloud`.`volume_store_ref` ON volumes.id = volume_store_ref.volume_id
left join
`cloud`.`disk_offering` ON volumes.disk_offering_id = disk_offering.id
left join
`cloud`.`storage_pool` ON volumes.pool_id = storage_pool.id
left join
`cloud`.`host_pod_ref` ON storage_pool.pod_id = host_pod_ref.id
left join
`cloud`.`cluster` ON storage_pool.cluster_id = cluster.id
left join
`cloud`.`vm_template` ON volumes.template_id = vm_template.id
left join
`cloud`.`vm_template` iso ON iso.id = volumes.iso_id
left join
`cloud`.`resource_tags` ON resource_tags.resource_id = volumes.id
and resource_tags.resource_type = 'Volume'
left join
`cloud`.`async_job` ON async_job.instance_id = volumes.id
and async_job.instance_type = 'Volume'
and async_job.job_status = 0
left join
`cloud`.`account` resource_tag_account ON resource_tag_account.id = resource_tags.account_id
left join
`cloud`.`domain` resource_tag_domain ON resource_tag_domain.id = resource_tags.domain_id;
-- Extra Dhcp Options
CREATE TABLE IF NOT EXISTS `cloud`.`nic_extra_dhcp_options` (
`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
`uuid` varchar(255) UNIQUE,
`nic_id` bigint unsigned NOT NULL COMMENT ' nic id where dhcp options are applied',
`code` int(32),
`value` text,
PRIMARY KEY (`id`),
CONSTRAINT `fk_nic_extra_dhcp_options_nic_id` FOREIGN KEY (`nic_id`) REFERENCES `nics`(`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Add new OS versions
-- Add XenServer 7.1 and 7.2 hypervisor capabilities
INSERT IGNORE INTO `cloud`.`hypervisor_capabilities`(uuid, hypervisor_type, hypervisor_version, max_guests_limit, max_data_volumes_limit, storage_motion_supported) values (UUID(), 'XenServer', '7.1.0', 500, 13, 1);
INSERT IGNORE INTO `cloud`.`hypervisor_capabilities`(uuid, hypervisor_type, hypervisor_version, max_guests_limit, max_data_volumes_limit, storage_motion_supported) values (UUID(), 'XenServer', '7.2.0', 500, 13, 1);
-- Add XenServer 7.0 support for windows 10
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'Xenserver', '7.0.0', 'Windows 10 (64-bit)', 258, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'Xenserver', '7.0.0', 'Windows 10 (32-bit)', 257, now(), 0);
-- Add XenServer 7.1 hypervisor guest OS mappings (copy 7.0.0)
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) SELECT UUID(),'Xenserver', '7.1.0', guest_os_name, guest_os_id, utc_timestamp(), 0 FROM `cloud`.`guest_os_hypervisor` WHERE hypervisor_type='Xenserver' AND hypervisor_version='7.0.0';
-- Add XenServer 7.1 hypervisor guest OS (see https://docs.citrix.com/content/dam/docs/en-us/xenserver/7-1/downloads/xenserver-7-1-release-notes.pdf)
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'Xenserver', '7.1.0', 'Windows Server 2016 (64-bit)', 259, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'Xenserver', '7.1.0', 'SUSE Linux Enterprise Server 11 SP4', 187, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'Xenserver', '7.1.0', 'Red Hat Enterprise Linux 6 (64-bit)', 240, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'Xenserver', '7.1.0', 'Red Hat Enterprise Linux 7', 245, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'Xenserver', '7.1.0', 'Oracle Enterprise Linux 6 (64-bit)', 251, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'Xenserver', '7.1.0', 'Oracle Linux 7', 247, now(), 0);
-- Add XenServer 7.2 hypervisor guest OS mappings (copy 7.1.0 & remove Windows Vista, Windows XP, Windows 2003, CentOS 4.x, RHEL 4.xS, LES 10 (all versions) as per XenServer 7.2 Release Notes)
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) SELECT UUID(),'Xenserver', '7.2.0', guest_os_name, guest_os_id, utc_timestamp(), 0 FROM `cloud`.`guest_os_hypervisor` WHERE hypervisor_type='Xenserver' AND hypervisor_version='7.1.0' AND guest_os_id not in (1,2,3,4,56,101,56,58,93,94,50,51,87,88,89,90,91,92,26,27,28,29,40,41,42,43,44,45,96,97,107,108,109,110,151,152,153);
-- Add table to track primary storage in use for snapshots
CREATE TABLE IF NOT EXISTS `cloud_usage`.`usage_snapshot_on_primary` (
`id` bigint(20) unsigned NOT NULL,
`zone_id` bigint(20) unsigned NOT NULL,
`account_id` bigint(20) unsigned NOT NULL,
`domain_id` bigint(20) unsigned NOT NULL,
`vm_id` bigint(20) unsigned NOT NULL,
`name` varchar(128),
`type` int(1) unsigned NOT NULL,
`physicalsize` bigint(20),
`virtualsize` bigint(20),
`created` datetime NOT NULL,
`deleted` datetime,
INDEX `i_usage_snapshot_on_primary` (`account_id`,`id`,`vm_id`,`created`)
) ENGINE=InnoDB CHARSET=utf8;
-- Change monitor patch for apache2 in systemvm
UPDATE `cloud`.`monitoring_services` SET pidfile="/var/run/apache2/apache2.pid" WHERE process_name="apache2" AND service_name="apache2";
-- Use 'Other Linux 64-bit' as guest os for the default systemvmtemplate for VMware
-- This fixes a memory allocation issue to systemvms on VMware/ESXi
UPDATE `cloud`.`vm_template` SET guest_os_id=99 WHERE id=8;
-- Network External Ids
CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.networks','external_id', 'varchar(255)');
-- Separate Subnet for CPVM and SSVM (system vms)
CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.op_dc_ip_address_alloc','forsystemvms', 'TINYINT(1) NOT NULL DEFAULT 0 COMMENT ''Indicates if IP is dedicated for CPVM or SSVM'' ');
CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.op_dc_ip_address_alloc','vlan', 'INT(10) UNSIGNED NULL COMMENT ''Vlan the management network range is on'' ');
-- CLOUDSTACK-4757: Support multidisk OVA
CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.vm_template','parent_template_id', 'bigint(20) unsigned DEFAULT NULL COMMENT ''If datadisk template, then id of the root template this template belongs to'' ');
-- CLOUDSTACK-10146: Bypass Secondary Storage for KVM templates
CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.vm_template','direct_download', 'TINYINT(1) DEFAULT 0 COMMENT ''Indicates if Secondary Storage is bypassed and template is downloaded to Primary Storage'' ');
-- Changes to template_view for both multidisk OVA and bypass secondary storage for KVM templates
DROP VIEW IF EXISTS `cloud`.`template_view`;
CREATE VIEW `cloud`.`template_view` AS
SELECT
`vm_template`.`id` AS `id`,
`vm_template`.`uuid` AS `uuid`,
`vm_template`.`unique_name` AS `unique_name`,
`vm_template`.`name` AS `name`,
`vm_template`.`public` AS `public`,
`vm_template`.`featured` AS `featured`,
`vm_template`.`type` AS `type`,
`vm_template`.`hvm` AS `hvm`,
`vm_template`.`bits` AS `bits`,
`vm_template`.`url` AS `url`,
`vm_template`.`format` AS `format`,
`vm_template`.`created` AS `created`,
`vm_template`.`checksum` AS `checksum`,
`vm_template`.`display_text` AS `display_text`,
`vm_template`.`enable_password` AS `enable_password`,
`vm_template`.`dynamically_scalable` AS `dynamically_scalable`,
`vm_template`.`state` AS `template_state`,
`vm_template`.`guest_os_id` AS `guest_os_id`,
`guest_os`.`uuid` AS `guest_os_uuid`,
`guest_os`.`display_name` AS `guest_os_name`,
`vm_template`.`bootable` AS `bootable`,
`vm_template`.`prepopulate` AS `prepopulate`,
`vm_template`.`cross_zones` AS `cross_zones`,
`vm_template`.`hypervisor_type` AS `hypervisor_type`,
`vm_template`.`extractable` AS `extractable`,
`vm_template`.`template_tag` AS `template_tag`,
`vm_template`.`sort_key` AS `sort_key`,
`vm_template`.`removed` AS `removed`,
`vm_template`.`enable_sshkey` AS `enable_sshkey`,
`parent_template`.`id` AS `parent_template_id`,
`parent_template`.`uuid` AS `parent_template_uuid`,
`source_template`.`id` AS `source_template_id`,
`source_template`.`uuid` AS `source_template_uuid`,
`account`.`id` AS `account_id`,
`account`.`uuid` AS `account_uuid`,
`account`.`account_name` AS `account_name`,
`account`.`type` AS `account_type`,
`domain`.`id` AS `domain_id`,
`domain`.`uuid` AS `domain_uuid`,
`domain`.`name` AS `domain_name`,
`domain`.`path` AS `domain_path`,
`projects`.`id` AS `project_id`,
`projects`.`uuid` AS `project_uuid`,
`projects`.`name` AS `project_name`,
`data_center`.`id` AS `data_center_id`,
`data_center`.`uuid` AS `data_center_uuid`,
`data_center`.`name` AS `data_center_name`,
`launch_permission`.`account_id` AS `lp_account_id`,
`template_store_ref`.`store_id` AS `store_id`,
`image_store`.`scope` AS `store_scope`,
`template_store_ref`.`state` AS `state`,
`template_store_ref`.`download_state` AS `download_state`,
`template_store_ref`.`download_pct` AS `download_pct`,
`template_store_ref`.`error_str` AS `error_str`,
`template_store_ref`.`size` AS `size`,
`template_store_ref`.physical_size AS `physical_size`,
`template_store_ref`.`destroyed` AS `destroyed`,
`template_store_ref`.`created` AS `created_on_store`,
`vm_template_details`.`name` AS `detail_name`,
`vm_template_details`.`value` AS `detail_value`,
`resource_tags`.`id` AS `tag_id`,
`resource_tags`.`uuid` AS `tag_uuid`,
`resource_tags`.`key` AS `tag_key`,
`resource_tags`.`value` AS `tag_value`,
`resource_tags`.`domain_id` AS `tag_domain_id`,
`domain`.`uuid` AS `tag_domain_uuid`,
`domain`.`name` AS `tag_domain_name`,
`resource_tags`.`account_id` AS `tag_account_id`,
`account`.`account_name` AS `tag_account_name`,
`resource_tags`.`resource_id` AS `tag_resource_id`,
`resource_tags`.`resource_uuid` AS `tag_resource_uuid`,
`resource_tags`.`resource_type` AS `tag_resource_type`,
`resource_tags`.`customer` AS `tag_customer`,
CONCAT(`vm_template`.`id`,
'_',
IFNULL(`data_center`.`id`, 0)) AS `temp_zone_pair`,
`vm_template`.`direct_download` AS `direct_download`
FROM
(((((((((((((`vm_template`
JOIN `guest_os` ON ((`guest_os`.`id` = `vm_template`.`guest_os_id`)))
JOIN `account` ON ((`account`.`id` = `vm_template`.`account_id`)))
JOIN `domain` ON ((`domain`.`id` = `account`.`domain_id`)))
LEFT JOIN `projects` ON ((`projects`.`project_account_id` = `account`.`id`)))
LEFT JOIN `vm_template_details` ON ((`vm_template_details`.`template_id` = `vm_template`.`id`)))
LEFT JOIN `vm_template` `source_template` ON ((`source_template`.`id` = `vm_template`.`source_template_id`)))
LEFT JOIN `template_store_ref` ON (((`template_store_ref`.`template_id` = `vm_template`.`id`)
AND (`template_store_ref`.`store_role` = 'Image')
AND (`template_store_ref`.`destroyed` = 0))))
LEFT JOIN `vm_template` `parent_template` ON ((`parent_template`.`id` = `vm_template`.`parent_template_id`)))
LEFT JOIN `image_store` ON ((ISNULL(`image_store`.`removed`)
AND (`template_store_ref`.`store_id` IS NOT NULL)
AND (`image_store`.`id` = `template_store_ref`.`store_id`))))
LEFT JOIN `template_zone_ref` ON (((`template_zone_ref`.`template_id` = `vm_template`.`id`)
AND ISNULL(`template_store_ref`.`store_id`)
AND ISNULL(`template_zone_ref`.`removed`))))
LEFT JOIN `data_center` ON (((`image_store`.`data_center_id` = `data_center`.`id`)
OR (`template_zone_ref`.`zone_id` = `data_center`.`id`))))
LEFT JOIN `launch_permission` ON ((`launch_permission`.`template_id` = `vm_template`.`id`)))
LEFT JOIN `resource_tags` ON (((`resource_tags`.`resource_id` = `vm_template`.`id`)
AND ((`resource_tags`.`resource_type` = 'Template')
OR (`resource_tags`.`resource_type` = 'ISO')))));
-- CLOUDSTACK-10109: Enable dedication of public IPs to SSVM and CPVM
CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.user_ip_address','forsystemvms', 'TINYINT(1) NOT NULL DEFAULT 0 COMMENT ''true if IP is set to system vms, false if not'' ');
-- ldap binding on domain level
CREATE TABLE IF NOT EXISTS `cloud`.`domain_details` (
`id` bigint unsigned NOT NULL auto_increment,
`domain_id` bigint unsigned NOT NULL COMMENT 'account id',
`name` varchar(255) NOT NULL,
`value` varchar(255) NULL,
PRIMARY KEY (`id`),
CONSTRAINT `fk_domain_details__domain_id` FOREIGN KEY (`domain_id`) REFERENCES `domain`(`id`) ON DELETE CASCADE
)ENGINE=InnoDB DEFAULT CHARSET=utf8;
CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.ldap_configuration','domain_id', 'BIGINT(20) DEFAULT NULL');
CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.ldap_trust_map','account_id', 'BIGINT(20) DEFAULT 0');
CALL `cloud`.`IDEMPOTENT_DROP_FOREIGN_KEY`('cloud.ldap_trust_map','fk_ldap_trust_map__domain_id');
CALL `cloud`.`IDEMPOTENT_DROP_INDEX`('uk_ldap_trust_map__domain_id','cloud.ldap_trust_map');
CALL `cloud`.`IDEMPOTENT_CREATE_UNIQUE_INDEX`('uk_ldap_trust_map__bind_location','cloud.ldap_trust_map', '(domain_id, account_id)');
CREATE TABLE IF NOT EXISTS `cloud`.`netscaler_servicepackages` (
`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
`uuid` varchar(255) UNIQUE,
`name` varchar(255) UNIQUE COMMENT 'name of the service package',
`description` varchar(255) COMMENT 'description of the service package',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `cloud`.`external_netscaler_controlcenter` (
`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
`uuid` varchar(255) UNIQUE,
`username` varchar(255) COMMENT 'username of the NCC',
`password` varchar(255) COMMENT 'password of NCC',
`ncc_ip` varchar(255) COMMENT 'IP of NCC Manager',
`num_retries` bigint unsigned NOT NULL default 2 COMMENT 'Number of retries in ncc for command failure',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.sslcerts','name', 'varchar(255) NULL default NULL COMMENT ''Name of the Certificate'' ');
CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.network_offerings','service_package_id', 'varchar(255) NULL default NULL COMMENT ''Netscaler ControlCenter Service Package'' '); | the_stack |
-- 2021-06-21T10:33:17.580Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=20,Updated=TO_TIMESTAMP('2021-06-21 12:33:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=573764
;
-- 2021-06-21T10:33:17.604Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=30,Updated=TO_TIMESTAMP('2021-06-21 12:33:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=2254
;
-- 2021-06-21T10:33:17.610Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=40,Updated=TO_TIMESTAMP('2021-06-21 12:33:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=573974
;
-- 2021-06-21T10:33:17.614Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=50,Updated=TO_TIMESTAMP('2021-06-21 12:33:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=573975
;
-- 2021-06-21T10:33:17.619Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=60,Updated=TO_TIMESTAMP('2021-06-21 12:33:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=3695
;
-- 2021-06-21T10:33:17.624Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=70,Updated=TO_TIMESTAMP('2021-06-21 12:33:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=2250
;
-- 2021-06-21T10:33:17.629Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=80,Updated=TO_TIMESTAMP('2021-06-21 12:33:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=2252
;
-- 2021-06-21T10:33:17.634Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=90,Updated=TO_TIMESTAMP('2021-06-21 12:33:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=573976
;
-- 2021-06-21T10:33:17.638Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=100,Updated=TO_TIMESTAMP('2021-06-21 12:33:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=574444
;
-- 2021-06-21T10:33:17.642Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=110,Updated=TO_TIMESTAMP('2021-06-21 12:33:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=3054
;
-- 2021-06-21T10:33:17.647Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=120,Updated=TO_TIMESTAMP('2021-06-21 12:33:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=574445
;
-- 2021-06-21T10:33:17.651Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=130,Updated=TO_TIMESTAMP('2021-06-21 12:33:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=2242
;
-- 2021-06-21T10:33:47.806Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET FilterOperator='B',Updated=TO_TIMESTAMP('2021-06-21 12:33:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=3054
;
-- 2021-06-21T10:33:58.909Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsShowFilterInline='Y', FilterOperator='B',Updated=TO_TIMESTAMP('2021-06-21 12:33:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=574444
;
-- 2021-06-21T10:34:05.997Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsShowFilterInline='Y',Updated=TO_TIMESTAMP('2021-06-21 12:34:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=3054
;
-- 2021-06-21T10:36:45.950Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsShowFilterInline='N',Updated=TO_TIMESTAMP('2021-06-21 12:36:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=3054
;
-- 2021-06-21T10:36:57.937Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsShowFilterInline='N',Updated=TO_TIMESTAMP('2021-06-21 12:36:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=574444
;
-- 2021-06-21T10:39:08.998Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Tab_ID,IsDisplayed,DisplayLength,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,IsActive,Created,CreatedBy,IsReadOnly,Updated,UpdatedBy,Help,AD_Field_ID,IsDisplayedGrid,AD_Column_ID,Description,Name,AD_Org_ID,EntityType) VALUES (174,'N',14,'N','N','N','N',0,'Y',TO_TIMESTAMP('2021-06-21 12:39:08','YYYY-MM-DD HH24:MI:SS'),100,'N',TO_TIMESTAMP('2021-06-21 12:39:08','YYYY-MM-DD HH24:MI:SS'),100,'"Reihenfolge" bestimmt die Reihenfolge der Einträge',649735,'N',574445,'Zur Bestimmung der Reihenfolge der Einträge; die kleinste Zahl kommt zuerst','Reihenfolge',0,'D')
;
-- 2021-06-21T10:39:08.999Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Field_ID, t.Help,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_Field t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y') AND t.AD_Field_ID=649735 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-06-21T10:39:09.032Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(566)
;
-- 2021-06-21T10:39:09.060Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=649735
;
-- 2021-06-21T10:39:09.062Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Field(649735)
;
-- 2021-06-21T10:39:59.555Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=110, AD_UI_ElementGroup_ID=540519,Updated=TO_TIMESTAMP('2021-06-21 12:39:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=585274
;
-- 2021-06-21T10:40:12.749Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=120, AD_UI_ElementGroup_ID=540519,Updated=TO_TIMESTAMP('2021-06-21 12:40:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=585275
;
-- 2021-06-21T10:41:03.889Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=40,Updated=TO_TIMESTAMP('2021-06-21 12:41:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=584459
;
-- 2021-06-21T10:41:10.519Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=30,Updated=TO_TIMESTAMP('2021-06-21 12:41:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=584674
;
-- 2021-06-21T10:41:44.488Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (UpdatedBy,AD_UI_Element_ID,Help,AD_Client_ID,CreatedBy,SeqNo,SeqNoGrid,IsDisplayed_SideList,SeqNo_SideList,AD_Org_ID,AD_UI_ElementType,IsAllowFiltering,MultiLine_LinesCount,IsMultiLine,Description,AD_UI_ElementGroup_ID,Name,AD_Field_ID,AD_Tab_ID,Created,Updated,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid) VALUES (100,586801,'"Reihenfolge" bestimmt die Reihenfolge der Einträge',0,100,20,0,'N',0,0,'F','N',0,'N','Zur Bestimmung der Reihenfolge der Einträge; die kleinste Zahl kommt zuerst',545777,'SeqNo',649735,174,TO_TIMESTAMP('2021-06-21 12:41:44','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2021-06-21 12:41:44','YYYY-MM-DD HH24:MI:SS'),'Y','N','Y','N')
;
---
-- 2021-06-21T10:43:14.473Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNoGrid=50, IsDisplayedGrid='Y',Updated=TO_TIMESTAMP('2021-06-21 12:43:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=586801
;
-- 2021-06-21T10:43:14.479Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNoGrid=60, IsDisplayedGrid='Y',Updated=TO_TIMESTAMP('2021-06-21 12:43:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=584680
;
-- 2021-06-21T10:43:14.484Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNoGrid=70, IsDisplayedGrid='Y',Updated=TO_TIMESTAMP('2021-06-21 12:43:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=584681
;
-- 2021-06-21T10:43:14.489Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNoGrid=80, IsDisplayedGrid='Y',Updated=TO_TIMESTAMP('2021-06-21 12:43:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=585278
;
-- 2021-06-21T10:43:14.496Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNoGrid=90, IsDisplayedGrid='Y',Updated=TO_TIMESTAMP('2021-06-21 12:43:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=584679
;
-- 2021-06-21T10:43:14.501Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNoGrid=100, IsDisplayedGrid='Y',Updated=TO_TIMESTAMP('2021-06-21 12:43:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=584676
;
-- 2021-06-21T10:43:14.505Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNoGrid=110, IsDisplayedGrid='Y',Updated=TO_TIMESTAMP('2021-06-21 12:43:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=584460
;
-- 2021-06-21T10:43:14.510Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNoGrid=120, IsDisplayedGrid='Y',Updated=TO_TIMESTAMP('2021-06-21 12:43:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=584675
;
-- 2021-06-21T10:43:14.515Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNoGrid=130, IsDisplayedGrid='Y',Updated=TO_TIMESTAMP('2021-06-21 12:43:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=585274
;
-- 2021-06-21T10:43:14.519Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNoGrid=140, IsDisplayedGrid='Y',Updated=TO_TIMESTAMP('2021-06-21 12:43:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=585275
;
-- 2021-06-21T10:43:14.522Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNoGrid=150, IsDisplayedGrid='Y',Updated=TO_TIMESTAMP('2021-06-21 12:43:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544924
;
-- 2021-06-21T10:43:14.526Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNoGrid=160, IsDisplayedGrid='Y',Updated=TO_TIMESTAMP('2021-06-21 12:43:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544930
;
-- 2021-06-21T10:44:35.192Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Reference_ID=11, DefaultValue='0', FilterOperator='E',Updated=TO_TIMESTAMP('2021-06-21 12:44:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=574445
;
-- 2021-06-21T10:44:39.731Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO t_alter_column values('c_tax','SeqNo','NUMERIC(10)',null,'0')
;
-- 2021-06-21T10:44:40.053Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE C_Tax SET SeqNo=0 WHERE SeqNo IS NULL
;
--select migrationscript_ignore('43-de.metas.acct/5594890_sys_gh11130_tweak_tax_window.sql'); | the_stack |
-- As of now, the following plpgsql language constructs are unshippable
-- select count(*) into var from t2;ts
-- expressions such as var+var, var*var
-- reference to variables such as var in insert
-- reference to constant such as insert into t2 (a2, b2) values(100, 100)
set explain_perf_mode=pretty;
create table traverse_triggers_tbl1(a1 int, b1 int, c1 int) distribute by hash(a1,b1);
create table traverse_triggers_tbl2(a2 int, b2 int) distribute by hash(a2,b2);
create table traverse_triggers_tbl3(c1 varchar(255)) distribute by hash(c1);
------------------------------------
--Create trigger functions
------------------------------------
--assign----------------------------
drop function if exists trigger_function_assign() cascade;
create or replace function trigger_function_assign() returns trigger as
$$
declare
var integer := 1;
begin
insert into traverse_triggers_tbl2 (a2, b2) values(NEW.a1, NEW.b1);
--select count(*) into var from traverse_triggers_tbl2;
raise notice 'traverse_triggers_tbl2 count: %', var;
return NEW;
end
$$ language plpgsql;
--if--------------------------------
drop function if exists trigger_function_if() cascade;
create or replace function trigger_function_if() returns trigger as
$$
declare
var integer := 1;
begin
insert into traverse_triggers_tbl2 (a2, b2) values(NEW.a1, NEW.b1);
--select count(*) into var from traverse_triggers_tbl2;
raise notice 'traverse_triggers_tbl2 count: %', var;
if (var > 1) then
var := var + 1;
end if;
--insert into traverse_triggers_tbl2 (a2, b2) values(var+var, var*var);
raise notice 'traverse_triggers_tbl2 count: %', var;
return NEW;
end
$$ language plpgsql;
--case------------------------------
drop function if exists trigger_function_case() cascade;
create or replace function trigger_function_case() returns trigger as
$$
declare
var integer := 1;
begin
insert into traverse_triggers_tbl2 (a2, b2) values(NEW.a1, NEW.b1);
--select count(*) into var from traverse_triggers_tbl2;
raise notice 'traverse_triggers_tbl2 count: %', var;
case var
when 1 then
var := var + 1;
else
var := var + 2;
end case;
--insert into traverse_triggers_tbl2 (a2, b2) values(var+var, var*var);
raise notice 'traverse_triggers_tbl2 count: %', var;
return NEW;
end
$$ language plpgsql;
--loop------------------------------
drop function if exists trigger_function_loop() cascade;
create or replace function trigger_function_loop() returns trigger as
$$
declare
var integer := 1;
begin
insert into traverse_triggers_tbl2 (a2, b2) values(NEW.a1, NEW.b1);
-- select count(*) into var from traverse_triggers_tbl2;
raise notice 'traverse_triggers_tbl2 count: %', var;
loop
var := var + 1;
if var > 10 then
exit; -- exit loop
end if;
end loop;
-- insert into traverse_triggers_tbl2 (a2, b2) values(var+var, var*var);
raise notice 'traverse_triggers_tbl2 count: %', var;
return NEW;
end
$$ language plpgsql;
--while-----------------------------
drop function if exists trigger_function_while() cascade;
create or replace function trigger_function_while() returns trigger as
$$
declare
var integer := 1;
begin
insert into traverse_triggers_tbl2 (a2, b2) values(NEW.a1, NEW.b1);
-- select count(*) into var from traverse_triggers_tbl2;
raise notice 'traverse_triggers_tbl2 count: %', var;
while var < 10 loop
var := var + 1;
end loop;
-- insert into traverse_triggers_tbl2 (a2, b2) values(var+var, var*var);
raise notice 'traverse_triggers_tbl2 count: %', var;
return NEW;
end
$$ language plpgsql;
--fori------------------------------
drop function if exists trigger_function_fori() cascade;
create or replace function trigger_function_fori() returns trigger as
$$
declare
var integer := 1;
begin
insert into traverse_triggers_tbl2 (a2, b2) values(NEW.a1, NEW.b1);
-- select count(*) into var from traverse_triggers_tbl2;
raise notice 'traverse_triggers_tbl2 count: %', var;
for i in reverse 10..1 by 2 loop
-- i will take on the values 10,8,6,4,2 within the loop
var := var + i;
end loop;
-- insert into traverse_triggers_tbl2 (a2, b2) values(var+var, var*var);
raise notice 'traverse_triggers_tbl2 count: %', var;
return NEW;
end
$$ language plpgsql;
--fors------------------------------
drop function if exists trigger_function_fors() cascade;
create or replace function trigger_function_fors() returns trigger as
$$
declare
var integer := 1;
r record;
begin
insert into traverse_triggers_tbl2 (a2, b2) values(NEW.a1, NEW.b1);
-- select count(*) into var from traverse_triggers_tbl2;
raise notice 'traverse_triggers_tbl2 count: %', var;
for r in select tgrelid::regclass, tgenabled, tgname from pg_trigger loop
insert into traverse_triggers_tbl3 values (r.tgrelid::regclass || ' + ' || r.tgenabled || ' + ' || r.tgname );
end loop;
return NEW;
end
$$ language plpgsql;
--forc------------------------------
drop function if exists trigger_function_forc() cascade;
create or replace function trigger_function_forc() returns trigger as
$$
declare
var integer := 1;
cursor c no scroll for select tgname from pg_trigger;
triggername varchar;
begin
insert into traverse_triggers_tbl2 (a2, b2) values(NEW.a1, NEW.b1);
-- select count(*) into var from traverse_triggers_tbl2;
raise notice 'traverse_triggers_tbl2 count: %', var;
open c;
fetch first from c into triggername;
while found loop
insert into traverse_triggers_tbl3 values (triggername);
fetch next from c into triggername;
end loop;
close c;
return NEW;
end
$$ language plpgsql;
--foreach_a-------------------------
drop function if exists trigger_function_foreach_a() cascade;
create or replace function trigger_function_foreach_a() returns trigger as
$$
declare
var integer := 1;
myarray integer[];
begin
insert into traverse_triggers_tbl2 (a2, b2) values(NEW.a1, NEW.b1);
-- select count(*) into var from traverse_triggers_tbl2;
raise notice 'traverse_triggers_tbl2 count: %', var;
myarray := array[1,2,3,4,5];
foreach var in array myarray
loop
raise notice '%', var;
end loop;
return NEW;
end
$$ language plpgsql;
--exit------------------------------
drop function if exists trigger_function_exit() cascade;
create or replace function trigger_function_exit() returns trigger as
$$
declare
var integer := 1;
myarray integer[];
begin
insert into traverse_triggers_tbl2 (a2, b2) values(NEW.a1, NEW.b1);
-- select count(*) into var from traverse_triggers_tbl2;
raise notice 'traverse_triggers_tbl2 count: %', var;
myarray := array[1,2,3,4,5];
foreach var in array myarray
loop
raise notice '%', var;
exit when var > 2;
end loop;
return NEW;
end
$$ language plpgsql;
--return_next-----------------------
drop function if exists get_all_traverse_triggers_tbl1_doesnotwork() cascade;
create or replace function get_all_traverse_triggers_tbl1_doesnotwork() returns setof traverse_triggers_tbl1 as
$$
declare
r traverse_triggers_tbl1%rowtype;
begin
for r in
select * from traverse_triggers_tbl1
loop
-- can do some processing here
return next r; -- return current row of select
end loop;
return;
end
$$
language plpgsql;
drop function if exists get_all_traverse_triggers_tbl1_doesnotwork2() cascade;
create or replace function get_all_traverse_triggers_tbl1_doesnotwork2() returns table(a1 integer, b1 integer) as
$$
begin
for a1, b1 in
select traverse_triggers_tbl1.a1, traverse_triggers_tbl1.b1 from traverse_triggers_tbl1
loop
-- can do some processing here
return next; -- return current row of select
end loop;
end
$$
language plpgsql;
drop function if exists get_all_traverse_triggers_tbl1() cascade;
create or replace function get_all_traverse_triggers_tbl1() returns table(a1 integer, b1 integer) as
$$
declare
r record;
begin
for r in (select traverse_triggers_tbl1.a1, traverse_triggers_tbl1.b1 from traverse_triggers_tbl1)
loop
-- can do some processing here
a1 := a1+10;
b1 := b1+10;
return next; -- return current row of select
end loop;
end
$$
language plpgsql;
drop function if exists trigger_function_return_next() cascade;
create or replace function trigger_function_return_next() returns trigger as
$$
declare
var integer := 1;
begin
insert into traverse_triggers_tbl2 (a2, b2) values(NEW.a1, NEW.b1);
--select count(*) into var from traverse_triggers_tbl2;
raise notice 'traverse_triggers_tbl2 count: %', var;
--select * from get_all_traverse_triggers_tbl1();
return NEW;
end
$$ language plpgsql;
--return_query----------------------
drop function if exists get_one_row_traverse_triggers_tbl1() cascade;
create or replace function get_one_row_traverse_triggers_tbl1() returns table(a1 integer, b1 integer, c1 integer) as
$$
begin
return query select a1, b1, c1 from traverse_triggers_tbl1 limit 1;
-- since execution is not finished, we can check whether rows were returned
-- and --raise exception if not.
if not found then
raise exception 'no row at found';
end if;
end
$$
language plpgsql;
drop function if exists trigger_function_return_query() cascade;
create or replace function trigger_function_return_query() returns trigger as
$$
declare
var integer := 1;
begin
insert into traverse_triggers_tbl2 (a2, b2) values(NEW.a1, NEW.b1);
--select count(*) into var from traverse_triggers_tbl2;
raise notice 'traverse_triggers_tbl2 count: %', var;
--select * from get_one_row_traverse_triggers_tbl1();
return NEW;
end
$$ language plpgsql;
--open------------------------------
--fetch-----------------------------
--cursor_direction------------------
--close-----------------------------
drop function if exists trigger_function_open_fetch_close_cursor_direction() cascade;
create or replace function trigger_function_open_fetch_close_cursor_direction() returns trigger as
$$
declare
var integer := 1;
cursor c no scroll for select tgname from pg_trigger;
triggername varchar;
begin
insert into traverse_triggers_tbl2 (a2, b2) values(NEW.a1, NEW.b1);
--select count(*) into var from traverse_triggers_tbl2;
raise notice 'traverse_triggers_tbl2 count: %', var;
open c;
fetch first from c into triggername;
while found loop
insert into traverse_triggers_tbl3 values (triggername);
fetch next from c into triggername;
end loop;
close c;
return NEW;
end
$$ language plpgsql;
--perform---------------------------
drop function if exists trigger_function_perform() cascade;
create or replace function trigger_function_perform() returns trigger as
$$
declare
var integer := 1;
begin
insert into traverse_triggers_tbl2 (a2, b2) values(NEW.a1, NEW.b1);
--select count(*) into var from traverse_triggers_tbl2;
raise notice 'traverse_triggers_tbl2 count: %', var;
perform 2+2;
return NEW;
end
$$ language plpgsql;
--dynexecute---------------------------
drop function if exists trigger_function_dynexecute() cascade;
create or replace function trigger_function_dynexecute() returns trigger as
$$
begin
execute 'create table dyn_execute_create_table(id int);drop table dyn_execute_create_table;';
return null;
end
$$ language plpgsql;
------------------------------------
--Before Insert Row Triggers
------------------------------------
drop trigger if exists trigger_function_assign ON traverse_triggers_tbl1;
create trigger trigger_function_assign before insert on traverse_triggers_tbl1 for each row execute procedure trigger_function_assign();
drop trigger if exists trigger_function_if ON traverse_triggers_tbl1;
create trigger trigger_function_if before insert on traverse_triggers_tbl1 for each row execute procedure trigger_function_if();
drop trigger if exists trigger_function_case ON traverse_triggers_tbl1;
create trigger trigger_function_case before insert on traverse_triggers_tbl1 for each row execute procedure trigger_function_case();
drop trigger if exists trigger_function_loop ON traverse_triggers_tbl1;
create trigger trigger_function_loop before insert on traverse_triggers_tbl1 for each row execute procedure trigger_function_loop();
drop trigger if exists trigger_function_while ON traverse_triggers_tbl1;
create trigger trigger_function_while before insert on traverse_triggers_tbl1 for each row execute procedure trigger_function_while();
drop trigger if exists trigger_function_fori ON traverse_triggers_tbl1;
create trigger trigger_function_fori before insert on traverse_triggers_tbl1 for each row execute procedure trigger_function_fori();
drop trigger if exists trigger_function_fors ON traverse_triggers_tbl1;
create trigger trigger_function_fors before insert on traverse_triggers_tbl1 for each row execute procedure trigger_function_fors();
drop trigger if exists trigger_function_forc ON traverse_triggers_tbl1;
create trigger trigger_function_forc before insert on traverse_triggers_tbl1 for each row execute procedure trigger_function_forc();
drop trigger if exists trigger_function_foreach_a ON traverse_triggers_tbl1;
create trigger trigger_function_foreach_a before insert on traverse_triggers_tbl1 for each row execute procedure trigger_function_foreach_a();
drop trigger if exists trigger_function_exit ON traverse_triggers_tbl1;
create trigger trigger_function_exit before insert on traverse_triggers_tbl1 for each row execute procedure trigger_function_exit();
drop trigger if exists trigger_function_return_next ON traverse_triggers_tbl1;
create trigger trigger_function_return_next before insert on traverse_triggers_tbl1 for each row execute procedure trigger_function_return_next();
drop trigger if exists trigger_function_return_query ON traverse_triggers_tbl1;
create trigger trigger_function_return_query before insert on traverse_triggers_tbl1 for each row execute procedure trigger_function_return_query();
drop trigger if exists trigger_function_open_fetch_close_cursor_direction ON traverse_triggers_tbl1;
create trigger trigger_function_open_fetch_close_cursor_direction before insert on traverse_triggers_tbl1 for each row execute procedure trigger_function_open_fetch_close_cursor_direction();
drop trigger if exists trigger_function_perform ON traverse_triggers_tbl1;
create trigger trigger_function_perform before insert on traverse_triggers_tbl1 for each row execute procedure trigger_function_perform();
drop trigger if exists trigger_function_dynexecute ON traverse_triggers_tbl1;
create trigger trigger_function_dynexecute before insert on traverse_triggers_tbl1 for each row execute procedure trigger_function_dynexecute();
------------------------------------
--Disable all Triggers
------------------------------------
alter table traverse_triggers_tbl1 disable trigger all;
------------------------------------------
--Trigger traverse function testcase: assign
------------------------------------------
alter table traverse_triggers_tbl1 enable trigger trigger_function_assign;
set enable_trigger_shipping=off;
explain performance insert into traverse_triggers_tbl1 values (1,1);
set enable_trigger_shipping=on;
explain performance insert into traverse_triggers_tbl1 values (1,1);
alter table traverse_triggers_tbl1 disable trigger trigger_function_assign;
------------------------------------------
--Trigger traverse function testcase: if
------------------------------------------
alter table traverse_triggers_tbl1 enable trigger trigger_function_if;
set enable_trigger_shipping=off;
explain performance insert into traverse_triggers_tbl1 values (1,1);
set enable_trigger_shipping=on;
explain performance insert into traverse_triggers_tbl1 values (1,1);
alter table traverse_triggers_tbl1 disable trigger trigger_function_if;
------------------------------------------
--Trigger traverse function testcase: case
------------------------------------------
alter table traverse_triggers_tbl1 enable trigger trigger_function_case;
set enable_trigger_shipping=off;
explain verbose insert into traverse_triggers_tbl1 values (1,1);
set enable_trigger_shipping=on;
explain performance insert into traverse_triggers_tbl1 values (1,1);
alter table traverse_triggers_tbl1 disable trigger trigger_function_case;
------------------------------------------
--Trigger traverse function testcase: loop
------------------------------------------
alter table traverse_triggers_tbl1 enable trigger trigger_function_loop;
set enable_trigger_shipping=off;
explain performance insert into traverse_triggers_tbl1 values (1,1);
set enable_trigger_shipping=on;
explain performance insert into traverse_triggers_tbl1 values (1,1);
alter table traverse_triggers_tbl1 disable trigger trigger_function_loop;
------------------------------------------
--Trigger traverse function testcase: while
------------------------------------------
alter table traverse_triggers_tbl1 enable trigger trigger_function_while;
set enable_trigger_shipping=off;
explain performance insert into traverse_triggers_tbl1 values (1,1);
set enable_trigger_shipping=on;
explain performance insert into traverse_triggers_tbl1 values (1,1);
alter table traverse_triggers_tbl1 disable trigger trigger_function_while;
------------------------------------------
--Trigger traverse function testcase: fori
------------------------------------------
alter table traverse_triggers_tbl1 enable trigger trigger_function_fori;
set enable_trigger_shipping=off;
explain performance insert into traverse_triggers_tbl1 values (1,1);
set enable_trigger_shipping=on;
explain performance insert into traverse_triggers_tbl1 values (1,1);
alter table traverse_triggers_tbl1 disable trigger trigger_function_fori;
------------------------------------------
--Trigger traverse function testcase: fors
------------------------------------------
alter table traverse_triggers_tbl1 enable trigger trigger_function_fors;
set enable_trigger_shipping=off;
explain performance insert into traverse_triggers_tbl1 values (1,1);
set enable_trigger_shipping=on;
explain performance insert into traverse_triggers_tbl1 values (1,1);
alter table traverse_triggers_tbl1 disable trigger trigger_function_fors;
------------------------------------------
--Trigger traverse function testcase: forc
------------------------------------------
alter table traverse_triggers_tbl1 enable trigger trigger_function_forc;
set enable_trigger_shipping=off;
explain performance insert into traverse_triggers_tbl1 values (1,1);
set enable_trigger_shipping=on;
explain performance insert into traverse_triggers_tbl1 values (1,1);
alter table traverse_triggers_tbl1 disable trigger trigger_function_forc;
------------------------------------------
--Trigger traverse function testcase: foreach_a
------------------------------------------
alter table traverse_triggers_tbl1 enable trigger trigger_function_foreach_a;
set enable_trigger_shipping=off;
explain performance insert into traverse_triggers_tbl1 values (1,1);
set enable_trigger_shipping=on;
explain performance insert into traverse_triggers_tbl1 values (1,1);
alter table traverse_triggers_tbl1 disable trigger trigger_function_foreach_a;
------------------------------------------
--Trigger traverse function testcase: exit
------------------------------------------
alter table traverse_triggers_tbl1 enable trigger trigger_function_exit;
set enable_trigger_shipping=off;
explain performance insert into traverse_triggers_tbl1 values (1,1);
set enable_trigger_shipping=on;
explain performance insert into traverse_triggers_tbl1 values (1,1);
alter table traverse_triggers_tbl1 disable trigger trigger_function_exit;
------------------------------------------
--Trigger traverse function testcase: return_next
------------------------------------------
alter table traverse_triggers_tbl1 enable trigger trigger_function_return_next;
set enable_trigger_shipping=off;
explain performance insert into traverse_triggers_tbl1 values (1,1);
set enable_trigger_shipping=on;
explain performance insert into traverse_triggers_tbl1 values (1,1);
alter table traverse_triggers_tbl1 disable trigger trigger_function_return_next;
------------------------------------------
--Trigger traverse function testcase: return_query
------------------------------------------
alter table traverse_triggers_tbl1 enable trigger trigger_function_return_query;
set enable_trigger_shipping=off;
explain performance insert into traverse_triggers_tbl1 values (1,1);
set enable_trigger_shipping=on;
explain performance insert into traverse_triggers_tbl1 values (1,1);
alter table traverse_triggers_tbl1 disable trigger trigger_function_return_query;
------------------------------------------
--Trigger traverse function testcase: open_fetch_close_cursor_direction
------------------------------------------
alter table traverse_triggers_tbl1 enable trigger trigger_function_open_fetch_close_cursor_direction;
set enable_trigger_shipping=off;
explain performance insert into traverse_triggers_tbl1 values (1,1);
set enable_trigger_shipping=on;
explain performance insert into traverse_triggers_tbl1 values (1,1);
alter table traverse_triggers_tbl1 disable trigger trigger_function_open_fetch_close_cursor_direction;
------------------------------------------
--Trigger traverse function testcase: perform
------------------------------------------
alter table traverse_triggers_tbl1 enable trigger trigger_function_perform;
set enable_trigger_shipping=off;
explain performance insert into traverse_triggers_tbl1 values (1,1);
set enable_trigger_shipping=on;
explain performance insert into traverse_triggers_tbl1 values (1,1);
alter table traverse_triggers_tbl1 disable trigger trigger_function_perform;
------------------------------------------
--Trigger traverse function testcase: dynexecute
------------------------------------------
alter table traverse_triggers_tbl1 enable trigger trigger_function_dynexecute;
set enable_trigger_shipping=off;
explain performance insert into traverse_triggers_tbl1 values (1,1);
set enable_trigger_shipping=on;
explain performance insert into traverse_triggers_tbl1 values (1,1);
alter table traverse_triggers_tbl1 disable trigger trigger_function_dynexecute;
drop table IF EXISTS traverse_triggers_tbl1 cascade;
drop table IF EXISTS traverse_triggers_tbl2 cascade;
drop table IF EXISTS traverse_triggers_tbl3 cascade;
select time,type,detail_info from pg_query_audit('2000-01-01 00:00:00','9999-12-31') where detail_info like '%trigger_function_dynexecute%'; | the_stack |
CREATE schema hw_cursor_part8;
SET current_schema = hw_cursor_part8;
CREATE TABLE TEST_TB(ID INTEGER);
INSERT INTO TEST_TB VALUES(123);
INSERT INTO TEST_TB VALUES(124);
INSERT INTO TEST_TB VALUES(125);
DECLARE
CURSOR CURS1 IS SELECT * FROM TEST_TB;
TEMP INTEGER:=0;
BEGIN
FOR VARA IN CURS1 LOOP
raise notice '%',CURS1%ROWCOUNT;
END LOOP;
END;
/
--2 TEST FOR DISPLAY CURSOR IN (SELECT ,INSERT ,UPDATE ,DELETE);
DECLARE
CURSOR CURS1 IS SELECT * FROM TEST_TB;
TEMP INTEGER:=0;
BEGIN
FOR VARA IN CURS1 LOOP
-- FOR SELECT
SELECT ID INTO TEMP FROM TEST_TB WHERE ID = 123;
IF NOT CURS1%ISOPEN THEN --CURS1%ISOPEN ALWAYS BE FALSE
raise notice '%','TEST SELECT: CURS1%ISOPEN=FALSE';
END IF;
IF CURS1%FOUND THEN
raise notice '%','TEST SELECT: CURS1%FOUND=TRUE';
END IF;
IF CURS1%NOTFOUND THEN
raise notice '%','TEST SELECT: CURS1%NOTFOUND=TRUE';
END IF;
raise notice 'TEST SELECT: CURS1%%ROWCOUNT=%',CURS1%ROWCOUNT;
-- FOR INSERT
INSERT INTO TEST_TB VALUES (125);
IF NOT CURS1%ISOPEN THEN --CURS1%ISOPEN ALWAYS BE FALSE
raise notice '%','TEST INSERT: CURS1%ISOPEN=FALSE';
END IF;
IF CURS1%FOUND THEN
raise notice '%','TEST INSERT: CURS1%FOUND=TRUE';
END IF;
IF CURS1%NOTFOUND THEN
raise notice '%','TEST INSERT: CURS1%NOTFOUND=TRUE';
END IF;
raise notice 'TEST INSERT: CURS1%%ROWCOUNT=%',CURS1%ROWCOUNT;
--UPDATE
UPDATE TEST_TB SET ID=ID+1 WHERE ID=124;
IF NOT CURS1%ISOPEN THEN --CURS1%ISOPEN ALWAYS BE FALSE
raise notice '%','TEST UPDATE: CURS1%ISOPEN=FALSE';
END IF;
IF CURS1%FOUND THEN
raise notice '%','TEST UPDATE: CURS1%FOUND=TRUE';
END IF;
IF CURS1%NOTFOUND THEN
raise notice '%','TEST UPDATE: CURS1%NOTFOUND=TRUE';
END IF;
raise notice 'TEST UPDATE: CURS1%%ROWCOUNT=%',CURS1%ROWCOUNT;
--DELETE
DELETE FROM TEST_TB WHERE ID=125;
IF NOT CURS1%ISOPEN THEN --CURS1%ISOPEN ALWAYS BE FALSE
raise notice '%','TEST DELETE: CURS1%ISOPEN=FALSE';
END IF;
IF CURS1%FOUND THEN
raise notice '%','TEST DELETE: CURS1%FOUND=TRUE';
END IF;
IF CURS1%NOTFOUND THEN
raise notice '%','TEST DELETE: CURS1%NOTFOUND=TRUE';
END IF;
raise notice 'TEST DELETE: CURS1%%ROWCOUNT=%',CURS1%ROWCOUNT;
END LOOP;
END;
/
DROP TABLE IF EXISTS TEST_TB;
--3 TEST FOR IMPLICIT CURSOR IN (SELECT ,INSERT ,UPDATE ,DELETE)
CREATE TABLE TEST_TB (ID INT);
INSERT INTO TEST_TB VALUES (123);
INSERT INTO TEST_TB VALUES (124);
INSERT INTO TEST_TB VALUES (125);
DECLARE
TEMP INTEGER = 0;
BEGIN
-- FOR SELECT
SELECT ID INTO TEMP FROM TEST_TB WHERE ID = 123;
IF NOT SQL%ISOPEN THEN --SQL%ISOPEN ALWAYS BE FALSE
raise notice '%','TEST SELECT: SQL%ISOPEN=FALSE';
END IF;
IF SQL%FOUND THEN
raise notice '%','TEST SELECT: SQL%FOUND=TRUE';
END IF;
IF NOT SQL%NOTFOUND THEN
raise notice '%','TEST SELECT: SQL%NOTFOUND=FALSE';
END IF;
raise notice 'TEST SELECT: SQL%%ROWCOUNT=%',SQL%ROWCOUNT;
-- FOR INSERT
INSERT INTO TEST_TB VALUES (125);
IF NOT SQL%ISOPEN THEN --SQL%ISOPEN ALWAYS BE FALSE
raise notice '%','TEST INSERT: SQL%ISOPEN=FALSE';
END IF;
IF SQL%FOUND THEN
raise notice '%','TEST INSERT: SQL%FOUND=TRUE';
END IF;
IF NOT SQL%NOTFOUND THEN
raise notice '%','TEST INSERT: SQL%NOTFOUND=FALSE';
END IF;
raise notice 'TEST INSERT: SQL%%ROWCOUNT=%',SQL%ROWCOUNT;
--UPDATE
UPDATE TEST_TB SET ID=ID+1 WHERE ID<124;
IF NOT SQL%ISOPEN THEN --SQL%ISOPEN ALWAYS BE FALSE
raise notice '%','TEST UPDATE: SQL%ISOPEN=FALSE';
END IF;
IF SQL%FOUND THEN
raise notice '%','TEST UPDATE: SQL%FOUND=TRUE';
END IF;
IF NOT SQL%NOTFOUND THEN
raise notice '%','TEST UPDATE: SQL%NOTFOUND=FALSE';
END IF;
raise notice 'TEST UPDATE: SQL%%ROWCOUNT=%',SQL%ROWCOUNT;
--DELETE
DELETE FROM TEST_TB WHERE ID<125;
IF NOT SQL%ISOPEN THEN --SQL%ISOPEN ALWAYS BE FALSE
raise notice '%','TEST DELETE: SQL%ISOPEN=FALSE';
END IF;
IF SQL%FOUND THEN
raise notice '%','TEST DELETE: SQL%FOUND=TRUE';
END IF;
IF NOT SQL%NOTFOUND THEN
raise notice '%','TEST DELETE: SQL%NOTFOUND=FALSE';
END IF;
raise notice 'TEST DELETE: SQL%%ROWCOUNT=%',SQL%ROWCOUNT;
END;
/
DROP TABLE IF EXISTS TEST_TB;
--4 TEST FOR IMPLICIT CURSOR;
CREATE TABLE TEST_TB (ID INT);
INSERT INTO TEST_TB VALUES (123);
INSERT INTO TEST_TB VALUES (124);
INSERT INTO TEST_TB VALUES (125);
DECLARE
CURSOR CURS1 IS SELECT * FROM TEST_TB;
TEMP INTEGER:=0;
BEGIN
FOR VARA IN CURS1 LOOP
SELECT ID INTO TEMP FROM TEST_TB WHERE ID = 123;
IF NOT SQL%ISOPEN THEN --SQL%ISOPEN ALWAYS BE FALSE
raise notice '%','TEST SELECT: SQL%ISOPEN=FALSE';
END IF;
IF SQL%FOUND THEN
raise notice '%','TEST SELECT: SQL%FOUND=TRUE';
END IF;
IF NOT SQL%NOTFOUND THEN
raise notice '%','TEST SELECT: SQL%NOTFOUND=FALSE';
END IF;
raise notice 'TEST SELECT: SQL%%ROWCOUNT=%',SQL%ROWCOUNT;
END LOOP;
END;
/
DROP TABLE IF EXISTS TEST_TB;
CREATE TABLE TEST_TB(ID INTEGER);
INSERT INTO TEST_TB VALUES(123);
INSERT INTO TEST_TB VALUES(124);
INSERT INTO TEST_TB VALUES(125);
DECLARE
CURSOR CURS1 IS SELECT * FROM TEST_TB;
TEMP INTEGER:=0;
BEGIN
FOR VARA IN CURS1 LOOP
raise notice 'TEST SELECT: CURS1%%ROWCOUNT=%',CURS1%ROWCOUNT;
END LOOP;
IF NOT CURS1%ISOPEN THEN --CURS1%ISOPEN ALWAYS BE FALSE
raise notice '%','TEST SELECT: CURS1%ISOPEN=FALSE';
END IF;
IF CURS1%FOUND THEN
raise notice '%','TEST SELECT: CURS1%FOUND=TRUE';
END IF;
IF CURS1%NOTFOUND THEN
raise notice '%','TEST SELECT: CURS1%NOTFOUND=TRUE';
END IF;
raise notice 'TEST SELECT: CURS1%%ROWCOUNT=%', CURS1%ROWCOUNT;
END;
/
DROP TABLE IF EXISTS TEST_TB;
--TEST FOR CURSOR SYS_REFCURSOR IN PROCEDURE AND EMPTY TABLE;
--IF THE RESULT IS 0 ,THAT'S OK,ELSE IS ERROR;
DROP TABLE IF EXISTS TEST_TBL;
CREATE TABLE TEST_TBL(ID INTEGER);
CREATE OR REPLACE PROCEDURE T1(O OUT SYS_REFCURSOR)
IS
C1 SYS_REFCURSOR;
BEGIN
OPEN C1 FOR SELECT ID FROM TEST_TBL ORDER BY ID;
O := C1;
END;
/
DECLARE
C1 SYS_REFCURSOR;
TEMP INTEGER;
BEGIN
T1(C1);
LOOP
FETCH C1 INTO TEMP;
EXIT WHEN C1%NOTFOUND;
END LOOP;
raise notice '%',C1%ROWCOUNT;
END;
/
DROP TABLE IF EXISTS TEST_TBL;
DROP PROCEDURE T1;
--TEST FOR CURSOR REFCURSOR IN PROCEDURE AND EMPTY TABLE;
--IF THE RESULT IS 0 ,THAT'S OK,ELSE IS ERROR;
DROP TABLE IF EXISTS TEST_TBL;
CREATE TABLE TEST_TBL(ID INTEGER);
CREATE OR REPLACE PROCEDURE T2(O OUT REFCURSOR)
IS
C1 SYS_REFCURSOR;
BEGIN
OPEN C1 FOR SELECT ID FROM TEST_TBL ORDER BY ID;
O := C1;
END;
/
DECLARE
C1 REFCURSOR;
TEMP INTEGER;
BEGIN
T2(C1);
LOOP
FETCH C1 INTO TEMP;
EXIT WHEN C1%NOTFOUND;
END LOOP;
raise notice '%',C1%ROWCOUNT;
END;
/
DROP TABLE IF EXISTS TEST_TBL;
DROP PROCEDURE T2;
--TEST CURSOR IN Anonymous block
DROP TABLE IF EXISTS TEST_TBL;
CREATE TABLE TEST_TBL(ID INTEGER);
DECLARE
C1 REFCURSOR;
TEMP INTEGER;
BEGIN
OPEN C1 FOR SELECT ID FROM TEST_TBL ORDER BY ID;
LOOP
FETCH C1 INTO TEMP;
EXIT WHEN C1%NOTFOUND;
END LOOP;
raise notice '%',C1%ROWCOUNT;
END;
/
DROP TABLE IF EXISTS TEST_TBL;
DROP PROCEDURE TEST_TEMP;
DROP PROCEDURE TEST_CRS_RPT_EMPTYSOR;
DROP TABLE TBL_RCWSCFG;
drop table TBL_TEMP_MODULE_312;
CREATE TABLE TBL_RCWSCFG (
IWSNO INTEGER,
USCDBMID SMALLINT
);
INSERT INTO TBL_RCWSCFG VALUES (0, 184);
CREATE TABLE TBL_TEMP_MODULE_312 (
I_MODULENO INTEGER
);
CREATE OR REPLACE PROCEDURE TEST_TEMP
AS
BEGIN
raise notice '%','TEST_TEMP';
END;
/
CREATE OR REPLACE PROCEDURE TEST_CRS_RPT_EMPTYSOR(FLAG INTEGER)
AS
TYPE T_PSTMT_CRS_RPT_EMPTY IS REF CURSOR;
CRS_RPT_EMPTY T_PSTMT_CRS_RPT_EMPTY;
PI_MODULENO INTEGER;
PSV_MODULETBLNAME VARCHAR2(128) := 'TBL_TEMP_MODULE_312';
PSV_SQL VARCHAR2(128);
PI_NN INTEGER := NULL;
BEGIN
OPEN CRS_RPT_EMPTY FOR SELECT DISTINCT USCDBMID FROM TBL_RCWSCFG;
LOOP
FETCH CRS_RPT_EMPTY INTO PI_MODULENO;
EXIT WHEN CRS_RPT_EMPTY%NOTFOUND;
IF (FLAG = 0) THEN
-- INSERT INTO TBL_TEMP_MODULE_312, INSERT TRIGGER FUNCTION CALLED
PSV_SQL := 'BEGIN INSERT INTO '||PSV_MODULETBLNAME||' (I_MODULENO) VALUES('||PI_MODULENO||');END;';
EXECUTE IMMEDIATE PSV_SQL;
ELSE
TEST_TEMP();
END IF;
END LOOP;
-- check cursor attris status
raise notice 'CRS_RPT_EMPTY%%ROWCOUNT :%',NVL(TO_CHAR(CRS_RPT_EMPTY%ROWCOUNT),'NULL');
raise notice 'SQL%%ROWCOUNT :%',NVL(TO_CHAR(SQL%ROWCOUNT),'NULL');
END;
/
CALL TEST_CRS_RPT_EMPTYSOR(0);
CALL TEST_CRS_RPT_EMPTYSOR(1);
DROP TABLE TBL_TEMP_MODULE_312;
--test cursor define
create or replace procedure pro_cursor_c0019() as
declare
cursor cursor1 for create table t1(a int);
BEGIN
END;
/
create table t1(a int);
--test with query
create or replace procedure test_cursor() as
declare
cursor cursor1 is
with recursive StepCTE(a)
as (select a from t1) select * from StepCTE;
BEGIN
null;
END;
/
cursor pro_cursor_c0019_1 with hold for select * from t1;
create or replace procedure pro_cursor_c0019() as
declare
cursor cursor1 for fetch pro_cursor_c0019_1;
BEGIN
open cursor1;
raise notice '%','test cursor';
close cursor1;
END;
/
select * from pro_cursor_c0019();
close pro_cursor_c0019_1;
select * from pro_cursor_c0019();
create table test_cursor_table(c1 int,c2 varchar);
insert into test_cursor_table values(1,'Jack'),(2,'Rose');
create or replace procedure test_cursor() as
declare
type ref_cur is ref cursor;
cur1 ref_cur;
a1 test_cursor_table%rowtype;
SQL_STR VARCHAR(100);
begin
OPEN cur1 FOR with cte1 as (select * from test_cursor_table) select c1, c2 from cte1;
if cur1%isopen then
LOOP
FETCH cur1 INTO a1;
EXIT WHEN cur1%NOTFOUND;
raise notice '%---%',a1.c1,a1.c2;
END LOOP;
end if;
CLOSE cur1;
end
/
call test_cursor();
create or replace procedure test_cursor() as
declare
type ref_cur is ref cursor;
cur1 ref_cur;
a1 test_cursor_table%rowtype;
SQL_STR VARCHAR(100);
ID_T integer;
begin
ID_T := 1;
SQL_STR := 'with cte1 as (select * from test_cursor_table) select c1, c2 from cte1 where c1 = :1';
OPEN cur1 FOR SQL_STR USING ID_T;
if cur1%isopen then
LOOP
FETCH cur1 INTO a1;
EXIT WHEN cur1%NOTFOUND;
raise notice '%---%',a1.c1,a1.c2;
END LOOP;
end if;
CLOSE cur1;
end
/
call test_cursor();
create type pro_type_04 as ( v_tablefield character varying, v_tablefield2 character varying, v_tablename character varying, v_cur refcursor);
CREATE FUNCTION pro_base13_03(v_tablefield character varying, v_tablefield2 character varying,v_tablename character varying, OUT v_cur refcursor) RETURNS refcursor
LANGUAGE plpgsql NOT SHIPPABLE
AS $$ DECLARE
begin
open v_cur for
'select '||v_tablefield||' as tablecode, '||v_tablefield2||' as tablename from '||v_tablename|| ' order by 1,2;';
end $$;
CREATE FUNCTION pro_base13_04(v_tablefield character varying, v_tablefield2 character varying, v_tablename character varying) RETURNS record
LANGUAGE plpgsql NOT SHIPPABLE
AS $$ DECLARE
v_record pro_type_04;
v_cur refcursor;
begin
v_cur := pro_base13_03(v_tablefield, v_tablefield2, v_tablename,v_cur);
loop
fetch v_cur into v_record;
EXIT WHEN v_cur%notfound;
return v_record;
end loop;
end $$;
select pro_base13_04('c1','c2','test_cursor_table');
CREATE or REPLACE FUNCTION pro_base12_01(OUT o_resultnum numeric, OUT o_result_cur refcursor,OUT o_result_cur_1 refcursor)
RETURNS record
LANGUAGE plpgsql
AS $$ DECLARE
begin
select count(*), max(c1),min(c2) into o_resultnum,o_result_cur,o_result_cur_1
from test_cursor_table;
return;
end$$;
select pro_base12_01() from test_cursor_table;
drop schema hw_cursor_part8 CASCADE; | the_stack |
--Base tsvector test
SELECT '1'::tsvector;
SELECT '1 '::tsvector;
SELECT ' 1'::tsvector;
SELECT ' 1 '::tsvector;
SELECT '1 2'::tsvector;
SELECT '''1 2'''::tsvector;
SELECT E'''1 \\''2'''::tsvector;
SELECT E'''1 \\''2''3'::tsvector;
SELECT E'''1 \\''2'' 3'::tsvector;
SELECT E'''1 \\''2'' '' 3'' 4 '::tsvector;
SELECT $$'\\as' ab\c ab\\c AB\\\c ab\\\\c$$::tsvector;
SELECT tsvectorin(tsvectorout($$'\\as' ab\c ab\\c AB\\\c ab\\\\c$$::tsvector));
SELECT '''w'':4A,3B,2C,1D,5 a:8';
SELECT 'a:3A b:2a'::tsvector || 'ba:1234 a:1B';
--Base tsquery test
SELECT '1'::tsquery;
SELECT '1 '::tsquery;
SELECT ' 1'::tsquery;
SELECT ' 1 '::tsquery;
SELECT '''1 2'''::tsquery;
SELECT E'''1 \\''2'''::tsquery;
SELECT '!1'::tsquery;
SELECT '1|2'::tsquery;
SELECT '1|!2'::tsquery;
SELECT '!1|2'::tsquery;
SELECT '!1|!2'::tsquery;
SELECT '!(!1|!2)'::tsquery;
SELECT '!(!1|2)'::tsquery;
SELECT '!(1|!2)'::tsquery;
SELECT '!(1|2)'::tsquery;
SELECT '1&2'::tsquery;
SELECT '!1&2'::tsquery;
SELECT '1&!2'::tsquery;
SELECT '!1&!2'::tsquery;
SELECT '(1&2)'::tsquery;
SELECT '1&(2)'::tsquery;
SELECT '!(1)&2'::tsquery;
SELECT '!(1&2)'::tsquery;
SELECT '1|2&3'::tsquery;
SELECT '1|(2&3)'::tsquery;
SELECT '(1|2)&3'::tsquery;
SELECT '1|2&!3'::tsquery;
SELECT '1|!2&3'::tsquery;
SELECT '!1|2&3'::tsquery;
SELECT '!1|(2&3)'::tsquery;
SELECT '!(1|2)&3'::tsquery;
SELECT '(!1|2)&3'::tsquery;
SELECT '1|(2|(4|(5|6)))'::tsquery;
SELECT '1|2|4|5|6'::tsquery;
SELECT '1&(2&(4&(5&6)))'::tsquery;
SELECT '1&2&4&5&6'::tsquery;
SELECT '1&(2&(4&(5|6)))'::tsquery;
SELECT '1&(2&(4&(5|!6)))'::tsquery;
SELECT E'1&(''2''&('' 4''&(\\|5 | ''6 \\'' !|&'')))'::tsquery;
SELECT $$'\\as'$$::tsquery;
SELECT 'a:* & nbb:*ac | doo:a* | goo'::tsquery;
SELECT '!!b'::tsquery;
SELECT '!!!b'::tsquery;
SELECT '!(!b)'::tsquery;
SELECT 'a & !!b'::tsquery;
SELECT '!!a & b'::tsquery;
SELECT '!!a & !!b'::tsquery;
--comparisons
SELECT 'a' < 'b & c'::tsquery as "true";
SELECT 'a' > 'b & c'::tsquery as "false";
SELECT 'a | f' < 'b & c'::tsquery as "false";
SELECT 'a | ff' < 'b & c'::tsquery as "false";
SELECT 'a | f | g' < 'b & c'::tsquery as "false";
--concatenation
SELECT numnode( 'new'::tsquery );
SELECT numnode( 'new & york'::tsquery );
SELECT numnode( 'new & york | qwery'::tsquery );
SELECT 'foo & bar'::tsquery && 'asd';
SELECT 'foo & bar'::tsquery || 'asd & fg';
SELECT 'foo & bar'::tsquery || !!'asd & fg'::tsquery;
SELECT 'foo & bar'::tsquery && 'asd | fg';
SELECT 'a' <-> 'b & d'::tsquery;
SELECT 'a & g' <-> 'b & d'::tsquery;
SELECT 'a & g' <-> 'b | d'::tsquery;
SELECT 'a & g' <-> 'b <-> d'::tsquery;
SELECT tsquery_phrase('a <3> g', 'b & d', 10);
-- tsvector-tsquery operations
SELECT 'a b:89 ca:23A,64b d:34c'::tsvector @@ 'd:AC & ca' as "true";
SELECT 'a b:89 ca:23A,64b d:34c'::tsvector @@ 'd:AC & ca:B' as "true";
SELECT 'a b:89 ca:23A,64b d:34c'::tsvector @@ 'd:AC & ca:A' as "true";
SELECT 'a b:89 ca:23A,64b d:34c'::tsvector @@ 'd:AC & ca:C' as "false";
SELECT 'a b:89 ca:23A,64b d:34c'::tsvector @@ 'd:AC & ca:CB' as "true";
SELECT 'a b:89 ca:23A,64b d:34c'::tsvector @@ 'd:AC & c:*C' as "false";
SELECT 'a b:89 ca:23A,64b d:34c'::tsvector @@ 'd:AC & c:*CB' as "true";
SELECT 'a b:89 ca:23A,64b cb:80c d:34c'::tsvector @@ 'd:AC & c:*C' as "true";
SELECT 'a b:89 ca:23A,64c cb:80b d:34c'::tsvector @@ 'd:AC & c:*C' as "true";
SELECT 'a b:89 ca:23A,64c cb:80b d:34c'::tsvector @@ 'd:AC & c:*B' as "true";
SELECT 'supernova'::tsvector @@ 'super'::tsquery AS "false";
SELECT 'supeanova supernova'::tsvector @@ 'super'::tsquery AS "false";
SELECT 'supeznova supernova'::tsvector @@ 'super'::tsquery AS "false";
SELECT 'supernova'::tsvector @@ 'super:*'::tsquery AS "true";
SELECT 'supeanova supernova'::tsvector @@ 'super:*'::tsquery AS "true";
SELECT 'supeznova supernova'::tsvector @@ 'super:*'::tsquery AS "true";
--phrase search
SELECT to_tsvector('simple', '1 2 3 1') @@ '1 <-> 2' AS "true";
SELECT to_tsvector('simple', '1 2 3 1') @@ '1 <2> 2' AS "false";
SELECT to_tsvector('simple', '1 2 3 1') @@ '1 <-> 3' AS "false";
SELECT to_tsvector('simple', '1 2 3 1') @@ '1 <2> 3' AS "true";
SELECT to_tsvector('simple', '1 2 1 2') @@ '1 <3> 2' AS "true";
SELECT to_tsvector('simple', '1 2 11 3') @@ '1 <-> 3' AS "false";
SELECT to_tsvector('simple', '1 2 11 3') @@ '1:* <-> 3' AS "true";
SELECT to_tsvector('simple', '1 2 3 4') @@ '1 <-> 2 <-> 3' AS "true";
SELECT to_tsvector('simple', '1 2 3 4') @@ '(1 <-> 2) <-> 3' AS "true";
SELECT to_tsvector('simple', '1 2 3 4') @@ '1 <-> (2 <-> 3)' AS "true";
SELECT to_tsvector('simple', '1 2 3 4') @@ '1 <2> (2 <-> 3)' AS "false";
SELECT to_tsvector('simple', '1 2 1 2 3 4') @@ '(1 <-> 2) <-> 3' AS "true";
SELECT to_tsvector('simple', '1 2 1 2 3 4') @@ '1 <-> 2 <-> 3' AS "true";
-- without position data, phrase search does not match
SELECT strip(to_tsvector('simple', '1 2 3 4')) @@ '1 <-> 2 <-> 3' AS "false";
select to_tsvector('simple', 'q x q y') @@ 'q <-> (x & y)' AS "false";
select to_tsvector('simple', 'q x') @@ 'q <-> (x | y <-> z)' AS "true";
select to_tsvector('simple', 'q y') @@ 'q <-> (x | y <-> z)' AS "false";
select to_tsvector('simple', 'q y z') @@ 'q <-> (x | y <-> z)' AS "true";
select to_tsvector('simple', 'q y x') @@ 'q <-> (x | y <-> z)' AS "false";
select to_tsvector('simple', 'q x y') @@ 'q <-> (x | y <-> z)' AS "true";
select to_tsvector('simple', 'q x') @@ '(x | y <-> z) <-> q' AS "false";
select to_tsvector('simple', 'x q') @@ '(x | y <-> z) <-> q' AS "true";
select to_tsvector('simple', 'x y q') @@ '(x | y <-> z) <-> q' AS "false";
select to_tsvector('simple', 'x y z') @@ '(x | y <-> z) <-> q' AS "false";
select to_tsvector('simple', 'x y z q') @@ '(x | y <-> z) <-> q' AS "true";
select to_tsvector('simple', 'y z q') @@ '(x | y <-> z) <-> q' AS "true";
select to_tsvector('simple', 'y y q') @@ '(x | y <-> z) <-> q' AS "false";
select to_tsvector('simple', 'y y q') @@ '(!x | y <-> z) <-> q' AS "true";
select to_tsvector('simple', 'x y q') @@ '(!x | y <-> z) <-> q' AS "true";
select to_tsvector('simple', 'y y q') @@ '(x | y <-> !z) <-> q' AS "true";
select to_tsvector('simple', 'x q') @@ '(x | y <-> !z) <-> q' AS "true";
select to_tsvector('simple', 'x q') @@ '(!x | y <-> z) <-> q' AS "false";
select to_tsvector('simple', 'z q') @@ '(!x | y <-> z) <-> q' AS "true";
select to_tsvector('simple', 'x y q y') @@ '!x <-> y' AS "true";
select to_tsvector('simple', 'x y q y') @@ '!foo' AS "true";
select to_tsvector('simple', '') @@ '!foo' AS "true";
--ranking
SELECT ts_rank(' a:1 s:2C d g'::tsvector, 'a | s');
SELECT ts_rank(' a:1 sa:2C d g'::tsvector, 'a | s');
SELECT ts_rank(' a:1 sa:2C d g'::tsvector, 'a | s:*');
SELECT ts_rank(' a:1 sa:2C d g'::tsvector, 'a | sa:*');
SELECT ts_rank(' a:1 s:2B d g'::tsvector, 'a | s');
SELECT ts_rank(' a:1 s:2 d g'::tsvector, 'a | s');
SELECT ts_rank(' a:1 s:2C d g'::tsvector, 'a & s');
SELECT ts_rank(' a:1 s:2B d g'::tsvector, 'a & s');
SELECT ts_rank(' a:1 s:2 d g'::tsvector, 'a & s');
SELECT ts_rank_cd(' a:1 s:2C d g'::tsvector, 'a | s');
SELECT ts_rank_cd(' a:1 sa:2C d g'::tsvector, 'a | s');
SELECT ts_rank_cd(' a:1 sa:2C d g'::tsvector, 'a | s:*');
SELECT ts_rank_cd(' a:1 sa:2C d g'::tsvector, 'a | sa:*');
SELECT ts_rank_cd(' a:1 sa:3C sab:2c d g'::tsvector, 'a | sa:*');
SELECT ts_rank_cd(' a:1 s:2B d g'::tsvector, 'a | s');
SELECT ts_rank_cd(' a:1 s:2 d g'::tsvector, 'a | s');
SELECT ts_rank_cd(' a:1 s:2C d g'::tsvector, 'a & s');
SELECT ts_rank_cd(' a:1 s:2B d g'::tsvector, 'a & s');
SELECT ts_rank_cd(' a:1 s:2 d g'::tsvector, 'a & s');
SELECT ts_rank_cd(' a:1 s:2A d g'::tsvector, 'a <-> s');
SELECT ts_rank_cd(' a:1 s:2C d g'::tsvector, 'a <-> s');
SELECT ts_rank_cd(' a:1 s:2 d g'::tsvector, 'a <-> s');
SELECT ts_rank_cd(' a:1 s:2 d:2A g'::tsvector, 'a <-> s');
SELECT ts_rank_cd(' a:1 s:2,3A d:2A g'::tsvector, 'a <2> s:A');
SELECT ts_rank_cd(' a:1 b:2 s:3A d:2A g'::tsvector, 'a <2> s:A');
SELECT ts_rank_cd(' a:1 sa:2D sb:2A g'::tsvector, 'a <-> s:*');
SELECT ts_rank_cd(' a:1 sa:2A sb:2D g'::tsvector, 'a <-> s:*');
SELECT ts_rank_cd(' a:1 sa:2A sb:2D g'::tsvector, 'a <-> s:* <-> sa:A');
SELECT ts_rank_cd(' a:1 sa:2A sb:2D g'::tsvector, 'a <-> s:* <-> sa:B');
SELECT 'a:1 b:2'::tsvector @@ 'a <-> b'::tsquery AS "true";
SELECT 'a:1 b:2'::tsvector @@ 'a <0> b'::tsquery AS "false";
SELECT 'a:1 b:2'::tsvector @@ 'a <1> b'::tsquery AS "true";
SELECT 'a:1 b:2'::tsvector @@ 'a <2> b'::tsquery AS "false";
SELECT 'a:1 b:3'::tsvector @@ 'a <-> b'::tsquery AS "false";
SELECT 'a:1 b:3'::tsvector @@ 'a <0> b'::tsquery AS "false";
SELECT 'a:1 b:3'::tsvector @@ 'a <1> b'::tsquery AS "false";
SELECT 'a:1 b:3'::tsvector @@ 'a <2> b'::tsquery AS "true";
SELECT 'a:1 b:3'::tsvector @@ 'a <3> b'::tsquery AS "false";
SELECT 'a:1 b:3'::tsvector @@ 'a <0> a:*'::tsquery AS "true";
-- tsvector editing operations
SELECT strip('w:12B w:13* w:12,5,6 a:1,3* a:3 w asd:1dc asd'::tsvector);
SELECT strip('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector);
SELECT strip('base hidden rebel spaceship strike'::tsvector);
SELECT ts_delete(to_tsvector('english', 'Rebel spaceships, striking from a hidden base'), 'spaceship');
SELECT ts_delete('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector, 'base');
SELECT ts_delete('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector, 'bas');
SELECT ts_delete('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector, 'bases');
SELECT ts_delete('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector, 'spaceship');
SELECT ts_delete('base hidden rebel spaceship strike'::tsvector, 'spaceship');
SELECT ts_delete('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector, ARRAY['spaceship','rebel']);
SELECT ts_delete('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector, ARRAY['spaceships','rebel']);
SELECT ts_delete('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector, ARRAY['spaceshi','rebel']);
SELECT ts_delete('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector, ARRAY['spaceship','leya','rebel']);
SELECT ts_delete('base hidden rebel spaceship strike'::tsvector, ARRAY['spaceship','leya','rebel']);
SELECT ts_delete('base hidden rebel spaceship strike'::tsvector, ARRAY['spaceship','leya','rebel','rebel']);
SELECT ts_delete('base hidden rebel spaceship strike'::tsvector, ARRAY['spaceship','leya','rebel', NULL]);
SELECT unnest('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector);
SELECT unnest('base hidden rebel spaceship strike'::tsvector);
SELECT * FROM unnest('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector);
SELECT * FROM unnest('base hidden rebel spaceship strike'::tsvector);
SELECT lexeme, positions[1] from unnest('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector);
SELECT tsvector_to_array('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector);
SELECT tsvector_to_array('base hidden rebel spaceship strike'::tsvector);
SELECT array_to_tsvector(ARRAY['base','hidden','rebel','spaceship','strike']);
SELECT array_to_tsvector(ARRAY['base','hidden','rebel','spaceship', NULL]);
-- array_to_tsvector must sort and de-dup
SELECT array_to_tsvector(ARRAY['foo','bar','baz','bar']);
SELECT setweight('w:12B w:13* w:12,5,6 a:1,3* a:3 w asd:1dc asd zxc:81,567,222A'::tsvector, 'c');
SELECT setweight('a:1,3A asd:1C w:5,6,12B,13A zxc:81,222A,567'::tsvector, 'c');
SELECT setweight('a:1,3A asd:1C w:5,6,12B,13A zxc:81,222A,567'::tsvector, 'c', '{a}');
SELECT setweight('a:1,3A asd:1C w:5,6,12B,13A zxc:81,222A,567'::tsvector, 'c', '{a}');
SELECT setweight('a:1,3A asd:1C w:5,6,12B,13A zxc:81,222A,567'::tsvector, 'c', '{a,zxc}');
SELECT setweight('a asd w:5,6,12B,13A zxc'::tsvector, 'c', '{a,zxc}');
SELECT setweight('a asd w:5,6,12B,13A zxc'::tsvector, 'c', ARRAY['a', 'zxc', NULL]);
SELECT ts_filter('base:7A empir:17 evil:15 first:11 galact:16 hidden:6A rebel:1A spaceship:2A strike:3A victori:12 won:9'::tsvector, '{a}');
SELECT ts_filter('base hidden rebel spaceship strike'::tsvector, '{a}');
SELECT ts_filter('base hidden rebel spaceship strike'::tsvector, '{a,b,NULL}'); | the_stack |
/****** Object: Table [dbo].[umbracoNode] Script Date: 05/15/2009 05:27:55 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[umbracoNode]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[umbracoNode](
[id] [int] IDENTITY(1,1) NOT NULL,
[trashed] [bit] NOT NULL,
[parentID] [int] NOT NULL,
[nodeUser] [int] NULL,
[level] [smallint] NOT NULL,
[path] [nvarchar](150) COLLATE Danish_Norwegian_CI_AS NOT NULL,
[sortOrder] [int] NOT NULL,
[uniqueID] [uniqueidentifier] NULL,
[text] [nvarchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[nodeObjectType] [uniqueidentifier] NULL,
[createDate] [datetime] NOT NULL,
CONSTRAINT [PK_structure] PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
END
GO
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[umbracoNode]') AND name = N'IX_umbracoNodeObjectType')
CREATE NONCLUSTERED INDEX [IX_umbracoNodeObjectType] ON [dbo].[umbracoNode]
(
[nodeObjectType] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
GO
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[umbracoNode]') AND name = N'IX_umbracoNodeParentId')
CREATE NONCLUSTERED INDEX [IX_umbracoNodeParentId] ON [dbo].[umbracoNode]
(
[parentID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
GO
/****** Object: Table [dbo].[forumForums] Script Date: 05/15/2009 05:27:55 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[forumForums]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[forumForums](
[id] [int] NOT NULL,
[latestTopic] [int] NOT NULL,
[latestComment] [int] NOT NULL,
[totalTopics] [int] NOT NULL,
[totalComments] [int] NOT NULL,
[latestAuthor] [int] NOT NULL,
[latestPostDate] [datetime] NOT NULL,
[sortOrder] [int] NOT NULL,
[parentId] [int] NOT NULL,
CONSTRAINT [PK_forumForums] PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
END
GO
/****** Object: Table [dbo].[forumTopics] Script Date: 05/15/2009 05:27:55 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[forumTopics]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[forumTopics](
[id] [int] IDENTITY(1,1) NOT NULL,
[parentId] [int] NOT NULL,
[memberId] [int] NOT NULL,
[title] [nvarchar](70) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[body] [ntext] COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[created] [datetime] NOT NULL,
[updated] [datetime] NOT NULL,
[locked] [bit] NOT NULL,
[latestReplyAuthor] [int] NOT NULL,
[isSpam] [bit] NULL
CONSTRAINT [PK_forumTopics] PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
END
GO
/****** Object: Table [dbo].[forumComments] Script Date: 05/15/2009 05:27:55 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[forumComments]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[forumComments](
[id] [int] IDENTITY(1,1) NOT NULL,
[topicId] [int] NOT NULL,
[memberId] [int] NOT NULL,
[body] [ntext] COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[created] [datetime] NOT NULL,
[isSpam] [bit] NULL
CONSTRAINT [PK_forumComments] PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
END
GO
/****** Object: Default [DF_forumTopics_created] Script Date: 05/15/2009 05:27:55 ******/
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_forumTopics_created]') AND parent_object_id = OBJECT_ID(N'[dbo].[forumTopics]'))
Begin
ALTER TABLE [dbo].[forumTopics] ADD CONSTRAINT [DF_forumTopics_created] DEFAULT (getdate()) FOR [created]
End
GO
/****** Object: Default [DF_forumTopics_updated] Script Date: 05/15/2009 05:27:55 ******/
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_forumTopics_updated]') AND parent_object_id = OBJECT_ID(N'[dbo].[forumTopics]'))
Begin
ALTER TABLE [dbo].[forumTopics] ADD CONSTRAINT [DF_forumTopics_updated] DEFAULT (getdate()) FOR [updated]
End
GO
/****** Object: Default [DF_forumTopics_locked] Script Date: 05/15/2009 05:27:55 ******/
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_forumTopics_locked]') AND parent_object_id = OBJECT_ID(N'[dbo].[forumTopics]'))
Begin
ALTER TABLE [dbo].[forumTopics] ADD CONSTRAINT [DF_forumTopics_locked] DEFAULT ((0)) FOR [locked]
End
GO
/****** Object: Default [DF_forumTopics_latestReplyAuthor] Script Date: 05/15/2009 05:27:55 ******/
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_forumTopics_latestReplyAuthor]') AND parent_object_id = OBJECT_ID(N'[dbo].[forumTopics]'))
Begin
ALTER TABLE [dbo].[forumTopics] ADD CONSTRAINT [DF_forumTopics_latestReplyAuthor] DEFAULT ((0)) FOR [latestReplyAuthor]
End
GO
/****** Object: Default [DF_forumForums_latestTopic] Script Date: 05/15/2009 05:27:55 ******/
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_forumForums_latestTopic]') AND parent_object_id = OBJECT_ID(N'[dbo].[forumForums]'))
Begin
ALTER TABLE [dbo].[forumForums] ADD CONSTRAINT [DF_forumForums_latestTopic] DEFAULT ((0)) FOR [latestTopic]
End
GO
/****** Object: Default [DF_forumForums_latestComment] Script Date: 05/15/2009 05:27:55 ******/
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_forumForums_latestComment]') AND parent_object_id = OBJECT_ID(N'[dbo].[forumForums]'))
Begin
ALTER TABLE [dbo].[forumForums] ADD CONSTRAINT [DF_forumForums_latestComment] DEFAULT ((0)) FOR [latestComment]
End
GO
/****** Object: Default [DF_forumForums_totalTopics] Script Date: 05/15/2009 05:27:55 ******/
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_forumForums_totalTopics]') AND parent_object_id = OBJECT_ID(N'[dbo].[forumForums]'))
Begin
ALTER TABLE [dbo].[forumForums] ADD CONSTRAINT [DF_forumForums_totalTopics] DEFAULT ((0)) FOR [totalTopics]
End
GO
/****** Object: Default [DF_forumForums_totalComments] Script Date: 05/15/2009 05:27:55 ******/
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_forumForums_totalComments]') AND parent_object_id = OBJECT_ID(N'[dbo].[forumForums]'))
Begin
ALTER TABLE [dbo].[forumForums] ADD CONSTRAINT [DF_forumForums_totalComments] DEFAULT ((0)) FOR [totalComments]
End
GO
/****** Object: Default [DF_forumForums_latestAuthor] Script Date: 05/15/2009 05:27:55 ******/
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_forumForums_latestAuthor]') AND parent_object_id = OBJECT_ID(N'[dbo].[forumForums]'))
Begin
ALTER TABLE [dbo].[forumForums] ADD CONSTRAINT [DF_forumForums_latestAuthor] DEFAULT ((0)) FOR [latestAuthor]
End
GO
/****** Object: Default [DF_forumForums_latestPostDate] Script Date: 05/15/2009 05:27:55 ******/
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_forumForums_latestPostDate]') AND parent_object_id = OBJECT_ID(N'[dbo].[forumForums]'))
Begin
ALTER TABLE [dbo].[forumForums] ADD CONSTRAINT [DF_forumForums_latestPostDate] DEFAULT (getdate()) FOR [latestPostDate]
End
GO
/****** Object: Default [DF_forumForums_sortOrder] Script Date: 05/15/2009 05:27:55 ******/
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_forumForums_sortOrder]') AND parent_object_id = OBJECT_ID(N'[dbo].[forumForums]'))
Begin
ALTER TABLE [dbo].[forumForums] ADD CONSTRAINT [DF_forumForums_sortOrder] DEFAULT ((0)) FOR [sortOrder]
End
GO
/****** Object: Default [DF_forumComments_created] Script Date: 05/15/2009 05:27:55 ******/
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_forumComments_created]') AND parent_object_id = OBJECT_ID(N'[dbo].[forumComments]'))
Begin
ALTER TABLE [dbo].[forumComments] ADD CONSTRAINT [DF_forumComments_created] DEFAULT (getdate()) FOR [created]
End
GO
/****** Object: Default [DF_umbracoNode_trashed] Script Date: 05/15/2009 05:27:55 ******/
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_umbracoNode_trashed]') AND parent_object_id = OBJECT_ID(N'[dbo].[umbracoNode]'))
Begin
ALTER TABLE [dbo].[umbracoNode] ADD CONSTRAINT [DF_umbracoNode_trashed] DEFAULT ((0)) FOR [trashed]
End
GO
/****** Object: Default [DF_umbracoNode_createDate] Script Date: 05/15/2009 05:27:55 ******/
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_umbracoNode_createDate]') AND parent_object_id = OBJECT_ID(N'[dbo].[umbracoNode]'))
Begin
ALTER TABLE [dbo].[umbracoNode] ADD CONSTRAINT [DF_umbracoNode_createDate] DEFAULT (getdate()) FOR [createDate]
End
GO
/****** Object: ForeignKey [FK_forumTopics_umbracoNode1] Script Date: 05/15/2009 05:27:55 ******/
IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_forumTopics_umbracoNode1]') AND parent_object_id = OBJECT_ID(N'[dbo].[forumTopics]'))
ALTER TABLE [dbo].[forumTopics] WITH CHECK ADD CONSTRAINT [FK_forumTopics_umbracoNode1] FOREIGN KEY([parentId])
REFERENCES [dbo].[umbracoNode] ([id])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[forumTopics] CHECK CONSTRAINT [FK_forumTopics_umbracoNode1]
GO
/****** Object: ForeignKey [FK_forumComments_forumTopics] Script Date: 05/15/2009 05:27:55 ******/
IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_forumComments_forumTopics]') AND parent_object_id = OBJECT_ID(N'[dbo].[forumComments]'))
ALTER TABLE [dbo].[forumComments] WITH CHECK ADD CONSTRAINT [FK_forumComments_forumTopics] FOREIGN KEY([topicId])
REFERENCES [dbo].[forumTopics] ([id])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[forumComments] CHECK CONSTRAINT [FK_forumComments_forumTopics]
GO
/****** Object: ForeignKey [FK_umbracoNode_umbracoNode] Script Date: 05/15/2009 05:27:55 ******/
IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_umbracoNode_umbracoNode]') AND parent_object_id = OBJECT_ID(N'[dbo].[umbracoNode]'))
ALTER TABLE [dbo].[umbracoNode] WITH CHECK ADD CONSTRAINT [FK_umbracoNode_umbracoNode] FOREIGN KEY([parentID])
REFERENCES [dbo].[umbracoNode] ([id])
GO
ALTER TABLE [dbo].[umbracoNode] CHECK CONSTRAINT [FK_umbracoNode_umbracoNode]
GO
CREATE TABLE [dbo].[cmsTagToTopic](
[id] [int] IDENTITY(1,1) NOT NULL,
[tagId] [int] NOT NULL,
[topicId] [int] NOT NULL,
[weight] [float] NOT NULL,
CONSTRAINT [PK_cmsTagToTopic] PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO | the_stack |
-- 2018-08-13T15:29:15.173
-- 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,560761,565595,0,256,0,TO_TIMESTAMP('2018-08-13 15:29:14','YYYY-MM-DD HH24:MI:SS'),100,'Count number of not empty elements',0,'de.metas.swat','Calculate the total number (?) of not empty (NULL) elements (maximum is the number of lines).',0,'Y','Y','Y','N','N','N','N','N','Calculate Count (?)',130,130,0,1,1,TO_TIMESTAMP('2018-08-13 15:29:14','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-08-13T15:29:15.183
-- 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=565595 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-08-13T15:29:30.673
-- 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,560762,565596,0,256,0,TO_TIMESTAMP('2018-08-13 15:29:30','YYYY-MM-DD HH24:MI:SS'),100,0,'de.metas.swat',0,'Y','Y','Y','N','N','N','N','N','Zugewiesen an',140,140,0,1,1,TO_TIMESTAMP('2018-08-13 15:29:30','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-08-13T15:29:30.673
-- 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=565596 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-08-13T15:29:51.666
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET IsTranslated='Y',Name='Counted',Description='',Help='' WHERE AD_Field_ID=565595 AND AD_Language='en_US'
;
-- 2018-08-13T15:30:10.142
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET IsTranslated='Y',Name='Assigned to' WHERE AD_Field_ID=565596 AND AD_Language='en_US'
;
-- 2018-08-13T15:31:25.215
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Gezählt',Updated=TO_TIMESTAMP('2018-08-13 15:31:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=565595
;
-- 2018-08-13T15:31:34.468
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET Name='Gezählt' WHERE AD_Field_ID=565595 AND AD_Language='de_CH'
;
-- 2018-08-13T15:31:43.146
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET Name='Gezählt',Description='',Help='' WHERE AD_Field_ID=565595 AND AD_Language='nl_NL'
;
-- 2018-08-13T15:31:47.586
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET Description='',Help='' WHERE AD_Field_ID=565595 AND AD_Language='de_CH'
;
-- 2018-08-13T15:32:05.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_Element_ID,AD_UI_ElementGroup_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayed_SideList,IsDisplayedGrid,Name,SeqNo,SeqNo_SideList,SeqNoGrid,Updated,UpdatedBy) VALUES (0,565595,0,256,552506,541513,'F',TO_TIMESTAMP('2018-08-13 15:32:04','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','Gezählt',130,0,0,TO_TIMESTAMP('2018-08-13 15:32:04','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-08-13T15:32:24.810
-- 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_Element_ID,AD_UI_ElementGroup_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayed_SideList,IsDisplayedGrid,Name,SeqNo,SeqNo_SideList,SeqNoGrid,Updated,UpdatedBy) VALUES (0,565596,0,256,552507,541513,'F',TO_TIMESTAMP('2018-08-13 15:32:24','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','Zugewiesen an',140,0,0,TO_TIMESTAMP('2018-08-13 15:32:24','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-08-13T15:44:12.653
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsReadOnly='Y',Updated=TO_TIMESTAMP('2018-08-13 15:44:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=565596
;
-- 2018-08-13T16:26:31.449
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Tab_ID,IsDisplayed,DisplayLength,SortNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,IsActive,Created,CreatedBy,IsReadOnly,ColumnDisplayLength,IncludedTabHeight,Updated,UpdatedBy,Help,AD_Field_ID,IsDisplayedGrid,SeqNo,SeqNoGrid,SpanX,SpanY,AD_Column_ID,Description,AD_Org_ID,Name,EntityType) VALUES (256,'Y',26,0,'Y','N','N','N',0,'Y',TO_TIMESTAMP('2018-08-13 16:26:31','YYYY-MM-DD HH24:MI:SS'),100,'N',0,0,TO_TIMESTAMP('2018-08-13 16:26:31','YYYY-MM-DD HH24:MI:SS'),100,'Eine eindeutige (nicht monetäre) Maßeinheit',565597,'Y',65,150,1,1,556504,'Maßeinheit',0,'Maßeinheit','de.metas.swat')
;
-- 2018-08-13T16:26:31.455
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,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_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=565597 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-08-13T16:27:18.638
-- 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_Element_ID,AD_UI_ElementGroup_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayed_SideList,IsDisplayedGrid,Name,SeqNo,SeqNo_SideList,SeqNoGrid,Updated,UpdatedBy) VALUES (0,565597,0,256,552508,541513,'F',TO_TIMESTAMP('2018-08-13 16:27:18','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','Maßeinheit',25,0,0,TO_TIMESTAMP('2018-08-13 16:27:18','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-08-13T17:00:08.042
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET IsTranslated='Y',Name='UOM',Description='Unit of Measure',Help='' WHERE AD_Field_ID=565597 AND AD_Language='en_US'
;
-- 2018-08-13T17:01:07.606
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Val_Rule_ID=210,Updated=TO_TIMESTAMP('2018-08-13 17:01:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=556504
;
-- 2018-08-13T17:02:19.091
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=30,Updated=TO_TIMESTAMP('2018-08-13 17:02:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552508
;
-- 2018-08-13T17:02:19.098
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=40,Updated=TO_TIMESTAMP('2018-08-13 17:02:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=551251
;
-- 2018-08-13T17:02:19.102
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=50,Updated=TO_TIMESTAMP('2018-08-13 17:02:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=551249
;
-- 2018-08-13T17:02:19.105
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=60,Updated=TO_TIMESTAMP('2018-08-13 17:02:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=551253
;
-- 2018-08-13T17:02:19.108
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=70,Updated=TO_TIMESTAMP('2018-08-13 17:02:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=551252
;
-- 2018-08-13T17:02:19.110
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=80,Updated=TO_TIMESTAMP('2018-08-13 17:02:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=551318
;
-- 2018-08-13T17:02:19.113
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=90,Updated=TO_TIMESTAMP('2018-08-13 17:02:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=551254
;
-- 2018-08-13T17:02:19.115
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=100,Updated=TO_TIMESTAMP('2018-08-13 17:02:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=551255
;
-- 2018-08-13T17:02:19.117
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=110,Updated=TO_TIMESTAMP('2018-08-13 17:02:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=551246
; | the_stack |
-- migrate:up
create or replace function sg_private.insert_user_or_session()
returns trigger as $$
begin
if (current_setting('jwt.claims.user_id') is not null
and current_setting('jwt.claims.user_id') <> '') then
new.user_id = current_setting('jwt.claims.user_id')::uuid;
elsif (current_setting('jwt.claims.session_id') is not null
and current_setting('jwt.claims.session_id') <> '') then
new.session_id = current_setting('jwt.claims.session_id')::uuid;
end if;
return new;
end;
$$ language plpgsql strict security definer;
comment on function sg_private.insert_user_or_session()
is 'When inserting a row, automatically set the `user_id` or `session_id` field.';
create type sg_public.entity_kind as enum(
'card',
'subject'
);
comment on type sg_public.entity_kind
is 'The types of learning entities.';
create type sg_public.entity_status as enum(
'pending',
'blocked',
'declined',
'accepted'
);
comment on type sg_public.entity_status
is 'The four statuses of entity versions.';
create type sg_public.card_kind as enum(
'video',
'page',
'unscored_embed',
'choice'
);
comment on type sg_public.card_kind
is 'The kinds of cards available to learn. Expanding.';
create table sg_public.entity (
entity_id uuid primary key default uuid_generate_v4(),
entity_kind sg_public.entity_kind not null,
unique (entity_id, entity_kind)
);
comment on table sg_public.entity
is 'A list of all entity IDs and their kinds.';
comment on column sg_public.entity.entity_id
is 'The overall ID of the entity.';
comment on column sg_public.entity.entity_kind
is 'The kind of entity the ID represents.';
create table sg_public.entity_version (
version_id uuid primary key default uuid_generate_v4(),
entity_kind sg_public.entity_kind not null,
unique (version_id, entity_kind)
);
comment on table sg_public.entity_version
is 'A list of all entity version IDs and their kinds.';
comment on column sg_public.entity_version.version_id
is 'The ID of the version.';
comment on column sg_public.entity_version.entity_kind
is 'The kind of entity the ID represents.';
create table sg_public.subject_entity (
entity_id uuid primary key references sg_public.entity (entity_id)
);
comment on table sg_public.subject_entity
is 'A list of all subject entity IDs.';
comment on column sg_public.subject_entity.entity_id
is 'The ID of the entity.';
create table sg_public.subject_version (
-- all entity columns
version_id uuid primary key references sg_public.entity_version (version_id),
created timestamp not null default current_timestamp,
modified timestamp not null default current_timestamp,
entity_id uuid not null references sg_public.subject_entity (entity_id),
previous_version_id uuid null references sg_public.subject_version (version_id),
language varchar(5) not null default 'en'
constraint lang_check check (language ~* '^\w{2}(-\w{2})?$'),
name text not null,
status sg_public.entity_status not null default 'pending',
available boolean not null default true,
tags text[] null default array[]::text[],
user_id uuid null references sg_public.user (id),
session_id uuid null,
-- and the rest....
body text not null,
-- also see join table: sg_public.subject_version_parent_child
-- also see join table: sg_public.subject_version_before_after
constraint user_or_session check (user_id is not null or session_id is not null)
);
comment on table sg_public.subject_version
is 'Every version of the subjects. '
'A subject is a collection of cards and other subjects. '
'A subject has many cards and other subjects.';
comment on column sg_public.subject_version.version_id
is 'The version ID -- a single subject can have many versions.';
comment on column sg_public.subject_version.created
is 'When a user created this version.';
comment on column sg_public.subject_version.modified
is 'When a user last modified this version.';
comment on column sg_public.subject_version.entity_id
is 'The overall entity ID.';
comment on column sg_public.subject_version.previous_version_id
is 'The previous version this version is based on.';
comment on column sg_public.subject_version.language
is 'Which human language this subject contains.';
comment on constraint lang_check on sg_public.subject_version
is 'Languages must be BCP47 compliant.';
comment on column sg_public.subject_version.name
is 'The name of the subject.';
comment on column sg_public.subject_version.status
is 'The status of the subject. The latest accepted version is current.';
comment on column sg_public.subject_version.available
is 'Whether the subject is available to learners.';
comment on column sg_public.subject_version.tags
is 'A list of tags. Think Bloom taxonomy.';
comment on column sg_public.subject_version.user_id
is 'Which user created this version.';
comment on column sg_public.subject_version.session_id
is 'If no user, which session created this version.';
comment on column sg_public.subject_version.body
is 'The description of the goals of the subject.';
comment on constraint user_or_session on sg_public.subject_version
is 'Ensure only the user or session has data.';
create table sg_public.subject_version_parent_child (
id uuid primary key default uuid_generate_v4(),
created timestamp not null default current_timestamp,
modified timestamp not null default current_timestamp,
child_version_id uuid not null references sg_public.subject_version (version_id),
parent_entity_id uuid not null references sg_public.subject_entity (entity_id),
unique (child_version_id, parent_entity_id)
);
comment on table sg_public.subject_version_parent_child
is 'A join table between a subject version and the parents.';
comment on column sg_public.subject_version_parent_child.id
is 'The relationship ID.';
comment on column sg_public.subject_version_parent_child.created
is 'When a user created this version.';
comment on column sg_public.subject_version_parent_child.modified
is 'When a user last modified this version.';
comment on column sg_public.subject_version_parent_child.child_version_id
is 'The version ID of the child subject.';
comment on column sg_public.subject_version_parent_child.parent_entity_id
is 'The entity ID of the parent subject.';
create table sg_public.subject_version_before_after (
id uuid primary key default uuid_generate_v4(),
created timestamp not null default current_timestamp,
modified timestamp not null default current_timestamp,
after_version_id uuid not null references sg_public.subject_version (version_id),
before_entity_id uuid not null references sg_public.subject_entity (entity_id),
unique (after_version_id, before_entity_id)
);
comment on table sg_public.subject_version_before_after
is 'A join table between a subject version and the subjects before.';
comment on column sg_public.subject_version_before_after.id
is 'The relationship ID.';
comment on column sg_public.subject_version_before_after.created
is 'When a user created this version.';
comment on column sg_public.subject_version_before_after.modified
is 'When a user last modified this version.';
comment on column sg_public.subject_version_before_after.after_version_id
is 'The version ID of the after subject.';
comment on column sg_public.subject_version_before_after.before_entity_id
is 'The entity ID of the before subject.';
create table sg_public.card_entity (
entity_id uuid primary key references sg_public.entity (entity_id)
);
comment on table sg_public.card_entity
is 'A list of all card entity IDs';
comment on column sg_public.card_entity.entity_id
is 'The ID of the entity';
create table sg_public.card_version (
-- all entity columns
version_id uuid primary key references sg_public.entity_version (version_id),
created timestamp not null default current_timestamp,
modified timestamp not null default current_timestamp,
entity_id uuid not null references sg_public.card_entity (entity_id),
previous_id uuid null references sg_public.card_version (version_id),
language varchar(5) not null default 'en'
constraint lang_check check (language ~* '^\w{2}(-\w{2})?$'),
name text not null,
status sg_public.entity_status not null default 'pending',
available boolean not null default true,
tags text[] null default array[]::text[],
user_id uuid null references sg_public.user (id),
session_id uuid null,
-- and the rest....
subject_id uuid not null references sg_public.subject_entity (entity_id),
kind sg_public.card_kind not null,
data jsonb not null,
constraint user_or_session check (user_id is not null or session_id is not null),
constraint valid_video_card check (
kind <> 'video' or validate_json_schema($$ {
"type": "object",
"properties": {
"site": {
"type": "string",
"enum": ["youtube", "vimeo"]
},
"video_id": { "type": "string" }
},
"required": ["site", "video_id"]
} $$, data)
),
constraint valid_page_card check (
kind <> 'page' or validate_json_schema($$ {
"type": "object",
"properties": {
"body": { "type": "string" }
},
"required": ["body"]
} $$, data)
),
constraint valid_unscored_embed_card check (
kind <> 'unscored_embed' or validate_json_schema($$ {
"type": "object",
"properties": {
"url": {
"type": "string",
"format": "uri"
}
},
"required": ["url"]
} $$, data)
),
constraint valid_choice_card check (
kind <> 'choice' or validate_json_schema($$ {
"type": "object",
"properties": {
"body": {
"type": "string"
},
"options": {
"type": "object",
"patternProperties": {
"^[a-zA-Z0-9-]+$": {
"type": "object",
"properties": {
"value": { "type": "string" },
"correct": { "type": "boolean" },
"feedback": { "type": "string" }
},
"required": ["value", "correct", "feedback"]
}
},
"additionalProperties": false,
"minProperties": 1
},
"max_options_to_show": {
"type": "integer",
"minimum": 2,
"default": 4
}
},
"required": ["body", "options", "max_options_to_show"]
} $$, data)
)
);
comment on table sg_public.card_version
is 'Every version of the cards. A card is a single learning activity. '
'A card belongs to a single subject.';
comment on column sg_public.card_version.version_id
is 'The version ID -- a single card can have many versions.';
comment on column sg_public.card_version.created
is 'When a user created this version.';
comment on column sg_public.card_version.modified
is 'When a user last modified this version.';
comment on column sg_public.card_version.entity_id
is 'The overall entity ID.';
comment on column sg_public.card_version.previous_id
is 'The previous version this version is based on.';
comment on column sg_public.card_version.language
is 'Which human language this card contains.';
comment on constraint lang_check on sg_public.card_version
is 'Languages must be BCP47 compliant.';
comment on column sg_public.card_version.name
is 'The name of the card.';
comment on column sg_public.card_version.status
is 'The status of the card. The latest accepted version is current.';
comment on column sg_public.card_version.available
is 'Whether the card is available to learners.';
comment on column sg_public.card_version.tags
is 'A list of tags. Think Bloom taxonomy.';
comment on column sg_public.card_version.user_id
is 'Which user created this version.';
comment on column sg_public.card_version.session_id
is 'If no user, which session created this version.';
comment on column sg_public.card_version.subject_id
is 'The subject the card belongs to.';
comment on column sg_public.card_version.kind
is 'The subkind of the card, such as video or choice.';
comment on column sg_public.card_version.data
is 'The data of the card. The card kind changes the data shape.';
comment on constraint valid_video_card on sg_public.card_version
is 'If the `kind` is `video`, ensure `data` matches the data shape.';
comment on constraint valid_page_card on sg_public.card_version
is 'If the `kind` is `page`, ensure `data` matches the data shape.';
comment on constraint valid_unscored_embed_card on sg_public.card_version
is 'If the `kind` is `unscored_embed`, ensure `data` matches the data shape.';
comment on constraint valid_choice_card on sg_public.card_version
is 'If the `kind` is `choice`, ensure `data` matches the data shape.';
comment on constraint user_or_session on sg_public.card_version
is 'Ensure only the user or session has data.';
create trigger update_subject_version_modified
before update on sg_public.subject_version
for each row execute procedure sg_private.update_modified_column();
comment on trigger update_subject_version_modified on sg_public.subject_version
is 'Whenever a subject version changes, update the `modified` column.';
create trigger update_subject_version_parent_child_modified
before update on sg_public.subject_version_parent_child
for each row execute procedure sg_private.update_modified_column();
comment on trigger update_subject_version_parent_child_modified
on sg_public.subject_version_parent_child
is 'Whenever a subject version changes, update the `modified` column.';
create trigger update_subject_version_before_after_modified
before update on sg_public.subject_version_before_after
for each row execute procedure sg_private.update_modified_column();
comment on trigger update_subject_version_before_after_modified
on sg_public.subject_version_before_after
is 'Whenever a subject version changes, update the `modified` column.';
create trigger update_card_version_modified
before update on sg_public.card_version
for each row execute procedure sg_private.update_modified_column();
comment on trigger update_card_version_modified on sg_public.card_version
is 'Whenever a card version changes, update the `modified` column.';
create trigger insert_subject_version_user_or_session
before insert on sg_public.subject_version
for each row execute procedure sg_private.insert_user_or_session();
comment on trigger insert_subject_version_user_or_session
on sg_public.subject_version
is 'Automatically add the user_id or session_id.';
create trigger insert_card_version_user_or_session
before insert on sg_public.card_version
for each row execute procedure sg_private.insert_user_or_session();
comment on trigger insert_card_version_user_or_session
on sg_public.card_version
is 'Automatically add the user_id or session_id.';
create or replace function sg_public.new_subject(
language varchar,
name text,
tags text[],
body text,
parent uuid[],
before uuid[]
)
returns sg_public.subject_version as $$
declare
xentity_id uuid;
xversion_id uuid;
xsubject_version sg_public.subject_version;
begin
xentity_id := uuid_generate_v4();
xversion_id := uuid_generate_v4();
insert into sg_public.entity
(entity_id, entity_kind) values (xentity_id, 'subject');
insert into sg_public.subject_entity
(entity_id) values (xentity_id);
insert into sg_public.entity_version
(version_id, entity_kind) values (xversion_id, 'subject');
insert into sg_public.subject_version
(version_id, entity_id, language, name, tags, body)
values (xversion_id, xentity_id, language, name, tags, body)
returning * into xsubject_version;
insert into sg_public.subject_version_parent_child
(child_version_id, parent_entity_id)
select xversion_id, unnest(parent);
insert into sg_public.subject_version_before_after
(after_version_id, before_entity_id)
select xversion_id, unnest(before);
return xsubject_version;
end;
$$ language plpgsql strict security definer;
comment on function sg_public.new_subject(
varchar,
text,
text[],
text,
uuid[],
uuid[]
) is 'Create a new subject.';
grant execute on function sg_public.new_subject(
varchar,
text,
text[],
text,
uuid[],
uuid[]
) to sg_anonymous, sg_user, sg_admin;
create or replace function sg_public.new_card(
language varchar,
name text,
tags text[],
subject_id uuid,
kind sg_public.card_kind,
data jsonb
)
returns sg_public.card_version as $$
declare
xentity_id uuid;
xversion_id uuid;
xcard_version sg_public.card_version;
begin
xentity_id := uuid_generate_v4();
xversion_id := uuid_generate_v4();
insert into sg_public.entity
(entity_id, entity_kind) values (xentity_id, 'card');
insert into sg_public.card_entity
(entity_id) values (xentity_id);
insert into sg_public.entity_version
(version_id, entity_kind) values (xversion_id, 'card');
insert into sg_public.card_version
(version_id, entity_id, language, name, tags, subject_id, kind, data)
values (xversion_id, xentity_id, language, name, tags, subject_id, kind, data)
returning * into xcard_version;
return xcard_version;
end;
$$ language plpgsql strict security definer;
comment on function sg_public.new_card(
varchar,
text,
text[],
uuid,
sg_public.card_kind,
jsonb
) is 'Create a new card.';
grant execute on function sg_public.new_card(
varchar,
text,
text[],
uuid,
sg_public.card_kind,
jsonb
) to sg_anonymous, sg_user, sg_admin;
-- migrate:down | the_stack |
-- SQL language Functions defined in the 4.0 Catalog:
--
-- Derived via the following SQL run within a 4.0 catalog
--
-- NOTE: The SQL language functions all require use of the actual catalog types,
-- but this prohibits our ability to use them as definitions of other objects.
-- To handle this we rewrite all of them to return null, which is a less than
-- ideal solution for our testing, but it gets around a lot of issues. This
-- forces us to use alternate means of verifying that there have been no changes
-- to the definition of SQL language functions.
--
/*
\o /tmp/functions
SELECT
'CREATE FUNCTION upg_catalog.'
|| case when proname in ('convert')
then '"' || proname || '"'
else quote_ident(proname) end
|| '('
|| coalesce(
array_to_string(
case when proargmodes is null
then array(
select coalesce(proargnames[i] || ' ','')
|| 'upg_catalog.' || quote_ident(typname)
from pg_type t, generate_series(1, pronargs) i
where t.oid = proargtypes[i-1]
order by i)
else array(
select case when proargmodes[i] = 'i' then 'IN '
when proargmodes[i] = 'o' then 'OUT '
when proargmodes[i] = 'b' then 'INOUT '
else 'BROKEN(proargmode)' end
|| coalesce(proargnames[i] || ' ','')
|| 'upg_catalog.' || quote_ident(typname)
from pg_type t, generate_series(1, array_upper(proargmodes, 1)) i
where t.oid = proallargtypes[i]
order by i)
end, ', '), '')
|| ') RETURNS '
|| case when proretset then 'SETOF ' else '' end
|| 'upg_catalog.' || quote_ident(r.typname) || ' '
|| 'LANGUAGE ' || quote_ident(lanname) || ' '
|| case when provolatile = 'i' then 'IMMUTABLE '
when provolatile = 'v' then 'VOLATILE '
when provolatile = 's' then 'STABLE '
else '' end
|| case when proisstrict then 'STRICT ' else '' end
|| case when prosecdef then 'SECURITY DEFINER ' else '' end
|| 'AS ''select null::upg_catalog.' || quote_ident(r.typname) || ''';'
FROM pg_proc p
JOIN pg_type r on (p.prorettype = r.oid)
JOIN pg_language l on (p.prolang = l.oid)
JOIN pg_namespace n on (p.pronamespace = n.oid)
WHERE n.nspname = 'pg_catalog'
and proisagg = 'f'
and proiswin = 'f'
and p.oid not in (select unnest(array[typinput, typoutput, typreceive, typsend, typanalyze])
from pg_type)
and p.oid not in (select castfunc from pg_cast)
and p.oid not in (select conproc from pg_conversion)
and p.oid not in (select unnest(array[oprrest, oprjoin]) from pg_operator)
and p.oid not in (select unnest(array['pg_catalog.shell_in'::regproc, 'pg_catalog.shell_out'::regproc]))
and lanname = 'sql'
order by 1;
*/
CREATE FUNCTION upg_catalog."log"(upg_catalog."numeric") RETURNS upg_catalog."numeric" LANGUAGE sql IMMUTABLE STRICT AS 'select null::upg_catalog."numeric"';
CREATE FUNCTION upg_catalog."overlaps"(upg_catalog."time", upg_catalog."interval", upg_catalog."time", upg_catalog."interval") RETURNS upg_catalog.bool LANGUAGE sql IMMUTABLE AS 'select null::upg_catalog.bool';
CREATE FUNCTION upg_catalog."overlaps"(upg_catalog."time", upg_catalog."interval", upg_catalog."time", upg_catalog."time") RETURNS upg_catalog.bool LANGUAGE sql IMMUTABLE AS 'select null::upg_catalog.bool';
CREATE FUNCTION upg_catalog."overlaps"(upg_catalog."time", upg_catalog."time", upg_catalog."time", upg_catalog."interval") RETURNS upg_catalog.bool LANGUAGE sql IMMUTABLE AS 'select null::upg_catalog.bool';
CREATE FUNCTION upg_catalog."overlaps"(upg_catalog."timestamp", upg_catalog."interval", upg_catalog."timestamp", upg_catalog."interval") RETURNS upg_catalog.bool LANGUAGE sql IMMUTABLE AS 'select null::upg_catalog.bool';
CREATE FUNCTION upg_catalog."overlaps"(upg_catalog."timestamp", upg_catalog."interval", upg_catalog."timestamp", upg_catalog."timestamp") RETURNS upg_catalog.bool LANGUAGE sql IMMUTABLE AS 'select null::upg_catalog.bool';
CREATE FUNCTION upg_catalog."overlaps"(upg_catalog."timestamp", upg_catalog."timestamp", upg_catalog."timestamp", upg_catalog."interval") RETURNS upg_catalog.bool LANGUAGE sql IMMUTABLE AS 'select null::upg_catalog.bool';
CREATE FUNCTION upg_catalog."overlaps"(upg_catalog.timestamptz, upg_catalog."interval", upg_catalog.timestamptz, upg_catalog."interval") RETURNS upg_catalog.bool LANGUAGE sql STABLE AS 'select null::upg_catalog.bool';
CREATE FUNCTION upg_catalog."overlaps"(upg_catalog.timestamptz, upg_catalog."interval", upg_catalog.timestamptz, upg_catalog.timestamptz) RETURNS upg_catalog.bool LANGUAGE sql STABLE AS 'select null::upg_catalog.bool';
CREATE FUNCTION upg_catalog."overlaps"(upg_catalog.timestamptz, upg_catalog.timestamptz, upg_catalog.timestamptz, upg_catalog."interval") RETURNS upg_catalog.bool LANGUAGE sql STABLE AS 'select null::upg_catalog.bool';
CREATE FUNCTION upg_catalog."overlay"(upg_catalog.text, upg_catalog.text, upg_catalog.int4) RETURNS upg_catalog.text LANGUAGE sql IMMUTABLE STRICT AS 'select null::upg_catalog.text';
CREATE FUNCTION upg_catalog."overlay"(upg_catalog.text, upg_catalog.text, upg_catalog.int4, upg_catalog.int4) RETURNS upg_catalog.text LANGUAGE sql IMMUTABLE STRICT AS 'select null::upg_catalog.text';
CREATE FUNCTION upg_catalog."substring"(upg_catalog."bit", upg_catalog.int4) RETURNS upg_catalog."bit" LANGUAGE sql IMMUTABLE STRICT AS 'select null::upg_catalog."bit"';
CREATE FUNCTION upg_catalog."substring"(upg_catalog.text, upg_catalog.text, upg_catalog.text) RETURNS upg_catalog.text LANGUAGE sql IMMUTABLE STRICT AS 'select null::upg_catalog.text';
CREATE FUNCTION upg_catalog.age(upg_catalog."timestamp") RETURNS upg_catalog."interval" LANGUAGE sql STABLE STRICT AS 'select null::upg_catalog."interval"';
CREATE FUNCTION upg_catalog.age(upg_catalog.timestamptz) RETURNS upg_catalog."interval" LANGUAGE sql STABLE STRICT AS 'select null::upg_catalog."interval"';
CREATE FUNCTION upg_catalog.bit_length(upg_catalog."bit") RETURNS upg_catalog.int4 LANGUAGE sql IMMUTABLE STRICT AS 'select null::upg_catalog.int4';
CREATE FUNCTION upg_catalog.bit_length(upg_catalog.bytea) RETURNS upg_catalog.int4 LANGUAGE sql IMMUTABLE STRICT AS 'select null::upg_catalog.int4';
CREATE FUNCTION upg_catalog.bit_length(upg_catalog.text) RETURNS upg_catalog.int4 LANGUAGE sql IMMUTABLE STRICT AS 'select null::upg_catalog.int4';
CREATE FUNCTION upg_catalog.col_description(upg_catalog.oid, upg_catalog.int4) RETURNS upg_catalog.text LANGUAGE sql STABLE STRICT AS 'select null::upg_catalog.text';
CREATE FUNCTION upg_catalog.date_part(upg_catalog.text, upg_catalog.abstime) RETURNS upg_catalog.float8 LANGUAGE sql STABLE STRICT AS 'select null::upg_catalog.float8';
CREATE FUNCTION upg_catalog.date_part(upg_catalog.text, upg_catalog.date) RETURNS upg_catalog.float8 LANGUAGE sql IMMUTABLE STRICT AS 'select null::upg_catalog.float8';
CREATE FUNCTION upg_catalog.date_part(upg_catalog.text, upg_catalog.reltime) RETURNS upg_catalog.float8 LANGUAGE sql STABLE STRICT AS 'select null::upg_catalog.float8';
CREATE FUNCTION upg_catalog.int8pl_inet(upg_catalog.int8, upg_catalog.inet) RETURNS upg_catalog.inet LANGUAGE sql IMMUTABLE STRICT AS 'select null::upg_catalog.inet';
CREATE FUNCTION upg_catalog.integer_pl_date(upg_catalog.int4, upg_catalog.date) RETURNS upg_catalog.date LANGUAGE sql IMMUTABLE STRICT AS 'select null::upg_catalog.date';
CREATE FUNCTION upg_catalog.interval_pl_date(upg_catalog."interval", upg_catalog.date) RETURNS upg_catalog."timestamp" LANGUAGE sql IMMUTABLE STRICT AS 'select null::upg_catalog."timestamp"';
CREATE FUNCTION upg_catalog.interval_pl_time(upg_catalog."interval", upg_catalog."time") RETURNS upg_catalog."time" LANGUAGE sql IMMUTABLE STRICT AS 'select null::upg_catalog."time"';
CREATE FUNCTION upg_catalog.interval_pl_timestamp(upg_catalog."interval", upg_catalog."timestamp") RETURNS upg_catalog."timestamp" LANGUAGE sql IMMUTABLE STRICT AS 'select null::upg_catalog."timestamp"';
CREATE FUNCTION upg_catalog.interval_pl_timestamptz(upg_catalog."interval", upg_catalog.timestamptz) RETURNS upg_catalog.timestamptz LANGUAGE sql STABLE STRICT AS 'select null::upg_catalog.timestamptz';
CREATE FUNCTION upg_catalog.interval_pl_timetz(upg_catalog."interval", upg_catalog.timetz) RETURNS upg_catalog.timetz LANGUAGE sql IMMUTABLE STRICT AS 'select null::upg_catalog.timetz';
CREATE FUNCTION upg_catalog.lpad(upg_catalog.text, upg_catalog.int4) RETURNS upg_catalog.text LANGUAGE sql IMMUTABLE STRICT AS 'select null::upg_catalog.text';
CREATE FUNCTION upg_catalog.obj_description(upg_catalog.oid) RETURNS upg_catalog.text LANGUAGE sql STABLE STRICT AS 'select null::upg_catalog.text';
CREATE FUNCTION upg_catalog.obj_description(upg_catalog.oid, upg_catalog.name) RETURNS upg_catalog.text LANGUAGE sql STABLE STRICT AS 'select null::upg_catalog.text';
CREATE FUNCTION upg_catalog.path_contain_pt(upg_catalog.path, upg_catalog.point) RETURNS upg_catalog.bool LANGUAGE sql IMMUTABLE STRICT AS 'select null::upg_catalog.bool';
CREATE FUNCTION upg_catalog.round(upg_catalog."numeric") RETURNS upg_catalog."numeric" LANGUAGE sql IMMUTABLE STRICT AS 'select null::upg_catalog."numeric"';
CREATE FUNCTION upg_catalog.rpad(upg_catalog.text, upg_catalog.int4) RETURNS upg_catalog.text LANGUAGE sql IMMUTABLE STRICT AS 'select null::upg_catalog.text';
CREATE FUNCTION upg_catalog.shobj_description(upg_catalog.oid, upg_catalog.name) RETURNS upg_catalog.text LANGUAGE sql STABLE STRICT AS 'select null::upg_catalog.text';
CREATE FUNCTION upg_catalog.timedate_pl(upg_catalog."time", upg_catalog.date) RETURNS upg_catalog."timestamp" LANGUAGE sql IMMUTABLE STRICT AS 'select null::upg_catalog."timestamp"';
CREATE FUNCTION upg_catalog.timestamptz(upg_catalog.date, upg_catalog."time") RETURNS upg_catalog.timestamptz LANGUAGE sql STABLE STRICT AS 'select null::upg_catalog.timestamptz';
CREATE FUNCTION upg_catalog.timetzdate_pl(upg_catalog.timetz, upg_catalog.date) RETURNS upg_catalog.timestamptz LANGUAGE sql IMMUTABLE STRICT AS 'select null::upg_catalog.timestamptz';
CREATE FUNCTION upg_catalog.to_timestamp(upg_catalog.float8) RETURNS upg_catalog.timestamptz LANGUAGE sql IMMUTABLE STRICT AS 'select null::upg_catalog.timestamptz';
CREATE FUNCTION upg_catalog.trunc(upg_catalog."numeric") RETURNS upg_catalog."numeric" LANGUAGE sql IMMUTABLE STRICT AS 'select null::upg_catalog."numeric"'; | the_stack |
-- Revert goiardi_postgres:jsonbb from pg
BEGIN;
DROP VIEW IF EXISTS goiardi.joined_cookbook_version;
DROP VIEW goiardi.node_latest_statuses;
ALTER TABLE goiardi.cookbook_versions
ALTER COLUMN metadata TYPE json USING NULL,
ALTER COLUMN definitions TYPE json USING NULL,
ALTER COLUMN libraries TYPE json USING NULL,
ALTER COLUMN attributes TYPE json USING NULL,
ALTER COLUMN recipes TYPE json USING NULL,
ALTER COLUMN resources TYPE json USING NULL,
ALTER COLUMN providers TYPE json USING NULL,
ALTER COLUMN templates TYPE json USING NULL,
ALTER COLUMN root_files TYPE json USING NULL,
ALTER COLUMN files TYPE json USING NULL;
ALTER TABLE goiardi.data_bag_items
ALTER COLUMN raw_data TYPE json USING NULL;
ALTER TABLE goiardi.environments
ALTER COLUMN default_attr TYPE json USING NULL,
ALTER COLUMN override_attr TYPE json USING NULL,
ALTER COLUMN cookbook_vers TYPE json USING NULL;
ALTER TABLE goiardi.nodes
ALTER COLUMN run_list TYPE json USING NULL,
ALTER COLUMN automatic_attr TYPE json USING NULL,
ALTER COLUMN normal_attr TYPE json USING NULL,
ALTER COLUMN default_attr TYPE json USING NULL,
ALTER COLUMN override_attr TYPE json USING NULL;
ALTER TABLE goiardi.reports
ALTER COLUMN resources TYPE json USING NULL,
ALTER COLUMN data TYPE json USING NULL;
ALTER TABLE goiardi.roles
ALTER COLUMN run_list TYPE json USING NULL,
ALTER COLUMN env_run_lists TYPE json USING NULL,
ALTER COLUMN default_attr TYPE json USING NULL,
ALTER COLUMN override_attr TYPE json USING NULL;
ALTER TABLE goiardi.sandboxes
ALTER COLUMN checksums TYPE json USING NULL;
DROP FUNCTION goiardi.merge_cookbook_versions(c_id bigint, is_frozen bool, defb jsonb, libb jsonb, attb jsonb, recb jsonb, prob jsonb, resb jsonb, temb jsonb, roob jsonb, filb jsonb, metb jsonb, maj bigint, min bigint, patch bigint);
DROP FUNCTION goiardi.insert_dbi(m_data_bag_name text, m_name text, m_orig_name text, m_dbag_id bigint, m_raw_data jsonb);
DROP FUNCTION goiardi.merge_environments(m_name text, m_description text, m_default_attr jsonb, m_override_attr jsonb, m_cookbook_vers jsonb);
DROP FUNCTION goiardi.merge_nodes(m_name text, m_chef_environment text, m_run_list jsonb, m_automatic_attr jsonb, m_normal_attr jsonb, m_default_attr jsonb, m_override_attr jsonb);
DROP FUNCTION goiardi.merge_reports(m_run_id uuid, m_node_name text, m_start_time timestamp with time zone, m_end_time timestamp with time zone, m_total_res_count int, m_status goiardi.report_status, m_run_list text, m_resources jsonb, m_data jsonb);
DROP FUNCTION goiardi.merge_roles(m_name text, m_description text, m_run_list jsonb, m_env_run_lists jsonb, m_default_attr jsonb, m_override_attr jsonb);
DROP FUNCTION goiardi.merge_sandboxes(m_sbox_id varchar(32), m_creation_time timestamp with time zone, m_checksums jsonb, m_completed boolean);
CREATE OR REPLACE VIEW goiardi.joined_cookbook_version(
-- Cookbook Version fields
major_ver, -- these 3 are needed for version information (duh)
minor_ver,
patch_ver,
version, -- concatenated string of the complete version
id, -- used for retrieving environment-filtered recipes
metadata,
recipes,
-- Cookbook fields
organization_id, -- not actually doing anything yet
name) -- both version and recipe queries require the cookbook name
AS
SELECT v.major_ver,
v.minor_ver,
v.patch_ver,
v.major_ver || '.' || v.minor_ver || '.' || v.patch_ver,
v.id,
v.metadata,
v.recipes,
c.organization_id,
c.name
FROM goiardi.cookbooks AS c
JOIN goiardi.cookbook_versions AS v
ON c.id = v.cookbook_id;
CREATE OR REPLACE VIEW goiardi.node_latest_statuses(
id,
name,
chef_environment,
run_list,
automatic_attr,
normal_attr,
default_attr,
override_attr,
is_down,
status,
updated_at)
AS
SELECT DISTINCT ON (n.id)
n.id,
n.name,
n.chef_environment,
n.run_list,
n.automatic_attr,
n.normal_attr,
n.default_attr,
n.override_attr,
n.is_down,
ns.status,
ns.updated_at
FROM goiardi.nodes n INNER JOIN goiardi.node_statuses ns ON n.id = ns.node_id
ORDER BY n.id, ns.updated_at DESC;
CREATE OR REPLACE FUNCTION goiardi.merge_cookbook_versions(c_id bigint, is_frozen bool, defb json, libb json, attb json, recb json, prob json, resb json, temb json, roob json, filb json, metb json, maj bigint, min bigint, patch bigint) RETURNS BIGINT AS
$$
DECLARE
cbv_id BIGINT;
BEGIN
LOOP
-- first try to update the key
UPDATE goiardi.cookbook_versions SET frozen = is_frozen, metadata = metb, definitions = defb, libraries = libb, attributes = attb, recipes = recb, providers = prob, resources = resb, templates = temb, root_files = roob, files = filb, updated_at = NOW() WHERE cookbook_id = c_id AND major_ver = maj AND minor_ver = min AND patch_ver = patch RETURNING id INTO cbv_id;
IF found THEN
RETURN cbv_id;
END IF;
-- not there, so try to insert the key
-- if someone else inserts the same key concurrently,
-- we could get a unique-key failure
BEGIN
INSERT INTO goiardi.cookbook_versions (cookbook_id, major_ver, minor_ver, patch_ver, frozen, metadata, definitions, libraries, attributes, recipes, providers, resources, templates, root_files, files, created_at, updated_at) VALUES (c_id, maj, min, patch, is_frozen, metb, defb, libb, attb, recb, prob, resb, temb, roob, filb, NOW(), NOW()) RETURNING id INTO cbv_id;
RETURN c_id;
EXCEPTION WHEN unique_violation THEN
-- Do nothing, and loop to try the UPDATE again.
END;
END LOOP;
END;
$$
LANGUAGE plpgsql;
CREATE OR REPLACE FUNCTION goiardi.insert_dbi(m_data_bag_name text, m_name text, m_orig_name text, m_dbag_id bigint, m_raw_data json) RETURNS BIGINT AS
$$
DECLARE
u BIGINT;
dbi_id BIGINT;
BEGIN
SELECT id INTO u FROM goiardi.data_bags WHERE id = m_dbag_id;
IF NOT FOUND THEN
RAISE EXCEPTION 'aiiiie! The data bag % was deleted from the db while we were doing something else', m_data_bag_name;
END IF;
INSERT INTO goiardi.data_bag_items (name, orig_name, data_bag_id, raw_data, created_at, updated_at) VALUES (m_name, m_orig_name, m_dbag_id, m_raw_data, NOW(), NOW()) RETURNING id INTO dbi_id;
RETURN dbi_id;
END;
$$
LANGUAGE plpgsql;
CREATE OR REPLACE FUNCTION goiardi.merge_environments(m_name text, m_description text, m_default_attr json, m_override_attr json, m_cookbook_vers json) RETURNS VOID AS
$$
BEGIN
LOOP
-- first try to update the key
UPDATE goiardi.environments SET description = m_description, default_attr = m_default_attr, override_attr = m_override_attr, cookbook_vers = m_cookbook_vers, updated_at = NOW() WHERE name = m_name;
IF found THEN
RETURN;
END IF;
-- not there, so try to insert the key
-- if someone else inserts the same key concurrently,
-- we could get a unique-key failure
BEGIN
INSERT INTO goiardi.environments (name, description, default_attr, override_attr, cookbook_vers, created_at, updated_at) VALUES (m_name, m_description, m_default_attr, m_override_attr, m_cookbook_vers, NOW(), NOW());
RETURN;
EXCEPTION WHEN unique_violation THEN
-- Do nothing, and loop to try the UPDATE again.
END;
END LOOP;
END;
$$
LANGUAGE plpgsql;
CREATE OR REPLACE FUNCTION goiardi.merge_nodes(m_name text, m_chef_environment text, m_run_list json, m_automatic_attr json, m_normal_attr json, m_default_attr json, m_override_attr json) RETURNS VOID AS
$$
BEGIN
LOOP
-- first try to update the key
UPDATE goiardi.nodes SET chef_environment = m_chef_environment, run_list = m_run_list, automatic_attr = m_automatic_attr, normal_attr = m_normal_attr, default_attr = m_default_attr, override_attr = m_override_attr, updated_at = NOW() WHERE name = m_name;
IF found THEN
RETURN;
END IF;
-- not there, so try to insert the key
-- if someone else inserts the same key concurrently,
-- we could get a unique-key failure
BEGIN
INSERT INTO goiardi.nodes (name, chef_environment, run_list, automatic_attr, normal_attr, default_attr, override_attr, created_at, updated_at) VALUES (m_name, m_chef_environment, m_run_list, m_automatic_attr, m_normal_attr, m_default_attr, m_override_attr, NOW(), NOW());
RETURN;
EXCEPTION WHEN unique_violation THEN
-- Do nothing, and loop to try the UPDATE again.
END;
END LOOP;
END;
$$
LANGUAGE plpgsql;
CREATE OR REPLACE FUNCTION goiardi.merge_reports(m_run_id uuid, m_node_name text, m_start_time timestamp with time zone, m_end_time timestamp with time zone, m_total_res_count int, m_status goiardi.report_status, m_run_list text, m_resources json, m_data json) RETURNS VOID AS
$$
BEGIN
LOOP
-- first try to update the key
UPDATE goiardi.reports SET start_time = m_start_time, end_time = m_end_time, total_res_count = m_total_res_count, status = m_status, run_list = m_run_list, resources = m_resources, data = m_data, updated_at = NOW() WHERE run_id = m_run_id;
IF found THEN
RETURN;
END IF;
-- not there, so try to insert the key
-- if someone else inserts the same key concurrently,
-- we could get a unique-key failure
BEGIN
INSERT INTO goiardi.reports (run_id, node_name, start_time, end_time, total_res_count, status, run_list, resources, data, created_at, updated_at) VALUES (m_run_id, m_node_name, m_start_time, m_end_time, m_total_res_count, m_status, m_run_list, m_resources, m_data, NOW(), NOW());
RETURN;
EXCEPTION WHEN unique_violation THEN
-- Do nothing, and loop to try the UPDATE again.
END;
END LOOP;
END;
$$
LANGUAGE plpgsql;
CREATE OR REPLACE FUNCTION goiardi.merge_roles(m_name text, m_description text, m_run_list json, m_env_run_lists json, m_default_attr json, m_override_attr json) RETURNS VOID AS
$$
BEGIN
LOOP
-- first try to update the key
UPDATE goiardi.roles SET description = m_description, run_list = m_run_list, env_run_lists = m_env_run_lists, default_attr = m_default_attr, override_attr = m_override_attr, updated_at = NOW() WHERE name = m_name;
IF found THEN
RETURN;
END IF;
-- not there, so try to insert the key
-- if someone else inserts the same key concurrently,
-- we could get a unique-key failure
BEGIN
INSERT INTO goiardi.roles (name, description, run_list, env_run_lists, default_attr, override_attr, created_at, updated_at) VALUES (m_name, m_description, m_run_list, m_env_run_lists, m_default_attr, m_override_attr, NOW(), NOW());
RETURN;
EXCEPTION WHEN unique_violation THEN
-- Do nothing, and loop to try the UPDATE again.
END;
END LOOP;
END;
$$
LANGUAGE plpgsql;
CREATE OR REPLACE FUNCTION goiardi.merge_sandboxes(m_sbox_id varchar(32), m_creation_time timestamp with time zone, m_checksums json, m_completed boolean) RETURNS VOID AS
$$
BEGIN
LOOP
-- first try to update the key
UPDATE goiardi.sandboxes SET checksums = m_checksums, completed = m_completed WHERE sbox_id = m_sbox_id;
IF found THEN
RETURN;
END IF;
-- not there, so try to insert the key
-- if someone else inserts the same key concurrently,
-- we could get a unique-key failure
BEGIN
INSERT INTO goiardi.sandboxes (sbox_id, creation_time, checksums, completed) VALUES (m_sbox_id, m_creation_time, m_checksums, m_completed);
RETURN;
EXCEPTION WHEN unique_violation THEN
-- Do nothing, and loop to try the UPDATE again.
END;
END LOOP;
END;
$$
LANGUAGE plpgsql;
COMMIT; | the_stack |
-- CreateTable
CREATE TABLE `User` (
`id` VARCHAR(191) NOT NULL,
`firstName` VARCHAR(191) NOT NULL,
`lastName` VARCHAR(191) NULL,
`image` VARCHAR(191) NULL,
`email` VARCHAR(191) NOT NULL,
`username` VARCHAR(191) NULL,
`password` VARCHAR(191) NULL,
`userBioId` VARCHAR(191) NULL,
`isOnboarded` BOOLEAN NOT NULL DEFAULT false,
`onboardingState` JSON NOT NULL,
UNIQUE INDEX `User_email_key`(`email`),
UNIQUE INDEX `User_username_key`(`username`),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `UserBio` (
`id` VARCHAR(191) NOT NULL,
`description` VARCHAR(191) NULL,
`github` VARCHAR(191) NULL,
`twitter` VARCHAR(191) NULL,
`linkedin` VARCHAR(191) NULL,
`facebook` VARCHAR(191) NULL,
`hashnode` VARCHAR(191) NULL,
`instagram` VARCHAR(191) NULL,
`devto` VARCHAR(191) NULL,
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `Preferences` (
`id` VARCHAR(191) NOT NULL,
`userId` VARCHAR(191) NOT NULL,
`kudos` JSON NOT NULL,
`blogs` JSON NOT NULL,
`header` JSON NOT NULL,
UNIQUE INDEX `Preferences_userId_key`(`userId`),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `Flare` (
`id` VARCHAR(191) NOT NULL,
`deleted` BOOLEAN NOT NULL DEFAULT false,
`tags` VARCHAR(191) NOT NULL DEFAULT '',
`createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
`authorId` VARCHAR(191) NOT NULL,
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `Block` (
`id` VARCHAR(191) NOT NULL,
`type` VARCHAR(191) NOT NULL,
`content` JSON NOT NULL,
`createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
`flareId` VARCHAR(191) NOT NULL,
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `Comment` (
`id` VARCHAR(191) NOT NULL,
`text` VARCHAR(191) NOT NULL,
`createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
`flareId` VARCHAR(191) NULL,
`authorId` VARCHAR(191) NOT NULL,
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `Like` (
`id` VARCHAR(191) NOT NULL,
`reaction` VARCHAR(191) NOT NULL,
`createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
`flareId` VARCHAR(191) NULL,
`authorId` VARCHAR(191) NOT NULL,
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `Notification` (
`id` VARCHAR(191) NOT NULL,
`toId` VARCHAR(191) NOT NULL,
`type` ENUM('FOLLOW', 'REACTION', 'COMMENT', 'FLARE') NOT NULL,
`followeeId` VARCHAR(191) NOT NULL,
`createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
`content` JSON NULL,
`read` BOOLEAN NOT NULL DEFAULT false,
`flareId` VARCHAR(191) NULL,
`commentId` VARCHAR(191) NULL,
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `Bookmark` (
`id` VARCHAR(191) NOT NULL,
`createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
`flareId` VARCHAR(191) NOT NULL,
`authorId` VARCHAR(191) NOT NULL,
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `Slot` (
`id` VARCHAR(191) NOT NULL,
`name` VARCHAR(191) NOT NULL,
`date` JSON NOT NULL,
`time` JSON NOT NULL,
`days` JSON NOT NULL,
`active` BOOLEAN NOT NULL,
`paid` BOOLEAN NOT NULL,
`plan` JSON NOT NULL,
`createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
`updatedAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `Booking` (
`id` VARCHAR(191) NOT NULL,
`date` DATETIME(3) NOT NULL,
`status` ENUM('PENDING', 'CONFIRMED', 'CANCELLED') NOT NULL,
`paid` BOOLEAN NOT NULL,
`plan` JSON NOT NULL,
`createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
`updatedAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
`bookingPaymentId` VARCHAR(191) NOT NULL,
`userId` VARCHAR(191) NOT NULL,
`slotId` VARCHAR(191) NOT NULL,
UNIQUE INDEX `Booking_bookingPaymentId_key`(`bookingPaymentId`),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `BookingPayment` (
`id` VARCHAR(191) NOT NULL,
`amount` DOUBLE NOT NULL,
`currency` JSON NOT NULL,
`createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
`updatedAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `Tip` (
`id` VARCHAR(191) NOT NULL,
`createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
`amount` DOUBLE NOT NULL,
`currency` JSON NOT NULL,
`paymentDetails` JSON NOT NULL,
`flareId` VARCHAR(191) NOT NULL,
`userId` VARCHAR(191) NOT NULL,
`tippedById` VARCHAR(191) NOT NULL,
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `Sponsor` (
`id` VARCHAR(191) NOT NULL,
`type` ENUM('ONE_TIME', 'MONTHLY', 'ANNUALLY') NOT NULL,
`amount` DOUBLE NOT NULL,
`currency` JSON NOT NULL,
`paymentDetails` JSON NOT NULL,
`createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
`userId` VARCHAR(191) NOT NULL,
`sponsoredById` VARCHAR(191) NOT NULL,
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `Kudos` (
`id` VARCHAR(191) NOT NULL,
`createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
`content` JSON NOT NULL,
`kudosById` VARCHAR(191) NOT NULL,
`userId` VARCHAR(191) NOT NULL,
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `HeaderPromo` (
`id` VARCHAR(191) NOT NULL,
`userId` VARCHAR(191) NOT NULL,
`sponsorId` VARCHAR(191) NOT NULL,
`image` JSON NOT NULL,
`title` VARCHAR(191) NOT NULL,
`description` VARCHAR(191) NOT NULL,
`price` JSON NOT NULL,
`state` ENUM('PENDING', 'ACTIVE', 'INACTIVE', 'REJECTED') NOT NULL,
`createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `_UserFollows` (
`A` VARCHAR(191) NOT NULL,
`B` VARCHAR(191) NOT NULL,
UNIQUE INDEX `_UserFollows_AB_unique`(`A`, `B`),
INDEX `_UserFollows_B_index`(`B`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- AddForeignKey
ALTER TABLE `User` ADD CONSTRAINT `User_userBioId_fkey` FOREIGN KEY (`userBioId`) REFERENCES `UserBio`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Preferences` ADD CONSTRAINT `Preferences_userId_fkey` FOREIGN KEY (`userId`) REFERENCES `User`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Flare` ADD CONSTRAINT `Flare_authorId_fkey` FOREIGN KEY (`authorId`) REFERENCES `User`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Block` ADD CONSTRAINT `Block_flareId_fkey` FOREIGN KEY (`flareId`) REFERENCES `Flare`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Comment` ADD CONSTRAINT `Comment_authorId_fkey` FOREIGN KEY (`authorId`) REFERENCES `User`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Comment` ADD CONSTRAINT `Comment_flareId_fkey` FOREIGN KEY (`flareId`) REFERENCES `Flare`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Like` ADD CONSTRAINT `Like_authorId_fkey` FOREIGN KEY (`authorId`) REFERENCES `User`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Like` ADD CONSTRAINT `Like_flareId_fkey` FOREIGN KEY (`flareId`) REFERENCES `Flare`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Notification` ADD CONSTRAINT `Notification_toId_fkey` FOREIGN KEY (`toId`) REFERENCES `User`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Notification` ADD CONSTRAINT `Notification_followeeId_fkey` FOREIGN KEY (`followeeId`) REFERENCES `User`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Notification` ADD CONSTRAINT `Notification_flareId_fkey` FOREIGN KEY (`flareId`) REFERENCES `Flare`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Notification` ADD CONSTRAINT `Notification_commentId_fkey` FOREIGN KEY (`commentId`) REFERENCES `Comment`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Bookmark` ADD CONSTRAINT `Bookmark_authorId_fkey` FOREIGN KEY (`authorId`) REFERENCES `User`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Bookmark` ADD CONSTRAINT `Bookmark_flareId_fkey` FOREIGN KEY (`flareId`) REFERENCES `Flare`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Booking` ADD CONSTRAINT `Booking_userId_fkey` FOREIGN KEY (`userId`) REFERENCES `User`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Booking` ADD CONSTRAINT `Booking_slotId_fkey` FOREIGN KEY (`slotId`) REFERENCES `Slot`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Booking` ADD CONSTRAINT `Booking_bookingPaymentId_fkey` FOREIGN KEY (`bookingPaymentId`) REFERENCES `BookingPayment`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Tip` ADD CONSTRAINT `Tip_userId_fkey` FOREIGN KEY (`userId`) REFERENCES `User`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Tip` ADD CONSTRAINT `Tip_tippedById_fkey` FOREIGN KEY (`tippedById`) REFERENCES `User`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Tip` ADD CONSTRAINT `Tip_flareId_fkey` FOREIGN KEY (`flareId`) REFERENCES `Flare`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Sponsor` ADD CONSTRAINT `Sponsor_userId_fkey` FOREIGN KEY (`userId`) REFERENCES `User`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Sponsor` ADD CONSTRAINT `Sponsor_sponsoredById_fkey` FOREIGN KEY (`sponsoredById`) REFERENCES `User`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Kudos` ADD CONSTRAINT `Kudos_userId_fkey` FOREIGN KEY (`userId`) REFERENCES `User`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Kudos` ADD CONSTRAINT `Kudos_kudosById_fkey` FOREIGN KEY (`kudosById`) REFERENCES `User`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `HeaderPromo` ADD CONSTRAINT `HeaderPromo_userId_fkey` FOREIGN KEY (`userId`) REFERENCES `User`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `HeaderPromo` ADD CONSTRAINT `HeaderPromo_sponsorId_fkey` FOREIGN KEY (`sponsorId`) REFERENCES `User`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `_UserFollows` ADD FOREIGN KEY (`A`) REFERENCES `User`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `_UserFollows` ADD FOREIGN KEY (`B`) REFERENCES `User`(`id`) ON DELETE CASCADE ON UPDATE CASCADE; | the_stack |
-- 2019-11-28T08:04:31.342Z
-- 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,577396,0,'netamount',TO_TIMESTAMP('2019-11-28 10:04:31','YYYY-MM-DD HH24:MI:SS'),100,'U','Y','netamount','netamount',TO_TIMESTAMP('2019-11-28 10:04:31','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-11-28T08:04:31.345Z
-- 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=577396 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)
;
-- 2019-11-28T08:04:31.454Z
-- 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,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAllowLogging,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsTranslated,IsUpdateable,Name,Updated,UpdatedBy,Version) VALUES (0,569682,577396,0,22,540148,'netamount',TO_TIMESTAMP('2019-11-28 10:04:31','YYYY-MM-DD HH24:MI:SS'),100,'U',131089,'Y','Y','N','N','N','N','N','N','N','N','N','netamount',TO_TIMESTAMP('2019-11-28 10:04:31','YYYY-MM-DD HH24:MI:SS'),100,0)
;
-- 2019-11-28T08:04:31.457Z
-- 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=569682 AND NOT EXISTS (SELECT 1 FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 2019-11-28T08:04:31.461Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_Column_Translation_From_AD_Element(577396)
;
-- 2019-11-28T08:04:31.588Z
-- 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,577397,0,'grossamount',TO_TIMESTAMP('2019-11-28 10:04:31','YYYY-MM-DD HH24:MI:SS'),100,'U','Y','grossamount','grossamount',TO_TIMESTAMP('2019-11-28 10:04:31','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-11-28T08:04:31.590Z
-- 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=577397 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)
;
-- 2019-11-28T08:04:31.684Z
-- 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,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAllowLogging,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsTranslated,IsUpdateable,Name,Updated,UpdatedBy,Version) VALUES (0,569683,577397,0,22,540148,'grossamount',TO_TIMESTAMP('2019-11-28 10:04:31','YYYY-MM-DD HH24:MI:SS'),100,'U',131089,'Y','Y','N','N','N','N','N','N','N','N','N','grossamount',TO_TIMESTAMP('2019-11-28 10:04:31','YYYY-MM-DD HH24:MI:SS'),100,0)
;
-- 2019-11-28T08:04:31.686Z
-- 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=569683 AND NOT EXISTS (SELECT 1 FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 2019-11-28T08:04:31.687Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_Column_Translation_From_AD_Element(577397)
;
-- 2019-11-29T10:03:12.930Z
-- 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,569682,592818,0,540737,0,TO_TIMESTAMP('2019-11-29 12:03:12','YYYY-MM-DD HH24:MI:SS'),100,0,'D',0,'Y','Y','Y','N','N','N','N','N','Nettowert',90,90,0,1,1,TO_TIMESTAMP('2019-11-29 12:03:12','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-11-29T10:03:12.933Z
-- 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=592818 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)
;
-- 2019-11-29T10:03:12.970Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(577396)
;
-- 2019-11-29T10:03:12.990Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=592818
;
-- 2019-11-29T10:03:12.995Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Field(592818)
;
-- 2019-11-29T10:03:45.611Z
-- 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,569683,592819,0,540737,0,TO_TIMESTAMP('2019-11-29 12:03:45','YYYY-MM-DD HH24:MI:SS'),100,0,'D',0,'Y','Y','Y','N','N','N','N','N','Bruttowert',100,100,0,1,1,TO_TIMESTAMP('2019-11-29 12:03:45','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-11-29T10:03:45.614Z
-- 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=592819 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)
;
-- 2019-11-29T10:03:45.619Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(577397)
;
-- 2019-11-29T10:03:45.628Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=592819
;
-- 2019-11-29T10:03:45.637Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Field(592819)
;
-- 2019-11-29T10:12:17.149Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET EntityType='de.metas.fresh',Updated=TO_TIMESTAMP('2019-11-29 12:12:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=592818
;
-- 2019-11-29T10:12:34.308Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET EntityType='de.metas.fresh',Updated=TO_TIMESTAMP('2019-11-29 12:12:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=592819
;
-- 2019-11-29T10:38:54.062Z
-- 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_Element_ID,AD_UI_ElementGroup_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayed_SideList,IsDisplayedGrid,IsMultiLine,MultiLine_LinesCount,Name,SeqNo,SeqNo_SideList,SeqNoGrid,Updated,UpdatedBy) VALUES (0,592818,0,540737,564374,1000030,'F',TO_TIMESTAMP('2019-11-29 12:38:53','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','N',0,'Nettwert',20,0,0,TO_TIMESTAMP('2019-11-29 12:38:53','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-11-29T10:39:25.610Z
-- 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_Element_ID,AD_UI_ElementGroup_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayed_SideList,IsDisplayedGrid,IsMultiLine,MultiLine_LinesCount,Name,SeqNo,SeqNo_SideList,SeqNoGrid,Updated,UpdatedBy) VALUES (0,592819,0,540737,564375,1000030,'F',TO_TIMESTAMP('2019-11-29 12:39:25','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','N',0,'Bruttowert',30,0,0,TO_TIMESTAMP('2019-11-29 12:39:25','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-11-29T10:40:03.195Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=80,Updated=TO_TIMESTAMP('2019-11-29 12:40:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=564375
;
-- 2019-11-29T10:40:03.199Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=90,Updated=TO_TIMESTAMP('2019-11-29 12:40:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=564374
;
-- 2019-11-29T10:40:03.201Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=100,Updated=TO_TIMESTAMP('2019-11-29 12:40:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541472
; | the_stack |
-- 2018-01-31T12:16:42.523
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2018-01-31 12:16:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=550055
;
-- 2018-01-31T12:16:42.532
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2018-01-31 12:16:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=550054
;
-- 2018-01-31T12:16:42.535
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=40,Updated=TO_TIMESTAMP('2018-01-31 12:16:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=550057
;
-- 2018-01-31T12:16:42.539
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=50,Updated=TO_TIMESTAMP('2018-01-31 12:16:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=550058
;
-- 2018-01-31T12:16:42.542
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=60,Updated=TO_TIMESTAMP('2018-01-31 12:16:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=550051
;
-- 2018-01-31T12:30:37.761
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-01-31 12:30:37','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Field_ID=561321 AND AD_Language='en_US'
;
-- 2018-01-31T12:30:42.529
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-01-31 12:30:42','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Field_ID=561322 AND AD_Language='en_US'
;
-- 2018-01-31T12:30:46.284
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-01-31 12:30:46','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Field_ID=561323 AND AD_Language='en_US'
;
-- 2018-01-31T12:30:51.637
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-01-31 12:30:51','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Field_ID=561315 AND AD_Language='en_US'
;
-- 2018-01-31T12:30:56.293
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-01-31 12:30:56','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Field_ID=561317 AND AD_Language='en_US'
;
-- 2018-01-31T12:31:07.651
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-01-31 12:31:07','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Subscription Progress' WHERE AD_Field_ID=561318 AND AD_Language='nl_NL'
;
-- 2018-01-31T12:31:48.557
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-01-31 12:31:48','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Field_ID=561314 AND AD_Language='en_US'
;
-- 2018-01-31T12:32:02.145
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-01-31 12:32:02','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Material Cockpit' WHERE AD_Field_ID=561316 AND AD_Language='en_US'
;
-- 2018-01-31T12:32:06.785
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-01-31 12:32:06','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Field_ID=561313 AND AD_Language='en_US'
;
-- 2018-01-31T12:37:21.494
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-01-31 12:37:21','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Document Details' WHERE AD_Process_ID=540910 AND AD_Language='en_US'
;
-- 2018-01-31T12:39:36.824
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET Name='Bestellt',Updated=TO_TIMESTAMP('2018-01-31 12:39:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558286
;
-- 2018-01-31T12:39:36.829
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Bestellt', Description=NULL, Help=NULL WHERE AD_Column_ID=558286
;
-- 2018-01-31T12:39:57.331
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET Name='Beauftragt',Updated=TO_TIMESTAMP('2018-01-31 12:39:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558283
;
-- 2018-01-31T12:39:57.334
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Beauftragt', Description=NULL, Help=NULL WHERE AD_Column_ID=558283
;
-- 2018-01-31T12:40:49.909
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element SET Name='Bestellt', PrintName='Bestellt',Updated=TO_TIMESTAMP('2018-01-31 12:40:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=543682
;
-- 2018-01-31T12:40:49.912
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName='QtyReserved_Purchase', Name='Bestellt', Description=NULL, Help=NULL WHERE AD_Element_ID=543682
;
-- 2018-01-31T12:40:49.927
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='QtyReserved_Purchase', Name='Bestellt', Description=NULL, Help=NULL, AD_Element_ID=543682 WHERE UPPER(ColumnName)='QTYRESERVED_PURCHASE' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2018-01-31T12:40:49.929
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='QtyReserved_Purchase', Name='Bestellt', Description=NULL, Help=NULL WHERE AD_Element_ID=543682 AND IsCentrallyMaintained='Y'
;
-- 2018-01-31T12:40:49.931
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Bestellt', Description=NULL, Help=NULL WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=543682) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 543682)
;
-- 2018-01-31T12:40:49.955
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_PrintFormatItem pi SET PrintName='Bestellt', Name='Bestellt' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=543682)
;
-- 2018-01-31T13:06:09.772
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-01-31 13:06:09','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Qty Ordered',PrintName='Qty Ordered' WHERE AD_Element_ID=543682 AND AD_Language='en_US'
;
-- 2018-01-31T13:06:09.838
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(543682,'en_US')
;
-- 2018-01-31T13:12:10.662
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET Name='Offene Menge',Updated=TO_TIMESTAMP('2018-01-31 13:12:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558519
;
-- 2018-01-31T13:12:10.663
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Offene Menge', Description='Reservierte Menge', Help='Die "Reservierte Menge" bezeichnet die Menge einer Ware, die zur Zeit reserviert ist.' WHERE AD_Column_ID=558519
;
-- 2018-01-31T13:12:53.945
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET Name='Bestellt/ Beauftragt',Updated=TO_TIMESTAMP('2018-01-31 13:12:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558518
;
-- 2018-01-31T13:12:53.946
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Bestellt/ Beauftragt', Description='Bestellte Menge', Help='Die "Bestellte Menge" bezeichnet die Menge einer Ware, die bestellt wurde.' WHERE AD_Column_ID=558518
;
-- 2018-01-31T13:16:36.012
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET Name='Offen',Updated=TO_TIMESTAMP('2018-01-31 13:16:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558519
;
-- 2018-01-31T13:16:36.013
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Offen', Description='Reservierte Menge', Help='Die "Reservierte Menge" bezeichnet die Menge einer Ware, die zur Zeit reserviert ist.' WHERE AD_Column_ID=558519
;
-- 2018-01-31T13:18:33.467
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element SET Description='Offene Menge', Help='Die "Offene Menge" bezeichnet die Menge einer Ware, die zur Zeit reserviert ist und noch geliefert/ empfangen werden muss.', Name='Offen', PO_Description='Offen', PO_Name='Offen', PO_PrintName='Offen', PrintName='Offen',Updated=TO_TIMESTAMP('2018-01-31 13:18:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=532
;
-- 2018-01-31T13:18:33.469
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName='QtyReserved', Name='Offen', Description='Offene Menge', Help='Die "Offene Menge" bezeichnet die Menge einer Ware, die zur Zeit reserviert ist und noch geliefert/ empfangen werden muss.' WHERE AD_Element_ID=532
;
-- 2018-01-31T13:18:33.479
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='QtyReserved', Name='Offen', Description='Offene Menge', Help='Die "Offene Menge" bezeichnet die Menge einer Ware, die zur Zeit reserviert ist und noch geliefert/ empfangen werden muss.', AD_Element_ID=532 WHERE UPPER(ColumnName)='QTYRESERVED' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2018-01-31T13:18:33.480
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='QtyReserved', Name='Offen', Description='Offene Menge', Help='Die "Offene Menge" bezeichnet die Menge einer Ware, die zur Zeit reserviert ist und noch geliefert/ empfangen werden muss.' WHERE AD_Element_ID=532 AND IsCentrallyMaintained='Y'
;
-- 2018-01-31T13:18:33.480
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Offen', Description='Offene Menge', Help='Die "Offene Menge" bezeichnet die Menge einer Ware, die zur Zeit reserviert ist und noch geliefert/ empfangen werden muss.' WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=532) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 532)
;
-- 2018-01-31T13:18:33.497
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_PrintFormatItem pi SET PrintName='Offen', Name='Offen' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=532)
;
-- 2018-01-31T13:19:04.450
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element SET Description='Bestellt/ Beauftragt', Name='Bestellt/ Beauftragt', PO_Description='Bestellt/ Beauftragt', PO_Name='Bestellt/ Beauftragt', PO_PrintName='Bestellt/ Beauftragt', PrintName='Bestellt/ Beauftragt',Updated=TO_TIMESTAMP('2018-01-31 13:19:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=531
;
-- 2018-01-31T13:19:04.453
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName='QtyOrdered', Name='Bestellt/ Beauftragt', Description='Bestellt/ Beauftragt', Help='Die "Bestellte Menge" bezeichnet die Menge einer Ware, die bestellt wurde.' WHERE AD_Element_ID=531
;
-- 2018-01-31T13:19:04.488
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='QtyOrdered', Name='Bestellt/ Beauftragt', Description='Bestellt/ Beauftragt', Help='Die "Bestellte Menge" bezeichnet die Menge einer Ware, die bestellt wurde.', AD_Element_ID=531 WHERE UPPER(ColumnName)='QTYORDERED' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2018-01-31T13:19:04.490
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='QtyOrdered', Name='Bestellt/ Beauftragt', Description='Bestellt/ Beauftragt', Help='Die "Bestellte Menge" bezeichnet die Menge einer Ware, die bestellt wurde.' WHERE AD_Element_ID=531 AND IsCentrallyMaintained='Y'
;
-- 2018-01-31T13:19:04.491
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Bestellt/ Beauftragt', Description='Bestellt/ Beauftragt', Help='Die "Bestellte Menge" bezeichnet die Menge einer Ware, die bestellt wurde.' WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=531) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 531)
;
-- 2018-01-31T13:19:04.517
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_PrintFormatItem pi SET PrintName='Bestellt/ Beauftragt', Name='Bestellt/ Beauftragt' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=531)
;
-- 2018-01-31T13:19:28.483
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-01-31 13:19:28','YYYY-MM-DD HH24:MI:SS') WHERE AD_Element_ID=531 AND AD_Language='en_US'
;
-- 2018-01-31T13:19:28.487
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(531,'en_US')
;
-- 2018-01-31T13:20:01.044
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-01-31 13:20:01','YYYY-MM-DD HH24:MI:SS'),Name='Open Qty',PrintName='Open Qty',Description='Open Qty' WHERE AD_Element_ID=532 AND AD_Language='en_US'
;
-- 2018-01-31T13:20:01.056
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(532,'en_US')
;
-- 2018-01-31T13:22:46.957
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-01-31 13:22:46','YYYY-MM-DD HH24:MI:SS'),Name='Qty Purchased' WHERE AD_Column_ID=558286 AND AD_Language='en_US'
;
-- 2018-01-31T13:23:01.601
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-01-31 13:23:01','YYYY-MM-DD HH24:MI:SS'),Name='Qty Sold',IsTranslated='Y' WHERE AD_Column_ID=558283 AND AD_Language='en_US'
;
-- 2018-01-31T13:26:24.300
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-01-31 13:26:24','YYYY-MM-DD HH24:MI:SS'),Name='Internal Usage' WHERE AD_Column_ID=558313 AND AD_Language='en_US'
;
-- 2018-01-31T13:26:39.870
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-01-31 13:26:39','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Internal Usage',PrintName='Internal Usage' WHERE AD_Element_ID=542653 AND AD_Language='en_US'
;
-- 2018-01-31T13:26:39.884
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(542653,'en_US')
;
-- 2018-01-31T13:27:02.305
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-01-31 13:27:02','YYYY-MM-DD HH24:MI:SS'),Name='Qty Promised' WHERE AD_Column_ID=558316 AND AD_Language='en_US'
;
-- 2018-01-31T13:27:20.437
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-01-31 13:27:20','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Qty Promised',PrintName='Qty Promised' WHERE AD_Element_ID=543681 AND AD_Language='en_US'
;
-- 2018-01-31T13:27:20.446
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(543681,'en_US')
;
-- 2018-01-31T13:30:01.397
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-01-31 13:30:01','YYYY-MM-DD HH24:MI:SS'),Name='Qty Available' WHERE AD_Column_ID=558316 AND AD_Language='en_US'
;
-- 2018-01-31T13:30:14.550
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-01-31 13:30:14','YYYY-MM-DD HH24:MI:SS'),Name='Qty Available',PrintName='Qty Available' WHERE AD_Element_ID=543681 AND AD_Language='en_US'
;
-- 2018-01-31T13:30:14.643
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(543681,'en_US')
;
-- 2018-01-31T13:31:55.441
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-01-31 13:31:55','YYYY-MM-DD HH24:MI:SS'),Name='Vendor Promised' WHERE AD_Column_ID=558287 AND AD_Language='en_US'
;
-- 2018-01-31T13:32:12.640
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-01-31 13:32:12','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Vendor Promised',PrintName='Vendor Promised',Description='' WHERE AD_Element_ID=543070 AND AD_Language='en_US'
;
-- 2018-01-31T13:32:12.645
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(543070,'en_US')
;
-- 2018-01-31T13:33:31.882
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-01-31 13:33:31','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Qty Sold',PrintName='Qty Sold' WHERE AD_Element_ID=543683 AND AD_Language='en_US'
;
-- 2018-01-31T13:33:31.891
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(543683,'en_US')
;
-- 2018-01-31T13:33:55.266
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-01-31 13:33:55','YYYY-MM-DD HH24:MI:SS'),Name='Qty Purchased',PrintName='Qty Purchased' WHERE AD_Element_ID=543682 AND AD_Language='en_US'
;
-- 2018-01-31T13:33:55.277
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(543682,'en_US')
;
-- 2018-01-31T13:34:27.768
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET Name='Menge für Produktion',Updated=TO_TIMESTAMP('2018-01-31 13:34:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558312
;
-- 2018-01-31T13:34:27.770
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Menge für Produktion', Description=NULL, Help=NULL WHERE AD_Column_ID=558312
;
-- 2018-01-31T13:34:43.727
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-01-31 13:34:43','YYYY-MM-DD HH24:MI:SS'),Name='Qty Manufacturing' WHERE AD_Column_ID=558312 AND AD_Language='en_US'
;
-- 2018-01-31T13:34:58.060
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-01-31 13:34:58','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Qty Manufacturing',PrintName='Qty Manufacturing' WHERE AD_Element_ID=543678 AND AD_Language='en_US'
;
-- 2018-01-31T13:34:58.070
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(543678,'en_US')
;
-- 2018-01-31T13:35:23.606
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-01-31 13:35:23','YYYY-MM-DD HH24:MI:SS'),Name='Estimation' WHERE AD_Column_ID=558284 AND AD_Language='en_US'
;
-- 2018-01-31T13:35:38.098
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-01-31 13:35:38','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Estimation',PrintName='Estimation' WHERE AD_Element_ID=543667 AND AD_Language='en_US'
;
-- 2018-01-31T13:35:38.104
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(543667,'en_US')
;
-- 2018-01-31T13:42:07.063
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET Name='Produkt Kategorie',Updated=TO_TIMESTAMP('2018-01-31 13:42:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558319
;
-- 2018-01-31T13:42:07.067
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Produkt Kategorie', Description='Kategorie eines Produktes', Help='Identifiziert die Kategorie zu der ein Produkt gehört. Produktkategorien werden für Preisfindung und Auswahl verwendet.' WHERE AD_Column_ID=558319
;
-- 2018-01-31T13:42:16.550
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element SET Name='Produkt Kategorie', PrintName='Produkt Kategorie',Updated=TO_TIMESTAMP('2018-01-31 13:42:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=453
;
-- 2018-01-31T13:42:16.555
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName='M_Product_Category_ID', Name='Produkt Kategorie', Description='Kategorie eines Produktes', Help='Identifiziert die Kategorie zu der ein Produkt gehört. Produktkategorien werden für Preisfindung und Auswahl verwendet.' WHERE AD_Element_ID=453
;
-- 2018-01-31T13:42:16.591
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='M_Product_Category_ID', Name='Produkt Kategorie', Description='Kategorie eines Produktes', Help='Identifiziert die Kategorie zu der ein Produkt gehört. Produktkategorien werden für Preisfindung und Auswahl verwendet.', AD_Element_ID=453 WHERE UPPER(ColumnName)='M_PRODUCT_CATEGORY_ID' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2018-01-31T13:42:16.594
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='M_Product_Category_ID', Name='Produkt Kategorie', Description='Kategorie eines Produktes', Help='Identifiziert die Kategorie zu der ein Produkt gehört. Produktkategorien werden für Preisfindung und Auswahl verwendet.' WHERE AD_Element_ID=453 AND IsCentrallyMaintained='Y'
;
-- 2018-01-31T13:42:16.599
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Produkt Kategorie', Description='Kategorie eines Produktes', Help='Identifiziert die Kategorie zu der ein Produkt gehört. Produktkategorien werden für Preisfindung und Auswahl verwendet.' WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=453) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 453)
;
-- 2018-01-31T13:42:16.622
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_PrintFormatItem pi SET PrintName='Produkt Kategorie', Name='Produkt Kategorie' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=453)
; | the_stack |
-- 2017-07-16T12:56:37.050
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Deutsch (DE)',Updated=TO_TIMESTAMP('2017-07-16 12:56:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=191
;
-- 2017-07-16T12:57:12.088
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Deutsch (CH)',Updated=TO_TIMESTAMP('2017-07-16 12:57:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=123
;
-- 2017-07-16T12:59:14.140
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Albanian (AL)',Updated=TO_TIMESTAMP('2017-07-16 12:59:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=181
;
-- 2017-07-16T12:59:39.455
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Arabic (DZ)',Updated=TO_TIMESTAMP('2017-07-16 12:59:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=102
;
-- 2017-07-16T12:59:44.942
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Arabic (BH)',Updated=TO_TIMESTAMP('2017-07-16 12:59:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=101
;
-- 2017-07-16T12:59:48.386
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Arabic (EG)',Updated=TO_TIMESTAMP('2017-07-16 12:59:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=103
;
-- 2017-07-16T12:59:53.371
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Arabic (IQ)',Updated=TO_TIMESTAMP('2017-07-16 12:59:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=104
;
-- 2017-07-16T12:59:57.677
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Arabic (JO)',Updated=TO_TIMESTAMP('2017-07-16 12:59:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=105
;
-- 2017-07-16T13:00:02.317
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Arabic (KW)',Updated=TO_TIMESTAMP('2017-07-16 13:00:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=106
;
-- 2017-07-16T13:00:07.836
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Arabic (LB)',Updated=TO_TIMESTAMP('2017-07-16 13:00:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=107
;
-- 2017-07-16T13:00:12.101
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Arabic (LY)',Updated=TO_TIMESTAMP('2017-07-16 13:00:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=108
;
-- 2017-07-16T13:00:15.477
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Arabic (MA)',Updated=TO_TIMESTAMP('2017-07-16 13:00:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=109
;
-- 2017-07-16T13:00:19.972
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Arabic (OM)',Updated=TO_TIMESTAMP('2017-07-16 13:00:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=110
;
-- 2017-07-16T13:00:23.227
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Arabic (QA)',Updated=TO_TIMESTAMP('2017-07-16 13:00:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=111
;
-- 2017-07-16T13:00:28.351
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Arabic (SA)',Updated=TO_TIMESTAMP('2017-07-16 13:00:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=112
;
-- 2017-07-16T13:00:33.382
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Arabic (SD)',Updated=TO_TIMESTAMP('2017-07-16 13:00:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=113
;
-- 2017-07-16T13:00:36.932
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Arabic (SY)',Updated=TO_TIMESTAMP('2017-07-16 13:00:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=114
;
-- 2017-07-16T13:00:42.812
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Arabic (TN)',Updated=TO_TIMESTAMP('2017-07-16 13:00:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=115
;
-- 2017-07-16T13:00:48.541
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Arabic (AE)',Updated=TO_TIMESTAMP('2017-07-16 13:00:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=100
;
-- 2017-07-16T13:00:52.390
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Arabic (YE)',Updated=TO_TIMESTAMP('2017-07-16 13:00:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=116
;
-- 2017-07-16T13:01:30.189
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Bulgarian (BG)',Updated=TO_TIMESTAMP('2017-07-16 13:01:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=118
;
-- 2017-07-16T13:01:34.682
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Byelorussian (BY)',Updated=TO_TIMESTAMP('2017-07-16 13:01:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=117
;
-- 2017-07-16T13:01:40.428
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Catalan (ES)',Updated=TO_TIMESTAMP('2017-07-16 13:01:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=119
;
-- 2017-07-16T13:01:44.835
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Chinese (CH)',Updated=TO_TIMESTAMP('2017-07-16 13:01:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=187
;
-- 2017-07-16T13:01:50.013
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Chinese (HK)',Updated=TO_TIMESTAMP('2017-07-16 13:01:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=188
;
-- 2017-07-16T13:01:54.804
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Chinese (TW)',Updated=TO_TIMESTAMP('2017-07-16 13:01:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=189
;
-- 2017-07-16T13:02:03.421
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Croatian (HR)',Updated=TO_TIMESTAMP('2017-07-16 13:02:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=159
;
-- 2017-07-16T13:02:09.389
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Czech (CZ)',Updated=TO_TIMESTAMP('2017-07-16 13:02:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=120
;
-- 2017-07-16T13:02:14.373
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Danish (DK)',Updated=TO_TIMESTAMP('2017-07-16 13:02:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=121
;
-- 2017-07-16T13:02:24.158
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Dutch (BE)',Updated=TO_TIMESTAMP('2017-07-16 13:02:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=170
;
-- 2017-07-16T13:02:28.569
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Dutch (NL)',Updated=TO_TIMESTAMP('2017-07-16 13:02:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=171
;
-- 2017-07-16T13:02:35.305
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='English (AU)',Updated=TO_TIMESTAMP('2017-07-16 13:02:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=126
;
-- 2017-07-16T13:02:38.982
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='English (CA)',Updated=TO_TIMESTAMP('2017-07-16 13:02:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=127
;
-- 2017-07-16T13:02:43.984
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='English (IN)',Updated=TO_TIMESTAMP('2017-07-16 13:02:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=130
;
-- 2017-07-16T13:02:48.254
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='English (IE)',Updated=TO_TIMESTAMP('2017-07-16 13:02:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=129
;
-- 2017-07-16T13:02:54.079
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='English (NZ)',Updated=TO_TIMESTAMP('2017-07-16 13:02:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=131
;
-- 2017-07-16T13:03:01.049
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='English (ZA)',Updated=TO_TIMESTAMP('2017-07-16 13:03:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=132
;
-- 2017-07-16T13:03:06.391
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='English (GB)',Updated=TO_TIMESTAMP('2017-07-16 13:03:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=128
;
-- 2017-07-16T13:03:10.566
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='English (US)',Updated=TO_TIMESTAMP('2017-07-16 13:03:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=192
;
-- 2017-07-16T13:03:16.906
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Estonian (EE)',Updated=TO_TIMESTAMP('2017-07-16 13:03:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=152
;
-- 2017-07-16T13:03:33.190
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Farsi (IR)',Updated=TO_TIMESTAMP('2017-07-16 13:03:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=193
;
-- 2017-07-16T13:03:41.266
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Finnish (FI)',Updated=TO_TIMESTAMP('2017-07-16 13:03:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=153
;
-- 2017-07-16T13:04:28.474
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Französisch (FR)',Updated=TO_TIMESTAMP('2017-07-16 13:04:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=190
;
-- 2017-07-16T13:04:37.614
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='French (BE)',Updated=TO_TIMESTAMP('2017-07-16 13:04:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=154
;
-- 2017-07-16T13:04:42.371
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='French (CE)',Updated=TO_TIMESTAMP('2017-07-16 13:04:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=155
;
-- 2017-07-16T13:04:47.855
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='French (LU)',Updated=TO_TIMESTAMP('2017-07-16 13:04:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=157
;
-- 2017-07-16T13:04:52.770
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='French (CH)',Updated=TO_TIMESTAMP('2017-07-16 13:04:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=156
;
-- 2017-07-16T13:04:57.417
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='German (AU)',Updated=TO_TIMESTAMP('2017-07-16 13:04:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=122
;
-- 2017-07-16T13:05:03.209
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='German (LU)',Updated=TO_TIMESTAMP('2017-07-16 13:05:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=124
;
-- 2017-07-16T13:05:07.842
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Greek (GR)',Updated=TO_TIMESTAMP('2017-07-16 13:05:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=125
;
-- 2017-07-16T13:05:13.536
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Hebrew (IL)',Updated=TO_TIMESTAMP('2017-07-16 13:05:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=164
;
-- 2017-07-16T13:05:17.499
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Hindi (IN)',Updated=TO_TIMESTAMP('2017-07-16 13:05:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=158
;
-- 2017-07-16T13:05:22.849
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Hungarian (HU)',Updated=TO_TIMESTAMP('2017-07-16 13:05:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=160
;
-- 2017-07-16T13:05:26.979
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Icelandic (IS)',Updated=TO_TIMESTAMP('2017-07-16 13:05:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=161
;
-- 2017-07-16T13:05:32.113
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Italian (IT)',Updated=TO_TIMESTAMP('2017-07-16 13:05:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=163
;
-- 2017-07-16T13:05:38.510
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Italienisch (CH)',Updated=TO_TIMESTAMP('2017-07-16 13:05:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=162
;
-- 2017-07-16T13:05:43.858
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Japanese (JP)',Updated=TO_TIMESTAMP('2017-07-16 13:05:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=165
;
-- 2017-07-16T13:05:48.912
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Korean (KR)',Updated=TO_TIMESTAMP('2017-07-16 13:05:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=166
;
-- 2017-07-16T13:05:56.401
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Latvian (LV)',Updated=TO_TIMESTAMP('2017-07-16 13:05:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=168
;
-- 2017-07-16T13:06:04.465
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Lithuanian (LT)',Updated=TO_TIMESTAMP('2017-07-16 13:06:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=167
;
-- 2017-07-16T13:06:09.353
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Macedonian (MK)',Updated=TO_TIMESTAMP('2017-07-16 13:06:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=169
;
-- 2017-07-16T13:06:14.019
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Norwegian (NO)',Updated=TO_TIMESTAMP('2017-07-16 13:06:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=172
;
-- 2017-07-16T13:06:19.618
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Polish (PL)',Updated=TO_TIMESTAMP('2017-07-16 13:06:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=173
;
-- 2017-07-16T13:06:23.645
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Portuguese (BR)',Updated=TO_TIMESTAMP('2017-07-16 13:06:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=174
;
-- 2017-07-16T13:06:31.451
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Portuguese (PO)',Updated=TO_TIMESTAMP('2017-07-16 13:06:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=175
;
-- 2017-07-16T13:06:36.570
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Romanian (RO)',Updated=TO_TIMESTAMP('2017-07-16 13:06:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=176
;
-- 2017-07-16T13:06:49.060
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Russian (RU)',Updated=TO_TIMESTAMP('2017-07-16 13:06:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=177
;
-- 2017-07-16T13:06:55.933
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Serbian (YU)',Updated=TO_TIMESTAMP('2017-07-16 13:06:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=182
;
-- 2017-07-16T13:07:03.023
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Serbo-Croatian (YU)',Updated=TO_TIMESTAMP('2017-07-16 13:07:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=178
;
-- 2017-07-16T13:07:09.462
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Slovak (SL)',Updated=TO_TIMESTAMP('2017-07-16 13:07:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=179
;
-- 2017-07-16T13:07:20.021
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Slovenian (SL)',Updated=TO_TIMESTAMP('2017-07-16 13:07:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=180
;
-- 2017-07-16T13:07:24.837
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Spanish (AR)',Updated=TO_TIMESTAMP('2017-07-16 13:07:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=133
;
-- 2017-07-16T13:07:30.091
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Spanish (BO)',Updated=TO_TIMESTAMP('2017-07-16 13:07:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=134
;
-- 2017-07-16T13:07:34.349
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Spanish (CH)',Updated=TO_TIMESTAMP('2017-07-16 13:07:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=135
;
-- 2017-07-16T13:07:38.988
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Spanish (CO)',Updated=TO_TIMESTAMP('2017-07-16 13:07:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=136
;
-- 2017-07-16T13:07:43.276
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Spanish (CR)',Updated=TO_TIMESTAMP('2017-07-16 13:07:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=137
;
-- 2017-07-16T13:07:48.709
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Spanish (DO)',Updated=TO_TIMESTAMP('2017-07-16 13:07:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=138
;
-- 2017-07-16T13:07:52.751
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Spanish (EC)',Updated=TO_TIMESTAMP('2017-07-16 13:07:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=139
;
-- 2017-07-16T13:08:00.547
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Spanish (SV)',Updated=TO_TIMESTAMP('2017-07-16 13:08:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=149
;
-- 2017-07-16T13:08:04.980
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Spanish (GT)',Updated=TO_TIMESTAMP('2017-07-16 13:08:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=141
;
-- 2017-07-16T13:08:09.427
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Spanish (HN)',Updated=TO_TIMESTAMP('2017-07-16 13:08:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=142
;
-- 2017-07-16T13:08:13.363
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Spanish (MX)',Updated=TO_TIMESTAMP('2017-07-16 13:08:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=143
;
-- 2017-07-16T13:08:17.960
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Spanish (NI)',Updated=TO_TIMESTAMP('2017-07-16 13:08:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=144
;
-- 2017-07-16T13:08:21.608
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Spanish (PA)',Updated=TO_TIMESTAMP('2017-07-16 13:08:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=145
;
-- 2017-07-16T13:08:26.852
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Spanish (PY)',Updated=TO_TIMESTAMP('2017-07-16 13:08:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=148
;
-- 2017-07-16T13:08:30.607
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Spanish (PE)',Updated=TO_TIMESTAMP('2017-07-16 13:08:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=146
;
-- 2017-07-16T13:08:35.132
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Spanish (PR)',Updated=TO_TIMESTAMP('2017-07-16 13:08:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=147
;
-- 2017-07-16T13:08:39.980
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Spanish (ES)',Updated=TO_TIMESTAMP('2017-07-16 13:08:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=140
;
-- 2017-07-16T13:08:44.219
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Spanish (UY)',Updated=TO_TIMESTAMP('2017-07-16 13:08:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=150
;
-- 2017-07-16T13:08:48.580
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Spanish (VE)',Updated=TO_TIMESTAMP('2017-07-16 13:08:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=151
;
-- 2017-07-16T13:08:52.228
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Swedish (SE)',Updated=TO_TIMESTAMP('2017-07-16 13:08:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=183
;
-- 2017-07-16T13:08:56.996
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Thai (TH)',Updated=TO_TIMESTAMP('2017-07-16 13:08:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=184
;
-- 2017-07-16T13:09:00.879
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Turkish (TR)',Updated=TO_TIMESTAMP('2017-07-16 13:09:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=185
;
-- 2017-07-16T13:09:51.990
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Ukrainian (UA)',Updated=TO_TIMESTAMP('2017-07-16 13:09:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=186
;
-- 2017-07-16T13:09:58.830
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Language SET Name='Vietnamese (VN)',Updated=TO_TIMESTAMP('2017-07-16 13:09:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language_ID=194
; | the_stack |
-- ----------------------------
-- Table structure for oauth_client_details
-- ----------------------------
DROP TABLE IF EXISTS `oauth_client_details`;
CREATE TABLE `oauth_client_details` (
`client_id` varchar(48) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`resource_ids` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`client_secret` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`scope` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`authorized_grant_types` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`web_server_redirect_uri` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`authorities` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`access_token_validity` int(11) DEFAULT NULL,
`refresh_token_validity` int(11) DEFAULT NULL,
`additional_information` varchar(4096) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`autoapprove` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
PRIMARY KEY (`client_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- ----------------------------
-- Records of oauth_client_details
-- ----------------------------
BEGIN;
INSERT INTO `oauth_client_details` VALUES ('lion-client', NULL, '{bcrypt}$2a$10$iq0/gR20ZXaSPkxyQAWlleRHZsl/8cfmpQ4JXqqccjiNSKh88y4LG', 'all', 'authorization_code,password,refresh_token', 'https://github.com/micyo202/lion', NULL, 25200, 108000, NULL, NULL);
COMMIT;
-- ----------------------------
-- Table structure for sys_id
-- ----------------------------
DROP TABLE IF EXISTS `sys_id`;
CREATE TABLE `sys_id` (
`id` bigint(20) NOT NULL COMMENT '主键',
`code` varchar(36) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '编码',
`name` varchar(36) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '名称',
`max_id` bigint(20) DEFAULT NULL COMMENT '已分配的最大ID',
`step` bigint(20) DEFAULT NULL COMMENT '步长',
`valid` tinyint(1) DEFAULT NULL COMMENT '有效标志(0:无效,1:有效)',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='自增ID规则表';
-- ----------------------------
-- Records of sys_id
-- ----------------------------
BEGIN;
INSERT INTO `sys_id` VALUES (1, 'user', '用户ID生成规则', 0, 10, 1, '2019-04-28 16:38:40', '2019-11-27 14:46:39');
INSERT INTO `sys_id` VALUES (2, 'order', '订单ID生成规则', 0, 1000, 1, '2019-04-28 16:39:05', '2019-04-28 16:39:05');
COMMIT;
-- ----------------------------
-- Table structure for sys_menu
-- ----------------------------
DROP TABLE IF EXISTS `sys_menu`;
CREATE TABLE `sys_menu` (
`id` bigint(20) NOT NULL COMMENT '主键',
`code` varchar(36) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '编码',
`p_id` bigint(20) DEFAULT NULL COMMENT '父主键',
`p_code` varchar(36) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '父编码',
`name` varchar(36) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '名称',
`url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '请求地址',
`level` int(11) DEFAULT NULL COMMENT '层级',
`sort` int(11) DEFAULT NULL COMMENT '排序',
`is_menu` tinyint(1) DEFAULT NULL COMMENT '是否菜单(0:否,1:是)',
`icon` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '图标',
`valid` tinyint(1) DEFAULT NULL COMMENT '有效标志(0:无效,1:有效)',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`),
UNIQUE KEY `FK_CODE` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='菜单表';
-- ----------------------------
-- Records of sys_menu
-- ----------------------------
BEGIN;
INSERT INTO `sys_menu` VALUES (1, '1', 0, '0', '系统管理', '/manager', 1, 1, 1, NULL, 1, '2019-04-15 11:16:02', NULL);
INSERT INTO `sys_menu` VALUES (2, '2', 1, '1', '用户管理', '/manager/user', 2, 1, 1, NULL, 1, NULL, NULL);
INSERT INTO `sys_menu` VALUES (3, '3', 1, '1', '角色管理', '/manager/role', 2, 2, 1, NULL, 1, NULL, NULL);
INSERT INTO `sys_menu` VALUES (4, '4', 1, '1', '菜单管理', '/manager/menu', 2, 3, 1, NULL, 1, NULL, NULL);
INSERT INTO `sys_menu` VALUES (5, '5', 1, '1', '用户角色管理', '/manager/user_role', 2, 4, 1, NULL, 1, NULL, NULL);
INSERT INTO `sys_menu` VALUES (6, '6', 1, '1', '角色菜单管理', '/manager/role_menu', 2, 5, 1, NULL, 1, NULL, NULL);
COMMIT;
-- ----------------------------
-- Table structure for sys_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_role`;
CREATE TABLE `sys_role` (
`id` bigint(20) NOT NULL COMMENT '主键',
`code` varchar(36) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '编码',
`name` varchar(36) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '名称',
`valid` tinyint(1) DEFAULT NULL COMMENT '有效标志(0:无效,1:有效)',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`),
UNIQUE KEY `unique_role_name` (`name`),
UNIQUE KEY `unique_role_value` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='角色表';
-- ----------------------------
-- Records of sys_role
-- ----------------------------
BEGIN;
INSERT INTO `sys_role` VALUES (1, 'super', '超级管理员', 1, '2017-06-20 15:08:45', NULL);
INSERT INTO `sys_role` VALUES (2, 'admin', '管理员', 1, '2017-06-20 15:07:13', '2017-06-26 12:46:09');
INSERT INTO `sys_role` VALUES (3, 'user', '一般用户', 1, '2017-06-28 18:50:39', '2017-07-21 09:41:28');
COMMIT;
-- ----------------------------
-- Table structure for sys_role_menu
-- ----------------------------
DROP TABLE IF EXISTS `sys_role_menu`;
CREATE TABLE `sys_role_menu` (
`id` bigint(20) NOT NULL COMMENT '主键',
`role_id` bigint(20) NOT NULL COMMENT '角色主键',
`menu_id` bigint(20) NOT NULL COMMENT '菜单主键',
`valid` tinyint(1) DEFAULT NULL COMMENT '有效标志(0:无效,1:有效)',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='角色菜单关系表';
-- ----------------------------
-- Records of sys_role_menu
-- ----------------------------
BEGIN;
INSERT INTO `sys_role_menu` VALUES (1, 2, 1, 1, '2019-04-15 11:18:26', NULL);
INSERT INTO `sys_role_menu` VALUES (2, 2, 2, 1, '2019-04-19 13:41:36', NULL);
INSERT INTO `sys_role_menu` VALUES (3, 2, 3, 1, '2019-04-19 13:41:39', NULL);
INSERT INTO `sys_role_menu` VALUES (4, 2, 4, 1, '2019-04-19 13:41:42', NULL);
INSERT INTO `sys_role_menu` VALUES (5, 2, 5, 1, '2019-04-19 13:41:45', NULL);
INSERT INTO `sys_role_menu` VALUES (6, 2, 6, 1, '2019-04-19 13:42:20', NULL);
COMMIT;
-- ----------------------------
-- Table structure for sys_schedule
-- ----------------------------
DROP TABLE IF EXISTS `sys_schedule`;
CREATE TABLE `sys_schedule` (
`id` bigint(20) NOT NULL COMMENT '主键',
`name` varchar(36) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '任务名称',
`cron` varchar(36) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '执行周期表达式',
`app_name` varchar(36) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '所属应用名称',
`class_name` varchar(36) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '执行类',
`method` varchar(36) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '执行方法 各服务范围应一致',
`valid` tinyint(1) DEFAULT NULL COMMENT '有效标志(0:无效,1:有效)',
`createTime` datetime DEFAULT NULL COMMENT '创建时间',
`updateTime` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='定时任务计划表';
-- ----------------------------
-- Records of sys_schedule
-- ----------------------------
BEGIN;
INSERT INTO `sys_schedule` VALUES (1, '测试定时任务1', '0/10 * * * * ?', 'lion-demo-', 'scheduleDemo', 'firstMethod', 1, NULL, NULL);
INSERT INTO `sys_schedule` VALUES (2, '测试定时任务2', '5/15 * * * * ?', 'lion-demo-', 'scheduleDemo', 'secondMethod', 1, NULL, NULL);
INSERT INTO `sys_schedule` VALUES (3, '测试定时任务3', '30 0/1 * * * ?', 'lion-demo-', 'scheduleDemo', 'thirdMethod', 1, NULL, NULL);
COMMIT;
-- ----------------------------
-- Table structure for sys_user
-- ----------------------------
DROP TABLE IF EXISTS `sys_user`;
CREATE TABLE `sys_user` (
`id` bigint(20) NOT NULL COMMENT '主键',
`username` varchar(36) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '用户名',
`password` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '密码',
`name` varchar(36) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '名称',
`birthday` date DEFAULT NULL COMMENT '出生日期',
`sex` tinyint(1) DEFAULT NULL COMMENT '性别',
`phone` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '电话',
`email` varchar(36) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '邮箱',
`avatar` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '头像',
`enabled` tinyint(1) DEFAULT NULL COMMENT '启用标志(0:不启用,1:启用)',
`account_non_expired` tinyint(1) DEFAULT NULL COMMENT '账户不过期(0:过期,1:正常)',
`credentials_non_expired` tinyint(1) DEFAULT NULL COMMENT '凭证不过期(0:过期,1:正常)',
`account_non_locked` tinyint(1) DEFAULT NULL COMMENT '账户不锁定(0:锁定,1:正常)',
`valid` tinyint(1) DEFAULT NULL COMMENT '有效标志(0:无效,1:有效)',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`),
UNIQUE KEY `unique_user_username` (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='用户表';
-- ----------------------------
-- Records of sys_user
-- ----------------------------
BEGIN;
INSERT INTO `sys_user` VALUES (1, 'super', '{bcrypt}$2a$10$zt3xDTDmnFFZdzaTZSPUhu.ZhvQYijtGpj4y5BrkBn/6lKi/SQQZ2', '超级管理员', '1989-06-22', 1, NULL, NULL, NULL, 1, 1, 1, 1, 1, '2017-06-20 15:12:16', '2019-04-19 13:30:26');
INSERT INTO `sys_user` VALUES (2, 'admin', '{bcrypt}$2a$10$zt3xDTDmnFFZdzaTZSPUhu.ZhvQYijtGpj4y5BrkBn/6lKi/SQQZ2', '管理员', '1990-08-08', 1, NULL, NULL, NULL, 1, 1, 1, 1, 1, '2017-06-26 17:31:41', NULL);
INSERT INTO `sys_user` VALUES (3, 'user', '{bcrypt}$2a$10$zt3xDTDmnFFZdzaTZSPUhu.ZhvQYijtGpj4y5BrkBn/6lKi/SQQZ2', '普通用户', '1991-05-01', 0, NULL, NULL, NULL, 1, 1, 1, 1, 1, '2017-09-18 16:11:15', NULL);
INSERT INTO `sys_user` VALUES (4, 'test', '{bcrypt}$2a$10$zt3xDTDmnFFZdzaTZSPUhu.ZhvQYijtGpj4y5BrkBn/6lKi/SQQZ2', '测试用户', '1996-07-20', 0, NULL, NULL, NULL, 1, 1, 1, 1, 1, '2017-09-21 17:09:51', NULL);
COMMIT;
-- ----------------------------
-- Table structure for sys_user_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_user_role`;
CREATE TABLE `sys_user_role` (
`id` bigint(20) NOT NULL COMMENT '主键',
`user_id` bigint(20) NOT NULL COMMENT '用户主键',
`role_id` bigint(20) NOT NULL COMMENT '角色主键',
`valid` tinyint(1) DEFAULT NULL COMMENT '有效标志(0:无效,1:有效)',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='用户角色关系表';
-- ----------------------------
-- Records of sys_user_role
-- ----------------------------
BEGIN;
INSERT INTO `sys_user_role` VALUES (1, 1, 1, 1, '2019-04-10 11:57:40', NULL);
INSERT INTO `sys_user_role` VALUES (2, 2, 2, 1, '2019-04-10 11:58:02', NULL);
INSERT INTO `sys_user_role` VALUES (3, 2, 3, 1, '2019-04-10 11:58:19', NULL);
INSERT INTO `sys_user_role` VALUES (4, 3, 3, 1, '2019-04-10 11:58:44', NULL);
COMMIT;
-- ----------------------------
-- Table structure for temp_mybatis
-- ----------------------------
DROP TABLE IF EXISTS `temp_mybatis`;
CREATE TABLE `temp_mybatis` (
`id` bigint(20) NOT NULL COMMENT '主键',
`name` varchar(36) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '名称',
`valid` tinyint(1) DEFAULT NULL COMMENT '有效标志(0:无效,1:有效)',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='MyBatis示例表';
-- ----------------------------
-- Table structure for temp_order
-- ----------------------------
DROP TABLE IF EXISTS `temp_order`;
CREATE TABLE `temp_order` (
`id` bigint(20) NOT NULL COMMENT '主键',
`product_code` varchar(36) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '产品编码',
`count` int(11) DEFAULT NULL COMMENT '数量',
`valid` tinyint(1) DEFAULT NULL COMMENT '有效标志(0:无效,1:有效)',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='订单表';
-- ----------------------------
-- Table structure for temp_product
-- ----------------------------
DROP TABLE IF EXISTS `temp_product`;
CREATE TABLE `temp_product` (
`id` bigint(20) NOT NULL COMMENT '主键',
`code` varchar(36) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '编码',
`name` varchar(36) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '名称',
`count` int(11) DEFAULT NULL COMMENT '数量',
`valid` tinyint(1) DEFAULT NULL COMMENT '有效标志(0:无效,1:有效)',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='产品表';
-- ----------------------------
-- Records of temp_product
-- ----------------------------
BEGIN;
INSERT INTO `temp_product` VALUES (1, 'product-1', '有库存的商品', 9, 1, '2020-03-20 16:50:22', '2020-03-20 16:50:22');
INSERT INTO `temp_product` VALUES (2, 'product-2', '无库存的商品', 0, 1, '2020-03-30 10:52:00', '2020-03-30 10:52:00');
COMMIT;
-- ----------------------------
-- Table structure for undo_log
-- ----------------------------
DROP TABLE IF EXISTS `undo_log`;
CREATE TABLE `undo_log` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`branch_id` bigint(20) NOT NULL,
`xid` varchar(100) NOT NULL,
`context` varchar(128) NOT NULL,
`rollback_info` longblob NOT NULL,
`log_status` int(11) NOT NULL,
`log_created` datetime NOT NULL,
`log_modified` datetime NOT NULL,
`ext` varchar(100) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `ux_undo_log` (`xid`,`branch_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; | the_stack |
aooms script
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for aooms_admin_dict
-- ----------------------------
DROP TABLE IF EXISTS `aooms_admin_dict`;
CREATE TABLE `aooms_admin_dict` (
`id` varchar(32) NOT NULL,
`parent_dict_id` varchar(32) DEFAULT NULL COMMENT '父ID',
`dicttype_id` varchar(32) DEFAULT NULL COMMENT '字典类型ID',
`dict_name` varchar(200) DEFAULT NULL COMMENT '字典名称',
`dict_code` varchar(255) DEFAULT NULL COMMENT '字典编码',
`is_default` char(1) DEFAULT NULL COMMENT '是否内置 Y-是 N-否',
`icon` varchar(255) DEFAULT NULL COMMENT '图标',
`status` char(1) DEFAULT NULL COMMENT '状态 Y-启用 N-禁用',
`ordinal` int(5) DEFAULT NULL COMMENT '序号',
`dict_extension` varchar(500) DEFAULT NULL COMMENT '扩展参数 建议 json格式',
`create_time` varchar(20) DEFAULT NULL COMMENT '创建时间',
`update_time` varchar(20) DEFAULT NULL COMMENT '修改时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of aooms_admin_dict
-- ----------------------------
INSERT INTO `aooms_admin_dict` VALUES ('257215353380147200', 'ROOT', '0', '中', null, null, null, 'N', '0', null, '2018-10-11 18:41:59', '2018-10-12 10:49:29');
INSERT INTO `aooms_admin_dict` VALUES ('257215367867273216', 'ROOT', '1', '2', null, null, null, 'Y', '0', null, '2018-10-11 18:42:02', '2018-10-12 10:49:27');
INSERT INTO `aooms_admin_dict` VALUES ('257218744508485632', '257215353380147200', '1', '7', null, null, null, 'Y', '0', null, '2018-10-11 18:55:27', '2018-10-12 10:28:30');
INSERT INTO `aooms_admin_dict` VALUES ('257219364602777600', '257215353380147200', '1', '5', null, null, null, 'Y', '0', null, '2018-10-11 18:57:55', null);
INSERT INTO `aooms_admin_dict` VALUES ('257220547547500544', '257218744508485632', '1', '6', null, null, null, 'Y', '0', null, '2018-10-11 19:02:37', null);
INSERT INTO `aooms_admin_dict` VALUES ('257236146461872128', '257218744508485632', '1', '71', null, null, null, 'Y', '0', null, '2018-10-11 20:04:36', '2018-10-11 20:15:38');
INSERT INTO `aooms_admin_dict` VALUES ('257238440209289216', '257215353380147200', '1', '8', null, null, null, 'Y', '0', null, '2018-10-11 20:13:43', null);
INSERT INTO `aooms_admin_dict` VALUES ('257430521066295296', 'ROOT', '1', '3', null, null, null, 'Y', '0', null, '2018-10-12 08:56:59', null);
INSERT INTO `aooms_admin_dict` VALUES ('257443024399765504', 'ROOT', '0', '123', null, null, null, 'Y', '0', null, '2018-10-12 09:46:40', null);
INSERT INTO `aooms_admin_dict` VALUES ('257443070713270272', 'ROOT', '2', '435', null, null, null, 'Y', '0', null, '2018-10-12 09:46:51', null);
INSERT INTO `aooms_admin_dict` VALUES ('257443089742827520', 'ROOT', '3', '234', null, null, null, 'Y', '0', null, '2018-10-12 09:46:55', null);
-- ----------------------------
-- Table structure for aooms_admin_dicttype
-- ----------------------------
DROP TABLE IF EXISTS `aooms_admin_dicttype`;
CREATE TABLE `aooms_admin_dicttype` (
`id` varchar(32) NOT NULL,
`type_name` varchar(200) DEFAULT NULL COMMENT '类型名称',
`type_code` varchar(255) DEFAULT NULL COMMENT '类型编码',
`is_default` char(1) DEFAULT NULL COMMENT '系统内置 Y 是 N 否',
`ordinal` int(5) DEFAULT NULL COMMENT '序号',
`create_time` varchar(20) DEFAULT NULL COMMENT '创建时间',
`update_time` varchar(20) DEFAULT NULL COMMENT '修改时间',
PRIMARY KEY (`id`),
UNIQUE KEY `idx_dicttype_code` (`type_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of aooms_admin_dicttype
-- ----------------------------
INSERT INTO `aooms_admin_dicttype` VALUES ('257215353380147200', '中', null, null, '0', '2018-10-11 18:41:59', '2018-10-12 10:49:29');
INSERT INTO `aooms_admin_dicttype` VALUES ('257215367867273216', '2', null, null, '0', '2018-10-11 18:42:02', '2018-10-12 10:49:27');
INSERT INTO `aooms_admin_dicttype` VALUES ('257218744508485632', '7', null, null, '0', '2018-10-11 18:55:27', '2018-10-12 10:28:30');
INSERT INTO `aooms_admin_dicttype` VALUES ('257219364602777600', '5', null, null, '0', '2018-10-11 18:57:55', null);
INSERT INTO `aooms_admin_dicttype` VALUES ('257220547547500544', '6', null, null, '0', '2018-10-11 19:02:37', null);
INSERT INTO `aooms_admin_dicttype` VALUES ('257236146461872128', '71', null, null, '0', '2018-10-11 20:04:36', '2018-10-11 20:15:38');
INSERT INTO `aooms_admin_dicttype` VALUES ('257238440209289216', '8', null, null, '0', '2018-10-11 20:13:43', null);
INSERT INTO `aooms_admin_dicttype` VALUES ('257430521066295296', '3', null, null, '0', '2018-10-12 08:56:59', null);
INSERT INTO `aooms_admin_dicttype` VALUES ('257443024399765504', '123', null, null, '0', '2018-10-12 09:46:40', null);
INSERT INTO `aooms_admin_dicttype` VALUES ('257443070713270272', '435', null, null, '0', '2018-10-12 09:46:51', null);
INSERT INTO `aooms_admin_dicttype` VALUES ('257443089742827520', '234', null, null, '0', '2018-10-12 09:46:55', null);
-- ----------------------------
-- Table structure for aooms_admin_log
-- ----------------------------
DROP TABLE IF EXISTS `aooms_admin_log`;
CREATE TABLE `aooms_admin_log` (
`id` varchar(32) NOT NULL,
`parent_dict_id` varchar(32) DEFAULT NULL COMMENT '父ID',
`dicttype_id` varchar(32) DEFAULT NULL COMMENT '字典类型ID',
`dict_name` varchar(200) DEFAULT NULL COMMENT '字典名称',
`dict_code` varchar(255) DEFAULT NULL COMMENT '字典编码',
`is_default` char(1) DEFAULT NULL COMMENT '是否内置 Y-是 N-否',
`icon` varchar(255) DEFAULT NULL COMMENT '图标',
`status` char(1) DEFAULT NULL COMMENT '状态 Y-启用 N-禁用',
`ordinal` int(5) DEFAULT NULL COMMENT '序号',
`dict_extension` varchar(500) DEFAULT NULL COMMENT '扩展参数 建议 json格式',
`create_time` varchar(20) DEFAULT NULL COMMENT '创建时间',
`update_time` varchar(20) DEFAULT NULL COMMENT '修改时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of aooms_admin_log
-- ----------------------------
INSERT INTO `aooms_admin_log` VALUES ('257215353380147200', 'ROOT', '0', '中', null, null, null, 'N', '0', null, '2018-10-11 18:41:59', '2018-10-12 10:49:29');
INSERT INTO `aooms_admin_log` VALUES ('257215367867273216', 'ROOT', '1', '2', null, null, null, 'Y', '0', null, '2018-10-11 18:42:02', '2018-10-12 10:49:27');
INSERT INTO `aooms_admin_log` VALUES ('257218744508485632', '257215353380147200', '1', '7', null, null, null, 'Y', '0', null, '2018-10-11 18:55:27', '2018-10-12 10:28:30');
INSERT INTO `aooms_admin_log` VALUES ('257219364602777600', '257215353380147200', '1', '5', null, null, null, 'Y', '0', null, '2018-10-11 18:57:55', null);
INSERT INTO `aooms_admin_log` VALUES ('257220547547500544', '257218744508485632', '1', '6', null, null, null, 'Y', '0', null, '2018-10-11 19:02:37', null);
INSERT INTO `aooms_admin_log` VALUES ('257236146461872128', '257218744508485632', '1', '71', null, null, null, 'Y', '0', null, '2018-10-11 20:04:36', '2018-10-11 20:15:38');
INSERT INTO `aooms_admin_log` VALUES ('257238440209289216', '257215353380147200', '1', '8', null, null, null, 'Y', '0', null, '2018-10-11 20:13:43', null);
INSERT INTO `aooms_admin_log` VALUES ('257430521066295296', 'ROOT', '1', '3', null, null, null, 'Y', '0', null, '2018-10-12 08:56:59', null);
INSERT INTO `aooms_admin_log` VALUES ('257443024399765504', 'ROOT', '0', '123', null, null, null, 'Y', '0', null, '2018-10-12 09:46:40', null);
INSERT INTO `aooms_admin_log` VALUES ('257443070713270272', 'ROOT', '2', '435', null, null, null, 'Y', '0', null, '2018-10-12 09:46:51', null);
INSERT INTO `aooms_admin_log` VALUES ('257443089742827520', 'ROOT', '3', '234', null, null, null, 'Y', '0', null, '2018-10-12 09:46:55', null);
-- ----------------------------
-- Table structure for aooms_rbac_menu
-- ----------------------------
DROP TABLE IF EXISTS `aooms_rbac_menu`;
CREATE TABLE `aooms_rbac_menu` (
`id` varchar(32) NOT NULL,
`parent_menu_id` varchar(32) DEFAULT NULL COMMENT '父模块ID',
`resource_id` varchar(32) DEFAULT NULL COMMENT '资源ID',
`menu_name` varchar(200) DEFAULT NULL COMMENT '菜单名称',
`menu_type` char(1) DEFAULT NULL COMMENT '菜单类型 0-目录 1-菜单',
`open_type` char(1) DEFAULT NULL COMMENT '打开方式 0-默认 1-iframe 2-新窗口',
`icon` varchar(255) DEFAULT NULL COMMENT '图标',
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
`status` char(1) DEFAULT NULL COMMENT '状态 Y-启用 N-禁用',
`ordinal` int(5) DEFAULT NULL COMMENT '序号',
`create_time` varchar(20) DEFAULT NULL COMMENT '创建时间',
`update_time` varchar(20) DEFAULT NULL COMMENT '修改时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of aooms_rbac_menu
-- ----------------------------
INSERT INTO `aooms_rbac_menu` VALUES ('257215353380147200', 'ROOT', null, '中', '0', '0', null, null, 'N', '0', '2018-10-11 18:41:59', '2018-10-12 10:49:29');
INSERT INTO `aooms_rbac_menu` VALUES ('257215367867273216', 'ROOT', null, '2', '1', '0', null, null, 'Y', '0', '2018-10-11 18:42:02', '2018-10-12 10:49:27');
INSERT INTO `aooms_rbac_menu` VALUES ('257218744508485632', '257215353380147200', null, '7', '1', '0', null, null, 'Y', '0', '2018-10-11 18:55:27', '2018-10-12 10:28:30');
INSERT INTO `aooms_rbac_menu` VALUES ('257219364602777600', '257215353380147200', null, '5', '1', '0', null, null, 'Y', '0', '2018-10-11 18:57:55', null);
INSERT INTO `aooms_rbac_menu` VALUES ('257220547547500544', '257218744508485632', null, '6', '1', '0', null, null, 'Y', '0', '2018-10-11 19:02:37', null);
INSERT INTO `aooms_rbac_menu` VALUES ('257236146461872128', '257218744508485632', null, '71', '1', '0', null, null, 'Y', '0', '2018-10-11 20:04:36', '2018-10-11 20:15:38');
INSERT INTO `aooms_rbac_menu` VALUES ('257238440209289216', '257215353380147200', null, '8', '1', '0', null, null, 'Y', '0', '2018-10-11 20:13:43', null);
INSERT INTO `aooms_rbac_menu` VALUES ('257430521066295296', 'ROOT', null, '3', '1', '0', null, null, 'Y', '0', '2018-10-12 08:56:59', null);
INSERT INTO `aooms_rbac_menu` VALUES ('257443024399765504', 'ROOT', null, '123', '0', '0', null, null, 'Y', '0', '2018-10-12 09:46:40', null);
INSERT INTO `aooms_rbac_menu` VALUES ('257443070713270272', 'ROOT', null, '435', '2', '0', null, null, 'Y', '0', '2018-10-12 09:46:51', null);
INSERT INTO `aooms_rbac_menu` VALUES ('257443089742827520', 'ROOT', null, '234', '3', '0', null, null, 'Y', '0', '2018-10-12 09:46:55', null);
-- ----------------------------
-- Table structure for aooms_rbac_org
-- ----------------------------
DROP TABLE IF EXISTS `aooms_rbac_org`;
CREATE TABLE `aooms_rbac_org` (
`id` varchar(32) NOT NULL,
`parent_org_id` varchar(32) DEFAULT NULL COMMENT '父机构ID',
`org_name` varchar(200) DEFAULT NULL COMMENT '机构名称',
`org_shortname` varchar(100) DEFAULT NULL COMMENT '机构简称',
`org_code` varchar(255) DEFAULT NULL COMMENT '机构编码',
`photo` varchar(255) DEFAULT NULL COMMENT '头像',
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
`status` char(1) DEFAULT NULL COMMENT '状态 Y-启用 N-禁用',
`ordinal` int(5) DEFAULT NULL COMMENT '序号',
`org_level` int(1) DEFAULT NULL COMMENT '树层级',
`org_permission` varchar(100) DEFAULT NULL COMMENT '机构权限编码',
`data_permission` varchar(255) DEFAULT NULL COMMENT '数据权限标识代码 格式:机构.机构1.操作人ID',
`create_user_id` varchar(32) DEFAULT NULL COMMENT '创建人',
`create_time` varchar(20) DEFAULT NULL COMMENT '创建时间',
`update_time` varchar(20) DEFAULT NULL COMMENT '修改时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of aooms_rbac_org
-- ----------------------------
INSERT INTO `aooms_rbac_org` VALUES ('262216505125507072', 'ROOT', '1', null, '1', null, null, 'Y', '1', '1', '0001', '0001', null, '2018-10-25 13:54:46', null);
INSERT INTO `aooms_rbac_org` VALUES ('262216516278161408', 'ROOT', '2', null, '2', null, null, 'Y', '113', '1', '0003', '0003', null, '2018-10-25 13:54:49', '2018-11-01 10:59:31');
INSERT INTO `aooms_rbac_org` VALUES ('262216543364976640', '262216505125507072', '12', null, '12', null, null, 'Y', '1', '2', '0001', '0001.0001', null, '2018-10-25 13:54:55', '2018-11-01 12:46:50');
INSERT INTO `aooms_rbac_org` VALUES ('262216789121830912', '262216516278161408', '21', null, '21', null, null, 'Y', '1', '2', '0001', '0003.0001', null, '2018-10-25 13:55:54', null);
INSERT INTO `aooms_rbac_org` VALUES ('262216838321016832', '262216789121830912', '22', null, '22', null, null, 'Y', '1', '3', '0001', '0003.0001.0001', null, '2018-10-25 13:56:06', null);
INSERT INTO `aooms_rbac_org` VALUES ('262224019124654080', 'ROOT', '340', null, '3', null, null, 'Y', '11', '1', '0002', '0002', null, '2018-10-25 14:24:38', '2018-11-01 15:09:55');
INSERT INTO `aooms_rbac_org` VALUES ('ROOT', '', '顶层机构', '顶层机构', 'ROOT', null, null, 'Y', '0', '0', '', '', null, null, null);
-- ----------------------------
-- Table structure for aooms_rbac_permission
-- ----------------------------
DROP TABLE IF EXISTS `aooms_rbac_permission`;
CREATE TABLE `aooms_rbac_permission` (
`id` varchar(32) NOT NULL,
`role_id` varchar(32) DEFAULT NULL,
`resource_id` varchar(32) DEFAULT NULL,
`is_halfselect` char(1) DEFAULT NULL COMMENT '半选中状态 Y-是 N-否',
`create_time` varchar(20) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of aooms_rbac_permission
-- ----------------------------
INSERT INTO `aooms_rbac_permission` VALUES ('268484257125502976', '267321253608558592', '266986776843784192', 'N', '2018-11-11 21:00:35');
INSERT INTO `aooms_rbac_permission` VALUES ('268484257150668800', '267321253608558592', '266978270006743040', 'Y', '2018-11-11 21:00:35');
INSERT INTO `aooms_rbac_permission` VALUES ('269153043788861440', '267323584362319872', '266979132951236608', 'N', '2018-11-13 17:18:06');
INSERT INTO `aooms_rbac_permission` VALUES ('269153044539641856', '267323584362319872', '266978270006743040', 'Y', '2018-11-13 17:18:06');
INSERT INTO `aooms_rbac_permission` VALUES ('269153141126074368', '267326095118831616', '266979132951236608', 'N', '2018-11-13 17:18:29');
INSERT INTO `aooms_rbac_permission` VALUES ('269153141130268672', '267326095118831616', '266986727237750784', 'N', '2018-11-13 17:18:29');
INSERT INTO `aooms_rbac_permission` VALUES ('269153141163823104', '267326095118831616', '266978270006743040', 'Y', '2018-11-13 17:18:29');
-- ----------------------------
-- Table structure for aooms_rbac_resource
-- ----------------------------
DROP TABLE IF EXISTS `aooms_rbac_resource`;
CREATE TABLE `aooms_rbac_resource` (
`id` varchar(32) NOT NULL,
`parent_resource_id` varchar(32) DEFAULT NULL COMMENT '父模块ID',
`resource_name` varchar(200) DEFAULT NULL COMMENT '资源名称',
`resource_code` varchar(255) DEFAULT NULL COMMENT '资源编码',
`resource_type` char(1) DEFAULT NULL COMMENT '资源类型 0-目录 1-模块 2-按钮 3-接口',
`resource_url` varchar(255) DEFAULT NULL COMMENT '资源链接地址',
`open_type` char(1) DEFAULT NULL COMMENT '打开方式 0-默认 1-iframe 2-新窗口',
`permission` varchar(255) DEFAULT NULL COMMENT '资源权限标识',
`icon` varchar(255) DEFAULT NULL COMMENT '图标',
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
`status` char(1) DEFAULT NULL COMMENT '状态 Y-启用 N-禁用',
`ordinal` int(5) DEFAULT NULL COMMENT '序号',
`create_time` varchar(20) DEFAULT NULL COMMENT '创建时间',
`update_time` varchar(20) DEFAULT NULL COMMENT '修改时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of aooms_rbac_resource
-- ----------------------------
INSERT INTO `aooms_rbac_resource` VALUES ('266978270006743040', 'ROOT', '系统管理', 'system', '0', '/rbac', '0', null, 'gear', null, 'Y', '1', '2018-11-07 17:16:19', '2018-11-08 11:45:07');
INSERT INTO `aooms_rbac_resource` VALUES ('266979132951236608', '266978270006743040', '机构管理', 'org', '1', '/rbac/org', '0', null, 'cubes', null, 'Y', '1', '2018-11-07 17:19:45', '2018-11-08 18:08:15');
INSERT INTO `aooms_rbac_resource` VALUES ('266979208247382016', '266978270006743040', '用户管理', 'user', '1', '/rbac/user', '0', null, 'user', null, 'Y', '2', '2018-11-07 17:20:03', '2018-11-08 15:19:31');
INSERT INTO `aooms_rbac_resource` VALUES ('266986727237750784', '266978270006743040', '资源管理', 'resource', '1', '/rbac/resource', '0', null, 'delicious', null, 'Y', '5', '2018-11-07 17:49:56', '2018-11-07 17:50:16');
INSERT INTO `aooms_rbac_resource` VALUES ('266986776843784192', '266978270006743040', '角色管理', 'role', '1', '/rbac/role', '0', null, 'user-circle', null, 'Y', '4', '2018-11-07 17:50:07', '2018-11-08 15:19:52');
INSERT INTO `aooms_rbac_resource` VALUES ('ROOT', null, '顶层', 'ROOT', '0', null, null, null, null, null, 'Y', '0', '2018-10-23 17:38:01', '2018-10-23 17:38:01');
-- ----------------------------
-- Table structure for aooms_rbac_role
-- ----------------------------
DROP TABLE IF EXISTS `aooms_rbac_role`;
CREATE TABLE `aooms_rbac_role` (
`id` varchar(32) NOT NULL,
`org_id` varchar(32) DEFAULT NULL COMMENT '机构ID',
`role_name` varchar(20) DEFAULT NULL COMMENT '角色名称',
`role_code` varchar(50) DEFAULT NULL COMMENT '角色编码',
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
`status` char(1) DEFAULT NULL COMMENT '状态 Y-启用 N-禁用',
`ordinal` int(5) DEFAULT NULL COMMENT '序号',
`is_admin` char(1) DEFAULT NULL COMMENT '是否管理员角色 Y-是 N-否 ',
`create_time` varchar(20) DEFAULT NULL COMMENT '创建时间',
`update_time` varchar(20) DEFAULT NULL COMMENT '修改时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of aooms_rbac_role
-- ----------------------------
INSERT INTO `aooms_rbac_role` VALUES ('267321253608558592', 'ROOT', '管理员', 'system', null, 'Y', '0', 'Y', '2018-11-08 15:59:13', '2018-11-08 16:01:47');
INSERT INTO `aooms_rbac_role` VALUES ('267323584362319872', '262216516278161408', '角色1', '1', '1', 'Y', '1', 'N', '2018-11-08 16:08:29', '2018-11-08 16:10:36');
INSERT INTO `aooms_rbac_role` VALUES ('267326095118831616', '262216505125507072', '角色2', '2', '2', 'Y', '1', 'N', '2018-11-08 16:18:27', '2018-11-08 17:24:42');
-- ----------------------------
-- Table structure for aooms_rbac_tenant
-- ----------------------------
DROP TABLE IF EXISTS `aooms_rbac_tenant`;
CREATE TABLE `aooms_rbac_tenant` (
`id` varchar(32) NOT NULL,
`parent_org_id` varchar(32) DEFAULT NULL COMMENT '父机构ID',
`org_name` varchar(200) DEFAULT NULL COMMENT '机构名称',
`org_shortname` varchar(100) DEFAULT NULL COMMENT '机构简称',
`org_code` varchar(255) DEFAULT NULL COMMENT '机构编码',
`photo` varchar(255) DEFAULT NULL COMMENT '头像',
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
`status` char(1) DEFAULT NULL COMMENT '状态 Y-启用 N-禁用',
`ordinal` int(5) DEFAULT NULL COMMENT '序号',
`tree_level` int(1) DEFAULT NULL COMMENT '树层级',
`tree_code` varchar(100) DEFAULT NULL COMMENT '树快速查询编码',
`create_time` varchar(20) DEFAULT NULL COMMENT '创建时间',
`update_time` varchar(20) DEFAULT NULL COMMENT '修改时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of aooms_rbac_tenant
-- ----------------------------
INSERT INTO `aooms_rbac_tenant` VALUES ('252117563901743104', 'ROOT', '第11', null, '7', null, '6', 'Y', '7', null, null, null, '2018-10-10 12:21:43');
INSERT INTO `aooms_rbac_tenant` VALUES ('252117989950754816', 'ROOT', '第2', null, '8', null, null, 'Y', '8', null, null, null, '2018-10-10 12:20:28');
INSERT INTO `aooms_rbac_tenant` VALUES ('252118060553474048', 'ROOT', '第3', null, '9', null, null, 'Y', '9', null, null, null, '2018-10-10 12:20:29');
INSERT INTO `aooms_rbac_tenant` VALUES ('252118128241152000', 'ROOT', '第4', null, '10', null, null, 'Y', '10', null, null, null, '2018-10-10 12:20:29');
INSERT INTO `aooms_rbac_tenant` VALUES ('252119922958667776', 'ROOT', '第51', '999', '00', null, null, 'Y', '11', null, null, null, '2018-10-11 13:02:14');
INSERT INTO `aooms_rbac_tenant` VALUES ('252122146900283392', 'ROOT', '第6', null, null, null, '8', 'Y', null, null, null, null, null);
INSERT INTO `aooms_rbac_tenant` VALUES ('252123287105048576', 'ROOT', '第7', null, null, null, '9', 'Y', null, null, null, null, null);
INSERT INTO `aooms_rbac_tenant` VALUES ('252123581616492544', 'ROOT', '第8', null, null, null, '9', 'Y', null, null, null, null, null);
INSERT INTO `aooms_rbac_tenant` VALUES ('252124272418361344', 'ROOT', '第9', null, null, null, '9', 'Y', null, null, null, null, null);
INSERT INTO `aooms_rbac_tenant` VALUES ('252124411157549056', 'ROOT', '第10', null, null, null, '9', 'Y', null, null, null, '2018-09-27 17:32:24', null);
INSERT INTO `aooms_rbac_tenant` VALUES ('256075948120608768', 'ROOT', '第11', '131', '322', null, '23123', 'Y', '0', null, null, '2018-10-08 15:14:23', null);
INSERT INTO `aooms_rbac_tenant` VALUES ('256078934423113728', 'ROOT', '12388', '123', '123', null, '123', 'Y', '123', null, null, '2018-10-08 15:26:15', '2018-10-09 08:58:39');
INSERT INTO `aooms_rbac_tenant` VALUES ('256078973149122560', 'ROOT', '123', '232', '23', null, '323', 'Y', '0', null, null, '2018-10-08 15:26:24', null);
INSERT INTO `aooms_rbac_tenant` VALUES ('256446263040413696', 'ROOT', '999', '999', '999', null, '999', 'Y', '0', null, null, '2018-10-09 15:45:53', null);
INSERT INTO `aooms_rbac_tenant` VALUES ('256743759763476480', '252117563901743104', '56', '123', '123', null, '123123', 'Y', '0', null, null, '2018-10-10 11:28:02', '2018-10-12 08:50:53');
INSERT INTO `aooms_rbac_tenant` VALUES ('256744140635639808', '252117563901743104', '34', '23423', '234', null, '4243', 'Y', '0', null, null, '2018-10-10 11:29:33', '2018-10-10 11:29:48');
INSERT INTO `aooms_rbac_tenant` VALUES ('257457467774996480', '252117563901743104', '666', 're', '666', null, null, 'Y', '0', null, null, '2018-10-12 10:44:03', '2018-10-12 10:44:08');
-- ----------------------------
-- Table structure for aooms_rbac_user
-- ----------------------------
DROP TABLE IF EXISTS `aooms_rbac_user`;
CREATE TABLE `aooms_rbac_user` (
`id` varchar(32) NOT NULL,
`org_id` varchar(32) DEFAULT NULL COMMENT '机构ID',
`user_name` varchar(20) DEFAULT NULL COMMENT '姓名',
`user_nickname` varchar(100) DEFAULT NULL COMMENT '昵称',
`account` varchar(20) DEFAULT NULL COMMENT '登陆账号',
`password` varchar(255) DEFAULT NULL COMMENT '登陆密码',
`sex` char(1) DEFAULT NULL COMMENT '性别 0-男 1-女',
`is_admin` char(1) DEFAULT NULL COMMENT '管理员 Y-是 N-否',
`phone` varchar(11) DEFAULT NULL COMMENT '电话',
`photo` varchar(255) DEFAULT NULL COMMENT '头像',
`email` varchar(50) DEFAULT NULL COMMENT '邮箱',
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
`status` char(1) DEFAULT NULL COMMENT '状态 Y-启用 N-禁用',
`ordinal` int(5) DEFAULT NULL COMMENT '序号',
`create_time` varchar(20) DEFAULT NULL COMMENT '创建时间',
`update_time` varchar(20) DEFAULT NULL COMMENT '修改时间',
PRIMARY KEY (`id`),
UNIQUE KEY `idx_user_account` (`account`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of aooms_rbac_user
-- ----------------------------
INSERT INTO `aooms_rbac_user` VALUES ('10', null, '李四四8', '消失的风筝', 'admin1', '1', '1', null, '13345678900', null, '1234567890@qq.com', '没有备注', 'N', null, '2018-01-01 14:00:09', '2018-03-07 16:23:55');
INSERT INTO `aooms_rbac_user` VALUES ('123', null, '张三三1', '消失的风筝', 'admin2', '1', '0', null, '13345678900', null, '1234567890@qq.com', '这个备注可能会很长很长的这个备注可能会很长很长的这个备注可能会很长很长的这个备注可能会很长很长的', 'Y', null, '2018-01-01 14:00:09', '2018-10-08 19:20:12');
INSERT INTO `aooms_rbac_user` VALUES ('252112545710608384', null, null, null, null, null, null, null, null, null, null, null, 'Y', null, null, null);
INSERT INTO `aooms_rbac_user` VALUES ('252113117272608768', null, null, null, null, null, null, null, null, null, null, null, 'Y', '1', null, null);
INSERT INTO `aooms_rbac_user` VALUES ('252116958130999296', null, '6', null, '61', '6', '0', null, '6', null, null, '6', 'Y', '1', null, null);
INSERT INTO `aooms_rbac_user` VALUES ('252117563901743104', 'ROOT', '6', null, '67', '6', '0', null, '6', null, null, '6', 'N', '1', null, '2018-10-24 13:57:55');
INSERT INTO `aooms_rbac_user` VALUES ('252117989950754816', 'ROOT', '张三', null, 'test', '1027:b0bb306048f7b19b4ce82b5b70396d1b0650b9bf8c282535:c1f709b71a4de3bad1588b59c0cdbc0aef2b6d8743075e62', null, null, null, null, null, null, 'Y', '1', null, '2018-11-13 17:18:17');
INSERT INTO `aooms_rbac_user` VALUES ('252118060553474048', 'ROOT', null, null, null, null, null, null, null, null, null, null, 'N', '1', null, '2018-11-07 15:54:24');
INSERT INTO `aooms_rbac_user` VALUES ('252118128241152000', 'ROOT', null, null, null, null, null, null, null, null, null, null, 'Y', '1', null, '2018-10-24 13:57:45');
INSERT INTO `aooms_rbac_user` VALUES ('252119922958667776', 'ROOT', null, null, null, null, null, null, null, null, null, null, 'Y', '1', null, '2018-10-24 13:57:46');
INSERT INTO `aooms_rbac_user` VALUES ('252122146900283392', 'ROOT', '8', null, '83', '8', '0', null, '8', null, null, '8', 'Y', '1', null, '2018-10-24 13:57:47');
INSERT INTO `aooms_rbac_user` VALUES ('252123287105048576', 'ROOT', '9', null, '91', '9', '0', null, '9', null, null, '9', 'Y', '1', null, '2018-10-24 13:57:47');
INSERT INTO `aooms_rbac_user` VALUES ('252123581616492544', 'ROOT', '9', null, '92', '9', '0', null, '9', null, null, '9', 'Y', '1', null, null);
INSERT INTO `aooms_rbac_user` VALUES ('252124272418361344', 'ROOT', '9', null, '93', '9', '0', null, '9', null, null, '9', 'Y', '1', null, null);
INSERT INTO `aooms_rbac_user` VALUES ('252124411157549056', 'ROOT', '9', null, '94', '9', '0', null, '9', null, null, '9', 'Y', '1', '2018-09-27 17:32:24', null);
INSERT INTO `aooms_rbac_user` VALUES ('261069476450013184', '252117563901743104', 'w', null, 'ere', 'ee', null, null, null, null, null, null, 'Y', '1', '2018-10-22 09:56:53', null);
INSERT INTO `aooms_rbac_user` VALUES ('261495438773850112', '257457467774996480', '23', null, '23', '23', '0', null, null, null, null, null, 'Y', '1', '2018-10-23 14:09:30', null);
INSERT INTO `aooms_rbac_user` VALUES ('261495521640714240', '252118060553474048', '23', null, '3', '23', '0', null, null, null, null, null, 'Y', '1', '2018-10-23 14:09:50', '2018-10-23 14:41:48');
INSERT INTO `aooms_rbac_user` VALUES ('262272308003999744', '262216838321016832', 'www', null, '2222', null, '0', null, null, null, null, null, 'N', '1', '2018-10-25 17:36:31', '2018-11-07 15:54:33');
INSERT INTO `aooms_rbac_user` VALUES ('267342332607598592', 'ROOT', '6', null, '66', '1027:66ffab1ce9c49aebd75fac25fd3751ba67a5243c53526bd8:7f8298a04ef30fe69b626b8ec994286ec4142bf183c5fd06', '0', 'N', null, null, null, null, 'Y', '1', '2018-11-08 17:22:59', null);
INSERT INTO `aooms_rbac_user` VALUES ('5', null, '李四四3789', '消失的风筝', 'admin7', '1', '1', null, '13345678900', null, '1234567890@qq.com', '没有备注', 'N', '1', '2018-01-01 14:00:09', '2018-09-27 19:29:04');
INSERT INTO `aooms_rbac_user` VALUES ('6', null, '李四四4', '消失的风筝', 'admin8', '1', '1', null, '13345678900', null, '1234567890@qq.com', '没有备注', 'N', '1', '2018-01-01 14:00:09', '2018-03-07 16:23:55');
INSERT INTO `aooms_rbac_user` VALUES ('7', null, '李四四5', '消失的风筝', 'admin9', '1', '1', null, '13345678900', null, '1234567890@qq.com', '没有备注', 'N', '1', '2018-01-01 14:00:09', '2018-03-07 16:23:55');
INSERT INTO `aooms_rbac_user` VALUES ('8', null, '李四四6', '消失的风筝', 'admin0', '1', '1', null, '13345678900', null, '1234567890@qq.com', '没有备注', 'N', '1', '2018-01-01 14:00:09', '2018-03-07 16:23:55');
INSERT INTO `aooms_rbac_user` VALUES ('9', null, '李四四7', '消失的风筝', 'admin00', '1', '1', null, '13345678900', null, '1234567890@qq.com', '没有备注', 'N', '1', '2018-01-01 14:00:09', '2018-03-07 16:23:55');
INSERT INTO `aooms_rbac_user` VALUES ('admin', 'ROOT', '超级管理员', '超级管理员', 'admin', '1027:eb9e8434db52d1f11db342858787a3c075dccc7f6a65cc9e:197df28343ce3a9e292d6f5a912ab10cb7517a9a2bb8662a', '1', 'Y', '6667', null, '1234567890@qq.com', '', 'Y', '0', '2018-01-01 14:00:09', '2018-11-14 18:18:12');
-- ----------------------------
-- Table structure for aooms_rbac_userrole
-- ----------------------------
DROP TABLE IF EXISTS `aooms_rbac_userrole`;
CREATE TABLE `aooms_rbac_userrole` (
`id` varchar(32) DEFAULT NULL,
`user_id` varchar(32) DEFAULT NULL,
`role_id` varchar(32) DEFAULT NULL,
`create_time` varchar(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of aooms_rbac_userrole
-- ----------------------------
INSERT INTO `aooms_rbac_userrole` VALUES ('267342333048000512', '267342332607598592', '267326095118831616', '2018-11-08 17:22:59');
INSERT INTO `aooms_rbac_userrole` VALUES ('269153091083833344', '252117989950754816', '267323584362319872', '2018-11-13 17:18:17');
INSERT INTO `aooms_rbac_userrole` VALUES ('269153091100610560', '252117989950754816', '267326095118831616', '2018-11-13 17:18:17'); | the_stack |
-- 2017-10-06T19:25:14.534
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:25:14','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Billing Record' WHERE AD_Tab_ID=540860 AND AD_Language='en_US'
;
-- 2017-10-06T19:25:54.482
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:25:54','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Simulation' WHERE AD_Field_ID=559663 AND AD_Language='en_US'
;
-- 2017-10-06T19:26:06.315
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:26:06','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Period',Description='',Help='' WHERE AD_Field_ID=559664 AND AD_Language='en_US'
;
-- 2017-10-06T19:26:18.940
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:26:18','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Date reported',Description='' WHERE AD_Field_ID=559665 AND AD_Language='en_US'
;
-- 2017-10-06T19:26:36.563
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:26:36','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Reported by',Description='' WHERE AD_Field_ID=559666 AND AD_Language='en_US'
;
-- 2017-10-06T19:40:24.798
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:40:24','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='UOM',Description='Unit of Measure' WHERE AD_Field_ID=559667 AND AD_Language='en_US'
;
-- 2017-10-06T19:40:41.833
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:40:41','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Amount per UOM' WHERE AD_Field_ID=559668 AND AD_Language='en_US'
;
-- 2017-10-06T19:40:55.553
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:40:55','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Currency',Description='',Help='' WHERE AD_Field_ID=559669 AND AD_Language='en_US'
;
-- 2017-10-06T19:41:08.682
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:41:08','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Qty reported',Description='' WHERE AD_Field_ID=559670 AND AD_Language='en_US'
;
-- 2017-10-06T19:41:28.233
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:41:28','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Flatrate Amount',Description='' WHERE AD_Field_ID=559671 AND AD_Language='en_US'
;
-- 2017-10-06T19:41:45.242
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:41:45','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Actual Qty',Description='' WHERE AD_Field_ID=559672 AND AD_Language='en_US'
;
-- 2017-10-06T19:42:04.795
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:42:04','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Actual Qty per UOM',Description='' WHERE AD_Field_ID=559673 AND AD_Language='en_US'
;
-- 2017-10-06T19:42:21.474
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:42:21','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Diff. Qty',Description='' WHERE AD_Field_ID=559674 AND AD_Language='en_US'
;
-- 2017-10-06T19:42:43.424
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:42:43','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Diff Qty per UOM',Description='' WHERE AD_Field_ID=559675 AND AD_Language='en_US'
;
-- 2017-10-06T19:42:53.633
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:42:53','YYYY-MM-DD HH24:MI:SS'),Name='Diff. Qty per UOM' WHERE AD_Field_ID=559675 AND AD_Language='en_US'
;
-- 2017-10-06T19:43:11.393
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:43:11','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Diff. Qty %',Description='' WHERE AD_Field_ID=559676 AND AD_Language='en_US'
;
-- 2017-10-06T19:43:28.628
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:43:28','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Diff. Qty % eff.',Description='' WHERE AD_Field_ID=559677 AND AD_Language='en_US'
;
-- 2017-10-06T19:43:50.212
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:43:50','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Flatrate Amount Corr.',Description='' WHERE AD_Field_ID=559678 AND AD_Language='en_US'
;
-- 2017-10-06T19:44:01.542
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:44:01','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Note',Description='',Help='' WHERE AD_Field_ID=559679 AND AD_Language='en_US'
;
-- 2017-10-06T19:44:18.804
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:44:18','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Status',Description='',Help='' WHERE AD_Field_ID=559680 AND AD_Language='en_US'
;
-- 2017-10-06T19:44:32.666
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:44:32','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Processed',Description='',Help='' WHERE AD_Field_ID=559681 AND AD_Language='en_US'
;
-- 2017-10-06T19:44:48.005
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:44:48','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Docaction',Description='',Help='' WHERE AD_Field_ID=559682 AND AD_Language='en_US'
;
-- 2017-10-06T19:45:05.189
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:45:05','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Invoice Candidate',Description='',Help='' WHERE AD_Field_ID=559683 AND AD_Language='en_US'
;
-- 2017-10-06T19:45:18.726
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:45:18','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Invoice Candidate Corr.' WHERE AD_Field_ID=559684 AND AD_Language='en_US'
;
-- 2017-10-06T19:45:24.597
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:45:24','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Field_ID=559660 AND AD_Language='en_US'
;
-- 2017-10-06T19:45:37.541
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:45:37','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Organisation',Description='',Help='' WHERE AD_Field_ID=559653 AND AD_Language='en_US'
;
-- 2017-10-06T19:45:48.636
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:45:48','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Created',Description='',Help='' WHERE AD_Field_ID=559654 AND AD_Language='en_US'
;
-- 2017-10-06T19:46:01.125
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:46:01','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Created By',Description='',Help='' WHERE AD_Field_ID=559655 AND AD_Language='en_US'
;
-- 2017-10-06T19:46:12.569
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:46:12','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Active',Description='',Help='' WHERE AD_Field_ID=559656 AND AD_Language='en_US'
;
-- 2017-10-06T19:46:24.063
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:46:24','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Updated',Description='',Help='' WHERE AD_Field_ID=559657 AND AD_Language='en_US'
;
-- 2017-10-06T19:46:36.053
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:46:36','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Updated By',Description='',Help='' WHERE AD_Field_ID=559658 AND AD_Language='en_US'
;
-- 2017-10-06T19:46:47.081
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:46:47','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Type' WHERE AD_Field_ID=559659 AND AD_Language='en_US'
;
-- 2017-10-06T19:46:58.293
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:46:58','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Client',Description='',Help='' WHERE AD_Field_ID=559652 AND AD_Language='en_US'
;
-- 2017-10-06T19:47:20.006
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:47:20','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Contract Period' WHERE AD_Field_ID=559661 AND AD_Language='en_US'
;
-- 2017-10-06T19:47:38.934
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:47:38','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Product',Description='' WHERE AD_Field_ID=559662 AND AD_Language='en_US'
;
-- 2017-10-06T19:47:56.832
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:47:56','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Billing Record' WHERE AD_Field_ID=559685 AND AD_Language='en_US'
;
-- 2017-10-06T19:50:44.096
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:50:44','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Correction Record' WHERE AD_Tab_ID=540861 AND AD_Language='en_US'
;
-- 2017-10-06T19:51:08.765
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:51:08','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Simulation' WHERE AD_Field_ID=559696 AND AD_Language='en_US'
;
-- 2017-10-06T19:51:34.501
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:51:34','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Corr. until Period',Description='' WHERE AD_Field_ID=559697 AND AD_Language='en_US'
;
-- 2017-10-06T19:51:47.217
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:51:47','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Date reported',Description='' WHERE AD_Field_ID=559698 AND AD_Language='en_US'
;
-- 2017-10-06T19:52:00.257
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:52:00','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Reported By',Description='' WHERE AD_Field_ID=559699 AND AD_Language='en_US'
;
-- 2017-10-06T19:52:11.079
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:52:11','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='UOM',Description='',Help='' WHERE AD_Field_ID=559700 AND AD_Language='en_US'
;
-- 2017-10-06T19:52:50.493
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:52:50','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Amount per UOM' WHERE AD_Field_ID=559701 AND AD_Language='en_US'
;
-- 2017-10-06T19:53:01.734
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:53:01','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Currency',Description='',Help='' WHERE AD_Field_ID=559702 AND AD_Language='en_US'
;
-- 2017-10-06T19:53:26.223
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:53:26','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Planned Qty',Description='' WHERE AD_Field_ID=559703 AND AD_Language='en_US'
;
-- 2017-10-06T19:53:41.645
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:53:41','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Reported Qty',Description='',Help='' WHERE AD_Field_ID=559704 AND AD_Language='en_US'
;
-- 2017-10-06T19:53:56.118
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:53:56','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Flatrate Amount',Description='' WHERE AD_Field_ID=559705 AND AD_Language='en_US'
;
-- 2017-10-06T19:54:08.302
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:54:08','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Actual Qty',Description='' WHERE AD_Field_ID=559706 AND AD_Language='en_US'
;
-- 2017-10-06T19:54:24.599
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:54:24','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Actual Qty per UOM',Description='' WHERE AD_Field_ID=559707 AND AD_Language='en_US'
;
-- 2017-10-06T19:54:47.136
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:54:47','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Diff. Qty',Description='' WHERE AD_Field_ID=559708 AND AD_Language='en_US'
;
-- 2017-10-06T19:55:04.630
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:55:04','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Diff. Qty per UOM',Description='' WHERE AD_Field_ID=559709 AND AD_Language='en_US'
;
-- 2017-10-06T19:55:21.477
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:55:21','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Diff. Qty %',Description='' WHERE AD_Field_ID=559710 AND AD_Language='en_US'
;
-- 2017-10-06T19:55:35.063
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:55:35','YYYY-MM-DD HH24:MI:SS'),Name='Diff. Qty % eff.',Description='' WHERE AD_Field_ID=559711 AND AD_Language='en_US'
;
-- 2017-10-06T19:55:54.121
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:55:54','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Flatrate Amount Corr.',Description='' WHERE AD_Field_ID=559712 AND AD_Language='en_US'
;
-- 2017-10-06T19:56:04.872
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:56:04','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Note',Description='',Help='' WHERE AD_Field_ID=559713 AND AD_Language='en_US'
;
-- 2017-10-06T19:56:16.441
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:56:16','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Status',Description='',Help='' WHERE AD_Field_ID=559714 AND AD_Language='en_US'
;
-- 2017-10-06T19:56:28.193
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:56:28','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Processed',Description='',Help='' WHERE AD_Field_ID=559715 AND AD_Language='en_US'
;
-- 2017-10-06T19:56:39.344
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:56:39','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Docaction',Description='',Help='' WHERE AD_Field_ID=559716 AND AD_Language='en_US'
;
-- 2017-10-06T19:56:53.074
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:56:53','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='invoice Candidate',Description='' WHERE AD_Field_ID=559717 AND AD_Language='en_US'
;
-- 2017-10-06T19:57:06.833
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:57:06','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Invoice Candidate Corr.' WHERE AD_Field_ID=559718 AND AD_Language='en_US'
;
-- 2017-10-06T19:57:13.250
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:57:13','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Field_ID=559695 AND AD_Language='en_US'
;
-- 2017-10-06T19:57:24.235
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:57:24','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Client',Description='',Help='' WHERE AD_Field_ID=559693 AND AD_Language='en_US'
;
-- 2017-10-06T19:57:32.880
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:57:32','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Type' WHERE AD_Field_ID=559686 AND AD_Language='en_US'
;
-- 2017-10-06T19:57:44.483
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:57:44','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Updated By',Description='',Help='' WHERE AD_Field_ID=559692 AND AD_Language='en_US'
;
-- 2017-10-06T19:57:55.105
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:57:55','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Updated',Description='',Help='' WHERE AD_Field_ID=559691 AND AD_Language='en_US'
;
-- 2017-10-06T19:58:07.875
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:58:07','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Active',Description='',Help='' WHERE AD_Field_ID=559690 AND AD_Language='en_US'
;
-- 2017-10-06T19:58:19.722
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:58:19','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Created By',Description='',Help='' WHERE AD_Field_ID=559689 AND AD_Language='en_US'
;
-- 2017-10-06T19:58:29.930
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:58:29','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Created',Description='',Help='' WHERE AD_Field_ID=559688 AND AD_Language='en_US'
;
-- 2017-10-06T19:58:44.732
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:58:44','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Organisation',Description='',Help='' WHERE AD_Field_ID=559687 AND AD_Language='en_US'
;
-- 2017-10-06T19:58:57.140
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:58:57','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Product',Description='' WHERE AD_Field_ID=559694 AND AD_Language='en_US'
;
-- 2017-10-06T19:59:10.980
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:59:10','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Billing Record' WHERE AD_Field_ID=559720 AND AD_Language='en_US'
;
-- 2017-10-06T19:59:33.363
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 19:59:33','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Contract Period' WHERE AD_Field_ID=559719 AND AD_Language='en_US'
;
-- 2017-10-06T20:03:18.079
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 20:03:18','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Supply Agreement' WHERE AD_Tab_ID=540862 AND AD_Language='en_US'
;
-- 2017-10-06T20:03:30.553
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 20:03:30','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Product',Description='' WHERE AD_Field_ID=559721 AND AD_Language='en_US'
;
-- 2017-10-06T20:03:41.631
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 20:03:41','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Period',Description='',Help='' WHERE AD_Field_ID=559722 AND AD_Language='en_US'
;
-- 2017-10-06T20:03:53.592
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 20:03:53','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Planned Qty',Description='' WHERE AD_Field_ID=559723 AND AD_Language='en_US'
;
-- 2017-10-06T20:04:04.401
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 20:04:04','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='UOM',Description='',Help='' WHERE AD_Field_ID=559724 AND AD_Language='en_US'
;
-- 2017-10-06T20:04:18.562
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 20:04:18','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Amount per UOM' WHERE AD_Field_ID=559725 AND AD_Language='en_US'
;
-- 2017-10-06T20:04:34.982
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 20:04:34','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Supply Product' WHERE AD_Field_ID=559726 AND AD_Language='en_US'
;
-- 2017-10-06T20:04:58.860
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 20:04:58','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Flatrate Amount',Description='' WHERE AD_Field_ID=559727 AND AD_Language='en_US'
;
-- 2017-10-06T20:05:11.412
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 20:05:11','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Currency',Description='',Help='' WHERE AD_Field_ID=559728 AND AD_Language='en_US'
;
-- 2017-10-06T20:05:23.817
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 20:05:23','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Docaction',Description='',Help='' WHERE AD_Field_ID=559729 AND AD_Language='en_US'
;
-- 2017-10-06T20:05:35.025
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 20:05:35','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Status' WHERE AD_Field_ID=559730 AND AD_Language='en_US'
;
-- 2017-10-06T20:05:46.467
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 20:05:46','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Processed',Description='',Help='' WHERE AD_Field_ID=559731 AND AD_Language='en_US'
;
-- 2017-10-06T20:05:51.250
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 20:05:51','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Field_ID=559732 AND AD_Language='en_US'
;
-- 2017-10-06T20:06:01.883
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 20:06:01','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Note',Description='',Help='' WHERE AD_Field_ID=559733 AND AD_Language='en_US'
;
-- 2017-10-06T20:06:11.075
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 20:06:11','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Client',Description='',Help='' WHERE AD_Field_ID=559734 AND AD_Language='en_US'
;
-- 2017-10-06T20:06:24.768
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 20:06:24','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Invoice Candidate',Description='' WHERE AD_Field_ID=559735 AND AD_Language='en_US'
;
-- 2017-10-06T20:06:38.283
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 20:06:38','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Qty per UOM',Description='' WHERE AD_Field_ID=559736 AND AD_Language='en_US'
;
-- 2017-10-06T20:06:51.843
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 20:06:51','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Qty',Description='' WHERE AD_Field_ID=559737 AND AD_Language='en_US'
;
-- 2017-10-06T20:07:04.860
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 20:07:04','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Diff. Qty',Description='' WHERE AD_Field_ID=559738 AND AD_Language='en_US'
;
-- 2017-10-06T20:07:23.189
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 20:07:23','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Diff. Qty per UOM',Description='' WHERE AD_Field_ID=559739 AND AD_Language='en_US'
;
-- 2017-10-06T20:07:37.374
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 20:07:37','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Diff. Qty % eff.',Description='' WHERE AD_Field_ID=559740 AND AD_Language='en_US'
;
-- 2017-10-06T20:07:56.086
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 20:07:56','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Amount Corr.',Description='' WHERE AD_Field_ID=559741 AND AD_Language='en_US'
;
-- 2017-10-06T20:08:05.710
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 20:08:05','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Simulation' WHERE AD_Field_ID=559742 AND AD_Language='en_US'
;
-- 2017-10-06T20:08:18.063
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 20:08:18','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Invoice Candidate Corr.' WHERE AD_Field_ID=559743 AND AD_Language='en_US'
;
-- 2017-10-06T20:08:30.350
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 20:08:30','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Diff. Qty %',Description='' WHERE AD_Field_ID=559744 AND AD_Language='en_US'
;
-- 2017-10-06T20:08:48.839
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 20:08:48','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Contract Period' WHERE AD_Field_ID=559745 AND AD_Language='en_US'
;
-- 2017-10-06T20:09:00.961
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 20:09:00','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Organisation',Description='',Help='' WHERE AD_Field_ID=559746 AND AD_Language='en_US'
;
-- 2017-10-06T20:09:13.158
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 20:09:13','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Active',Description='',Help='' WHERE AD_Field_ID=559747 AND AD_Language='en_US'
;
-- 2017-10-06T20:09:25.911
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 20:09:25','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Billing Record' WHERE AD_Field_ID=559748 AND AD_Language='en_US'
;
-- 2017-10-06T20:09:42.599
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 20:09:42','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Qty reported',Description='' WHERE AD_Field_ID=559749 AND AD_Language='en_US'
;
-- 2017-10-06T20:09:53.944
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 20:09:53','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Reported By',Description='' WHERE AD_Field_ID=559750 AND AD_Language='en_US'
;
-- 2017-10-06T20:10:09.003
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 20:10:09','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Date reported',Description='' WHERE AD_Field_ID=559751 AND AD_Language='en_US'
;
-- 2017-10-06T20:10:24.665
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 20:10:24','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Type',Description='',Help='' WHERE AD_Field_ID=559752 AND AD_Language='en_US'
;
-- 2017-10-06T20:13:00.196
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 20:13:00','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Subscription Progress' WHERE AD_Tab_ID=540880 AND AD_Language='en_US'
;
-- 2017-10-06T20:13:11.579
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 20:13:11','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Shipment Schedule' WHERE AD_Field_ID=560359 AND AD_Language='en_US'
;
-- 2017-10-06T20:13:22.580
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 20:13:22','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Organisation',Description='',Help='' WHERE AD_Field_ID=560345 AND AD_Language='en_US'
;
-- 2017-10-06T20:13:33.220
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 20:13:33','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Client',Description='',Help='' WHERE AD_Field_ID=560344 AND AD_Language='en_US'
;
-- 2017-10-06T20:13:42.869
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 20:13:42','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Active',Description='',Help='' WHERE AD_Field_ID=560347 AND AD_Language='en_US'
;
-- 2017-10-06T20:13:51.664
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 20:13:51','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Qty',Description='',Help='' WHERE AD_Field_ID=560348 AND AD_Language='en_US'
;
-- 2017-10-06T20:14:03.942
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 20:14:03','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='SeqNo.',Description='',Help='' WHERE AD_Field_ID=560349 AND AD_Language='en_US'
;
-- 2017-10-06T20:14:11.976
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 20:14:11','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Date' WHERE AD_Field_ID=560350 AND AD_Language='en_US'
;
-- 2017-10-06T20:14:16.274
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 20:14:16','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Field_ID=560351 AND AD_Language='en_US'
;
-- 2017-10-06T20:14:25.868
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 20:14:25','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Event Type' WHERE AD_Field_ID=560352 AND AD_Language='en_US'
;
-- 2017-10-06T20:14:35.694
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 20:14:35','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Contract Status' WHERE AD_Field_ID=560353 AND AD_Language='en_US'
;
-- 2017-10-06T20:14:48.708
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 20:14:48','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Ship Location' WHERE AD_Field_ID=560354 AND AD_Language='en_US'
;
-- 2017-10-06T20:15:03.951
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 20:15:03','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Flatrate Period' WHERE AD_Field_ID=560355 AND AD_Language='en_US'
;
-- 2017-10-06T20:15:17.381
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 20:15:17','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Ship Partner' WHERE AD_Field_ID=560356 AND AD_Language='en_US'
;
-- 2017-10-06T20:15:27.492
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 20:15:27','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Ship User' WHERE AD_Field_ID=560357 AND AD_Language='en_US'
;
-- 2017-10-06T20:15:38.687
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 20:15:38','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Processed',Description='',Help='' WHERE AD_Field_ID=560358 AND AD_Language='en_US'
;
-- 2017-10-06T20:15:53.204
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-06 20:15:53','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Subscription Progress' WHERE AD_Field_ID=560346 AND AD_Language='en_US'
; | the_stack |
-- LTRIM(string, trimSet)/RTRIM(string, trimSet) is not supported anymore. Mastering the
-- output with errors for now. We may implement our own LTRIM_TRIMSET()/RTRIM_TRIMSET()
-- functions for testing only in the future and replace usages of LTRIM/RTRIM here.
AUTOCOMMIT OFF;
-- MODULE DML112
-- SQL Test Suite, V6.0, Interactive SQL, dml112.sql
-- 59-byte ID
-- TEd Version #
-- AUTHORIZATION FLATER
set schema FLATER;
--O SELECT USER FROM HU.ECCO;
VALUES USER;
-- RERUN if USER value does not match preceding AUTHORIZATION comment
ROLLBACK WORK;
-- date_time print
-- TEST:0621 DATETIME NULLs!
CREATE TABLE MERCH (
ITEMKEY INT,
ORDERED DATE,
RDATE DATE,
RTIME TIME,
SOLD TIMESTAMP);
-- PASS:0621 If table is created?
COMMIT WORK;
--O CREATE TABLE TURNAROUND (
--O ITEMKEY INT,
--O MWAIT INTERVAL MONTH,
--O DWAIT INTERVAL DAY TO HOUR);
-- PASS:0621 If table is created?
--O COMMIT WORK;
--O CREATE VIEW INVENTORY AS
--O SELECT MERCH.ITEMKEY AS ITEMKEY, ORDERED,
--O MWAIT, DWAIT FROM MERCH, TURNAROUND COR1 WHERE RDATE
--O IS NOT NULL AND SOLD IS NULL AND
--O MERCH.ITEMKEY = COR1.ITEMKEY
--O UNION
--O SELECT ITEMKEY, ORDERED,
--O CAST (NULL AS INTERVAL MONTH),
--O CAST (NULL AS INTERVAL DAY TO HOUR) FROM
--O MERCH WHERE RDATE IS NOT NULL AND SOLD IS NULL
--O AND MERCH.ITEMKEY NOT IN (SELECT ITEMKEY
--O FROM TURNAROUND);
-- PASS:0621 If view is created?
--O COMMIT WORK;
INSERT INTO MERCH VALUES (0, DATE( '1993-11-23'), NULL, NULL, NULL);
-- PASS:0621 If 1 row is inserted?
INSERT INTO MERCH VALUES (1, DATE( '1993-12-10'), DATE( '1994-01-03'),
CAST (NULL AS TIME), NULL);
-- PASS:0621 If 1 row is inserted?
INSERT INTO MERCH VALUES (2, DATE( '1993-12-11'), NULL,
--O NULL, CAST ('TIMESTAMP ''1993-12-11 13:00:00''' AS TIMESTAMP));
NULL, TIMESTAMP( '1993-12-11 13:00:00' ));
-- PASS:0621 If 1 row is inserted?
INSERT INTO MERCH VALUES (4, DATE( '1993-01-26'), DATE( '1993-01-27'),
NULL, NULL);
-- PASS:0621 If 1 row is inserted?
--O INSERT INTO TURNAROUND VALUES (2, INTERVAL '1' MONTH,
--O INTERVAL '20:0' DAY TO HOUR);
-- PASS:0621 If 1 row is inserted?
--O INSERT INTO TURNAROUND VALUES (5, INTERVAL '5' MONTH,
--O CAST (NULL AS INTERVAL DAY TO HOUR));
-- PASS:0621 If 1 row is inserted?
--O INSERT INTO TURNAROUND VALUES (6, INTERVAL '2' MONTH, NULL);
-- PASS:0621 If 1 row is inserted?
--O SELECT COUNT(*) FROM
--O MERCH A, MERCH B WHERE A.SOLD = B.SOLD;
-- PASS:0621 If count = 1?
--O SELECT COUNT(*) FROM
--O MERCH A, MERCH B WHERE A.RTIME = B.RTIME;
-- PASS:0621 If count = 0?
--O SELECT COUNT(*) FROM
--O MERCH WHERE RDATE IS NULL;
-- PASS:0621 If count = 2?
--O SELECT COUNT(*) FROM
--O TURNAROUND WHERE DWAIT IS NOT NULL;
-- PASS:0621 If count = 1?
--O SELECT DAY( RDATE)
--O FROM MERCH, TURNAROUND WHERE MERCH.ITEMKEY =
--O TURNAROUND.ITEMKEY;
-- PASS:0621 If 1 row selected and value is NULL?
SELECT ITEMKEY FROM MERCH WHERE SOLD IS NOT NULL;
-- PASS:0621 If 1 row selected and ITEMKEY is 2?
--O SELECT HOUR( AVG (DWAIT))
--O FROM MERCH, TURNAROUND WHERE
--O MERCH.ITEMKEY = TURNAROUND.ITEMKEY OR
--O TURNAROUND.ITEMKEY NOT IN
--O (SELECT ITEMKEY FROM MERCH);
-- PASS:0621 If 1 row selected and value is 0?
--O SELECT COUNT(*)
--O FROM INVENTORY WHERE MWAIT IS NULL
--O AND DWAIT IS NULL;
-- PASS:0621 If count = 2?
COMMIT WORK;
--O DROP TABLE MERCH CASCADE;
DROP TABLE MERCH ;
-- PASS:0621 If table is dropped?
COMMIT WORK;
--O DROP TABLE TURNAROUND CASCADE;
-- PASS:0621 If table is dropped?
--O COMMIT WORK;
-- END TEST >>> 0621 <<< END TEST
-- *********************************************
-- TEST:0623 OUTER JOINs with NULLs and empty tables!
CREATE TABLE JNULL1 (C1 INT, C2 INT);
-- PASS:0623 If table is created?
COMMIT WORK;
CREATE TABLE JNULL2 (D1 INT, D2 INT);
-- PASS:0623 If table is created?
COMMIT WORK;
CREATE VIEW JNULL3 AS
SELECT C1, D1, D2 FROM JNULL1 LEFT OUTER JOIN JNULL2
ON C2 = D2;
-- PASS:0623 If view is created?
COMMIT WORK;
CREATE VIEW JNULL4 AS
SELECT D1, D2 AS C2 FROM JNULL2;
-- PASS:0623 If view is created?
COMMIT WORK;
CREATE VIEW JNULL5 AS
SELECT C1, D1, JNULL1.C2 FROM JNULL1 RIGHT OUTER JOIN JNULL4
ON (JNULL1.C2 = JNULL4.C2);
-- PASS:0623 If view is created?
COMMIT WORK;
CREATE VIEW JNULL6 (C1, C2, D1, D2) AS
SELECT * FROM JNULL1 LEFT OUTER JOIN JNULL4
ON (JNULL1.C2 = JNULL4.C2);
-- PASS:0623 If view is created?
COMMIT WORK;
INSERT INTO JNULL1 VALUES (NULL, NULL);
-- PASS:0623 If 1 row is inserted?
INSERT INTO JNULL1 VALUES (1, NULL);
-- PASS:0623 If 1 row is inserted?
INSERT INTO JNULL1 VALUES (NULL, 1);
-- PASS:0623 If 1 row is inserted?
INSERT INTO JNULL1 VALUES (1, 1);
-- PASS:0623 If 1 row is inserted?
INSERT INTO JNULL1 VALUES (2, 2);
-- PASS:0623 If 1 row is inserted?
SELECT COUNT(*) FROM JNULL3;
-- PASS:0623 If count = 5?
SELECT COUNT(*) FROM JNULL3
WHERE D2 IS NOT NULL OR D1 IS NOT NULL;
-- PASS:0623 If count = 0?
SELECT COUNT(*) FROM JNULL5;
---- ON (C2);
---- SELECT D1, D2 AS C2 FROM JNULL2;
-- PASS:0623 If count = 0?
SELECT COUNT(*) FROM JNULL6
WHERE C2 IS NOT NULL;
-- PASS:0623 If count = 3?
INSERT INTO JNULL2
SELECT * FROM JNULL1;
-- PASS:0623 If 5 rows are inserted?
UPDATE JNULL2
SET D2 = 1 WHERE D2 = 2;
-- PASS:0623 If 1 row is updated?
SELECT COUNT(*) FROM JNULL3;
-- PASS:0623 If count = 9?
SELECT COUNT(*)
FROM JNULL3 WHERE C1 IS NULL;
-- PASS:0623 If count = 4?
SELECT COUNT(*)
FROM JNULL3 WHERE D1 IS NULL;
-- PASS:0623 If count = 5?
SELECT COUNT(*)
FROM JNULL3 WHERE D2 IS NULL;
-- PASS:0623 If count = 3?
SELECT AVG(D1) * 10
FROM JNULL3;
-- PASS:0623 If value is 15 (approximately)?
SELECT COUNT(*)
FROM JNULL6
WHERE C2 = 1;
-- PASS:0623 If count = 6?
SELECT COUNT(*)
FROM JNULL6
WHERE C2 IS NULL;
-- PASS:0623 If count = 2?
SELECT COUNT(*)
FROM JNULL6
WHERE C2 = C1
AND D1 IS NULL;
-- PASS:0623 If count = 2?
COMMIT WORK;
--O DROP TABLE JNULL1 CASCADE;
DROP VIEW JNULL3 ;
DROP VIEW JNULL5 ;
DROP VIEW JNULL6 ;
DROP VIEW JNULL4 ;
DROP TABLE JNULL1 ;
-- PASS:0623 If table is dropped?
COMMIT WORK;
--O DROP TABLE JNULL2 CASCADE;
DROP TABLE JNULL2 ;
-- PASS:0623 If table is dropped?
COMMIT WORK;
-- END TEST >>> 0623 <<< END TEST
-- *********************************************
-- TEST:0625 ADD COLUMN and DROP COLUMN!
CREATE TABLE CHANGG
(NAAM CHAR (14) NOT NULL PRIMARY KEY, AGE INT);
-- PASS:0625 If table is created?
COMMIT WORK;
CREATE VIEW CHANGGVIEW AS
SELECT * FROM CHANGG;
-- PASS:0625 If view is created?
COMMIT WORK;
--O ALTER TABLE CHANGG
--O DROP NAAM RESTRICT;
-- PASS:0625 If ERROR, view references NAAM?
--O COMMIT WORK;
INSERT INTO CHANGG VALUES ('RALPH', 22);
-- PASS:0625 If 1 row is inserted?
INSERT INTO CHANGG VALUES ('RUDOLPH', 54);
-- PASS:0625 If 1 row is inserted?
INSERT INTO CHANGG VALUES ('QUEEG', 33);
-- PASS:0625 If 1 row is inserted?
INSERT INTO CHANGG VALUES ('BESSIE', 106);
-- PASS:0625 If 1 row is inserted?
SELECT COUNT(*)
FROM CHANGG WHERE DIVORCES IS NULL;
-- PASS:0625 If ERROR, column does not exist?
COMMIT WORK;
ALTER TABLE CHANGG ADD NUMBRR CHAR(11);
-- PASS:0625 If column is added?
COMMIT WORK;
SELECT MAX(AGE) FROM CHANGGVIEW;
-- PASS:0625 If value is 106?
SELECT MAX(NUMBRR) FROM CHANGGVIEW;
-- PASS:0625 If ERROR, column does not exist ?
COMMIT WORK;
--O DROP VIEW CHANGGVIEW CASCADE;
DROP VIEW CHANGGVIEW ;
-- PASS:0625 If view is dropped?
COMMIT WORK;
--O ALTER TABLE CHANGG
--O ADD COLUMN DIVORCES INT DEFAULT 0;
-- PASS:0625 If column is added?
--O COMMIT WORK;
--O SELECT COUNT(*)
--O FROM CHANGG WHERE NUMBRR IS NOT NULL
--O OR DIVORCES <> 0;
-- PASS:0625 If count = 0?
--O UPDATE CHANGG
--O SET NUMBRR = '837-47-1847', DIVORCES = 3
--O WHERE NAAM = 'RUDOLPH';
-- PASS:0625 If 1 row is updated?
--O UPDATE CHANGG
--O SET NUMBRR = '738-47-1847', DIVORCES = NULL
--O WHERE NAAM = 'QUEEG';
-- PASS:0625 If 1 row is updated?
DELETE FROM CHANGG
WHERE NUMBRR IS NULL;
-- PASS:0625 If 2 rows are deleted?
--O INSERT INTO CHANGG (NAAM, AGE, NUMBRR)
--O VALUES ('GOOBER', 16, '000-10-0001');
-- PASS:0625 If 1 row is inserted?
--O INSERT INTO CHANGG
--O VALUES ('OLIVIA', 20, '111-11-1111', 0);
-- PASS:0625 If 1 row is inserted?
--O SELECT AGE, NUMBRR, DIVORCES
--O FROM CHANGG
--O WHERE NAAM = 'RUDOLPH';
-- PASS:0625 If 1 row selected with values 54, 837-47-1847, 3 ?
--O SELECT AGE, NUMBRR, DIVORCES
--O FROM CHANGG
--O WHERE NAAM = 'QUEEG';
-- PASS:0625 If 1 row selected with values 33, 738-47-1847, NULL ?
--O SELECT AGE, NUMBRR, DIVORCES
--O FROM CHANGG
--O WHERE NAAM = 'GOOBER';
-- PASS:0625 If 1 row selected with values 16, 000-10-0001, 0 ?
--O SELECT AGE, NUMBRR, DIVORCES
--O FROM CHANGG
--O WHERE NAAM = 'OLIVIA';
-- PASS:0625 If 1 row selected with values 20, 111-11-1111, 0 ?
SELECT COUNT(*) FROM CHANGG;
-- PASS:0625 If count = 4?
COMMIT WORK;
--O ALTER TABLE CHANGG DROP AGE CASCADE;
-- PASS:0625 If column is dropped?
--O COMMIT WORK;
--O ALTER TABLE CHANGG DROP COLUMN DIVORCES RESTRICT;
-- PASS:0625 If column is dropped?
--O COMMIT WORK;
--O SELECT COUNT(*)
--O FROM CHANGG WHERE AGE > 30;
-- PASS:0625 If ERROR, column does not exist?
--O SELECT COUNT(*)
--O FROM CHANGG WHERE DIVORCES IS NULL;
-- PASS:0625 If ERROR, column does not exist?
--O SELECT NAAM
--O FROM CHANGG
--O WHERE NUMBRR LIKE '%000%';
-- PASS:0625 If 1 row selected with value GOOBER ?
--O COMMIT WORK;
--O CREATE TABLE REFERENCE_CHANGG (
--O NAAM CHAR (14) NOT NULL PRIMARY KEY
--O REFERENCES CHANGG);
-- PASS:0625 If table is created?
--O COMMIT WORK;
--O INSERT INTO REFERENCE_CHANGG VALUES ('NO SUCH NAAM');
-- PASS:0625 If RI ERROR, parent missing, 0 rows inserted?
--O COMMIT WORK;
--O ALTER TABLE CHANGG DROP NAAM RESTRICT;
-- PASS:0625 If ERROR, referential constraint exists?
--O COMMIT WORK;
--O ALTER TABLE CHANGG DROP NAAM CASCADE;
-- PASS:0625 If column is dropped?
--O COMMIT WORK;
--O INSERT INTO REFERENCE_CHANGG VALUES ('NO SUCH NAAM');
-- PASS:0625 If 1 row is inserted?
--O COMMIT WORK;
--O ALTER TABLE CHANGG DROP NUMBRR RESTRICT;
-- PASS:0625 If ERROR, last column may not be dropped?
--O COMMIT WORK;
--O DROP TABLE CHANGG CASCADE;
DROP TABLE CHANGG ;
-- PASS:0625 If table is dropped?
COMMIT WORK;
--O DROP TABLE REFERENCE_CHANGG CASCADE;
-- PASS:0625 If table is dropped?
--O COMMIT WORK;
-- END TEST >>> 0625 <<< END TEST
-- *********************************************
-- TEST:0631 Datetimes in a <default clause>!
--O CREATE TABLE OBITUARIES (
--O NAAM CHAR (14) NOT NULL PRIMARY KEY,
--O BORN DATE DEFAULT DATE( '1880-01-01'),
--O DIED DATE DEFAULT CURRENT_DATE,
--O ENTERED TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
--O TESTING1 DATE,
--O TESTING2 TIMESTAMP);
-- PASS:0631 If table is created?
--O COMMIT WORK;
--O CREATE TABLE BIRTHS (
--O NAAM CHAR (14) NOT NULL PRIMARY KEY,
--O CHECKIN TIME (0)
--O DEFAULT TIME( '00:00:00'),
--O LABOR INTERVAL HOUR
--O DEFAULT INTERVAL '4' HOUR,
--O CHECKOUT TIME
--O DEFAULT CURRENT_TIME,
--O TESTING TIME);
-- PASS:0631 If table is created?
--O COMMIT WORK;
--O INSERT INTO OBITUARIES (NAAM, TESTING1, TESTING2)
--O VALUES ('KEITH', CURRENT_DATE, CURRENT_TIMESTAMP);
-- PASS:0631 If 1 row is inserted?
--O INSERT INTO BIRTHS (NAAM, TESTING)
--O VALUES ('BJORN', CURRENT_TIME);
-- PASS:0631 If 1 row is inserted?
--O SELECT HOUR( CHECKIN) +
--O MINUTE( CHECKIN) +
--O SECOND( CHECKIN)
--O FROM BIRTHS;
-- PASS:0631 If 1 row selected with value 0?
--O SELECT HOUR( LABOR) FROM BIRTHS;
-- PASS:0631 If 1 row selected with value 4?
--O SELECT COUNT (*) FROM BIRTHS
--O WHERE TESTING <> CHECKOUT OR CHECKOUT IS NULL;
-- PASS:0631 If count = 0?
--O SELECT COUNT (*) FROM OBITUARIES
--O WHERE BORN <> DATE( '1880-01-01')
--O OR BORN IS NULL
--O OR DIED <> TESTING1
--O OR DIED IS NULL
--O OR ENTERED <> TESTING2
--O OR ENTERED IS NULL;
-- PASS:0631 If count = 0?
--O COMMIT WORK;
--O DROP TABLE BIRTHS CASCADE;
-- PASS:0631 If table is dropped?
--O COMMIT WORK;
--O DROP TABLE OBITUARIES CASCADE;
-- PASS:0631 If table is dropped?
--O COMMIT WORK;
-- END TEST >>> 0631 <<< END TEST
-- *********************************************
-- TEST:0633 TRIM function!
CREATE TABLE WEIRDPAD (
NAAM CHAR (14),
SPONSOR CHAR (14),
PADCHAR CHAR (1));
-- PASS:0633 If table is created?
COMMIT WORK;
INSERT INTO WEIRDPAD (NAAM, SPONSOR) VALUES
('KATEBBBBBBBBBB', '000000000KEITH');
-- PASS:0633 If 1 row is inserted?
INSERT INTO WEIRDPAD (NAAM, SPONSOR) VALUES
(' KEITH ', 'XXXXKATEXXXXXX');
-- PASS:0633 If 1 row is inserted?
SELECT LTRIM (RTRIM (SPONSOR,'X'),'X')
FROM WEIRDPAD
WHERE LTRIM (RTRIM (NAAM)) = 'KEITH';
-- PASS:0633 If 1 row selected with value KATE ?
SELECT LTRIM (SPONSOR, 'X')
FROM WEIRDPAD
WHERE RTRIM (NAAM) = ' KEITH';
-- PASS:0633 If 1 row selected with value KATEXXXXXX ?
SELECT LTRIM (SPONSOR, 'X')
FROM WEIRDPAD
WHERE RTRIM (SPONSOR, 'X') = 'XXXXKATE';
-- PASS:0633 If 1 row selected with value KATEXXXXXX ?
SELECT LTRIM (B.NAAM) FROM WEIRDPAD A,
WEIRDPAD B WHERE RTRIM (LTRIM (A.NAAM, 'B'),'B')
= RTRIM (LTRIM (B.SPONSOR, 'X'),'X');
-- PASS:0633 If 1 row selected with value KEITH ?
SELECT COUNT(*) FROM WEIRDPAD A,
WEIRDPAD B WHERE LTRIM (A.SPONSOR, '0')
= RTRIM (LTRIM (B.NAAM, ' '), ' ');
-- PASS:0633 If count = 1?
SELECT RTRIM (NAAM, 'BB')
FROM WEIRDPAD WHERE NAAM LIKE 'KATE%';
-- PASS:0633 If ERROR, length of trim character must be 1 ?
INSERT INTO WEIRDPAD (NAAM, SPONSOR)
SELECT DISTINCT LTRIM (HU.STAFF.CITY, 'D'),
RTRIM (PTYPE, 'n')
FROM HU.STAFF, HU.PROJ
WHERE EMPNAME = 'Alice';
-- PASS:0633 If 3 rows are inserted?
SELECT COUNT(*) FROM WEIRDPAD;
-- PASS:0633 If count = 5?
UPDATE WEIRDPAD
SET SPONSOR = LTRIM (RTRIM (SPONSOR, 'X'), 'X'),
NAAM = RTRIM (NAAM, 'B');
-- PASS:0633 If 5 rows are updated?
SELECT COUNT(*) FROM WEIRDPAD
WHERE NAAM = 'KATE' OR SPONSOR = 'KATE';
-- PASS:0633 If count = 2?
DELETE FROM WEIRDPAD WHERE
LTRIM('Kest', 'K') = LTRIM(SPONSOR, 'T');
-- PASS:0633 If 1 row is deleted?
SELECT COUNT(*) FROM WEIRDPAD;
-- PASS:0633 If count = 4?
UPDATE WEIRDPAD
SET PADCHAR = '0'
WHERE SPONSOR = '000000000KEITH'
OR NAAM = 'eale';
-- PASS:0633 If 3 rows are updated?
UPDATE WEIRDPAD
SET SPONSOR = NULL
WHERE SPONSOR = 'Desig';
-- PASS:0633 If 1 row is updated?
SELECT COUNT(*) FROM WEIRDPAD
WHERE RTRIM (SPONSOR, PADCHAR) IS NULL;
-- PASS:0633 If count = 2?
SELECT COUNT(*) FROM WEIRDPAD
WHERE LTRIM (SPONSOR, PADCHAR) = 'KEITH';
-- PASS:0633 If count = 1?
COMMIT WORK;
--0 DROP TABLE WEIRDPAD CASCADE;
DROP TABLE WEIRDPAD;
-- PASS:0633 If table is dropped?
COMMIT WORK;
-- END TEST >>> 0633 <<< END TEST
-- *************************************************////END-OF-MODULE | the_stack |
-- 2021-09-14T11:10:27.075971300Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Index_Table_Trl WHERE AD_Index_Table_ID=540631
;
-- 2021-09-14T11:10:27.082018700Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Index_Table WHERE AD_Index_Table_ID=540631
;
-- 2021-09-14T11:10:29.403060800Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Index_Table_Trl WHERE AD_Index_Table_ID=540632
;
-- 2021-09-14T11:10:29.407067900Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Index_Table WHERE AD_Index_Table_ID=540632
;
-- 2021-09-14T11:10:53.673332400Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Index_Table (AD_Client_ID,AD_Index_Table_ID,AD_Org_ID,AD_Table_ID,Created,CreatedBy,Description,EntityType,IsActive,IsUnique,Name,Processing,Updated,UpdatedBy) VALUES (0,540643,0,541803,TO_TIMESTAMP('2021-09-14 14:10:53','YYYY-MM-DD HH24:MI:SS'),100,'Unique constraint on parent config id','D','Y','Y','IDX_S_ExternalSystemRabbitMQ_unique_parent_id','N',TO_TIMESTAMP('2021-09-14 14:10:53','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2021-09-14T11:10:53.673332400Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Index_Table_Trl (AD_Language,AD_Index_Table_ID, ErrorMsg, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Index_Table_ID, t.ErrorMsg, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Index_Table t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y') AND t.AD_Index_Table_ID=540643 AND NOT EXISTS (SELECT 1 FROM AD_Index_Table_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Index_Table_ID=t.AD_Index_Table_ID)
;
-- 2021-09-14T11:11:15.511333100Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Index_Column (AD_Client_ID,AD_Column_ID,AD_Index_Column_ID,AD_Index_Table_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,SeqNo,Updated,UpdatedBy) VALUES (0,575936,541164,540643,0,TO_TIMESTAMP('2021-09-14 14:11:15','YYYY-MM-DD HH24:MI:SS'),100,'D','Y',10,TO_TIMESTAMP('2021-09-14 14:11:15','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2021-09-14T11:11:24.106159400Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
CREATE UNIQUE INDEX IDX_S_ExternalSystemRabbitMQ_unique_parent_id ON ExternalSystem_Config_RabbitMQ_HTTP (ExternalSystem_Config_ID)
;
-- 2021-09-14T11:11:47.857933700Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Index_Table (AD_Client_ID,AD_Index_Table_ID,AD_Org_ID,AD_Table_ID,Created,CreatedBy,Description,EntityType,IsActive,IsUnique,Name,Processing,Updated,UpdatedBy) VALUES (0,540644,0,541803,TO_TIMESTAMP('2021-09-14 14:11:47','YYYY-MM-DD HH24:MI:SS'),100,'Unique index external system rabbit value','de.metas.externalsystem','Y','Y','IDX_S_ExternalSystemRabbitMQ_unique_value','N',TO_TIMESTAMP('2021-09-14 14:11:47','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2021-09-14T11:11:47.857933700Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Index_Table_Trl (AD_Language,AD_Index_Table_ID, ErrorMsg, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Index_Table_ID, t.ErrorMsg, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Index_Table t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y') AND t.AD_Index_Table_ID=540644 AND NOT EXISTS (SELECT 1 FROM AD_Index_Table_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Index_Table_ID=t.AD_Index_Table_ID)
;
-- 2021-09-14T11:12:08.276015500Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Index_Column (AD_Client_ID,AD_Column_ID,AD_Index_Column_ID,AD_Index_Table_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,SeqNo,Updated,UpdatedBy) VALUES (0,575935,541165,540644,0,TO_TIMESTAMP('2021-09-14 14:12:08','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.externalsystem','Y',10,TO_TIMESTAMP('2021-09-14 14:12:08','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2021-09-14T11:12:16.048700300Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
CREATE UNIQUE INDEX IDX_S_ExternalSystemRabbitMQ_unique_value ON ExternalSystem_Config_RabbitMQ_HTTP (ExternalSystemValue)
;
-- 2021-09-14T11:14:30.782713200Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Index_Table_Trl WHERE AD_Index_Table_ID=540633
;
-- 2021-09-14T11:14:30.787715300Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Index_Table WHERE AD_Index_Table_ID=540633
;
-- 2021-09-14T11:14:33.276180600Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Index_Table_Trl WHERE AD_Index_Table_ID=540634
;
-- 2021-09-14T11:14:33.281213700Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Index_Table WHERE AD_Index_Table_ID=540634
;
-- 2021-09-14T11:14:35.216132100Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Index_Table_Trl WHERE AD_Index_Table_ID=540635
;
-- 2021-09-14T11:14:35.218127900Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Index_Table WHERE AD_Index_Table_ID=540635
;
-- 2021-09-14T11:14:57.324847200Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Index_Table (AD_Client_ID,AD_Index_Table_ID,AD_Org_ID,AD_Table_ID,Created,CreatedBy,Description,EntityType,IsActive,IsUnique,Name,Processing,Updated,UpdatedBy) VALUES (0,540645,0,541804,TO_TIMESTAMP('2021-09-14 14:14:57','YYYY-MM-DD HH24:MI:SS'),100,'Constraint on parent data export audit id','D','Y','N','IDX_DataExportAudit_parent_id','N',TO_TIMESTAMP('2021-09-14 14:14:57','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2021-09-14T11:14:57.324847200Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Index_Table_Trl (AD_Language,AD_Index_Table_ID, ErrorMsg, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Index_Table_ID, t.ErrorMsg, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Index_Table t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y') AND t.AD_Index_Table_ID=540645 AND NOT EXISTS (SELECT 1 FROM AD_Index_Table_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Index_Table_ID=t.AD_Index_Table_ID)
;
-- 2021-09-14T11:15:17.741939300Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Index_Column (AD_Client_ID,AD_Column_ID,AD_Index_Column_ID,AD_Index_Table_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,SeqNo,Updated,UpdatedBy) VALUES (0,575948,541166,540645,0,TO_TIMESTAMP('2021-09-14 14:15:17','YYYY-MM-DD HH24:MI:SS'),100,'D','Y',10,TO_TIMESTAMP('2021-09-14 14:15:17','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2021-09-14T11:15:21.088013200Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
CREATE INDEX IDX_DataExportAudit_parent_id ON Data_Export_Audit (Data_Export_Audit_Parent_ID)
;
-- 2021-09-14T11:15:46.005977300Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Index_Table (AD_Client_ID,AD_Index_Table_ID,AD_Org_ID,AD_Table_ID,Created,CreatedBy,Description,EntityType,IsActive,IsUnique,Name,Processing,Updated,UpdatedBy) VALUES (0,540646,0,541804,TO_TIMESTAMP('2021-09-14 14:15:45','YYYY-MM-DD HH24:MI:SS'),100,'Unique constraint on record_id and ad_table_id','D','Y','Y','IDX_DataExportAudit_unique_record_id_and_table_id','N',TO_TIMESTAMP('2021-09-14 14:15:45','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2021-09-14T11:15:46.005977300Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Index_Table_Trl (AD_Language,AD_Index_Table_ID, ErrorMsg, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Index_Table_ID, t.ErrorMsg, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Index_Table t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y') AND t.AD_Index_Table_ID=540646 AND NOT EXISTS (SELECT 1 FROM AD_Index_Table_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Index_Table_ID=t.AD_Index_Table_ID)
;
-- 2021-09-14T11:16:08.748311700Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Index_Column (AD_Client_ID,AD_Column_ID,AD_Index_Column_ID,AD_Index_Table_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,SeqNo,Updated,UpdatedBy) VALUES (0,575947,541167,540646,0,TO_TIMESTAMP('2021-09-14 14:16:08','YYYY-MM-DD HH24:MI:SS'),100,'D','Y',10,TO_TIMESTAMP('2021-09-14 14:16:08','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2021-09-14T11:16:23.627626100Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Index_Column (AD_Client_ID,AD_Column_ID,AD_Index_Column_ID,AD_Index_Table_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,SeqNo,Updated,UpdatedBy) VALUES (0,575946,541168,540646,0,TO_TIMESTAMP('2021-09-14 14:16:23','YYYY-MM-DD HH24:MI:SS'),100,'D','Y',20,TO_TIMESTAMP('2021-09-14 14:16:23','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2021-09-14T11:16:40.752284100Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
CREATE UNIQUE INDEX IDX_DataExportAudit_unique_record_id_and_table_id ON Data_Export_Audit (Record_ID,AD_Table_ID)
;
-- 2021-09-14T11:17:31.277929500Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Index_Table_Trl WHERE AD_Index_Table_ID=540636
;
-- 2021-09-14T11:17:31.280930700Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Index_Table WHERE AD_Index_Table_ID=540636
;
-- 2021-09-14T11:17:49.928677500Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Index_Table (AD_Client_ID,AD_Index_Table_ID,AD_Org_ID,AD_Table_ID,Created,CreatedBy,EntityType,IsActive,IsUnique,Name,Processing,Updated,UpdatedBy) VALUES (0,540647,0,541805,TO_TIMESTAMP('2021-09-14 14:17:49','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','N','IDX_DataExportAuditId_and_ExternalSystemConfig_ID','N',TO_TIMESTAMP('2021-09-14 14:17:49','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2021-09-14T11:17:49.930680200Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Index_Table_Trl (AD_Language,AD_Index_Table_ID, ErrorMsg, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Index_Table_ID, t.ErrorMsg, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Index_Table t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y') AND t.AD_Index_Table_ID=540647 AND NOT EXISTS (SELECT 1 FROM AD_Index_Table_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Index_Table_ID=t.AD_Index_Table_ID)
;
-- 2021-09-14T11:18:11.610970900Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Index_Column (AD_Client_ID,AD_Column_ID,AD_Index_Column_ID,AD_Index_Table_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,SeqNo,Updated,UpdatedBy) VALUES (0,575957,541169,540647,0,TO_TIMESTAMP('2021-09-14 14:18:11','YYYY-MM-DD HH24:MI:SS'),100,'D','Y',10,TO_TIMESTAMP('2021-09-14 14:18:11','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2021-09-14T11:18:24.247594600Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Index_Column (AD_Client_ID,AD_Column_ID,AD_Index_Column_ID,AD_Index_Table_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,SeqNo,Updated,UpdatedBy) VALUES (0,575959,541170,540647,0,TO_TIMESTAMP('2021-09-14 14:18:24','YYYY-MM-DD HH24:MI:SS'),100,'D','Y',20,TO_TIMESTAMP('2021-09-14 14:18:24','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2021-09-14T11:18:27.459131700Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
CREATE INDEX IDX_DataExportAuditId_and_ExternalSystemConfig_ID ON Data_Export_Audit_Log (Data_Export_Audit_ID,ExternalSystem_Config_ID)
; | the_stack |
-- tests index filter with outer refs
/*--EXPLAIN_QUERY_BEGIN*/
drop table if exists bfv_tab1;
CREATE TABLE bfv_tab1 (
unique1 int4,
unique2 int4,
two int4,
four int4,
ten int4,
twenty int4,
hundred int4,
thousand int4,
twothousand int4,
fivethous int4,
tenthous int4,
odd int4,
even int4,
stringu1 name,
stringu2 name,
string4 name
);
create index bfv_tab1_idx1 on bfv_tab1 using btree(unique1);
-- GPDB_12_MERGE_FIXME: Non default collation
explain (costs off) select * from bfv_tab1, (values(147, 'RFAAAA'), (931, 'VJAAAA')) as v (i, j)
WHERE bfv_tab1.unique1 = v.i and bfv_tab1.stringu1 = v.j;
set polar_px_enable_relsize_collection=on;
-- GPDB_12_MERGE_FIXME: Non default collation
explain (costs off) select * from bfv_tab1, (values(147, 'RFAAAA'), (931, 'VJAAAA')) as v (i, j)
WHERE bfv_tab1.unique1 = v.i and bfv_tab1.stringu1 = v.j;
-- Test that we do not choose to perform an index scan if indisvalid=false.
create table bfv_tab1_with_invalid_index (like bfv_tab1 including indexes);
set allow_system_table_mods=on;
update pg_index set indisvalid=false where indrelid='bfv_tab1_with_invalid_index'::regclass;
reset allow_system_table_mods;
explain (costs off) select * from bfv_tab1_with_invalid_index where unique1>42;
-- Cannot currently upgrade table with invalid index
-- (see https://github.com/greenplum-db/gpdb/issues/10805).
drop table bfv_tab1_with_invalid_index;
reset polar_px_enable_relsize_collection;
--start_ignore
DROP TABLE IF EXISTS bfv_tab2_facttable1;
DROP TABLE IF EXISTS bfv_tab2_dimdate;
DROP TABLE IF EXISTS bfv_tab2_dimtabl1;
--end_ignore
-- Bug-fix verification for MPP-25537: PANIC when bitmap index used in ORCA select
CREATE TABLE bfv_tab2_facttable1 (
col1 integer,
wk_id smallint,
id integer
)
partition by range (wk_id);
CREATE TABLE bfv_tab2_facttable1_1 PARTITION of bfv_tab2_facttable1 for values from (1) to (2);
CREATE TABLE bfv_tab2_facttable1_2 PARTITION of bfv_tab2_facttable1 for values from (2) to (3);
CREATE TABLE bfv_tab2_facttable1_3 PARTITION of bfv_tab2_facttable1 for values from (3) to (4);
CREATE TABLE bfv_tab2_facttable1_4 PARTITION of bfv_tab2_facttable1 for values from (4) to (5);
CREATE TABLE bfv_tab2_facttable1_5 PARTITION of bfv_tab2_facttable1 for values from (5) to (6);
CREATE TABLE bfv_tab2_facttable1_6 PARTITION of bfv_tab2_facttable1 for values from (6) to (7);
CREATE TABLE bfv_tab2_facttable1_7 PARTITION of bfv_tab2_facttable1 for values from (7) to (8);
CREATE TABLE bfv_tab2_facttable1_8 PARTITION of bfv_tab2_facttable1 for values from (8) to (9);
CREATE TABLE bfv_tab2_facttable1_9 PARTITION of bfv_tab2_facttable1 for values from (9) to (10);
CREATE TABLE bfv_tab2_facttable1_10 PARTITION of bfv_tab2_facttable1 for values from (10) to (11);
CREATE TABLE bfv_tab2_facttable1_11 PARTITION of bfv_tab2_facttable1 for values from (11) to (12);
CREATE TABLE bfv_tab2_facttable1_12 PARTITION of bfv_tab2_facttable1 for values from (12) to (13);
CREATE TABLE bfv_tab2_facttable1_13 PARTITION of bfv_tab2_facttable1 for values from (13) to (14);
CREATE TABLE bfv_tab2_facttable1_14 PARTITION of bfv_tab2_facttable1 for values from (14) to (15);
CREATE TABLE bfv_tab2_facttable1_15 PARTITION of bfv_tab2_facttable1 for values from (15) to (16);
CREATE TABLE bfv_tab2_facttable1_16 PARTITION of bfv_tab2_facttable1 for values from (16) to (17);
CREATE TABLE bfv_tab2_facttable1_17 PARTITION of bfv_tab2_facttable1 for values from (17) to (18);
CREATE TABLE bfv_tab2_facttable1_18 PARTITION of bfv_tab2_facttable1 for values from (18) to (19);
CREATE TABLE bfv_tab2_facttable1_19 PARTITION of bfv_tab2_facttable1 for values from (19) to (20);
CREATE TABLE bfv_tab2_facttable1_20 PARTITION of bfv_tab2_facttable1 default;
insert into bfv_tab2_facttable1 select col1, col1, col1 from (select generate_series(1,20) col1)a;
CREATE TABLE bfv_tab2_dimdate (
wk_id smallint,
col2 date
)
;
insert into bfv_tab2_dimdate select col1, current_date - col1 from (select generate_series(1,20,2) col1)a;
CREATE TABLE bfv_tab2_dimtabl1 (
id integer,
col2 integer
)
;
insert into bfv_tab2_dimtabl1 select col1, col1 from (select generate_series(1,20,3) col1)a;
CREATE INDEX idx_bfv_tab2_facttable1 on bfv_tab2_facttable1 (id);
--start_ignore
set optimizer_analyze_root_partition to on;
--end_ignore
ANALYZE bfv_tab2_facttable1;
ANALYZE bfv_tab2_dimdate;
ANALYZE bfv_tab2_dimtabl1;
SELECT count(*)
FROM bfv_tab2_facttable1 ft, bfv_tab2_dimdate dt, bfv_tab2_dimtabl1 dt1
WHERE ft.wk_id = dt.wk_id
AND ft.id = dt1.id;
explain (costs off) select count(*)
FROM bfv_tab2_facttable1 ft, bfv_tab2_dimdate dt, bfv_tab2_dimtabl1 dt1
WHERE ft.wk_id = dt.wk_id
AND ft.id = dt1.id;
explain (costs off) select count(*)
FROM bfv_tab2_facttable1 ft, bfv_tab2_dimdate dt, bfv_tab2_dimtabl1 dt1
WHERE ft.wk_id = dt.wk_id
AND ft.id = dt1.id;
-- start_ignore
create language plpythonu;
-- end_ignore
create or replace function count_index_scans(explain_query text) returns int as
$$
rv = plpy.execute(explain_query)
search_text = 'Index Scan'
result = 0
for i in range(len(rv)):
cur_line = rv[i]['QUERY PLAN']
if search_text.lower() in cur_line.lower():
result = result+1
return result
$$
language plpythonu;
DROP TABLE bfv_tab1;
DROP TABLE bfv_tab2_facttable1;
DROP TABLE bfv_tab2_dimdate;
DROP TABLE bfv_tab2_dimtabl1;
-- pick index scan when query has a relabel on the index key: non partitioned tables
set enable_seqscan = off;
-- start_ignore
drop table if exists Tab23383;
-- end_ignore
create table Tab23383(a int, b varchar(20));
insert into Tab23383 select g,g from generate_series(1,1000) g;
create index Tab23383_b on Tab23383(b);
-- start_ignore
select disable_xform('CXformGet2TableScan');
-- end_ignore
select count_index_scans('explain (costs off) select * from Tab23383 where b=''1'';');
select * from Tab23383 where b='1';
select count_index_scans('explain (costs off) select * from Tab23383 where ''1''=b;');
select * from Tab23383 where '1'=b;
select count_index_scans('explain (costs off) select * from Tab23383 where ''2''> b order by a limit 10;');
select * from Tab23383 where '2'> b order by a limit 10;
select count_index_scans('explain (costs off) select * from Tab23383 where b between ''1'' and ''2'' order by a limit 10;');
select * from Tab23383 where b between '1' and '2' order by a limit 10;
-- predicates on both index and non-index key
select count_index_scans('explain (costs off) select * from Tab23383 where b=''1'' and a=''1'';');
select * from Tab23383 where b='1' and a='1';
--negative tests: no index scan plan possible, fall back to planner
select count_index_scans('explain (costs off) select * from Tab23383 where b::int=''1'';');
drop table Tab23383;
-- pick index scan when query has a relabel on the index key: partitioned tables
-- start_ignore
drop table if exists Tbl23383_partitioned;
-- end_ignore
create table Tbl23383_partitioned(a int, b varchar(20), c varchar(20), d varchar(20))
partition by range(a);
CREATE TABLE Tbl23383_partitioned_1 PARTITION of Tbl23383_partitioned for values from (1) to (500);
CREATE TABLE Tbl23383_partitioned_2 PARTITION of Tbl23383_partitioned for values from (500) to (1001);
insert into Tbl23383_partitioned select g,g,g,g from generate_series(1,1000) g;
create index idx23383_b on Tbl23383_partitioned(b);
-- heterogenous indexes
create index idx23383_c on Tbl23383_partitioned_1(c);
create index idx23383_cd on Tbl23383_partitioned_2(c,d);
set polar_px_optimizer_enable_dynamictablescan = off;
select count_index_scans('explain (costs off) select * from Tbl23383_partitioned where b=''1''');
select * from Tbl23383_partitioned where b='1';
select count_index_scans('explain (costs off) select * from Tbl23383_partitioned where ''1''=b');
select * from Tbl23383_partitioned where '1'=b;
select count_index_scans('explain (costs off) select * from Tbl23383_partitioned where ''2''> b order by a limit 10;');
select * from Tbl23383_partitioned where '2'> b order by a limit 10;
select count_index_scans('explain (costs off) select * from Tbl23383_partitioned where b between ''1'' and ''2'' order by a limit 10;');
select * from Tbl23383_partitioned where b between '1' and '2' order by a limit 10;
-- predicates on both index and non-index key
select count_index_scans('explain (costs off) select * from Tbl23383_partitioned where b=''1'' and a=''1'';');
select * from Tbl23383_partitioned where b='1' and a='1';
--negative tests: no index scan plan possible, fall back to planner
select count_index_scans('explain (costs off) select * from Tbl23383_partitioned where b::int=''1'';');
-- heterogenous indexes
select count_index_scans('explain (costs off) select * from Tbl23383_partitioned where c=''1'';');
select * from Tbl23383_partitioned where c='1';
-- start_ignore
drop table Tbl23383_partitioned;
-- end_ignore
reset enable_seqscan;
-- negative test: due to non compatible cast and CXformGet2TableScan disabled no index plan possible, fallback to planner
-- start_ignore
drop table if exists tbl_ab;
-- end_ignore
create table tbl_ab(a int, b int);
create index idx_ab_b on tbl_ab(b);
-- start_ignore
select disable_xform('CXformGet2TableScan');
-- end_ignore
explain (costs off) select * from tbl_ab where b::oid=1;
drop table tbl_ab;
drop function count_index_scans(text);
-- start_ignore
select enable_xform('CXformGet2TableScan');
-- end_ignore
--
-- Check that ORCA can use an index for joins on quals like:
--
-- indexkey CMP expr
-- expr CMP indexkey
--
-- where expr is a scalar expression free of index keys and may have outer
-- references.
--
create table nestloop_x (i int, j int);
create table nestloop_y (i int, j int);
insert into nestloop_x select g, g from generate_series(1, 20) g;
insert into nestloop_y select g, g from generate_series(1, 7) g;
create index nestloop_y_idx on nestloop_y (j);
-- Coerce the Postgres planner to produce a similar plan. Nested loop joins
-- are not enabled by default. And to dissuade it from choosing a sequential
-- scan, bump up the cost. enable_seqscan=off won't help, because there is
-- no other way to scan table 'x', and once the planner chooses a seqscan for
-- one table, it will happily use a seqscan for other tables as well, despite
-- enable_seqscan=off. (On PostgreSQL, enable_seqscan works differently, and
-- just bumps up the cost of a seqscan, so it would work there.)
set seq_page_cost=10000000;
set enable_indexscan=on;
set enable_nestloop=on;
explain (costs off) select * from nestloop_x as x, nestloop_y as y where x.i + x.j < y.j;
select * from nestloop_x as x, nestloop_y as y where x.i + x.j < y.j;
explain (costs off) select * from nestloop_x as x, nestloop_y as y where y.j > x.i + x.j + 2;
select * from nestloop_x as x, nestloop_y as y where y.j > x.i + x.j + 2;
drop table nestloop_x, nestloop_y;
SET enable_seqscan = OFF;
SET enable_indexscan = ON;
DROP TABLE IF EXISTS bpchar_ops;
CREATE TABLE bpchar_ops(id INT8, v char(10));
CREATE INDEX bpchar_ops_btree_idx ON bpchar_ops USING btree(v bpchar_pattern_ops);
INSERT INTO bpchar_ops VALUES (0, 'row');
SELECT * FROM bpchar_ops WHERE v = 'row '::char(20);
DROP TABLE bpchar_ops;
--
-- Test index rechecks with AO and AOCS tables (and heaps as well, for good measure)
--
create table shape_heap (c circle) ;
create table shape_ao (c circle) ;
create table shape_aocs (c circle) ;
insert into shape_heap values ('<(0,0), 5>');
insert into shape_ao values ('<(0,0), 5>');
insert into shape_aocs values ('<(0,0), 5>');
create index shape_heap_bb_idx on shape_heap using gist(c);
create index shape_ao_bb_idx on shape_ao using gist(c);
create index shape_aocs_bb_idx on shape_aocs using gist(c);
select c && '<(5,5), 1>'::circle,
c && '<(5,5), 2>'::circle,
c && '<(5,5), 3>'::circle
from shape_heap;
-- Test the same values ;
--
-- The first two values don't overlap with the value in the tables, <(0,0), 5>,
-- but their bounding boxes do. In a GiST index scan that uses the bounding
-- boxes, these will fetch the row from the index, but filtered out by the
-- recheck using the actual overlap operator. The third entry is sanity check
-- that the index returns any rows.
set enable_seqscan=off;
set enable_indexscan=off;
set enable_bitmapscan=on;
-- Use EXPLAIN to verify that these use a bitmap index scan
explain (costs off) select * from shape_heap where c && '<(5,5), 1>'::circle;
explain (costs off) select * from shape_ao where c && '<(5,5), 1>'::circle;
explain (costs off) select * from shape_aocs where c && '<(5,5), 1>'::circle;
-- Test that they return correct results.
select * from shape_heap where c && '<(5,5), 1>'::circle;
select * from shape_ao where c && '<(5,5), 1>'::circle;
select * from shape_aocs where c && '<(5,5), 1>'::circle;
select * from shape_heap where c && '<(5,5), 2>'::circle;
select * from shape_ao where c && '<(5,5), 2>'::circle;
select * from shape_aocs where c && '<(5,5), 2>'::circle;
select * from shape_heap where c && '<(5,5), 3>'::circle;
select * from shape_ao where c && '<(5,5), 3>'::circle;
select * from shape_aocs where c && '<(5,5), 3>'::circle;
--
-- Given a table with different column types
--
CREATE TABLE table_with_reversed_index(a int, b bool, c text);
--
-- And it has an index that is ordered differently than columns on the table.
--
CREATE INDEX ON table_with_reversed_index(c, a);
INSERT INTO table_with_reversed_index VALUES (10, true, 'ab');
--
-- Then an index only scan should succeed. (i.e. varattno is set up correctly)
--
SET enable_seqscan=off;
SET enable_bitmapscan=off;
SET polar_px_optimizer_enable_seqscan=off;
SET polar_px_optimizer_enable_indexscan=off;
SET polar_px_optimizer_enable_indexonlyscan=on;
explain (costs off) select c, a FROM table_with_reversed_index WHERE a > 5;
SELECT c, a FROM table_with_reversed_index WHERE a > 5;
RESET enable_seqscan;
RESET enable_bitmapscan;
RESET polar_px_optimizer_enable_seqscan;
RESET polar_px_optimizer_enable_indexscan;
RESET polar_px_optimizer_enable_indexonlyscan; | the_stack |
--
-- $Id: POSTGRESQL.sql,v 1.7 2011-02-06 14:53:45 dan Exp $
--
-- Copyright (c) 1998-2006 DVL Software Limited
--
--
-- users, groups, permissions for postgresql
--
--
-- for the http server
--
-- DO THIS BEFORE YOU LOAD THE DATA
create group www;
create user www with password 'password';
alter group www add user www;
-- DO THIS AFTER YOU LOAD THE DATA
--
-- select access only
--
grant select on commit_log to group www;
grant select on commit_log_branches to group www;
grant select on commit_log_elements to group www;
grant select on commit_log_port_elements to group www;
grant select on commit_log_ports_elements to group www;
grant select on commit_log_ports to group www;
grant select on commit_log_ports_ignore to group www;
grant select on latest_commits to group www;
grant select on latest_commits_ports to group www;
grant select on element to group www;
grant select on element_pathname to group www;
grant select on element_revision to group www;
grant select on ports to group www;
grant select on port_dependencies to group www;
grant select on ports_categories to group www;
grant select on ports_active to group www;
grant select on ports_all to group www;
grant select on ports_moved to group www;
grant select on ports_updating to group www;
grant select on ports_updating_ports_xref to group www;
grant select on ports_vulnerable to group www;
grant select on sanity_test_failures to group www;
grant select on system to group www;
grant select on system_branch to group www;
grant select on system_branch_element_revision to group www;
grant select on tasks to group www;
grant select on user_tasks to group www;
grant select on commit_log_ports_vuxml to group www;
grant select on vuxml to group www;
grant select on vuxml_affected to group www;
grant select on vuxml_names to group www;
grant select on vuxml_ranges to group www;
grant select on vuxml_references to group www;
--
-- select, update
--
grant select, insert on cache_clearing_ports to group www;
grant select, update on cache_clearing_ports_id_seq to group www;
grant select, insert on cache_clearing_dates to group www;
grant select, update on cache_clearing_dates_id_seq to group www;
grant select, update on categories to group www;
grant select, insert, delete on category_stats to group www;
grant select, insert, delete on user_password_reset to group www;
--
-- select, insert, update
--
grant select, insert, update on users to group www;
grant select, update on users_id_seq to group www;
grant select, insert, update, delete on announcements to group www;
grant update on announcements_id_seq to group www;
grant select, insert, delete, update on committer_notify to group www;
grant select, insert, update on security_notice to group www;
grant select, insert, delete, update on watch_list to group www;
grant select, insert, delete, update on watch_list_staging to group www;
grant select, update on watch_list_staging_id_seq to group www;
grant select, insert, delete, update on commits_flagged to group www;
--
-- select, insert, update, delete
--
grant select, insert, update, delete on watch_list_element to group www;
grant select, update on watch_list_id_seq to group www;
--
-- select, delete
--
grant select, insert, delete on user_confirmations to group www;
grant insert on watch_list_staging_log to group www;
grant update on watch_list_staging_log_id_seq to group www;
grant select on watch_notice to group www;
grant select on graphs to group www;
grant select on daily_stats to group www;
grant select on daily_stats_data to group www;
grant select on report_frequency to group www;
grant select on reports to group www;
grant select, update, delete, insert on report_subscriptions to group www;
grant select on report_log to group www;
--
-- no access
--
-- watch_notice_id_seq to group www;
-- watch_notice_log to group www;
-- watch_notice_log_id_seq to group www;
--
-- for scripts etc
--
create user commits with password 'ld6420uX';
create group commits;
alter group commits add user commits;
--
-- select access only
--
grant select on announcements to group commits;
grant select, insert, update on cache_clearing_ports to group commits;
grant select, update on cache_clearing_ports_id_seq to group commits;
grant select, insert, update on cache_clearing_dates to group commits;
grant select, update on cache_clearing_dates_id_seq to group commits;
grant select, insert, update on categories to group commits;
grant select, update on categories_id_seq to group commits;
grant select, insert, update, delete on commit_log to group commits;
grant select, update on commit_log_id_seq to group commits;
grant select, insert, update, delete on commit_log_branches to group commits;
grant select, insert, update, delete on commit_log_elements to group commits;
grant select, update on commit_log_elements_id_seq to group commits;
grant select, update on commit_log_id_seq to group commits;
grant select, insert, update, delete on commit_log_port_elements to group commits;
grant select, insert, update, delete on commit_log_ports_elements to group commits;
grant select, insert, update, delete on commit_log_ports to group commits;
grant select, insert on commit_log_ports_ignore to group commits;
grant select, insert, delete on latest_commits to group commits;
grant select, insert, delete on latest_commits_ports to group commits;
grant select on commits_recent to group commits;
grant select on commits_recent_ports to group commits;
grant select on committer_notify to group commits;
grant select, insert, update, delete on element to group commits;
grant select, insert, update, delete on element_pathname to group commits;
grant select, update on element_id_seq to group commits;
grant select, insert, update, delete on element_revision to group commits;
grant select, insert, update, delete on ports to group commits;
grant select, insert, update, delete on port_dependencies to group commits;
grant select, update on ports_id_seq to group commits;
grant select, insert, update, delete on ports_all to group commits;
grant select, insert, update, delete on ports_categories to group commits;
grant select on security_notice to group commits;
--
-- mostly for use only by ~/scripts/ports_categories-populate.pl
--
grant select on ports_active to group commits;
grant select, insert, update, delete on ports_vulnerable to group commits;
grant select, insert, update, delete on system to group commits;
grant select, insert, update, delete on system_branch to group commits;
grant select, update on system_branch_id_seq to group commits;
grant select, insert, update, delete on system_branch_element_revision to group commits;
grant select on users to group commits;
grant select on watch_list to group commits;
grant select on watch_list_element to group commits;
grant select, insert, update on watch_notice_log to group commits;
grant select, insert, update on watch_notice to group commits;
grant insert on watch_notice_log to group commits;
grant update on watch_notice_log_id_seq to group commits;
grant ALL on ports_check to group commits;
grant update on ports_check_id_seq to group commits;
grant select, insert, delete on daily_refreshes to group commits;
grant select on daily_stats to group commits;
grant insert on daily_stats_data to group commits;
grant update on daily_stats_data_seq to group commits;
grant select on report_frequency to group commits;
grant select on reports to group commits;
grant select on report_subscriptions to group commits;
grant select, insert on report_log to group commits;
grant update on report_log_id_seq to group commits;
grant select on report_log_latest to group commits;
grant select, insert, delete, update on ports_moved to group commits;
grant update on ports_moved_id_seq to group commits;
grant insert on sanity_test_failures to group commits;
grant update on sanity_test_failures_id_seq to group commits;
grant insert, delete, update on ports_updating to group commits;
grant update on ports_updating_id_seq to group commits;
grant select, insert, delete, update on ports_updating_ports_xref to group commits;
grant insert, delete, select,update on vuxml to group commits;
grant update on vuxml_id_seq to group commits;
grant insert, select on vuxml_affected to group commits;
grant update on vuxml_affected_id_seq to group commits;
grant insert, select on vuxml_names to group commits;
grant update on vuxml_names_id_seq to group commits;
grant insert on vuxml_ranges to group commits;
grant update on vuxml_ranges_id_seq to group commits;
grant insert on vuxml_references to group commits;
grant update on vuxml_references_id_seq to group commits;
grant insert, select on vuxml_ranges to group commits;
grant update on vuxml_ranges_id_seq to group commits;
grant insert, delete, select on commit_log_ports_vuxml to group commits;
grant update on commit_log_ports_vuxml_id_seq to group commits;
grant select, delete on user_password_reset to group commits;
--
-- the READING group only needs to read some things.
--
create group reading;
create user reading with password 'Bifrost1718';
alter group reading add user reading;
GRANT SELECT ON commit_log TO GROUP reading;
GRANT SELECT ON commit_log_branches TO GROUP reading;
GRANT SELECT ON commit_log_ports TO GROUP reading;
GRANT SELECT ON element TO GROUP reading;
GRANT SELECT ON ports TO GROUP reading;
GRANT SELECT ON ports_active TO GROUP reading;
GRANT SELECT ON ports_categories TO GROUP reading;
GRANT SELECT ON ports_vulnerable TO GROUP reading;
GRANT SELECT ON report_subscriptions TO GROUP reading;
GRANT SELECT ON system_branch TO GROUP reading;
GRANT SELECT ON users TO GROUP reading;
--
-- For statistics gathering
--
grant insert on page_load_detail to group www;
grant update on page_load_detail_id_seq to group www;
grant select, delete on page_load_detail to group commits;
grant insert on page_load_summary to group commits;
grant update on page_load_summary_id_seq to group commits;
--
-- for the fp-listen daemon
--
CREATE GROUP listening;
ALTER USER listening PASSWORD '2m38aqo';
ALTER USER listening LOGIN;
GRANT select ON listen_for TO GROUP listening;
GRANT select, delete ON cache_clearing_ports TO GROUP listening;
GRANT select, delete ON cache_clearing_dates TO GROUP listening;
-- for the session schema
grant select, insert, delete on session_variables to group commits;
-- For FreshSource database access
create role freshsource_ro;
grant select on system to freshsource_ro;
grant select on latest_commits to freshsource_ro;
grant select on security_notice to freshsource_ro;
grant select on element to freshsource_ro;
grant select on commit_log_elements to freshsource_ro;
grant select on commit_log to freshsource_ro;
grant select on repo to freshsource_ro;
grant select on users to freshsource_ro;
grant select on watch_notice to freshsource_ro;
grant select on watch_list_element to freshsource_ro;
grant select on watch_list to freshsource_ro;
grant select on watch_list to freshsource_ro;
grant update (cookie) on users to freshsource_ro;
grant update (lastlogin) on users to freshsource_ro;
create user freshsource_dev with password '[redacted]' IN ROLE freshsource_ro;
-- For monitoring, e.g. nagios
create group reporting;
grant select on cache_clearing_dates to group reporting;
grant select on cache_clearing_ports to group reporting;
grant reporting to nagios;
-- for the packages table
CREATE ROLE packaging;
GRANT SELECT, INSERT ON abi TO packaging;
GRANT SELECT ON element TO packaging;
GRANT SELECT ON element_pathname TO packaging;
GRANT INSERT ON package_imports TO packaging;
GRANT SELECT, UPDATE, INSERT, DELETE ON packages TO packaging;
GRANT SELECT, INSERT, DELETE ON ports TO packaging;
GRANT SELECT ON ports_origin TO packaging;
GRANT SELECT ON system_branch TO packaging;
GRANT SELECT, UPDATE, INSERT, DELETE ON packages_raw TO packaging;
GRANT SELECT, UPDATE ON packages_last_checked TO packaging;
GRANT SELECT ON packages TO www;
GRANT SELECT ON abi TO www;
GRANT SELECT ON packages_last_checked TO www;
GRANT SELECT, INSERT, UPDATE ON ports_origin TO commits;
CREATE USER packager_dev WITH PASSWORD '[redacted]' IN ROLE packaging; | the_stack |
-- 2020-05-20T08:50:07.011Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2020-05-20 11:50:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=540911 AND AD_Language='de_DE'
;
-- 2020-05-20T08:50:10.058Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2020-05-20 11:50:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=540911 AND AD_Language='en_US'
;
-- 2020-05-20T10:40:23.322Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element SET PrintName='Verbuchung erzwingen', Name='Verbuchung erzwingen',Updated=TO_TIMESTAMP('2020-05-20 13:40:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=543744
;
-- 2020-05-20T10:40:23.349Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName='IsEnforcePosting', Name='Verbuchung erzwingen', Description=NULL, Help=NULL WHERE AD_Element_ID=543744
;
-- 2020-05-20T10:40:23.351Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='IsEnforcePosting', Name='Verbuchung erzwingen', Description=NULL, Help=NULL, AD_Element_ID=543744 WHERE UPPER(ColumnName)='ISENFORCEPOSTING' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2020-05-20T10:40:23.353Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='IsEnforcePosting', Name='Verbuchung erzwingen', Description=NULL, Help=NULL WHERE AD_Element_ID=543744 AND IsCentrallyMaintained='Y'
;
-- 2020-05-20T10:40:23.354Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Verbuchung erzwingen', Description=NULL, Help=NULL WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=543744) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 543744)
;
-- 2020-05-20T10:40:23.364Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_PrintFormatItem pi SET PrintName='Verbuchung erzwingen', Name='Verbuchung erzwingen' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=543744)
;
-- 2020-05-20T10:40:23.378Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET Name='Verbuchung erzwingen', Description=NULL, Help=NULL, CommitWarning = NULL WHERE AD_Element_ID = 543744
;
-- 2020-05-20T10:40:23.380Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_WINDOW SET Name='Verbuchung erzwingen', Description=NULL, Help=NULL WHERE AD_Element_ID = 543744
;
-- 2020-05-20T10:40:23.381Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu SET Name = 'Verbuchung erzwingen', Description = NULL, WEBUI_NameBrowse = NULL, WEBUI_NameNew = NULL, WEBUI_NameNewBreadcrumb = NULL WHERE AD_Element_ID = 543744
;
-- 2020-05-20T10:41:01.465Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET PrintName='Verbuchung erzwingen', IsTranslated='Y', Name='Verbuchung erzwingen',Updated=TO_TIMESTAMP('2020-05-20 13:41:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_CH' AND AD_Element_ID=543744
;
-- 2020-05-20T10:41:01.490Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(543744,'de_CH')
;
-- 2020-05-20T10:41:08.389Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET PrintName='Verbuchung erzwingen', IsTranslated='Y', Name='Verbuchung erzwingen',Updated=TO_TIMESTAMP('2020-05-20 13:41:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_DE' AND AD_Element_ID=543744
;
-- 2020-05-20T10:41:08.392Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(543744,'de_DE')
;
-- 2020-05-20T10:41:08.419Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_ad_element_on_ad_element_trl_update(543744,'de_DE')
;
-- 2020-05-20T10:41:08.420Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName='IsEnforcePosting', Name='Verbuchung erzwingen', Description=NULL, Help=NULL WHERE AD_Element_ID=543744
;
-- 2020-05-20T10:41:08.421Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='IsEnforcePosting', Name='Verbuchung erzwingen', Description=NULL, Help=NULL, AD_Element_ID=543744 WHERE UPPER(ColumnName)='ISENFORCEPOSTING' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2020-05-20T10:41:08.423Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='IsEnforcePosting', Name='Verbuchung erzwingen', Description=NULL, Help=NULL WHERE AD_Element_ID=543744 AND IsCentrallyMaintained='Y'
;
-- 2020-05-20T10:41:08.424Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Verbuchung erzwingen', Description=NULL, Help=NULL WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=543744) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 543744)
;
-- 2020-05-20T10:41:08.433Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_PrintFormatItem pi SET PrintName='Verbuchung erzwingen', Name='Verbuchung erzwingen' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=543744)
;
-- 2020-05-20T10:41:08.446Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET Name='Verbuchung erzwingen', Description=NULL, Help=NULL, CommitWarning = NULL WHERE AD_Element_ID = 543744
;
-- 2020-05-20T10:41:08.448Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_WINDOW SET Name='Verbuchung erzwingen', Description=NULL, Help=NULL WHERE AD_Element_ID = 543744
;
-- 2020-05-20T10:41:08.450Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu SET Name = 'Verbuchung erzwingen', Description = NULL, WEBUI_NameBrowse = NULL, WEBUI_NameNew = NULL, WEBUI_NameNewBreadcrumb = NULL WHERE AD_Element_ID = 543744
;
-- 2020-05-20T10:41:32.435Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET Description='Der Beleg soll erneut verbucht werden, auch wenn er scheinbar gerade im Moment schon von metasfresh verbucht wird',Updated=TO_TIMESTAMP('2020-05-20 13:41:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_CH' AND AD_Element_ID=543744
;
-- 2020-05-20T10:41:32.436Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(543744,'de_CH')
;
-- 2020-05-20T10:41:36.724Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET Description='Der Beleg soll erneut verbucht werden, auch wenn er scheinbar gerade im Moment schon von metasfresh verbucht wird',Updated=TO_TIMESTAMP('2020-05-20 13:41:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_DE' AND AD_Element_ID=543744
;
-- 2020-05-20T10:41:36.726Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(543744,'de_DE')
;
-- 2020-05-20T10:41:36.748Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_ad_element_on_ad_element_trl_update(543744,'de_DE')
;
-- 2020-05-20T10:41:36.750Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName='IsEnforcePosting', Name='Verbuchung erzwingen', Description='Der Beleg soll erneut verbucht werden, auch wenn er scheinbar gerade im Moment schon von metasfresh verbucht wird', Help=NULL WHERE AD_Element_ID=543744
;
-- 2020-05-20T10:41:36.751Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='IsEnforcePosting', Name='Verbuchung erzwingen', Description='Der Beleg soll erneut verbucht werden, auch wenn er scheinbar gerade im Moment schon von metasfresh verbucht wird', Help=NULL, AD_Element_ID=543744 WHERE UPPER(ColumnName)='ISENFORCEPOSTING' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2020-05-20T10:41:36.752Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='IsEnforcePosting', Name='Verbuchung erzwingen', Description='Der Beleg soll erneut verbucht werden, auch wenn er scheinbar gerade im Moment schon von metasfresh verbucht wird', Help=NULL WHERE AD_Element_ID=543744 AND IsCentrallyMaintained='Y'
;
-- 2020-05-20T10:41:36.755Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Verbuchung erzwingen', Description='Der Beleg soll erneut verbucht werden, auch wenn er scheinbar gerade im Moment schon von metasfresh verbucht wird', Help=NULL WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=543744) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 543744)
;
-- 2020-05-20T10:41:36.764Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET Name='Verbuchung erzwingen', Description='Der Beleg soll erneut verbucht werden, auch wenn er scheinbar gerade im Moment schon von metasfresh verbucht wird', Help=NULL, CommitWarning = NULL WHERE AD_Element_ID = 543744
;
-- 2020-05-20T10:41:36.766Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_WINDOW SET Name='Verbuchung erzwingen', Description='Der Beleg soll erneut verbucht werden, auch wenn er scheinbar gerade im Moment schon von metasfresh verbucht wird', Help=NULL WHERE AD_Element_ID = 543744
;
-- 2020-05-20T10:41:36.767Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu SET Name = 'Verbuchung erzwingen', Description = 'Der Beleg soll erneut verbucht werden, auch wenn er scheinbar gerade im Moment schon von metasfresh verbucht wird', WEBUI_NameBrowse = NULL, WEBUI_NameNew = NULL, WEBUI_NameNewBreadcrumb = NULL WHERE AD_Element_ID = 543744
;
-- 2020-05-20T10:42:04.435Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET PrintName='Force Posting', IsTranslated='Y', Name='Force Posting',Updated=TO_TIMESTAMP('2020-05-20 13:42:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='en_US' AND AD_Element_ID=543744
;
-- 2020-05-20T10:42:04.437Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(543744,'en_US')
;
-- 2020-05-20T10:42:15.436Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET Description='Post the document even if it is locked',Updated=TO_TIMESTAMP('2020-05-20 13:42:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='en_US' AND AD_Element_ID=543744
;
-- 2020-05-20T10:42:15.437Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(543744,'en_US')
; | the_stack |
--
-- Tests for PL/pgSQL control structures
--
-- integer FOR loop
do $$
begin
-- basic case
for i in 1..3 loop
raise notice '1..3: i = %', i;
end loop;
-- with BY, end matches exactly
for i in 1..10 by 3 loop
raise notice '1..10 by 3: i = %', i;
end loop;
-- with BY, end does not match
for i in 1..11 by 3 loop
raise notice '1..11 by 3: i = %', i;
end loop;
-- zero iterations
for i in 1..0 by 3 loop
raise notice '1..0 by 3: i = %', i;
end loop;
-- REVERSE
for i in reverse 10..0 by 3 loop
raise notice 'reverse 10..0 by 3: i = %', i;
end loop;
-- potential overflow
for i in 2147483620..2147483647 by 10 loop
raise notice '2147483620..2147483647 by 10: i = %', i;
end loop;
-- potential overflow, reverse direction
for i in reverse -2147483620..-2147483647 by 10 loop
raise notice 'reverse -2147483620..-2147483647 by 10: i = %', i;
end loop;
end$$;
-- BY can't be zero or negative
do $$
begin
for i in 1..3 by 0 loop
raise notice '1..3 by 0: i = %', i;
end loop;
end$$;
do $$
begin
for i in 1..3 by -1 loop
raise notice '1..3 by -1: i = %', i;
end loop;
end$$;
do $$
begin
for i in reverse 1..3 by -1 loop
raise notice 'reverse 1..3 by -1: i = %', i;
end loop;
end$$;
-- CONTINUE statement
create table conttesttbl(idx serial, v integer);
insert into conttesttbl(v) values(10);
insert into conttesttbl(v) values(20);
insert into conttesttbl(v) values(30);
insert into conttesttbl(v) values(40);
create function continue_test1() returns void as $$
declare _i integer = 0; _r record;
begin
raise notice '---1---';
loop
_i := _i + 1;
raise notice '%', _i;
continue when _i < 10;
exit;
end loop;
raise notice '---2---';
<<lbl>>
loop
_i := _i - 1;
loop
raise notice '%', _i;
continue lbl when _i > 0;
exit lbl;
end loop;
end loop;
raise notice '---3---';
<<the_loop>>
while _i < 10 loop
_i := _i + 1;
continue the_loop when _i % 2 = 0;
raise notice '%', _i;
end loop;
raise notice '---4---';
for _i in 1..10 loop
begin
-- applies to outer loop, not the nested begin block
continue when _i < 5;
raise notice '%', _i;
end;
end loop;
raise notice '---5---';
for _r in select * from conttesttbl loop
continue when _r.v <= 20;
raise notice '%', _r.v;
end loop;
raise notice '---6---';
for _r in execute 'select * from conttesttbl' loop
continue when _r.v <= 20;
raise notice '%', _r.v;
end loop;
raise notice '---7---';
<<looplabel>>
for _i in 1..3 loop
continue looplabel when _i = 2;
raise notice '%', _i;
end loop;
raise notice '---8---';
_i := 1;
while _i <= 3 loop
raise notice '%', _i;
_i := _i + 1;
continue when _i = 3;
end loop;
raise notice '---9---';
for _r in select * from conttesttbl order by v limit 1 loop
raise notice '%', _r.v;
continue;
end loop;
raise notice '---10---';
for _r in execute 'select * from conttesttbl order by v limit 1' loop
raise notice '%', _r.v;
continue;
end loop;
raise notice '---11---';
<<outerlooplabel>>
for _i in 1..2 loop
raise notice 'outer %', _i;
<<innerlooplabel>>
for _j in 1..3 loop
continue outerlooplabel when _j = 2;
raise notice 'inner %', _j;
end loop;
end loop;
end; $$ language plpgsql;
select continue_test1();
-- should fail: CONTINUE is only legal inside a loop
create function continue_error1() returns void as $$
begin
begin
continue;
end;
end;
$$ language plpgsql;
-- should fail: unlabeled EXIT is only legal inside a loop
create function exit_error1() returns void as $$
begin
begin
exit;
end;
end;
$$ language plpgsql;
-- should fail: no such label
create function continue_error2() returns void as $$
begin
begin
loop
continue no_such_label;
end loop;
end;
end;
$$ language plpgsql;
-- should fail: no such label
create function exit_error2() returns void as $$
begin
begin
loop
exit no_such_label;
end loop;
end;
end;
$$ language plpgsql;
-- should fail: CONTINUE can't reference the label of a named block
create function continue_error3() returns void as $$
begin
<<begin_block1>>
begin
loop
continue begin_block1;
end loop;
end;
end;
$$ language plpgsql;
-- On the other hand, EXIT *can* reference the label of a named block
create function exit_block1() returns void as $$
begin
<<begin_block1>>
begin
loop
exit begin_block1;
raise exception 'should not get here';
end loop;
end;
end;
$$ language plpgsql;
select exit_block1();
-- verbose end block and end loop
create function end_label1() returns void as $$
<<blbl>>
begin
<<flbl1>>
for i in 1 .. 10 loop
raise notice 'i = %', i;
exit flbl1;
end loop flbl1;
<<flbl2>>
for j in 1 .. 10 loop
raise notice 'j = %', j;
exit flbl2;
end loop;
end blbl;
$$ language plpgsql;
select end_label1();
-- should fail: undefined end label
create function end_label2() returns void as $$
begin
for _i in 1 .. 10 loop
exit;
end loop flbl1;
end;
$$ language plpgsql;
-- should fail: end label does not match start label
create function end_label3() returns void as $$
<<outer_label>>
begin
<<inner_label>>
for _i in 1 .. 10 loop
exit;
end loop outer_label;
end;
$$ language plpgsql;
-- should fail: end label on a block without a start label
create function end_label4() returns void as $$
<<outer_label>>
begin
for _i in 1 .. 10 loop
exit;
end loop outer_label;
end;
$$ language plpgsql;
-- unlabeled exit matches no blocks
do $$
begin
for i in 1..10 loop
<<innerblock>>
begin
begin -- unlabeled block
exit;
raise notice 'should not get here';
end;
raise notice 'should not get here, either';
end;
raise notice 'nor here';
end loop;
raise notice 'should get here';
end$$;
-- check exit out of an unlabeled block to a labeled one
do $$
<<outerblock>>
begin
<<innerblock>>
begin
<<moreinnerblock>>
begin
begin -- unlabeled block
exit innerblock;
raise notice 'should not get here';
end;
raise notice 'should not get here, either';
end;
raise notice 'nor here';
end;
raise notice 'should get here';
end$$;
-- check exit out of outermost block
do $$
<<outerblock>>
begin
<<innerblock>>
begin
exit outerblock;
raise notice 'should not get here';
end;
raise notice 'should not get here, either';
end$$;
-- unlabeled exit does match a while loop
do $$
begin
<<outermostwhile>>
while 1 > 0 loop
<<outerwhile>>
while 1 > 0 loop
<<innerwhile>>
while 1 > 0 loop
exit;
raise notice 'should not get here';
end loop;
raise notice 'should get here';
exit outermostwhile;
raise notice 'should not get here, either';
end loop;
raise notice 'nor here';
end loop;
raise notice 'should get here, too';
end$$;
-- check exit out of an unlabeled while to a labeled one
do $$
begin
<<outerwhile>>
while 1 > 0 loop
while 1 > 0 loop
exit outerwhile;
raise notice 'should not get here';
end loop;
raise notice 'should not get here, either';
end loop;
raise notice 'should get here';
end$$;
-- continue to an outer while
do $$
declare i int := 0;
begin
<<outermostwhile>>
while i < 2 loop
raise notice 'outermostwhile, i = %', i;
i := i + 1;
<<outerwhile>>
while 1 > 0 loop
<<innerwhile>>
while 1 > 0 loop
continue outermostwhile;
raise notice 'should not get here';
end loop;
raise notice 'should not get here, either';
end loop;
raise notice 'nor here';
end loop;
raise notice 'out of outermostwhile, i = %', i;
end$$;
-- return out of a while
create function return_from_while() returns int language plpgsql as $$
declare i int := 0;
begin
while i < 10 loop
if i > 2 then
return i;
end if;
i := i + 1;
end loop;
return null;
end$$;
select return_from_while();
-- using list of scalars in fori and fore stmts
create function for_vect() returns void as $proc$
<<lbl>>declare a integer; b varchar; c varchar; r record;
begin
-- fori
for i in 1 .. 3 loop
raise notice '%', i;
end loop;
-- fore with record var
for r in select gs as aa, 'BB' as bb, 'CC' as cc from generate_series(1,4) gs loop
raise notice '% % %', r.aa, r.bb, r.cc;
end loop;
-- fore with single scalar
for a in select gs from generate_series(1,4) gs loop
raise notice '%', a;
end loop;
-- fore with multiple scalars
for a,b,c in select gs, 'BB','CC' from generate_series(1,4) gs loop
raise notice '% % %', a, b, c;
end loop;
-- using qualified names in fors, fore is enabled, disabled only for fori
for lbl.a, lbl.b, lbl.c in execute $$select gs, 'bb','cc' from generate_series(1,4) gs$$ loop
raise notice '% % %', a, b, c;
end loop;
end;
$proc$ language plpgsql;
select for_vect();
-- CASE statement
create or replace function case_test(bigint) returns text as $$
declare a int = 10;
b int = 1;
begin
case $1
when 1 then
return 'one';
when 2 then
return 'two';
when 3,4,3+5 then
return 'three, four or eight';
when a then
return 'ten';
when a+b, a+b+1 then
return 'eleven, twelve';
end case;
end;
$$ language plpgsql immutable;
select case_test(1);
select case_test(2);
select case_test(3);
select case_test(4);
select case_test(5); -- fails
select case_test(8);
select case_test(10);
select case_test(11);
select case_test(12);
select case_test(13); -- fails
create or replace function catch() returns void as $$
begin
raise notice '%', case_test(6);
exception
when case_not_found then
raise notice 'caught case_not_found % %', SQLSTATE, SQLERRM;
end
$$ language plpgsql;
select catch();
-- test the searched variant too, as well as ELSE
create or replace function case_test(bigint) returns text as $$
declare a int = 10;
begin
case
when $1 = 1 then
return 'one';
when $1 = a + 2 then
return 'twelve';
else
return 'other';
end case;
end;
$$ language plpgsql immutable;
select case_test(1);
select case_test(2);
select case_test(12);
select case_test(13); | the_stack |
LOAD 'pg_hint_plan';
SET pg_hint_plan.enable_hint TO on;
SET pg_hint_plan.debug_print TO on;
SET client_min_messages TO LOG;
SET search_path TO public;
SET max_parallel_workers_per_gather TO 0;
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
----
---- No. L-1-1 specified pattern of the object name
----
-- No. L-1-1-1
/*+Leading(t4 t2 t3 t1)*/
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-- No. L-1-1-2
/*+Leading(t4 t2 t3 t1)*/
EXPLAIN (COSTS false) SELECT * FROM s1.t1 t_1, s1.t2 t_2, s1.t3 t_3, s1.t4 t_4 WHERE t_1.c1 = t_2.c1 AND t_1.c1 = t_3.c1 AND t_1.c1 = t_4.c1;
-- No. L-1-1-3
/*+Leading(t_4 t_2 t_3 t_1)*/
EXPLAIN (COSTS false) SELECT * FROM s1.t1 t_1, s1.t2 t_2, s1.t3 t_3, s1.t4 t_4 WHERE t_1.c1 = t_2.c1 AND t_1.c1 = t_3.c1 AND t_1.c1 = t_4.c1;
----
---- No. L-1-2 specified schema name in the hint option
----
-- No. L-1-2-1
/*+Leading(t4 t2 t3 t1)*/
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-- No. L-1-2-2
/*+Leading(s1.t4 s1.t2 s1.t3 s1.t1)*/
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
----
---- No. L-1-3 table doesn't exist in the hint option
----
-- No. L-1-3-1
/*+Leading(t4 t2 t3 t1)*/
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-- No. L-1-3-2
/*+Leading(t5 t2 t3 t1)*/
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
----
---- No. L-1-4 conflict table name
----
-- No. L-1-4-1
/*+Leading(t4 t2 t3 t1)*/
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-- No. L-1-4-2
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s2.t1 WHERE s1.t1.c1 = t2.c1 AND s1.t1.c1 = t3.c1 AND s1.t1.c1 = s2.t1.c1;
/*+Leading(t1 t2 t3 t1)*/
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s2.t1 WHERE s1.t1.c1 = t2.c1 AND s1.t1.c1 = t3.c1 AND s1.t1.c1 = s2.t1.c1;
/*+Leading(s1.t1 t2 t3 s2.t1)*/
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s2.t1 WHERE s1.t1.c1 = t2.c1 AND s1.t1.c1 = t3.c1 AND s1.t1.c1 = s2.t1.c1;
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s2.t1 s2t1 WHERE s1.t1.c1 = t2.c1 AND s1.t1.c1 = t3.c1 AND s1.t1.c1 = s2t1.c1;
/*+Leading(s2t1 t1 t3 t2)*/
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s2.t1 s2t1 WHERE s1.t1.c1 = t2.c1 AND s1.t1.c1 = t3.c1 AND s1.t1.c1 = s2t1.c1;
-- No. L-1-4-3
EXPLAIN (COSTS false) SELECT *, (SELECT max(t1.c1) FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1) FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
/*+Leading(t4 t2 t3 t1)*/
EXPLAIN (COSTS false) SELECT *, (SELECT max(t1.c1) FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1) FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
/*+Leading(st1 st2 st3 st4)Leading(t4 t2 t3 t1)*/
EXPLAIN (COSTS false) SELECT *, (SELECT max(st1.c1) FROM s1.t1 st1, s1.t2 st2, s1.t3 st3, s1.t4 st4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1) FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
----
---- No. L-1-5 conflict table name
----
-- No. L-1-5-1
/*+Leading(t4 t2 t3 t1)*/
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-- No. L-1-5-2
/*+Leading(t4 t2 t3 t1 t4)*/
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
/*+Leading(t4 t2 t3 t4)*/
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-- No. L-1-5-3
/*+Leading(t4 t2 t3 t1 t4 t2 t3 t1)*/
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
/*+Leading(t4 t2 t2 t4)*/
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
----
---- No. L-1-6 object type for the hint
----
-- No. L-1-6-1
/*+Leading(t4 t2 t3 t1)*/
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-- No. L-1-6-2
EXPLAIN (COSTS false) SELECT * FROM s1.p1 t1, s1.p1 t2, s1.p1 t3, s1.p1 t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
/*+Leading(t4 t3 t2 t1)*/
EXPLAIN (COSTS false) SELECT * FROM s1.p1 t1, s1.p1 t2, s1.p1 t3, s1.p1 t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-- No. L-1-6-3
EXPLAIN (COSTS false) SELECT * FROM s1.ul1 t1, s1.ul1 t2, s1.ul1 t3, s1.ul1 t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
/*+Leading(t4 t3 t2 t1)*/
EXPLAIN (COSTS false) SELECT * FROM s1.ul1 t1, s1.ul1 t2, s1.ul1 t3, s1.ul1 t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-- No. L-1-6-4
CREATE TEMP TABLE tm1 (LIKE s1.t1 INCLUDING ALL);
EXPLAIN (COSTS false) SELECT * FROM tm1 t1, tm1 t2, tm1 t3, tm1 t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
/*+Leading(t4 t3 t2 t1)*/
EXPLAIN (COSTS false) SELECT * FROM tm1 t1, tm1 t2, tm1 t3, tm1 t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-- No. L-1-6-5
EXPLAIN (COSTS false) SELECT * FROM pg_catalog.pg_class t1, pg_catalog.pg_class t2, pg_catalog.pg_class t3, pg_catalog.pg_class t4 WHERE t1.oid = t2.oid AND t1.oid = t3.oid AND t1.oid = t4.oid;
/*+Leading(t4 t3 t2 t1)*/
EXPLAIN (COSTS false) SELECT * FROM pg_catalog.pg_class t1, pg_catalog.pg_class t2, pg_catalog.pg_class t3, pg_catalog.pg_class t4 WHERE t1.oid = t2.oid AND t1.oid = t3.oid AND t1.oid = t4.oid;
-- No. L-1-6-6
-- refer ut-fdw.sql
-- No. L-1-6-7
EXPLAIN (COSTS false) SELECT * FROM s1.f1() t1, s1.f1() t2, s1.f1() t3, s1.f1() t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
/*+Leading(t4 t3 t2 t1)*/
EXPLAIN (COSTS false) SELECT * FROM s1.f1() t1, s1.f1() t2, s1.f1() t3, s1.f1() t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-- No. L-1-6-8
EXPLAIN (COSTS false) SELECT * FROM (VALUES(1,1,1,'1'), (2,2,2,'2')) AS t1 (c1, c2, c3, c4), s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
/*+Leading(t4 t3 t2 t1)*/
EXPLAIN (COSTS false) SELECT * FROM (VALUES(1,1,1,'1'), (2,2,2,'2')) AS t1 (c1, c2, c3, c4), s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-- No. L-1-6-9
EXPLAIN (COSTS false) WITH c1(c1) AS (SELECT st1.c1 FROM s1.t1 st1, s1.t1 st2, s1.t1 st3, s1.t1 st4 WHERE st1.c1 = st2.c1 AND st1.c1 = st3.c1 AND st1.c1 = st4.c1) SELECT * FROM c1 ct1, c1 ct2, c1 ct3, c1 ct4 WHERE ct1.c1 = ct2.c1 AND ct1.c1 = ct3.c1 AND ct1.c1 = ct4.c1;
/*+Leading(ct4 ct3 ct2 ct1)Leading(st4 st3 st2 st1)*/
EXPLAIN (COSTS false) WITH c1(c1) AS (SELECT st1.c1 FROM s1.t1 st1, s1.t1 st2, s1.t1 st3, s1.t1 st4 WHERE st1.c1 = st2.c1 AND st1.c1 = st3.c1 AND st1.c1 = st4.c1) SELECT * FROM c1 ct1, c1 ct2, c1 ct3, c1 ct4 WHERE ct1.c1 = ct2.c1 AND ct1.c1 = ct3.c1 AND ct1.c1 = ct4.c1;
-- No. L-1-6-10
EXPLAIN (COSTS false) SELECT * FROM s1.v1 t1, s1.v1 t2, s1.v1 t3, s1.v1 t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
/*+Leading(t4 t3 t2 t1)*/
EXPLAIN (COSTS false) SELECT * FROM s1.v1 t1, s1.v1 t2, s1.v1 t3, s1.v1 t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
EXPLAIN (COSTS false) SELECT * FROM s1.v1 t1, s1.v1_ t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
/*+Leading(t4 v1t1_ v1t1 t3)*/
EXPLAIN (COSTS false) SELECT * FROM s1.v1 t1, s1.v1_ t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-- No. L-1-6-11
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, (SELECT t4.c1 FROM s1.t4) st4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = st4.c1;
/*+Leading(st4 t2 t3 t1)*/
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, (SELECT t4.c1 FROM s1.t4) st4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = st4.c1;
/*+Leading(t4 t2 t3 t1)*/
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, (SELECT t4.c1 FROM s1.t4) st4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = st4.c1;
----
---- No. L-2-1 some complexity query blocks
----
-- No. L-2-1-1
EXPLAIN (COSTS false)
SELECT max(bmt1.c1), (
SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)'
), (
SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = b2t2.c1 AND b2t2.ctid = '(1,1)' AND b2t1.c1 = b2t3.c1 AND b2t3.ctid = '(1,1)' AND b2t1.c1 = b2t4.c1 AND b2t4.ctid = '(1,1)'
)
FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = bmt3.c1 AND bmt3.ctid = '(1,1)' AND bmt1.c1 = bmt4.c1 AND bmt4.ctid = '(1,1)'
;
/*+
Leading(bmt1 bmt2 bmt3 bmt4)
Leading(b1t2 b1t3 b1t4 b1t1)
Leading(b2t3 b2t4 b2t1 b2t2)
*/
EXPLAIN (COSTS false)
SELECT max(bmt1.c1), (
SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)'
), (
SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = b2t2.c1 AND b2t2.ctid = '(1,1)' AND b2t1.c1 = b2t3.c1 AND b2t3.ctid = '(1,1)' AND b2t1.c1 = b2t4.c1 AND b2t4.ctid = '(1,1)'
)
FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = bmt3.c1 AND bmt3.ctid = '(1,1)' AND bmt1.c1 = bmt4.c1 AND bmt4.ctid = '(1,1)'
;
-- No. L-2-1-2
EXPLAIN (COSTS false)
SELECT max(bmt1.c1), (
SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)'
), (
SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = b2t2.c1 AND b2t2.ctid = '(1,1)' AND b2t1.c1 = b2t3.c1 AND b2t3.ctid = '(1,1)' AND b2t1.c1 = b2t4.c1 AND b2t4.ctid = '(1,1)'
), (
SELECT max(b3t1.c1) FROM s1.t1 b3t1, s1.t2 b3t2, s1.t3 b3t3, s1.t4 b3t4 WHERE b3t1.ctid = '(1,1)' AND b3t1.c1 = b3t2.c1 AND b3t2.ctid = '(1,1)' AND b3t1.c1 = b3t3.c1 AND b3t3.ctid = '(1,1)' AND b3t1.c1 = b3t4.c1 AND b3t4.ctid = '(1,1)'
)
FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = bmt3.c1 AND bmt3.ctid = '(1,1)' AND bmt1.c1 = bmt4.c1 AND bmt4.ctid = '(1,1)'
;
/*+
Leading(bmt1 bmt2 bmt3 bmt4)
Leading(b1t2 b1t3 b1t4 b1t1)
Leading(b2t3 b2t4 b2t1 b2t2)
Leading(b3t4 b3t1 b3t2 b3t3)
*/
EXPLAIN (COSTS false)
SELECT max(bmt1.c1), (
SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)'
), (
SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = b2t2.c1 AND b2t2.ctid = '(1,1)' AND b2t1.c1 = b2t3.c1 AND b2t3.ctid = '(1,1)' AND b2t1.c1 = b2t4.c1 AND b2t4.ctid = '(1,1)'
), (
SELECT max(b3t1.c1) FROM s1.t1 b3t1, s1.t2 b3t2, s1.t3 b3t3, s1.t4 b3t4 WHERE b3t1.ctid = '(1,1)' AND b3t1.c1 = b3t2.c1 AND b3t2.ctid = '(1,1)' AND b3t1.c1 = b3t3.c1 AND b3t3.ctid = '(1,1)' AND b3t1.c1 = b3t4.c1 AND b3t4.ctid = '(1,1)'
)
FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = bmt3.c1 AND bmt3.ctid = '(1,1)' AND bmt1.c1 = bmt4.c1 AND bmt4.ctid = '(1,1)'
;
-- No. L-2-1-3
EXPLAIN (COSTS false) SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, (SELECT ctid, * FROM s1.t3 bmt3) sbmt3, (SELECT ctid, * FROM s1.t4 bmt4) sbmt4 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = sbmt3.c1 AND sbmt3.ctid = '(1,1)' AND bmt1.c1 = sbmt4.c1 AND sbmt4.ctid = '(1,1)';
/*+
Leading(bmt4 bmt3 bmt2 bmt1)
*/
EXPLAIN (COSTS false) SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, (SELECT ctid, * FROM s1.t3 bmt3) sbmt3, (SELECT ctid, * FROM s1.t4 bmt4) sbmt4 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = sbmt3.c1 AND sbmt3.ctid = '(1,1)' AND bmt1.c1 = sbmt4.c1 AND sbmt4.ctid = '(1,1)';
-- No. L-2-1-4
EXPLAIN (COSTS false) SELECT max(bmt1.c1) FROM s1.t1 bmt1, (SELECT ctid, * FROM s1.t2 bmt2) sbmt2, (SELECT ctid, * FROM s1.t3 bmt3) sbmt3, (SELECT ctid, * FROM s1.t4 bmt4) sbmt4 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = sbmt2.c1 AND sbmt2.ctid = '(1,1)' AND bmt1.c1 = sbmt3.c1 AND sbmt3.ctid = '(1,1)' AND bmt1.c1 = sbmt4.c1 AND sbmt4.ctid = '(1,1)';
/*+
Leading(bmt4 bmt3 bmt2 bmt1)
*/
EXPLAIN (COSTS false) SELECT max(bmt1.c1) FROM s1.t1 bmt1, (SELECT ctid, * FROM s1.t2 bmt2) sbmt2, (SELECT ctid, * FROM s1.t3 bmt3) sbmt3, (SELECT ctid, * FROM s1.t4 bmt4) sbmt4 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = sbmt2.c1 AND sbmt2.ctid = '(1,1)' AND bmt1.c1 = sbmt3.c1 AND sbmt3.ctid = '(1,1)' AND bmt1.c1 = sbmt4.c1 AND sbmt4.ctid = '(1,1)';
-- No. L-2-1-5
EXPLAIN (COSTS false)
SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = bmt3.c1 AND bmt3.ctid = '(1,1)' AND bmt1.c1 = bmt4.c1 AND bmt4.ctid = '(1,1)'
AND bmt1.c1 <> (
SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)'
) AND bmt1.c1 <> (
SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = b2t2.c1 AND b2t2.ctid = '(1,1)' AND b2t1.c1 = b2t3.c1 AND b2t3.ctid = '(1,1)' AND b2t1.c1 = b2t4.c1 AND b2t4.ctid = '(1,1)'
)
;
/*+
Leading(bmt1 bmt2 bmt3 bmt4)
Leading(b1t2 b1t3 b1t4 b1t1)
Leading(b2t3 b2t4 b2t1 b2t2)
*/
EXPLAIN (COSTS false)
SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = bmt3.c1 AND bmt3.ctid = '(1,1)' AND bmt1.c1 = bmt4.c1 AND bmt4.ctid = '(1,1)'
AND bmt1.c1 <> (
SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)'
) AND bmt1.c1 <> (
SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = b2t2.c1 AND b2t2.ctid = '(1,1)' AND b2t1.c1 = b2t3.c1 AND b2t3.ctid = '(1,1)' AND b2t1.c1 = b2t4.c1 AND b2t4.ctid = '(1,1)'
)
;
-- No. L-2-1-6
EXPLAIN (COSTS false)
SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = bmt3.c1 AND bmt3.ctid = '(1,1)' AND bmt1.c1 = bmt4.c1 AND bmt4.ctid = '(1,1)'
AND bmt1.c1 <> (
SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)'
) AND bmt1.c1 <> (
SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = b2t2.c1 AND b2t2.ctid = '(1,1)' AND b2t1.c1 = b2t3.c1 AND b2t3.ctid = '(1,1)' AND b2t1.c1 = b2t4.c1 AND b2t4.ctid = '(1,1)'
) AND bmt1.c1 <> (
SELECT max(b3t1.c1) FROM s1.t1 b3t1, s1.t2 b3t2, s1.t3 b3t3, s1.t4 b3t4 WHERE b3t1.ctid = '(1,1)' AND b3t1.c1 = b3t2.c1 AND b3t2.ctid = '(1,1)' AND b3t1.c1 = b3t3.c1 AND b3t3.ctid = '(1,1)' AND b3t1.c1 = b3t4.c1 AND b3t4.ctid = '(1,1)'
)
;
/*+
Leading(bmt1 bmt2 bmt3 bmt4)
Leading(b1t2 b1t3 b1t4 b1t1)
Leading(b2t3 b2t4 b2t1 b2t2)
Leading(b3t4 b3t1 b3t2 b3t3)
*/
EXPLAIN (COSTS false)
SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = bmt3.c1 AND bmt3.ctid = '(1,1)' AND bmt1.c1 = bmt4.c1 AND bmt4.ctid = '(1,1)'
AND bmt1.c1 <> (
SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)'
) AND bmt1.c1 <> (
SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = b2t2.c1 AND b2t2.ctid = '(1,1)' AND b2t1.c1 = b2t3.c1 AND b2t3.ctid = '(1,1)' AND b2t1.c1 = b2t4.c1 AND b2t4.ctid = '(1,1)'
) AND bmt1.c1 <> (
SELECT max(b3t1.c1) FROM s1.t1 b3t1, s1.t2 b3t2, s1.t3 b3t3, s1.t4 b3t4 WHERE b3t1.ctid = '(1,1)' AND b3t1.c1 = b3t2.c1 AND b3t2.ctid = '(1,1)' AND b3t1.c1 = b3t3.c1 AND b3t3.ctid = '(1,1)' AND b3t1.c1 = b3t4.c1 AND b3t4.ctid = '(1,1)'
)
;
-- No. L-2-1-7
EXPLAIN (COSTS false)
WITH c1 (c1) AS (
SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)'
)
, c2 (c1) AS (
SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = b2t2.c1 AND b2t2.ctid = '(1,1)' AND b2t1.c1 = b2t3.c1 AND b2t3.ctid = '(1,1)' AND b2t1.c1 = b2t4.c1 AND b2t4.ctid = '(1,1)'
)
SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4
, c1, c2
WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = bmt3.c1 AND bmt3.ctid = '(1,1)' AND bmt1.c1 = bmt4.c1 AND bmt4.ctid = '(1,1)'
AND bmt1.c1 = c1.c1
AND bmt1.c1 = c2.c1
;
/*+
Leading(c2 c1 bmt1 bmt2 bmt3 bmt4)
Leading(b1t2 b1t3 b1t4 b1t1)
Leading(b2t3 b2t4 b2t1 b2t2)
*/
EXPLAIN (COSTS false)
WITH c1 (c1) AS (
SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)'
)
, c2 (c1) AS (
SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = b2t2.c1 AND b2t2.ctid = '(1,1)' AND b2t1.c1 = b2t3.c1 AND b2t3.ctid = '(1,1)' AND b2t1.c1 = b2t4.c1 AND b2t4.ctid = '(1,1)'
)
SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4
, c1, c2
WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = bmt3.c1 AND bmt3.ctid = '(1,1)' AND bmt1.c1 = bmt4.c1 AND bmt4.ctid = '(1,1)'
AND bmt1.c1 = c1.c1
AND bmt1.c1 = c2.c1
;
-- No. L-2-1-8
EXPLAIN (COSTS false)
WITH c1 (c1) AS (
SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)'
)
, c2 (c1) AS (
SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = b2t2.c1 AND b2t2.ctid = '(1,1)' AND b2t1.c1 = b2t3.c1 AND b2t3.ctid = '(1,1)' AND b2t1.c1 = b2t4.c1 AND b2t4.ctid = '(1,1)'
)
, c3 (c1) AS (
SELECT max(b3t1.c1) FROM s1.t1 b3t1, s1.t2 b3t2, s1.t3 b3t3, s1.t4 b3t4 WHERE b3t1.ctid = '(1,1)' AND b3t1.c1 = b3t2.c1 AND b3t2.ctid = '(1,1)' AND b3t1.c1 = b3t3.c1 AND b3t3.ctid = '(1,1)' AND b3t1.c1 = b3t4.c1 AND b3t4.ctid = '(1,1)'
)
SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4
, c1, c2, c3
WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = bmt3.c1 AND bmt3.ctid = '(1,1)' AND bmt1.c1 = bmt4.c1 AND bmt4.ctid = '(1,1)'
AND bmt1.c1 = c1.c1
AND bmt1.c1 = c2.c1
AND bmt1.c1 = c3.c1
;
/*+
Leading(c3 c2 c1 bmt1 bmt2 bmt3 bmt4)
Leading(b1t2 b1t3 b1t4 b1t1)
Leading(b2t3 b2t4 b2t1 b2t2)
Leading(b3t4 b3t1 b3t2 b3t3)
*/
EXPLAIN (COSTS false)
WITH c1 (c1) AS (
SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)'
)
, c2 (c1) AS (
SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = b2t2.c1 AND b2t2.ctid = '(1,1)' AND b2t1.c1 = b2t3.c1 AND b2t3.ctid = '(1,1)' AND b2t1.c1 = b2t4.c1 AND b2t4.ctid = '(1,1)'
)
, c3 (c1) AS (
SELECT max(b3t1.c1) FROM s1.t1 b3t1, s1.t2 b3t2, s1.t3 b3t3, s1.t4 b3t4 WHERE b3t1.ctid = '(1,1)' AND b3t1.c1 = b3t2.c1 AND b3t2.ctid = '(1,1)' AND b3t1.c1 = b3t3.c1 AND b3t3.ctid = '(1,1)' AND b3t1.c1 = b3t4.c1 AND b3t4.ctid = '(1,1)'
)
SELECT max(bmt1.c1) FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4
, c1, c2, c3
WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = bmt3.c1 AND bmt3.ctid = '(1,1)' AND bmt1.c1 = bmt4.c1 AND bmt4.ctid = '(1,1)'
AND bmt1.c1 = c1.c1
AND bmt1.c1 = c2.c1
AND bmt1.c1 = c3.c1
;
----
---- No. L-2-2 the number of the tables per quiry block
----
-- No. L-2-2-1
EXPLAIN (COSTS false)
WITH c1 (c1) AS (
SELECT max(b1t1.c1) FROM s1.t1 b1t1 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = 1
)
SELECT max(bmt1.c1), (
SELECT max(b2t1.c1) FROM s1.t1 b2t1 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = 1
)
FROM s1.t1 bmt1, c1 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = 1
AND bmt1.c1 <> (
SELECT max(b3t1.c1) FROM s1.t1 b3t1 WHERE b3t1.ctid = '(1,1)' AND b3t1.c1 = 1
)
;
/*+
Leading(c1 bmt1)
*/
EXPLAIN (COSTS false)
WITH c1 (c1) AS (
SELECT max(b1t1.c1) FROM s1.t1 b1t1 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = 1
)
SELECT max(bmt1.c1), (
SELECT max(b2t1.c1) FROM s1.t1 b2t1 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = 1
)
FROM s1.t1 bmt1, c1 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = 1
AND bmt1.c1 <> (
SELECT max(b3t1.c1) FROM s1.t1 b3t1 WHERE b3t1.ctid = '(1,1)' AND b3t1.c1 = 1
)
;
-- No. L-2-2-2
EXPLAIN (COSTS false)
WITH c1 (c1) AS (
SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)'
)
SELECT max(bmt1.c1), (
SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = b2t2.c1 AND b2t2.ctid = '(1,1)'
)
FROM s1.t1 bmt1, s1.t2 bmt2, c1 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)'
AND bmt1.c1 = c1.c1
AND bmt1.c1 <> (
SELECT max(b3t1.c1) FROM s1.t1 b3t1, s1.t2 b3t2 WHERE b3t1.ctid = '(1,1)' AND b3t1.c1 = b3t2.c1 AND b3t2.ctid = '(1,1)'
)
;
/*+
Leading(c1 bmt2 bmt1)
Leading(b1t2 b1t1)
Leading(b2t2 b2t1)
Leading(b3t2 b3t1)
*/
EXPLAIN (COSTS false)
WITH c1 (c1) AS (
SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)'
)
SELECT max(bmt1.c1), (
SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = b2t2.c1 AND b2t2.ctid = '(1,1)'
)
FROM s1.t1 bmt1, s1.t2 bmt2, c1 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)'
AND bmt1.c1 = c1.c1
AND bmt1.c1 <> (
SELECT max(b3t1.c1) FROM s1.t1 b3t1, s1.t2 b3t2 WHERE b3t1.ctid = '(1,1)' AND b3t1.c1 = b3t2.c1 AND b3t2.ctid = '(1,1)'
)
;
-- No. L-2-2-3
EXPLAIN (COSTS false)
WITH c1 (c1) AS (
SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)'
)
SELECT max(bmt1.c1), (
SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = b2t2.c1 AND b2t2.ctid = '(1,1)' AND b2t1.c1 = b2t3.c1 AND b2t3.ctid = '(1,1)' AND b2t1.c1 = b2t4.c1 AND b2t4.ctid = '(1,1)'
)
FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4, c1 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = bmt3.c1 AND bmt3.ctid = '(1,1)' AND bmt1.c1 = bmt4.c1 AND bmt4.ctid = '(1,1)' AND bmt1.c1 = c1.c1
AND bmt1.c1 <> (
SELECT max(b3t1.c1) FROM s1.t1 b3t1, s1.t2 b3t2, s1.t3 b3t3, s1.t4 b3t4 WHERE b3t1.ctid = '(1,1)' AND b3t1.c1 = b3t2.c1 AND b3t2.ctid = '(1,1)' AND b3t1.c1 = b3t3.c1 AND b3t3.ctid = '(1,1)' AND b3t1.c1 = b3t4.c1 AND b3t4.ctid = '(1,1)'
)
;
/*+
Leading(c1 bmt4 bmt3 bmt2 bmt1)
Leading(b1t4 b1t3 b1t2 b1t1)
Leading(b2t4 b2t3 b2t2 b2t1)
Leading(b3t4 b3t3 b3t2 b3t1)
*/
EXPLAIN (COSTS false)
WITH c1 (c1) AS (
SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)'
)
SELECT max(bmt1.c1), (
SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = b2t2.c1 AND b2t2.ctid = '(1,1)' AND b2t1.c1 = b2t3.c1 AND b2t3.ctid = '(1,1)' AND b2t1.c1 = b2t4.c1 AND b2t4.ctid = '(1,1)'
)
FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4, c1 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = bmt3.c1 AND bmt3.ctid = '(1,1)' AND bmt1.c1 = bmt4.c1 AND bmt4.ctid = '(1,1)' AND bmt1.c1 = c1.c1
AND bmt1.c1 <> (
SELECT max(b3t1.c1) FROM s1.t1 b3t1, s1.t2 b3t2, s1.t3 b3t3, s1.t4 b3t4 WHERE b3t1.ctid = '(1,1)' AND b3t1.c1 = b3t2.c1 AND b3t2.ctid = '(1,1)' AND b3t1.c1 = b3t3.c1 AND b3t3.ctid = '(1,1)' AND b3t1.c1 = b3t4.c1 AND b3t4.ctid = '(1,1)'
)
;
-- No. L-2-2-4
EXPLAIN (COSTS false)
WITH c1 (c1) AS (
SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)'
)
SELECT max(bmt1.c1), (
SELECT max(b2t1.c1) FROM s1.t1 b2t1 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = 1
)
FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4, c1 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = bmt3.c1 AND bmt3.ctid = '(1,1)' AND bmt1.c1 = bmt4.c1 AND bmt4.ctid = '(1,1)' AND bmt1.c1 = c1.c1
AND bmt1.c1 <> (
SELECT max(b3t1.c1) FROM s1.t1 b3t1 WHERE b3t1.ctid = '(1,1)'
)
;
/*+
Leading(c1 bmt4 bmt3 bmt2 bmt1)
Leading(b1t4 b1t3 b1t2 b1t1)
*/
EXPLAIN (COSTS false)
WITH c1 (c1) AS (
SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)'
)
SELECT max(bmt1.c1), (
SELECT max(b2t1.c1) FROM s1.t1 b2t1 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = 1
)
FROM s1.t1 bmt1, s1.t2 bmt2, s1.t3 bmt3, s1.t4 bmt4, c1 WHERE bmt1.ctid = '(1,1)' AND bmt1.c1 = bmt2.c1 AND bmt2.ctid = '(1,1)' AND bmt1.c1 = bmt3.c1 AND bmt3.ctid = '(1,1)' AND bmt1.c1 = bmt4.c1 AND bmt4.ctid = '(1,1)' AND bmt1.c1 = c1.c1
AND bmt1.c1 <> (
SELECT max(b3t1.c1) FROM s1.t1 b3t1 WHERE b3t1.ctid = '(1,1)'
)
;
----
---- No. L-2-3 RULE or VIEW
----
-- No. L-2-3-1
EXPLAIN (COSTS false) UPDATE s1.r1 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
/*+ Leading(t4 t3 t2 t1 r1) */
EXPLAIN (COSTS false) UPDATE s1.r1 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
EXPLAIN (COSTS false) UPDATE s1.r1_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
/*+ Leading(b1t1 b1t2 b1t3 b1t4 r1_) */
EXPLAIN (COSTS false) UPDATE s1.r1_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
-- No. L-2-3-2
EXPLAIN (COSTS false) UPDATE s1.r2 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
/*+ Leading(t4 t3 t2 t1 r2) */
EXPLAIN (COSTS false) UPDATE s1.r2 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
EXPLAIN (COSTS false) UPDATE s1.r2_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
/*+
Leading(b1t1 b1t2 b1t3 b1t4 r2_)
Leading(b2t1 b2t2 b2t3 b2t4 r2_)
*/
EXPLAIN (COSTS false) UPDATE s1.r2_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
-- No. L-2-3-3
EXPLAIN (COSTS false) UPDATE s1.r3 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
/*+ Leading(t4 t3 t2 t1 r3) */
EXPLAIN (COSTS false) UPDATE s1.r3 SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
EXPLAIN (COSTS false) UPDATE s1.r3_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
/*+
Leading(b1t1 b1t2 b1t3 b1t4 r3_)
Leading(b2t1 b2t2 b2t3 b2t4 r3_)
Leading(b3t1 b3t2 b3t3 b3t4 r3_)
*/
EXPLAIN (COSTS false) UPDATE s1.r3_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)';
-- No. L-2-3-4
EXPLAIN (COSTS false) SELECT * FROM s1.v1 v1, s1.v1 v2 WHERE v1.c1 = v2.c1;
/*+Leading(v1t1 v1t1)*/
EXPLAIN (COSTS false) SELECT * FROM s1.v1 v1, s1.v1 v2 WHERE v1.c1 = v2.c1;
-- No. L-2-3-5
EXPLAIN (COSTS false) SELECT * FROM s1.v1 v1, s1.v1_ v2 WHERE v1.c1 = v2.c1;
/*+Leading(v1t1 v1t1_)*/
EXPLAIN (COSTS false) SELECT * FROM s1.v1 v1, s1.v1_ v2 WHERE v1.c1 = v2.c1;
-- No. L-2-3-6
EXPLAIN (COSTS false) SELECT * FROM s1.r4 t1, s1.r4 t2 WHERE t1.c1 = t2.c1;
/*+Leading(r4t1 r4t1)*/
EXPLAIN (COSTS false) SELECT * FROM s1.r4 t1, s1.r4 t2 WHERE t1.c1 = t2.c1;
-- No. L-2-3-7
EXPLAIN (COSTS false) SELECT * FROM s1.r4 t1, s1.r5 t2 WHERE t1.c1 = t2.c1;
/*+Leading(r4t1 r5t1)*/
EXPLAIN (COSTS false) SELECT * FROM s1.r4 t1, s1.r5 t2 WHERE t1.c1 = t2.c1;
----
---- No. L-2-4 VALUES clause
----
-- No. L-2-4-1
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, (VALUES(1,1,1,'1'), (2,2,2,'2')) AS t3 (c1, c2, c3, c4) WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1;
/*+ Leading(t3 t1 t2) */
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, (VALUES(1,1,1,'1'), (2,2,2,'2')) AS t3 (c1, c2, c3, c4) WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1;
/*+ Leading(*VALUES* t1 t2) */
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, (VALUES(1,1,1,'1'), (2,2,2,'2')) AS t3 (c1, c2, c3, c4) WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1;
-- No. L-2-4-2
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, (VALUES(1,1,1,'1'), (2,2,2,'2')) AS t3 (c1, c2, c3, c4), (VALUES(1,1,1,'1'), (2,2,2,'2')) AS t4 (c1, c2, c3, c4) WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
/*+ Leading(t4 t3 t2 t1) */
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, (VALUES(1,1,1,'1'), (2,2,2,'2')) AS t3 (c1, c2, c3, c4), (VALUES(1,1,1,'1'), (2,2,2,'2')) AS t4 (c1, c2, c3, c4) WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
/*+ Leading(*VALUES* t3 t2 t1) */
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, (VALUES(1,1,1,'1'), (2,2,2,'2')) AS t3 (c1, c2, c3, c4), (VALUES(1,1,1,'1'), (2,2,2,'2')) AS t4 (c1, c2, c3, c4) WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
----
---- No. L-3-1 leading the order of table joins
----
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1;
-- No. L-3-1-1
/*+Leading(t3 t1 t2)*/
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1;
-- No. L-3-1-2
/*+Leading(t1 t2 t3)*/
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1;
----
---- No. L-3-2 GUC parameter to disable hints
----
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1;
-- No. L-3-2-1
Set geqo_threshold = 3;
Set geqo_seed = 0;
/*+Leading(t1 t2 t3)*/
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1;
Reset geqo_threshold;
-- No. L-3-2-2
Set geqo_threshold = 4;
Set geqo_seed = 0;
/*+Leading(t1 t2 t3)*/
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1;
Reset geqo_threshold;
-- No. L-3-2-3
Set from_collapse_limit = 2;
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.v2 WHERE t1.c1 = v2.c1;
/*+Leading(t1 v2t1 v2t2)*/
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.v2 WHERE t1.c1 = v2.c1;
Reset from_collapse_limit;
-- No. L-3-2-4
Set from_collapse_limit = 3;
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.v2 WHERE t1.c1 = v2.c1;
/*+Leading(v2t1 v2t2 t1)*/
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.v2 WHERE t1.c1 = v2.c1;
Reset from_collapse_limit;
-- No. L-3-2-5
Set join_collapse_limit = 2;
EXPLAIN (COSTS false) SELECT * FROM s1.t3
JOIN s1.t2 ON (t3.c1 = t2.c1)
JOIN s1.t1 ON (t1.c1 = t3.c1);
/*+Leading(t1 t2 t3)*/
EXPLAIN (COSTS false) SELECT * FROM s1.t3
JOIN s1.t2 ON (t3.c1 = t2.c1)
JOIN s1.t1 ON (t1.c1 = t3.c1);
Reset join_collapse_limit;
-- No. L-3-2-6
Set join_collapse_limit = 3;
EXPLAIN (COSTS false) SELECT * FROM s1.t3
JOIN s1.t2 ON (t3.c1 = t2.c1)
JOIN s1.t1 ON (t1.c1 = t3.c1);
/*+Leading(t1 t2 t3)*/
EXPLAIN (COSTS false) SELECT * FROM s1.t3
JOIN s1.t2 ON (t3.c1 = t2.c1)
JOIN s1.t1 ON (t1.c1 = t3.c1);
Reset join_collapse_limit;
----
---- No. L-3-3 join between parents or between children
----
-- No. L-3-3-1
/*+Leading(t1 t2 t3)*/
EXPLAIN (COSTS false) SELECT * FROM s1.p2c1 t1
JOIN s1.p2c2 t2 ON (t1.c1 = t2.c1)
JOIN s1.p2c3 t3 ON (t1.c1 = t3.c1);
-- No. L-3-3-2
/*+Leading(p2c1c1 p2c2c1 p2c3c1)*/
EXPLAIN (COSTS false) SELECT * FROM s1.p2c1 t1
JOIN s1.p2c2 t2 ON (t1.c1 = t2.c1)
JOIN s1.p2c3 t3 ON (t1.c1 = t3.c1);
----
---- No. L-3-4 conflict leading hint
----
-- No. L-3-4-1
EXPLAIN (COSTS false) SELECT * FROM s1.t1
JOIN s1.t2 ON (t1.c1 = t2.c1)
JOIN s1.t3 ON (t1.c1 = t3.c1);
/*+Leading(t2 t3 t1)Leading(t1 t2 t3)*/
EXPLAIN (COSTS false) SELECT * FROM s1.t1
JOIN s1.t2 ON (t1.c1 = t2.c1)
JOIN s1.t3 ON (t1.c1 = t3.c1);
-- No. L-3-4-2
/*+Leading(t3 t1 t2)Leading(t2 t3 t1)Leading(t1 t2 t3)*/
EXPLAIN (COSTS false) SELECT * FROM s1.t1
JOIN s1.t2 ON (t1.c1 = t2.c1)
JOIN s1.t3 ON (t1.c1 = t3.c1);
-- No. L-3-4-3
/*+Leading(t2 t3 t1)Leading()*/
EXPLAIN (COSTS false) SELECT * FROM s1.t1
JOIN s1.t2 ON (t1.c1 = t2.c1)
JOIN s1.t3 ON (t1.c1 = t3.c1);
-- No. L-3-4-4
/*+Leading(t3 t1 t2)Leading(t2 t3 t1)Leading()*/
EXPLAIN (COSTS false) SELECT * FROM s1.t1
JOIN s1.t2 ON (t1.c1 = t2.c1)
JOIN s1.t3 ON (t1.c1 = t3.c1);
----
---- No. L-3-5 hint state output
----
-- No. L-3-5-1
/*+Leading()*/
EXPLAIN (COSTS false) SELECT * FROM s1.t1
JOIN s1.t2 ON (t1.c1 = t2.c1)
JOIN s1.t3 ON (t1.c1 = t3.c1);
-- No. L-3-5-2
/*+Leading(t1)*/
EXPLAIN (COSTS false) SELECT * FROM s1.t1
JOIN s1.t2 ON (t1.c1 = t2.c1)
JOIN s1.t3 ON (t1.c1 = t3.c1);
-- No. L-3-5-3
/*+Leading(t1 t2)*/
EXPLAIN (COSTS false) SELECT * FROM s1.t1
JOIN s1.t2 ON (t1.c1 = t2.c1)
JOIN s1.t3 ON (t1.c1 = t3.c1);
-- No. L-3-5-4
/*+Leading(t1 t2 t3)*/
EXPLAIN (COSTS false) SELECT * FROM s1.t1
JOIN s1.t2 ON (t1.c1 = t2.c1)
JOIN s1.t3 ON (t1.c1 = t3.c1);
----
---- No. L-3-6 specified Inner/Outer side
----
-- No. L-3-6-1
/*+Leading((t2))*/
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-- No. L-3-6-2
/*+Leading((t2 t3))*/
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-- No. L-3-6-3
/*+Leading((t2 t3 t4))*/
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-- No. L-3-6-4
/*+Leading(((t1 t2) (t3 t4)))*/
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-- No. L-3-6-5
/*+Leading((((t1 t3) t4) t2)))*/
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-- No. L-3-6-6
/*+Leading((t1 (t3 (t4 t2))))*/
EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1; | the_stack |
-- // CLOUD-47417 Hibernate does not affect sequences
-- Migration SQL that makes the change goes here.
-- // regenerate sequence for table: recipe --------------
CREATE SEQUENCE recipe_id_seq START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE recipe
ALTER COLUMN id SET DEFAULT nextval ('recipe_id_seq');
SELECT setval ('recipe_id_seq',
(SELECT max (id) + 1
FROM recipe),
FALSE);
SELECT last_value FROM recipe_id_seq;
-- // regenerate sequence for table: securitygroup --------------
CREATE SEQUENCE securitygroup_id_seq START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE securitygroup
ALTER COLUMN id SET DEFAULT nextval ('securitygroup_id_seq');
DROP SEQUENCE IF EXISTS security_group_seq;
SELECT setval ('securitygroup_id_seq',
(SELECT max (id) + 1
FROM securitygroup),
FALSE);
SELECT last_value FROM securitygroup_id_seq;
-- // regenerate sequence for table: cluster --------------
CREATE SEQUENCE cluster_id_seq START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE cluster
ALTER COLUMN id SET DEFAULT nextval ('cluster_id_seq');
DROP SEQUENCE IF EXISTS cluster_seq;
SELECT setval ('cluster_id_seq',
(SELECT max (id) + 1
FROM cluster),
FALSE);
SELECT last_value FROM cluster_id_seq;
-- // regenerate sequence for table: securityrule --------------
CREATE SEQUENCE securityrule_id_seq START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE securityrule
ALTER COLUMN id SET DEFAULT nextval ('securityrule_id_seq');
DROP SEQUENCE IF EXISTS security_rule_seq;
SELECT setval ('securityrule_id_seq',
(SELECT max (id) + 1
FROM securityrule),
FALSE);
SELECT last_value FROM securityrule_id_seq;
-- // regenerate sequence for table: securityconfig --------------
CREATE SEQUENCE securityconfig_id_seq START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE securityconfig
ALTER COLUMN id SET DEFAULT nextval ('securityconfig_id_seq');
DROP SEQUENCE IF EXISTS securityconfig_table;
SELECT setval ('securityconfig_id_seq',
(SELECT max (id) + 1
FROM securityconfig),
FALSE);
SELECT last_value FROM securityconfig_id_seq;
-- // regenerate sequence for table: instancemetadata --------------
CREATE SEQUENCE instancemetadata_id_seq START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE instancemetadata
ALTER COLUMN id SET DEFAULT nextval ('instancemetadata_id_seq');
SELECT setval ('instancemetadata_id_seq',
(SELECT max (id) + 1
FROM instancemetadata),
FALSE);
SELECT last_value FROM instancemetadata_id_seq;
-- // regenerate sequence for table: network --------------
CREATE SEQUENCE network_id_seq START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE network
ALTER COLUMN id SET DEFAULT nextval ('network_id_seq');
DROP SEQUENCE IF EXISTS network_table;
SELECT setval ('network_id_seq',
(SELECT max (id) + 1
FROM network),
FALSE);
SELECT last_value FROM network_id_seq;
-- // regenerate sequence for table: ambaristackdetails --------------
CREATE SEQUENCE ambaristackdetails_id_seq START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE ambaristackdetails
ALTER COLUMN id SET DEFAULT nextval ('ambaristackdetails_id_seq');
DROP SEQUENCE IF EXISTS amb_stack_table;
SELECT setval ('ambaristackdetails_id_seq',
(SELECT max (id) + 1
FROM ambaristackdetails),
FALSE);
SELECT last_value FROM ambaristackdetails_id_seq;
-- // regenerate sequence for table: instancegroup --------------
CREATE SEQUENCE instancegroup_id_seq START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE instancegroup
ALTER COLUMN id SET DEFAULT nextval ('instancegroup_id_seq');
SELECT setval ('instancegroup_id_seq',
(SELECT max (id) + 1
FROM instancegroup),
FALSE);
SELECT last_value FROM instancegroup_id_seq;
-- // regenerate sequence for table: failurepolicy --------------
CREATE SEQUENCE failurepolicy_id_seq START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE failurepolicy
ALTER COLUMN id SET DEFAULT nextval ('failurepolicy_id_seq');
DROP SEQUENCE IF EXISTS sequence_table;
SELECT setval ('failurepolicy_id_seq',
(SELECT max (id) + 1
FROM failurepolicy),
FALSE);
SELECT last_value FROM failurepolicy_id_seq;
-- // regenerate sequence for table: template --------------
CREATE SEQUENCE template_id_seq START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE template
ALTER COLUMN id SET DEFAULT nextval ('template_id_seq');
SELECT setval ('template_id_seq',
(SELECT max (id) + 1
FROM template),
FALSE);
SELECT last_value FROM template_id_seq;
-- // regenerate sequence for table: cloudbreakevent --------------
CREATE SEQUENCE cloudbreakevent_id_seq START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE cloudbreakevent
ALTER COLUMN id SET DEFAULT nextval ('cloudbreakevent_id_seq');
DROP SEQUENCE IF EXISTS cloudbreakevent_seq;
SELECT setval ('cloudbreakevent_id_seq',
(SELECT max (id) + 1
FROM cloudbreakevent),
FALSE);
SELECT last_value FROM cloudbreakevent_id_seq;
-- // regenerate sequence for table: blueprint --------------
CREATE SEQUENCE blueprint_id_seq START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE blueprint
ALTER COLUMN id SET DEFAULT nextval ('blueprint_id_seq');
DROP SEQUENCE IF EXISTS blueprint_table;
SELECT setval ('blueprint_id_seq',
(SELECT max (id) + 1
FROM blueprint),
FALSE);
SELECT last_value FROM blueprint_id_seq;
-- // regenerate sequence for table: credential --------------
CREATE SEQUENCE credential_id_seq START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE credential
ALTER COLUMN id SET DEFAULT nextval ('credential_id_seq');
DROP SEQUENCE IF EXISTS credential_table;
SELECT setval ('credential_id_seq',
(SELECT max (id) + 1
FROM credential),
FALSE);
SELECT last_value FROM credential_id_seq;
-- // regenerate sequence for table: component --------------
CREATE SEQUENCE component_id_seq START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE component
ALTER COLUMN id SET DEFAULT nextval ('component_id_seq');
DROP SEQUENCE IF EXISTS component_table;
SELECT setval ('component_id_seq',
(SELECT max (id) + 1
FROM component),
FALSE);
SELECT last_value FROM component_id_seq;
-- // regenerate sequence for table: hostmetadata --------------
CREATE SEQUENCE hostmetadata_id_seq START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE hostmetadata
ALTER COLUMN id SET DEFAULT nextval ('hostmetadata_id_seq');
SELECT setval ('hostmetadata_id_seq',
(SELECT max (id) + 1
FROM hostmetadata),
FALSE);
SELECT last_value FROM hostmetadata_id_seq;
-- // regenerate sequence for table: stack --------------
CREATE SEQUENCE stack_id_seq START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE stack
ALTER COLUMN id SET DEFAULT nextval ('stack_id_seq');
DROP SEQUENCE IF EXISTS stack_table;
SELECT setval ('stack_id_seq',
(SELECT max (id) + 1
FROM stack),
FALSE);
SELECT last_value FROM stack_id_seq;
-- // regenerate sequence for table: subscription --------------
CREATE SEQUENCE subscription_id_seq START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE subscription
ALTER COLUMN id SET DEFAULT nextval ('subscription_id_seq');
SELECT setval ('subscription_id_seq',
(SELECT max (id) + 1
FROM subscription),
FALSE);
SELECT last_value FROM subscription_id_seq;
-- // regenerate sequence for table: resource --------------
CREATE SEQUENCE resource_id_seq START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE resource
ALTER COLUMN id SET DEFAULT nextval ('resource_id_seq');
SELECT setval ('resource_id_seq',
(SELECT max (id) + 1
FROM resource),
FALSE);
SELECT last_value FROM resource_id_seq;
-- // regenerate sequence for table: cloudbreakusage --------------
CREATE SEQUENCE cloudbreakusage_id_seq START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE cloudbreakusage
ALTER COLUMN id SET DEFAULT nextval ('cloudbreakusage_id_seq');
DROP SEQUENCE IF EXISTS cloudbreakusage_seq;
SELECT setval ('cloudbreakusage_id_seq',
(SELECT max (id) + 1
FROM cloudbreakusage),
FALSE);
SELECT last_value FROM cloudbreakusage_id_seq;
-- // regenerate sequence for table: hostgroup --------------
CREATE SEQUENCE hostgroup_id_seq START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE hostgroup
ALTER COLUMN id SET DEFAULT nextval ('hostgroup_id_seq');
SELECT setval ('hostgroup_id_seq',
(SELECT max (id) + 1
FROM hostgroup),
FALSE);
SELECT last_value FROM hostgroup_id_seq;
-- // regenerate sequence for table: filesystem --------------
CREATE SEQUENCE filesystem_id_seq START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE filesystem
ALTER COLUMN id SET DEFAULT nextval ('filesystem_id_seq');
DROP SEQUENCE IF EXISTS filesystem_table;
SELECT setval ('filesystem_id_seq',
(SELECT max (id) + 1
FROM filesystem),
FALSE);
SELECT last_value FROM filesystem_id_seq;
DROP SEQUENCE IF EXISTS hibernate_sequence;
-- //@UNDO
-- SQL to undo the change goes here.
-- // no way back the former version was totally wrong | the_stack |
-- 2019-01-25T17:32:26.871
-- 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,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAllowLogging,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsTranslated,IsUpdateable,Name,Updated,UpdatedBy,Version) VALUES (0,563987,54444,0,13,53304,'AD_Table_Process_ID',TO_TIMESTAMP('2019-01-25 17:32:26','YYYY-MM-DD HH24:MI:SS'),100,'D',10,'Y','Y','N','N','N','Y','Y','N','N','N','N','Table Process',TO_TIMESTAMP('2019-01-25 17:32:26','YYYY-MM-DD HH24:MI:SS'),100,1)
;
-- 2019-01-25T17:32:26.873
-- 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=563987 AND NOT EXISTS (SELECT 1 FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 2019-01-25T17:32:26.924
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DROP SEQUENCE IF EXISTS AD_TABLE_PROCESS_SEQ;
CREATE SEQUENCE AD_TABLE_PROCESS_SEQ INCREMENT 1 MINVALUE 1 MAXVALUE 2147483647 START 1000000
;
-- 2019-01-25T17:32:26.948
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
-- addded in a dedicated SQL
--ALTER TABLE AD_Table_Process ADD COLUMN AD_Table_Process_ID numeric(10,0)
--;
commit;
-- 2019-01-25T17:32:27.022
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540339 WHERE 1=1 AND AD_Process_ID=100.000000 AND AD_Table_ID=177.000000
;
-- 2019-01-25T17:32:27.090
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540340 WHERE 1=1 AND AD_Process_ID=103.000000 AND AD_Table_ID=295.000000
;
-- 2019-01-25T17:32:27.151
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540341 WHERE 1=1 AND AD_Process_ID=112.000000 AND AD_Table_ID=395.000000
;
-- 2019-01-25T17:32:27.211
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540342 WHERE 1=1 AND AD_Process_ID=113.000000 AND AD_Table_ID=105.000000
;
-- 2019-01-25T17:32:27.270
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540343 WHERE 1=1 AND AD_Process_ID=114.000000 AND AD_Table_ID=106.000000
;
-- 2019-01-25T17:32:27.336
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540344 WHERE 1=1 AND AD_Process_ID=135.000000 AND AD_Table_ID=381.000000
;
-- 2019-01-25T17:32:27.396
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540345 WHERE 1=1 AND AD_Process_ID=136.000000 AND AD_Table_ID=53018.000000
;
-- 2019-01-25T17:32:27.461
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540346 WHERE 1=1 AND AD_Process_ID=140.000000 AND AD_Table_ID=401.000000
;
-- 2019-01-25T17:32:27.545
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540347 WHERE 1=1 AND AD_Process_ID=142.000000 AND AD_Table_ID=318.000000
;
-- 2019-01-25T17:32:27.627
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540348 WHERE 1=1 AND AD_Process_ID=156.000000 AND AD_Table_ID=426.000000
;
-- 2019-01-25T17:32:27.702
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540349 WHERE 1=1 AND AD_Process_ID=156.000000 AND AD_Table_ID=499.000000
;
-- 2019-01-25T17:32:27.763
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540350 WHERE 1=1 AND AD_Process_ID=167.000000 AND AD_Table_ID=145.000000
;
-- 2019-01-25T17:32:27.825
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540351 WHERE 1=1 AND AD_Process_ID=173.000000 AND AD_Table_ID=100.000000
;
-- 2019-01-25T17:32:27.913
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540352 WHERE 1=1 AND AD_Process_ID=174.000000 AND AD_Table_ID=106.000000
;
-- 2019-01-25T17:32:28.009
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540353 WHERE 1=1 AND AD_Process_ID=181.000000 AND AD_Table_ID=101.000000
;
-- 2019-01-25T17:32:28.081
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540354 WHERE 1=1 AND AD_Process_ID=193.000000 AND AD_Table_ID=259.000000
;
-- 2019-01-25T17:32:28.143
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540355 WHERE 1=1 AND AD_Process_ID=194.000000 AND AD_Table_ID=533.000000
;
-- 2019-01-25T17:32:28.221
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540356 WHERE 1=1 AND AD_Process_ID=196.000000 AND AD_Table_ID=532.000000
;
-- 2019-01-25T17:32:28.300
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540357 WHERE 1=1 AND AD_Process_ID=197.000000 AND AD_Table_ID=534.000000
;
-- 2019-01-25T17:32:28.384
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540358 WHERE 1=1 AND AD_Process_ID=210.000000 AND AD_Table_ID=318.000000
;
-- 2019-01-25T17:32:28.466
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540359 WHERE 1=1 AND AD_Process_ID=219.000000 AND AD_Table_ID=572.000000
;
-- 2019-01-25T17:32:28.542
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540360 WHERE 1=1 AND AD_Process_ID=257.000000 AND AD_Table_ID=392.000000
;
-- 2019-01-25T17:32:28.611
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540361 WHERE 1=1 AND AD_Process_ID=257.000000 AND AD_Table_ID=393.000000
;
-- 2019-01-25T17:32:28.679
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540362 WHERE 1=1 AND AD_Process_ID=258.000000 AND AD_Table_ID=115.000000
;
-- 2019-01-25T17:32:28.783
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540363 WHERE 1=1 AND AD_Process_ID=260.000000 AND AD_Table_ID=291.000000
;
-- 2019-01-25T17:32:28.847
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540364 WHERE 1=1 AND AD_Process_ID=261.000000 AND AD_Table_ID=677.000000
;
-- 2019-01-25T17:32:28.924
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540365 WHERE 1=1 AND AD_Process_ID=265.000000 AND AD_Table_ID=677.000000
;
-- 2019-01-25T17:32:29.004
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540366 WHERE 1=1 AND AD_Process_ID=266.000000 AND AD_Table_ID=677.000000
;
-- 2019-01-25T17:32:29.096
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540367 WHERE 1=1 AND AD_Process_ID=267.000000 AND AD_Table_ID=677.000000
;
-- 2019-01-25T17:32:29.186
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540368 WHERE 1=1 AND AD_Process_ID=304.000000 AND AD_Table_ID=117.000000
;
-- 2019-01-25T17:32:29.276
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540369 WHERE 1=1 AND AD_Process_ID=328.000000 AND AD_Table_ID=101.000000
;
-- 2019-01-25T17:32:29.355
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540370 WHERE 1=1 AND AD_Process_ID=338.000000 AND AD_Table_ID=265.000000
;
-- 2019-01-25T17:32:29.422
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540371 WHERE 1=1 AND AD_Process_ID=339.000000 AND AD_Table_ID=828.000000
;
-- 2019-01-25T17:32:29.513
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540372 WHERE 1=1 AND AD_Process_ID=50011.000000 AND AD_Table_ID=100.000000
;
-- 2019-01-25T17:32:29.604
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540373 WHERE 1=1 AND AD_Process_ID=53074.000000 AND AD_Table_ID=53072.000000
;
-- 2019-01-25T17:32:29.955
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540374 WHERE 1=1 AND AD_Process_ID=53089.000000 AND AD_Table_ID=53072.000000
;
-- 2019-01-25T17:32:30.232
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540375 WHERE 1=1 AND AD_Process_ID=53235.000000 AND AD_Table_ID=688.000000
;
-- 2019-01-25T17:32:30.310
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540376 WHERE 1=1 AND AD_Process_ID=53388.000000 AND AD_Table_ID=53217.000000
;
-- 2019-01-25T17:32:30.374
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540377 WHERE 1=1 AND AD_Process_ID=53738.000000 AND AD_Table_ID=540640.000000
;
-- 2019-01-25T17:32:30.447
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540378 WHERE 1=1 AND AD_Process_ID=504600.000000 AND AD_Table_ID=318.000000
;
-- 2019-01-25T17:32:30.518
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540379 WHERE 1=1 AND AD_Process_ID=531089.000000 AND AD_Table_ID=259.000000
;
-- 2019-01-25T17:32:30.595
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540380 WHERE 1=1 AND AD_Process_ID=540001.000000 AND AD_Table_ID=540320.000000
;
-- 2019-01-25T17:32:30.666
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540381 WHERE 1=1 AND AD_Process_ID=540010.000000 AND AD_Table_ID=540029.000000
;
-- 2019-01-25T17:32:30.724
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540382 WHERE 1=1 AND AD_Process_ID=540010.000000 AND AD_Table_ID=540320.000000
;
-- 2019-01-25T17:32:30.788
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540383 WHERE 1=1 AND AD_Process_ID=540054.000000 AND AD_Table_ID=818.000000
;
-- 2019-01-25T17:32:30.846
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540384 WHERE 1=1 AND AD_Process_ID=540055.000000 AND AD_Table_ID=540101.000000
;
-- 2019-01-25T17:32:30.905
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540385 WHERE 1=1 AND AD_Process_ID=540106.000000 AND AD_Table_ID=114.000000
;
-- 2019-01-25T17:32:30.974
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540386 WHERE 1=1 AND AD_Process_ID=540147.000000 AND AD_Table_ID=53072.000000
;
-- 2019-01-25T17:32:31.043
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540387 WHERE 1=1 AND AD_Process_ID=540162.000000 AND AD_Table_ID=259.000000
;
-- 2019-01-25T17:32:31.112
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540388 WHERE 1=1 AND AD_Process_ID=540162.000000 AND AD_Table_ID=291.000000
;
-- 2019-01-25T17:32:31.172
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540389 WHERE 1=1 AND AD_Process_ID=540162.000000 AND AD_Table_ID=540060.000000
;
-- 2019-01-25T17:32:31.232
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540390 WHERE 1=1 AND AD_Process_ID=540170.000000 AND AD_Table_ID=540274.000000
;
-- 2019-01-25T17:32:31.292
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540391 WHERE 1=1 AND AD_Process_ID=540173.000000 AND AD_Table_ID=540245.000000
;
-- 2019-01-25T17:32:31.355
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540392 WHERE 1=1 AND AD_Process_ID=540174.000000 AND AD_Table_ID=688.000000
;
-- 2019-01-25T17:32:31.414
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540393 WHERE 1=1 AND AD_Process_ID=540192.000000 AND AD_Table_ID=112.000000
;
-- 2019-01-25T17:32:31.472
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540394 WHERE 1=1 AND AD_Process_ID=540192.000000 AND AD_Table_ID=540241.000000
;
-- 2019-01-25T17:32:31.531
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540395 WHERE 1=1 AND AD_Process_ID=540192.000000 AND AD_Table_ID=540242.000000
;
-- 2019-01-25T17:32:31.590
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540396 WHERE 1=1 AND AD_Process_ID=540195.000000 AND AD_Table_ID=540281.000000
;
-- 2019-01-25T17:32:31.650
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540397 WHERE 1=1 AND AD_Process_ID=540197.000000 AND AD_Table_ID=540294.000000
;
-- 2019-01-25T17:32:31.707
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540398 WHERE 1=1 AND AD_Process_ID=540216.000000 AND AD_Table_ID=540320.000000
;
-- 2019-01-25T17:32:31.764
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540399 WHERE 1=1 AND AD_Process_ID=540256.000000 AND AD_Table_ID=53217.000000
;
-- 2019-01-25T17:32:31.824
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540400 WHERE 1=1 AND AD_Process_ID=540257.000000 AND AD_Table_ID=53217.000000
;
-- 2019-01-25T17:32:31.884
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540401 WHERE 1=1 AND AD_Process_ID=540257.000000 AND AD_Table_ID=53218.000000
;
-- 2019-01-25T17:32:31.942
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540402 WHERE 1=1 AND AD_Process_ID=540268.000000 AND AD_Table_ID=540396.000000
;
-- 2019-01-25T17:32:32.001
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540403 WHERE 1=1 AND AD_Process_ID=540269.000000 AND AD_Table_ID=540396.000000
;
-- 2019-01-25T17:32:32.059
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540404 WHERE 1=1 AND AD_Process_ID=540284.000000 AND AD_Table_ID=540409.000000
;
-- 2019-01-25T17:32:32.117
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540405 WHERE 1=1 AND AD_Process_ID=540301.000000 AND AD_Table_ID=540244.000000
;
-- 2019-01-25T17:32:32.176
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540406 WHERE 1=1 AND AD_Process_ID=540304.000000 AND AD_Table_ID=540270.000000
;
-- 2019-01-25T17:32:32.236
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540407 WHERE 1=1 AND AD_Process_ID=540309.000000 AND AD_Table_ID=540422.000000
;
-- 2019-01-25T17:32:32.295
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540408 WHERE 1=1 AND AD_Process_ID=540312.000000 AND AD_Table_ID=540448.000000
;
-- 2019-01-25T17:32:32.353
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540409 WHERE 1=1 AND AD_Process_ID=540314.000000 AND AD_Table_ID=540435.000000
;
-- 2019-01-25T17:32:32.413
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540410 WHERE 1=1 AND AD_Process_ID=540315.000000 AND AD_Table_ID=540437.000000
;
-- 2019-01-25T17:32:32.476
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540411 WHERE 1=1 AND AD_Process_ID=540319.000000 AND AD_Table_ID=540435.000000
;
-- 2019-01-25T17:32:32.537
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540412 WHERE 1=1 AND AD_Process_ID=540322.000000 AND AD_Table_ID=301.000000
;
-- 2019-01-25T17:32:32.594
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540413 WHERE 1=1 AND AD_Process_ID=540324.000000 AND AD_Table_ID=540437.000000
;
-- 2019-01-25T17:32:32.654
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540414 WHERE 1=1 AND AD_Process_ID=540324.000000 AND AD_Table_ID=540473.000000
;
-- 2019-01-25T17:32:32.711
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540415 WHERE 1=1 AND AD_Process_ID=540331.000000 AND AD_Table_ID=540437.000000
;
-- 2019-01-25T17:32:32.769
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540416 WHERE 1=1 AND AD_Process_ID=540332.000000 AND AD_Table_ID=540437.000000
;
-- 2019-01-25T17:32:32.825
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540417 WHERE 1=1 AND AD_Process_ID=540335.000000 AND AD_Table_ID=540396.000000
;
-- 2019-01-25T17:32:32.886
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540418 WHERE 1=1 AND AD_Process_ID=540341.000000 AND AD_Table_ID=540409.000000
;
-- 2019-01-25T17:32:32.945
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540419 WHERE 1=1 AND AD_Process_ID=540346.000000 AND AD_Table_ID=540486.000000
;
-- 2019-01-25T17:32:33.004
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540420 WHERE 1=1 AND AD_Process_ID=540348.000000 AND AD_Table_ID=114.000000
;
-- 2019-01-25T17:32:33.080
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540421 WHERE 1=1 AND AD_Process_ID=540350.000000 AND AD_Table_ID=53079.000000
;
-- 2019-01-25T17:32:33.139
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540422 WHERE 1=1 AND AD_Process_ID=540359.000000 AND AD_Table_ID=114.000000
;
-- 2019-01-25T17:32:33.196
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540423 WHERE 1=1 AND AD_Process_ID=540360.000000 AND AD_Table_ID=540524.000000
;
-- 2019-01-25T17:32:33.254
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540424 WHERE 1=1 AND AD_Process_ID=540362.000000 AND AD_Table_ID=540435.000000
;
-- 2019-01-25T17:32:33.312
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540425 WHERE 1=1 AND AD_Process_ID=540370.000000 AND AD_Table_ID=540516.000000
;
-- 2019-01-25T17:32:33.371
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540426 WHERE 1=1 AND AD_Process_ID=540399.000000 AND AD_Table_ID=291.000000
;
-- 2019-01-25T17:32:33.429
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540427 WHERE 1=1 AND AD_Process_ID=540405.000000 AND AD_Table_ID=318.000000
;
-- 2019-01-25T17:32:33.486
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540428 WHERE 1=1 AND AD_Process_ID=540407.000000 AND AD_Table_ID=291.000000
;
-- 2019-01-25T17:32:33.544
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540429 WHERE 1=1 AND AD_Process_ID=540412.000000 AND AD_Table_ID=540516.000000
;
-- 2019-01-25T17:32:33.601
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540430 WHERE 1=1 AND AD_Process_ID=540413.000000 AND AD_Table_ID=540516.000000
;
-- 2019-01-25T17:32:33.658
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540431 WHERE 1=1 AND AD_Process_ID=540414.000000 AND AD_Table_ID=540516.000000
;
-- 2019-01-25T17:32:33.717
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540432 WHERE 1=1 AND AD_Process_ID=540415.000000 AND AD_Table_ID=540516.000000
;
-- 2019-01-25T17:32:33.774
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540433 WHERE 1=1 AND AD_Process_ID=540416.000000 AND AD_Table_ID=540516.000000
;
-- 2019-01-25T17:32:33.832
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540434 WHERE 1=1 AND AD_Process_ID=540429.000000 AND AD_Table_ID=540244.000000
;
-- 2019-01-25T17:32:33.893
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540435 WHERE 1=1 AND AD_Process_ID=540437.000000 AND AD_Table_ID=540244.000000
;
-- 2019-01-25T17:32:33.950
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540436 WHERE 1=1 AND AD_Process_ID=540455.000000 AND AD_Table_ID=295.000000
;
-- 2019-01-25T17:32:34.008
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540437 WHERE 1=1 AND AD_Process_ID=540456.000000 AND AD_Table_ID=540030.000000
;
-- 2019-01-25T17:32:34.096
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540438 WHERE 1=1 AND AD_Process_ID=540458.000000 AND AD_Table_ID=500221.000000
;
-- 2019-01-25T17:32:34.157
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540439 WHERE 1=1 AND AD_Process_ID=540460.000000 AND AD_Table_ID=291.000000
;
-- 2019-01-25T17:32:34.215
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540440 WHERE 1=1 AND AD_Process_ID=540461.000000 AND AD_Table_ID=426.000000
;
-- 2019-01-25T17:32:34.273
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540441 WHERE 1=1 AND AD_Process_ID=540466.000000 AND AD_Table_ID=818.000000
;
-- 2019-01-25T17:32:34.331
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540442 WHERE 1=1 AND AD_Process_ID=540467.000000 AND AD_Table_ID=291.000000
;
-- 2019-01-25T17:32:34.391
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540443 WHERE 1=1 AND AD_Process_ID=540469.000000 AND AD_Table_ID=101.000000
;
-- 2019-01-25T17:32:34.455
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540444 WHERE 1=1 AND AD_Process_ID=540470.000000 AND AD_Table_ID=540297.000000
;
-- 2019-01-25T17:32:34.516
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540445 WHERE 1=1 AND AD_Process_ID=540471.000000 AND AD_Table_ID=106.000000
;
-- 2019-01-25T17:32:34.576
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540446 WHERE 1=1 AND AD_Process_ID=540474.000000 AND AD_Table_ID=176.000000
;
-- 2019-01-25T17:32:34.634
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540447 WHERE 1=1 AND AD_Process_ID=540489.000000 AND AD_Table_ID=53027.000000
;
-- 2019-01-25T17:32:34.693
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540448 WHERE 1=1 AND AD_Process_ID=540490.000000 AND AD_Table_ID=53027.000000
;
-- 2019-01-25T17:32:34.758
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540449 WHERE 1=1 AND AD_Process_ID=540511.000000 AND AD_Table_ID=540453.000000
;
-- 2019-01-25T17:32:34.820
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540450 WHERE 1=1 AND AD_Process_ID=540519.000000 AND AD_Table_ID=540453.000000
;
-- 2019-01-25T17:32:34.881
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540451 WHERE 1=1 AND AD_Process_ID=540520.000000 AND AD_Table_ID=500221.000000
;
-- 2019-01-25T17:32:34.940
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540452 WHERE 1=1 AND AD_Process_ID=540521.000000 AND AD_Table_ID=53037.000000
;
-- 2019-01-25T17:32:35.010
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540453 WHERE 1=1 AND AD_Process_ID=540522.000000 AND AD_Table_ID=53020.000000
;
-- 2019-01-25T17:32:35.069
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540454 WHERE 1=1 AND AD_Process_ID=540523.000000 AND AD_Table_ID=720.000000
;
-- 2019-01-25T17:32:35.127
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540455 WHERE 1=1 AND AD_Process_ID=540524.000000 AND AD_Table_ID=540244.000000
;
-- 2019-01-25T17:32:35.185
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540456 WHERE 1=1 AND AD_Process_ID=540528.000000 AND AD_Table_ID=319.000000
;
-- 2019-01-25T17:32:35.242
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540457 WHERE 1=1 AND AD_Process_ID=540529.000000 AND AD_Table_ID=319.000000
;
-- 2019-01-25T17:32:35.308
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540458 WHERE 1=1 AND AD_Process_ID=540531.000000 AND AD_Table_ID=426.000000
;
-- 2019-01-25T17:32:35.375
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540459 WHERE 1=1 AND AD_Process_ID=540534.000000 AND AD_Table_ID=426.000000
;
-- 2019-01-25T17:32:35.436
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540460 WHERE 1=1 AND AD_Process_ID=540538.000000 AND AD_Table_ID=540639.000000
;
-- 2019-01-25T17:32:35.495
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540461 WHERE 1=1 AND AD_Process_ID=540540.000000 AND AD_Table_ID=392.000000
;
-- 2019-01-25T17:32:35.554
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540462 WHERE 1=1 AND AD_Process_ID=540541.000000 AND AD_Table_ID=540516.000000
;
-- 2019-01-25T17:32:35.618
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540463 WHERE 1=1 AND AD_Process_ID=540542.000000 AND AD_Table_ID=319.000000
;
-- 2019-01-25T17:32:35.675
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540464 WHERE 1=1 AND AD_Process_ID=540546.000000 AND AD_Table_ID=540524.000000
;
-- 2019-01-25T17:32:35.731
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540465 WHERE 1=1 AND AD_Process_ID=540547.000000 AND AD_Table_ID=540524.000000
;
-- 2019-01-25T17:32:35.791
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540466 WHERE 1=1 AND AD_Process_ID=540549.000000 AND AD_Table_ID=319.000000
;
-- 2019-01-25T17:32:35.849
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540467 WHERE 1=1 AND AD_Process_ID=540553.000000 AND AD_Table_ID=319.000000
;
-- 2019-01-25T17:32:35.907
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540468 WHERE 1=1 AND AD_Process_ID=540554.000000 AND AD_Table_ID=335.000000
;
-- 2019-01-25T17:32:35.967
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540469 WHERE 1=1 AND AD_Process_ID=540556.000000 AND AD_Table_ID=540644.000000
;
-- 2019-01-25T17:32:36.024
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540470 WHERE 1=1 AND AD_Process_ID=540557.000000 AND AD_Table_ID=540524.000000
;
-- 2019-01-25T17:32:36.084
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540471 WHERE 1=1 AND AD_Process_ID=540565.000000 AND AD_Table_ID=540030.000000
;
-- 2019-01-25T17:32:36.141
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540472 WHERE 1=1 AND AD_Process_ID=540568.000000 AND AD_Table_ID=53027.000000
;
-- 2019-01-25T17:32:36.198
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540473 WHERE 1=1 AND AD_Process_ID=540569.000000 AND AD_Table_ID=318.000000
;
-- 2019-01-25T17:32:36.258
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540474 WHERE 1=1 AND AD_Process_ID=540570.000000 AND AD_Table_ID=540425.000000
;
-- 2019-01-25T17:32:36.315
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540475 WHERE 1=1 AND AD_Process_ID=540571.000000 AND AD_Table_ID=500221.000000
;
-- 2019-01-25T17:32:36.371
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540476 WHERE 1=1 AND AD_Process_ID=540574.000000 AND AD_Table_ID=540645.000000
;
-- 2019-01-25T17:32:36.429
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540477 WHERE 1=1 AND AD_Process_ID=540576.000000 AND AD_Table_ID=540644.000000
;
-- 2019-01-25T17:32:36.486
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540478 WHERE 1=1 AND AD_Process_ID=540577.000000 AND AD_Table_ID=540634.000000
;
-- 2019-01-25T17:32:36.546
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540479 WHERE 1=1 AND AD_Process_ID=540578.000000 AND AD_Table_ID=540516.000000
;
-- 2019-01-25T17:32:36.604
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540480 WHERE 1=1 AND AD_Process_ID=540579.000000 AND AD_Table_ID=427.000000
;
-- 2019-01-25T17:32:36.662
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540481 WHERE 1=1 AND AD_Process_ID=540580.000000 AND AD_Table_ID=500221.000000
;
-- 2019-01-25T17:32:36.732
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540482 WHERE 1=1 AND AD_Process_ID=540584.000000 AND AD_Table_ID=319.000000
;
-- 2019-01-25T17:32:36.790
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540483 WHERE 1=1 AND AD_Process_ID=540589.000000 AND AD_Table_ID=259.000000
;
-- 2019-01-25T17:32:36.848
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540484 WHERE 1=1 AND AD_Process_ID=540591.000000 AND AD_Table_ID=318.000000
;
-- 2019-01-25T17:32:36.909
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540485 WHERE 1=1 AND AD_Process_ID=540592.000000 AND AD_Table_ID=392.000000
;
-- 2019-01-25T17:32:36.986
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540486 WHERE 1=1 AND AD_Process_ID=540593.000000 AND AD_Table_ID=426.000000
;
-- 2019-01-25T17:32:37.062
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540487 WHERE 1=1 AND AD_Process_ID=540599.000000 AND AD_Table_ID=540435.000000
;
-- 2019-01-25T17:32:37.128
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540488 WHERE 1=1 AND AD_Process_ID=540602.000000 AND AD_Table_ID=259.000000
;
-- 2019-01-25T17:32:37.195
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540489 WHERE 1=1 AND AD_Process_ID=540603.000000 AND AD_Table_ID=259.000000
;
-- 2019-01-25T17:32:37.263
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540490 WHERE 1=1 AND AD_Process_ID=540613.000000 AND AD_Table_ID=540516.000000
;
-- 2019-01-25T17:32:37.330
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540491 WHERE 1=1 AND AD_Process_ID=540626.000000 AND AD_Table_ID=540610.000000
;
-- 2019-01-25T17:32:37.398
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540492 WHERE 1=1 AND AD_Process_ID=540628.000000 AND AD_Table_ID=392.000000
;
-- 2019-01-25T17:32:37.465
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540493 WHERE 1=1 AND AD_Process_ID=540629.000000 AND AD_Table_ID=393.000000
;
-- 2019-01-25T17:32:37.533
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540494 WHERE 1=1 AND AD_Process_ID=540631.000000 AND AD_Table_ID=540692.000000
;
-- 2019-01-25T17:32:37.592
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540495 WHERE 1=1 AND AD_Process_ID=540633.000000 AND AD_Table_ID=540692.000000
;
-- 2019-01-25T17:32:37.656
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540496 WHERE 1=1 AND AD_Process_ID=540637.000000 AND AD_Table_ID=540340.000000
;
-- 2019-01-25T17:32:37.719
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540497 WHERE 1=1 AND AD_Process_ID=540638.000000 AND AD_Table_ID=224.000000
;
-- 2019-01-25T17:32:37.779
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540498 WHERE 1=1 AND AD_Process_ID=540638.000000 AND AD_Table_ID=225.000000
;
-- 2019-01-25T17:32:37.839
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540499 WHERE 1=1 AND AD_Process_ID=540639.000000 AND AD_Table_ID=225.000000
;
-- 2019-01-25T17:32:37.898
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540500 WHERE 1=1 AND AD_Process_ID=540647.000000 AND AD_Table_ID=284.000000
;
-- 2019-01-25T17:32:37.957
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540501 WHERE 1=1 AND AD_Process_ID=540648.000000 AND AD_Table_ID=540701.000000
;
-- 2019-01-25T17:32:38.020
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540502 WHERE 1=1 AND AD_Process_ID=540649.000000 AND AD_Table_ID=540701.000000
;
-- 2019-01-25T17:32:38.080
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540503 WHERE 1=1 AND AD_Process_ID=540657.000000 AND AD_Table_ID=208.000000
;
-- 2019-01-25T17:32:38.142
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540504 WHERE 1=1 AND AD_Process_ID=540658.000000 AND AD_Table_ID=540704.000000
;
-- 2019-01-25T17:32:38.210
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540505 WHERE 1=1 AND AD_Process_ID=540664.000000 AND AD_Table_ID=540747.000000
;
-- 2019-01-25T17:32:38.273
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540506 WHERE 1=1 AND AD_Process_ID=540665.000000 AND AD_Table_ID=540521.000000
;
-- 2019-01-25T17:32:38.335
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540507 WHERE 1=1 AND AD_Process_ID=540666.000000 AND AD_Table_ID=540750.000000
;
-- 2019-01-25T17:32:38.400
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540508 WHERE 1=1 AND AD_Process_ID=540667.000000 AND AD_Table_ID=540750.000000
;
-- 2019-01-25T17:32:38.466
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540509 WHERE 1=1 AND AD_Process_ID=540668.000000 AND AD_Table_ID=540310.000000
;
-- 2019-01-25T17:32:38.532
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540510 WHERE 1=1 AND AD_Process_ID=540668.000000 AND AD_Table_ID=540320.000000
;
-- 2019-01-25T17:32:38.598
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540511 WHERE 1=1 AND AD_Process_ID=540671.000000 AND AD_Table_ID=540752.000000
;
-- 2019-01-25T17:32:38.663
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540512 WHERE 1=1 AND AD_Process_ID=540673.000000 AND AD_Table_ID=540320.000000
;
-- 2019-01-25T17:32:38.728
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540513 WHERE 1=1 AND AD_Process_ID=540679.000000 AND AD_Table_ID=540270.000000
;
-- 2019-01-25T17:32:38.795
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540514 WHERE 1=1 AND AD_Process_ID=540680.000000 AND AD_Table_ID=540410.000000
;
-- 2019-01-25T17:32:38.860
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540515 WHERE 1=1 AND AD_Process_ID=540681.000000 AND AD_Table_ID=540745.000000
;
-- 2019-01-25T17:32:38.927
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540516 WHERE 1=1 AND AD_Process_ID=540687.000000 AND AD_Table_ID=540270.000000
;
-- 2019-01-25T17:32:38.994
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540517 WHERE 1=1 AND AD_Process_ID=540690.000000 AND AD_Table_ID=677.000000
;
-- 2019-01-25T17:32:39.053
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540518 WHERE 1=1 AND AD_Process_ID=540691.000000 AND AD_Table_ID=677.000000
;
-- 2019-01-25T17:32:39.140
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540519 WHERE 1=1 AND AD_Process_ID=540694.000000 AND AD_Table_ID=416.000000
;
-- 2019-01-25T17:32:39.205
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540520 WHERE 1=1 AND AD_Process_ID=540695.000000 AND AD_Table_ID=674.000000
;
-- 2019-01-25T17:32:39.266
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540521 WHERE 1=1 AND AD_Process_ID=540696.000000 AND AD_Table_ID=673.000000
;
-- 2019-01-25T17:32:39.327
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540522 WHERE 1=1 AND AD_Process_ID=540704.000000 AND AD_Table_ID=677.000000
;
-- 2019-01-25T17:32:39.390
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540523 WHERE 1=1 AND AD_Process_ID=540712.000000 AND AD_Table_ID=105.000000
;
-- 2019-01-25T17:32:39.448
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540524 WHERE 1=1 AND AD_Process_ID=540715.000000 AND AD_Table_ID=540782.000000
;
-- 2019-01-25T17:32:39.508
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540525 WHERE 1=1 AND AD_Process_ID=540716.000000 AND AD_Table_ID=540783.000000
;
-- 2019-01-25T17:32:39.577
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540526 WHERE 1=1 AND AD_Process_ID=540717.000000 AND AD_Table_ID=100.000000
;
-- 2019-01-25T17:32:39.642
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540527 WHERE 1=1 AND AD_Process_ID=540718.000000 AND AD_Table_ID=100.000000
;
-- 2019-01-25T17:32:39.707
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540528 WHERE 1=1 AND AD_Process_ID=540722.000000 AND AD_Table_ID=105.000000
;
-- 2019-01-25T17:32:39.768
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540529 WHERE 1=1 AND AD_Process_ID=540725.000000 AND AD_Table_ID=100.000000
;
-- 2019-01-25T17:32:39.837
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540530 WHERE 1=1 AND AD_Process_ID=540726.000000 AND AD_Table_ID=540425.000000
;
-- 2019-01-25T17:32:39.897
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540531 WHERE 1=1 AND AD_Process_ID=540728.000000 AND AD_Table_ID=540788.000000
;
-- 2019-01-25T17:32:39.956
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540532 WHERE 1=1 AND AD_Process_ID=540729.000000 AND AD_Table_ID=100.000000
;
-- 2019-01-25T17:32:40.023
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540533 WHERE 1=1 AND AD_Process_ID=540729.000000 AND AD_Table_ID=540790.000000
;
-- 2019-01-25T17:32:40.083
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540534 WHERE 1=1 AND AD_Process_ID=540730.000000 AND AD_Table_ID=100.000000
;
-- 2019-01-25T17:32:40.149
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540535 WHERE 1=1 AND AD_Process_ID=540730.000000 AND AD_Table_ID=540790.000000
;
-- 2019-01-25T17:32:40.213
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540536 WHERE 1=1 AND AD_Process_ID=540732.000000 AND AD_Table_ID=540789.000000
;
-- 2019-01-25T17:32:40.274
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540537 WHERE 1=1 AND AD_Process_ID=540732.000000 AND AD_Table_ID=540790.000000
;
-- 2019-01-25T17:32:40.372
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540538 WHERE 1=1 AND AD_Process_ID=540734.000000 AND AD_Table_ID=540788.000000
;
-- 2019-01-25T17:32:40.435
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540539 WHERE 1=1 AND AD_Process_ID=540735.000000 AND AD_Table_ID=540788.000000
;
-- 2019-01-25T17:32:40.497
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540540 WHERE 1=1 AND AD_Process_ID=540737.000000 AND AD_Table_ID=540788.000000
;
-- 2019-01-25T17:32:40.556
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540541 WHERE 1=1 AND AD_Process_ID=540744.000000 AND AD_Table_ID=540788.000000
;
-- 2019-01-25T17:32:40.646
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540542 WHERE 1=1 AND AD_Process_ID=540747.000000 AND AD_Table_ID=540789.000000
;
-- 2019-01-25T17:32:40.712
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540543 WHERE 1=1 AND AD_Process_ID=540747.000000 AND AD_Table_ID=540790.000000
;
-- 2019-01-25T17:32:40.771
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540544 WHERE 1=1 AND AD_Process_ID=540749.000000 AND AD_Table_ID=540524.000000
;
-- 2019-01-25T17:32:40.844
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540545 WHERE 1=1 AND AD_Process_ID=540750.000000 AND AD_Table_ID=540516.000000
;
-- 2019-01-25T17:32:40.906
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540546 WHERE 1=1 AND AD_Process_ID=540753.000000 AND AD_Table_ID=540524.000000
;
-- 2019-01-25T17:32:40.975
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540547 WHERE 1=1 AND AD_Process_ID=540755.000000 AND AD_Table_ID=540524.000000
;
-- 2019-01-25T17:32:41.055
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540548 WHERE 1=1 AND AD_Process_ID=540757.000000 AND AD_Table_ID=540516.000000
;
-- 2019-01-25T17:32:41.116
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540549 WHERE 1=1 AND AD_Process_ID=540758.000000 AND AD_Table_ID=540524.000000
;
-- 2019-01-25T17:32:41.233
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540550 WHERE 1=1 AND AD_Process_ID=540759.000000 AND AD_Table_ID=540524.000000
;
-- 2019-01-25T17:32:41.514
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540551 WHERE 1=1 AND AD_Process_ID=540760.000000 AND AD_Table_ID=540524.000000
;
-- 2019-01-25T17:32:41.766
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540552 WHERE 1=1 AND AD_Process_ID=540762.000000 AND AD_Table_ID=540524.000000
;
-- 2019-01-25T17:32:41.826
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540553 WHERE 1=1 AND AD_Process_ID=540763.000000 AND AD_Table_ID=540516.000000
;
-- 2019-01-25T17:32:41.895
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540554 WHERE 1=1 AND AD_Process_ID=540764.000000 AND AD_Table_ID=540801.000000
;
-- 2019-01-25T17:32:41.968
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540555 WHERE 1=1 AND AD_Process_ID=540765.000000 AND AD_Table_ID=540524.000000
;
-- 2019-01-25T17:32:42.036
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540556 WHERE 1=1 AND AD_Process_ID=540766.000000 AND AD_Table_ID=540516.000000
;
-- 2019-01-25T17:32:42.102
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540557 WHERE 1=1 AND AD_Process_ID=540767.000000 AND AD_Table_ID=540524.000000
;
-- 2019-01-25T17:32:42.171
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540558 WHERE 1=1 AND AD_Process_ID=540772.000000 AND AD_Table_ID=53027.000000
;
-- 2019-01-25T17:32:42.236
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540559 WHERE 1=1 AND AD_Process_ID=540774.000000 AND AD_Table_ID=284.000000
;
-- 2019-01-25T17:32:42.304
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540560 WHERE 1=1 AND AD_Process_ID=540780.000000 AND AD_Table_ID=291.000000
;
-- 2019-01-25T17:32:42.380
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540561 WHERE 1=1 AND AD_Process_ID=540781.000000 AND AD_Table_ID=53027.000000
;
-- 2019-01-25T17:32:42.443
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540562 WHERE 1=1 AND AD_Process_ID=540782.000000 AND AD_Table_ID=53027.000000
;
-- 2019-01-25T17:32:42.501
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540563 WHERE 1=1 AND AD_Process_ID=540783.000000 AND AD_Table_ID=53027.000000
;
-- 2019-01-25T17:32:42.578
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540564 WHERE 1=1 AND AD_Process_ID=540784.000000 AND AD_Table_ID=540808.000000
;
-- 2019-01-25T17:32:42.638
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540565 WHERE 1=1 AND AD_Process_ID=540788.000000 AND AD_Table_ID=53027.000000
;
-- 2019-01-25T17:32:42.703
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540566 WHERE 1=1 AND AD_Process_ID=540793.000000 AND AD_Table_ID=540516.000000
;
-- 2019-01-25T17:32:42.772
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540567 WHERE 1=1 AND AD_Process_ID=540795.000000 AND AD_Table_ID=540516.000000
;
-- 2019-01-25T17:32:42.832
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540568 WHERE 1=1 AND AD_Process_ID=540796.000000 AND AD_Table_ID=540516.000000
;
-- 2019-01-25T17:32:42.892
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540569 WHERE 1=1 AND AD_Process_ID=540797.000000 AND AD_Table_ID=540516.000000
;
-- 2019-01-25T17:32:42.953
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540570 WHERE 1=1 AND AD_Process_ID=540798.000000 AND AD_Table_ID=114.000000
;
-- 2019-01-25T17:32:43.017
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540571 WHERE 1=1 AND AD_Process_ID=540799.000000 AND AD_Table_ID=114.000000
;
-- 2019-01-25T17:32:43.093
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540572 WHERE 1=1 AND AD_Process_ID=540800.000000 AND AD_Table_ID=101.000000
;
-- 2019-01-25T17:32:43.153
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540573 WHERE 1=1 AND AD_Process_ID=540801.000000 AND AD_Table_ID=540823.000000
;
-- 2019-01-25T17:32:43.214
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540574 WHERE 1=1 AND AD_Process_ID=540802.000000 AND AD_Table_ID=53027.000000
;
-- 2019-01-25T17:32:43.278
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540575 WHERE 1=1 AND AD_Process_ID=540803.000000 AND AD_Table_ID=540516.000000
;
-- 2019-01-25T17:32:43.361
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540576 WHERE 1=1 AND AD_Process_ID=540813.000000 AND AD_Table_ID=276.000000
;
-- 2019-01-25T17:32:43.423
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540577 WHERE 1=1 AND AD_Process_ID=540816.000000 AND AD_Table_ID=540833.000000
;
-- 2019-01-25T17:32:43.493
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540578 WHERE 1=1 AND AD_Process_ID=540817.000000 AND AD_Table_ID=540569.000000
;
-- 2019-01-25T17:32:43.566
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540579 WHERE 1=1 AND AD_Process_ID=540818.000000 AND AD_Table_ID=540543.000000
;
-- 2019-01-25T17:32:43.630
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540580 WHERE 1=1 AND AD_Process_ID=540819.000000 AND AD_Table_ID=319.000000
;
-- 2019-01-25T17:32:43.697
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540581 WHERE 1=1 AND AD_Process_ID=540820.000000 AND AD_Table_ID=540516.000000
;
-- 2019-01-25T17:32:43.762
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540582 WHERE 1=1 AND AD_Process_ID=540822.000000 AND AD_Table_ID=540516.000000
;
-- 2019-01-25T17:32:43.826
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540583 WHERE 1=1 AND AD_Process_ID=540824.000000 AND AD_Table_ID=540836.000000
;
-- 2019-01-25T17:32:43.899
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540584 WHERE 1=1 AND AD_Process_ID=540828.000000 AND AD_Table_ID=540516.000000
;
-- 2019-01-25T17:32:43.961
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540585 WHERE 1=1 AND AD_Process_ID=540829.000000 AND AD_Table_ID=540409.000000
;
-- 2019-01-25T17:32:44.030
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540586 WHERE 1=1 AND AD_Process_ID=540830.000000 AND AD_Table_ID=540270.000000
;
-- 2019-01-25T17:32:44.101
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540587 WHERE 1=1 AND AD_Process_ID=540834.000000 AND AD_Table_ID=540840.000000
;
-- 2019-01-25T17:32:44.170
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540588 WHERE 1=1 AND AD_Process_ID=540836.000000 AND AD_Table_ID=540841.000000
;
-- 2019-01-25T17:32:44.231
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540589 WHERE 1=1 AND AD_Process_ID=540837.000000 AND AD_Table_ID=100.000000
;
-- 2019-01-25T17:32:44.293
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540590 WHERE 1=1 AND AD_Process_ID=540838.000000 AND AD_Table_ID=540029.000000
;
-- 2019-01-25T17:32:44.356
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540591 WHERE 1=1 AND AD_Process_ID=540838.000000 AND AD_Table_ID=540320.000000
;
-- 2019-01-25T17:32:44.421
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540592 WHERE 1=1 AND AD_Process_ID=540852.000000 AND AD_Table_ID=540029.000000
;
-- 2019-01-25T17:32:44.496
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540593 WHERE 1=1 AND AD_Process_ID=540855.000000 AND AD_Table_ID=500221.000000
;
-- 2019-01-25T17:32:44.560
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540594 WHERE 1=1 AND AD_Process_ID=540875.000000 AND AD_Table_ID=540516.000000
;
-- 2019-01-25T17:32:44.632
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540595 WHERE 1=1 AND AD_Process_ID=540876.000000 AND AD_Table_ID=540745.000000
;
-- 2019-01-25T17:32:44.694
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540596 WHERE 1=1 AND AD_Process_ID=540877.000000 AND AD_Table_ID=259.000000
;
-- 2019-01-25T17:32:44.764
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540597 WHERE 1=1 AND AD_Process_ID=540879.000000 AND AD_Table_ID=540320.000000
;
-- 2019-01-25T17:32:44.833
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540598 WHERE 1=1 AND AD_Process_ID=540887.000000 AND AD_Table_ID=259.000000
;
-- 2019-01-25T17:32:44.903
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540599 WHERE 1=1 AND AD_Process_ID=540890.000000 AND AD_Table_ID=540320.000000
;
-- 2019-01-25T17:32:44.969
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540600 WHERE 1=1 AND AD_Process_ID=540891.000000 AND AD_Table_ID=540320.000000
;
-- 2019-01-25T17:32:45.040
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540601 WHERE 1=1 AND AD_Process_ID=540896.000000 AND AD_Table_ID=381.000000
;
-- 2019-01-25T17:32:45.107
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540602 WHERE 1=1 AND AD_Process_ID=540898.000000 AND AD_Table_ID=540516.000000
;
-- 2019-01-25T17:32:45.177
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540603 WHERE 1=1 AND AD_Process_ID=540903.000000 AND AD_Table_ID=540880.000000
;
-- 2019-01-25T17:32:45.240
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540604 WHERE 1=1 AND AD_Process_ID=540905.000000 AND AD_Table_ID=540888.000000
;
-- 2019-01-25T17:32:45.299
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540605 WHERE 1=1 AND AD_Process_ID=540910.000000 AND AD_Table_ID=540863.000000
;
-- 2019-01-25T17:32:45.363
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540606 WHERE 1=1 AND AD_Process_ID=540911.000000 AND AD_Table_ID=270.000000
;
-- 2019-01-25T17:32:45.436
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540607 WHERE 1=1 AND AD_Process_ID=540912.000000 AND AD_Table_ID=53038.000000
;
-- 2019-01-25T17:32:45.500
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540608 WHERE 1=1 AND AD_Process_ID=540914.000000 AND AD_Table_ID=540898.000000
;
-- 2019-01-25T17:32:45.563
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540609 WHERE 1=1 AND AD_Process_ID=540919.000000 AND AD_Table_ID=540928.000000
;
-- 2019-01-25T17:32:45.637
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540610 WHERE 1=1 AND AD_Process_ID=540920.000000 AND AD_Table_ID=540861.000000
;
-- 2019-01-25T17:32:45.705
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540611 WHERE 1=1 AND AD_Process_ID=540921.000000 AND AD_Table_ID=540929.000000
;
-- 2019-01-25T17:32:45.771
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540612 WHERE 1=1 AND AD_Process_ID=540922.000000 AND AD_Table_ID=540929.000000
;
-- 2019-01-25T17:32:45.839
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540613 WHERE 1=1 AND AD_Process_ID=540923.000000 AND AD_Table_ID=540934.000000
;
-- 2019-01-25T17:32:45.904
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540614 WHERE 1=1 AND AD_Process_ID=540924.000000 AND AD_Table_ID=540934.000000
;
-- 2019-01-25T17:32:45.970
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540615 WHERE 1=1 AND AD_Process_ID=540925.000000 AND AD_Table_ID=259.000000
;
-- 2019-01-25T17:32:46.033
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540616 WHERE 1=1 AND AD_Process_ID=540932.000000 AND AD_Table_ID=540950.000000
;
-- 2019-01-25T17:32:46.093
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540617 WHERE 1=1 AND AD_Process_ID=540933.000000 AND AD_Table_ID=540516.000000
;
-- 2019-01-25T17:32:46.155
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540618 WHERE 1=1 AND AD_Process_ID=540934.000000 AND AD_Table_ID=259.000000
;
-- 2019-01-25T17:32:46.215
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540619 WHERE 1=1 AND AD_Process_ID=540935.000000 AND AD_Table_ID=321.000000
;
-- 2019-01-25T17:32:46.276
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540620 WHERE 1=1 AND AD_Process_ID=540937.000000 AND AD_Table_ID=540954.000000
;
-- 2019-01-25T17:32:46.338
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540621 WHERE 1=1 AND AD_Process_ID=540938.000000 AND AD_Table_ID=540763.000000
;
-- 2019-01-25T17:32:46.400
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540622 WHERE 1=1 AND AD_Process_ID=540939.000000 AND AD_Table_ID=540955.000000
;
-- 2019-01-25T17:32:46.470
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540623 WHERE 1=1 AND AD_Process_ID=540939.000000 AND AD_Table_ID=540956.000000
;
-- 2019-01-25T17:32:46.556
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540624 WHERE 1=1 AND AD_Process_ID=540947.000000 AND AD_Table_ID=540763.000000
;
-- 2019-01-25T17:32:46.622
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540625 WHERE 1=1 AND AD_Process_ID=540949.000000 AND AD_Table_ID=540956.000000
;
-- 2019-01-25T17:32:46.702
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540626 WHERE 1=1 AND AD_Process_ID=540950.000000 AND AD_Table_ID=291.000000
;
-- 2019-01-25T17:32:46.771
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540627 WHERE 1=1 AND AD_Process_ID=540951.000000 AND AD_Table_ID=291.000000
;
-- 2019-01-25T17:32:46.837
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540628 WHERE 1=1 AND AD_Process_ID=540953.000000 AND AD_Table_ID=259.000000
;
-- 2019-01-25T17:32:46.904
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540629 WHERE 1=1 AND AD_Process_ID=540956.000000 AND AD_Table_ID=540963.000000
;
-- 2019-01-25T17:32:46.988
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540630 WHERE 1=1 AND AD_Process_ID=540959.000000 AND AD_Table_ID=114.000000
;
-- 2019-01-25T17:32:47.131
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540631 WHERE 1=1 AND AD_Process_ID=540960.000000 AND AD_Table_ID=291.000000
;
-- 2019-01-25T17:32:47.196
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540632 WHERE 1=1 AND AD_Process_ID=540961.000000 AND AD_Table_ID=540970.000000
;
-- 2019-01-25T17:32:47.274
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540633 WHERE 1=1 AND AD_Process_ID=540963.000000 AND AD_Table_ID=540970.000000
;
-- 2019-01-25T17:32:47.337
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540634 WHERE 1=1 AND AD_Process_ID=540964.000000 AND AD_Table_ID=540970.000000
;
-- 2019-01-25T17:32:47.406
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540635 WHERE 1=1 AND AD_Process_ID=540965.000000 AND AD_Table_ID=540970.000000
;
-- 2019-01-25T17:32:47.476
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540636 WHERE 1=1 AND AD_Process_ID=540972.000000 AND AD_Table_ID=540861.000000
;
-- 2019-01-25T17:32:47.538
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540637 WHERE 1=1 AND AD_Process_ID=540975.000000 AND AD_Table_ID=291.000000
;
-- 2019-01-25T17:32:47.650
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540638 WHERE 1=1 AND AD_Process_ID=540976.000000 AND AD_Table_ID=540970.000000
;
-- 2019-01-25T17:32:47.716
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540639 WHERE 1=1 AND AD_Process_ID=540978.000000 AND AD_Table_ID=540408.000000
;
-- 2019-01-25T17:32:47.784
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540640 WHERE 1=1 AND AD_Process_ID=540979.000000 AND AD_Table_ID=540861.000000
;
-- 2019-01-25T17:32:47.846
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540641 WHERE 1=1 AND AD_Process_ID=540980.000000 AND AD_Table_ID=259.000000
;
-- 2019-01-25T17:32:47.915
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540642 WHERE 1=1 AND AD_Process_ID=540981.000000 AND AD_Table_ID=540990.000000
;
-- 2019-01-25T17:32:47.999
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540643 WHERE 1=1 AND AD_Process_ID=540985.000000 AND AD_Table_ID=540516.000000
;
-- 2019-01-25T17:32:48.069
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540644 WHERE 1=1 AND AD_Process_ID=540986.000000 AND AD_Table_ID=540889.000000
;
-- 2019-01-25T17:32:48.153
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540645 WHERE 1=1 AND AD_Process_ID=540987.000000 AND AD_Table_ID=540999.000000
;
-- 2019-01-25T17:32:48.222
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540646 WHERE 1=1 AND AD_Process_ID=540988.000000 AND AD_Table_ID=540030.000000
;
-- 2019-01-25T17:32:48.308
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540647 WHERE 1=1 AND AD_Process_ID=540990.000000 AND AD_Table_ID=291.000000
;
-- 2019-01-25T17:32:48.377
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540648 WHERE 1=1 AND AD_Process_ID=540991.000000 AND AD_Table_ID=259.000000
;
-- 2019-01-25T17:32:48.436
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540649 WHERE 1=1 AND AD_Process_ID=540992.000000 AND AD_Table_ID=540516.000000
;
-- 2019-01-25T17:32:48.501
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540650 WHERE 1=1 AND AD_Process_ID=540994.000000 AND AD_Table_ID=321.000000
;
-- 2019-01-25T17:32:48.563
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540651 WHERE 1=1 AND AD_Process_ID=540995.000000 AND AD_Table_ID=322.000000
;
-- 2019-01-25T17:32:48.626
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540652 WHERE 1=1 AND AD_Process_ID=540996.000000 AND AD_Table_ID=322.000000
;
-- 2019-01-25T17:32:48.688
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540653 WHERE 1=1 AND AD_Process_ID=540998.000000 AND AD_Table_ID=105.000000
;
-- 2019-01-25T17:32:48.755
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540654 WHERE 1=1 AND AD_Process_ID=540999.000000 AND AD_Table_ID=540401.000000
;
-- 2019-01-25T17:32:48.814
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540655 WHERE 1=1 AND AD_Process_ID=541000.000000 AND AD_Table_ID=208.000000
;
-- 2019-01-25T17:32:48.882
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540656 WHERE 1=1 AND AD_Process_ID=541006.000000 AND AD_Table_ID=540516.000000
;
-- 2019-01-25T17:32:48.941
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540657 WHERE 1=1 AND AD_Process_ID=541010.000000 AND AD_Table_ID=259.000000
;
-- 2019-01-25T17:32:49.016
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540658 WHERE 1=1 AND AD_Process_ID=541015.000000 AND AD_Table_ID=291.000000
;
-- 2019-01-25T17:32:49.077
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540659 WHERE 1=1 AND AD_Process_ID=541023.000000 AND AD_Table_ID=318.000000
;
-- 2019-01-25T17:32:49.142
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540660 WHERE 1=1 AND AD_Process_ID=541025.000000 AND AD_Table_ID=540453.000000
;
-- 2019-01-25T17:32:49.208
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540661 WHERE 1=1 AND AD_Process_ID=541029.000000 AND AD_Table_ID=276.000000
;
-- 2019-01-25T17:32:49.267
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540662 WHERE 1=1 AND AD_Process_ID=541031.000000 AND AD_Table_ID=540401.000000
;
-- 2019-01-25T17:32:49.326
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540663 WHERE 1=1 AND AD_Process_ID=541032.000000 AND AD_Table_ID=105.000000
;
-- 2019-01-25T17:32:49.386
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540664 WHERE 1=1 AND AD_Process_ID=541033.000000 AND AD_Table_ID=541144.000000
;
-- 2019-01-25T17:32:49.457
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540665 WHERE 1=1 AND AD_Process_ID=541038.000000 AND AD_Table_ID=259.000000
;
-- 2019-01-25T17:32:49.526
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET AD_Table_Process_ID=540666 WHERE 1=1 AND AD_Process_ID=541038.000000 AND AD_Table_ID=291.000000
;
commit;
-- 2019-01-25T17:32:49.533
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
ALTER TABLE AD_Table_Process ALTER COLUMN AD_Table_Process_ID SET DEFAULT nextval('ad_table_process_seq')
;
commit;
update AD_Table_Process set AD_Table_Process_ID=nextval('ad_table_process_seq') where AD_Table_Process_ID is null;
commit;
-- 2019-01-25T17:32:49.541
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
ALTER TABLE AD_Table_Process ALTER COLUMN AD_Table_Process_ID SET NOT NULL
;
-- 2019-01-25T17:32:49.549
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
ALTER TABLE AD_Table_Process DROP CONSTRAINT IF EXISTS ad_table_process_pkey
;
-- 2019-01-25T17:32:49.556
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
ALTER TABLE AD_Table_Process DROP CONSTRAINT IF EXISTS ad_table_process_key
;
-- 2019-01-25T17:32:49.565
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
ALTER TABLE AD_Table_Process ADD CONSTRAINT ad_table_process_pkey PRIMARY KEY (AD_Table_Process_ID)
;
-- 2019-01-25T17:32:49.746
-- 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,IsDisplayed,IsDisplayedGrid,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,563987,574200,0,53389,TO_TIMESTAMP('2019-01-25 17:32:49','YYYY-MM-DD HH24:MI:SS'),100,10,'D','Y','N','N','N','N','N','N','N','Table Process',TO_TIMESTAMP('2019-01-25 17:32:49','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-25T17:32:49.747
-- 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=574200 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)
;
-- 2019-01-25T17:32:49.832
-- 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,IsDisplayed,IsDisplayedGrid,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,563987,574201,0,53388,TO_TIMESTAMP('2019-01-25 17:32:49','YYYY-MM-DD HH24:MI:SS'),100,10,'D','Y','N','N','N','N','N','N','N','Table Process',TO_TIMESTAMP('2019-01-25 17:32:49','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-01-25T17:32:49.832
-- 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=574201 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)
; | the_stack |
DROP TABLE IF EXISTS QRTZ_FIRED_TRIGGERS;
DROP TABLE IF EXISTS QRTZ_PAUSED_TRIGGER_GRPS;
DROP TABLE IF EXISTS QRTZ_SCHEDULER_STATE;
DROP TABLE IF EXISTS QRTZ_LOCKS;
DROP TABLE IF EXISTS QRTZ_SIMPLE_TRIGGERS;
DROP TABLE IF EXISTS QRTZ_SIMPROP_TRIGGERS;
DROP TABLE IF EXISTS QRTZ_CRON_TRIGGERS;
DROP TABLE IF EXISTS QRTZ_BLOB_TRIGGERS;
DROP TABLE IF EXISTS QRTZ_TRIGGERS;
DROP TABLE IF EXISTS QRTZ_JOB_DETAILS;
DROP TABLE IF EXISTS QRTZ_CALENDARS;
CREATE TABLE QRTZ_JOB_DETAILS
(
SCHED_NAME VARCHAR(120) NOT NULL,
JOB_NAME VARCHAR(200) NOT NULL,
JOB_GROUP VARCHAR(200) NOT NULL,
DESCRIPTION VARCHAR(250) NULL,
JOB_CLASS_NAME VARCHAR(250) NOT NULL,
IS_DURABLE VARCHAR(1) NOT NULL,
IS_NONCONCURRENT VARCHAR(1) NOT NULL,
IS_UPDATE_DATA VARCHAR(1) NOT NULL,
REQUESTS_RECOVERY VARCHAR(1) NOT NULL,
JOB_DATA BLOB NULL,
PRIMARY KEY (SCHED_NAME,JOB_NAME,JOB_GROUP)
);
CREATE TABLE QRTZ_TRIGGERS
(
SCHED_NAME VARCHAR(120) NOT NULL,
TRIGGER_NAME VARCHAR(200) NOT NULL,
TRIGGER_GROUP VARCHAR(200) NOT NULL,
JOB_NAME VARCHAR(200) NOT NULL,
JOB_GROUP VARCHAR(200) NOT NULL,
DESCRIPTION VARCHAR(250) NULL,
NEXT_FIRE_TIME BIGINT(13) NULL,
PREV_FIRE_TIME BIGINT(13) NULL,
PRIORITY INTEGER NULL,
TRIGGER_STATE VARCHAR(16) NOT NULL,
TRIGGER_TYPE VARCHAR(8) NOT NULL,
START_TIME BIGINT(13) NOT NULL,
END_TIME BIGINT(13) NULL,
CALENDAR_NAME VARCHAR(200) NULL,
MISFIRE_INSTR SMALLINT(2) NULL,
JOB_DATA BLOB NULL,
PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
FOREIGN KEY (SCHED_NAME,JOB_NAME,JOB_GROUP)
REFERENCES QRTZ_JOB_DETAILS(SCHED_NAME,JOB_NAME,JOB_GROUP)
);
CREATE TABLE QRTZ_SIMPLE_TRIGGERS
(
SCHED_NAME VARCHAR(120) NOT NULL,
TRIGGER_NAME VARCHAR(200) NOT NULL,
TRIGGER_GROUP VARCHAR(200) NOT NULL,
REPEAT_COUNT BIGINT(7) NOT NULL,
REPEAT_INTERVAL BIGINT(12) NOT NULL,
TIMES_TRIGGERED BIGINT(10) NOT NULL,
PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
);
CREATE TABLE QRTZ_CRON_TRIGGERS
(
SCHED_NAME VARCHAR(120) NOT NULL,
TRIGGER_NAME VARCHAR(200) NOT NULL,
TRIGGER_GROUP VARCHAR(200) NOT NULL,
CRON_EXPRESSION VARCHAR(200) NOT NULL,
TIME_ZONE_ID VARCHAR(80),
PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
);
CREATE TABLE QRTZ_SIMPROP_TRIGGERS
(
SCHED_NAME VARCHAR(120) NOT NULL,
TRIGGER_NAME VARCHAR(200) NOT NULL,
TRIGGER_GROUP VARCHAR(200) NOT NULL,
STR_PROP_1 VARCHAR(512) NULL,
STR_PROP_2 VARCHAR(512) NULL,
STR_PROP_3 VARCHAR(512) NULL,
INT_PROP_1 INT NULL,
INT_PROP_2 INT NULL,
LONG_PROP_1 BIGINT NULL,
LONG_PROP_2 BIGINT NULL,
DEC_PROP_1 NUMERIC(13,4) NULL,
DEC_PROP_2 NUMERIC(13,4) NULL,
BOOL_PROP_1 VARCHAR(1) NULL,
BOOL_PROP_2 VARCHAR(1) NULL,
PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
);
CREATE TABLE QRTZ_BLOB_TRIGGERS
(
SCHED_NAME VARCHAR(120) NOT NULL,
TRIGGER_NAME VARCHAR(200) NOT NULL,
TRIGGER_GROUP VARCHAR(200) NOT NULL,
BLOB_DATA BLOB NULL,
PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
);
CREATE TABLE QRTZ_CALENDARS
(
SCHED_NAME VARCHAR(120) NOT NULL,
CALENDAR_NAME VARCHAR(200) NOT NULL,
CALENDAR BLOB NOT NULL,
PRIMARY KEY (SCHED_NAME,CALENDAR_NAME)
);
CREATE TABLE QRTZ_PAUSED_TRIGGER_GRPS
(
SCHED_NAME VARCHAR(120) NOT NULL,
TRIGGER_GROUP VARCHAR(200) NOT NULL,
PRIMARY KEY (SCHED_NAME,TRIGGER_GROUP)
);
CREATE TABLE QRTZ_FIRED_TRIGGERS
(
SCHED_NAME VARCHAR(120) NOT NULL,
ENTRY_ID VARCHAR(95) NOT NULL,
TRIGGER_NAME VARCHAR(200) NOT NULL,
TRIGGER_GROUP VARCHAR(200) NOT NULL,
INSTANCE_NAME VARCHAR(200) NOT NULL,
FIRED_TIME BIGINT(13) NOT NULL,
SCHED_TIME BIGINT(13) NOT NULL,
PRIORITY INTEGER NOT NULL,
STATE VARCHAR(16) NOT NULL,
JOB_NAME VARCHAR(200) NULL,
JOB_GROUP VARCHAR(200) NULL,
IS_NONCONCURRENT VARCHAR(1) NULL,
REQUESTS_RECOVERY VARCHAR(1) NULL,
PRIMARY KEY (SCHED_NAME,ENTRY_ID)
);
CREATE TABLE QRTZ_SCHEDULER_STATE
(
SCHED_NAME VARCHAR(120) NOT NULL,
INSTANCE_NAME VARCHAR(200) NOT NULL,
LAST_CHECKIN_TIME BIGINT(13) NOT NULL,
CHECKIN_INTERVAL BIGINT(13) NOT NULL,
PRIMARY KEY (SCHED_NAME,INSTANCE_NAME)
);
CREATE TABLE QRTZ_LOCKS
(
SCHED_NAME VARCHAR(120) NOT NULL,
LOCK_NAME VARCHAR(40) NOT NULL,
PRIMARY KEY (SCHED_NAME,LOCK_NAME)
);
# system tables
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for persistent_logins
-- ----------------------------
DROP TABLE IF EXISTS `persistent_logins`;
CREATE TABLE `persistent_logins` (
`username` varchar(64) NOT NULL,
`series` varchar(64) NOT NULL,
`token` varchar(64) NOT NULL,
`last_used` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`series`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of persistent_logins
-- ----------------------------
-- ----------------------------
-- 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` bigint(20) DEFAULT NULL COMMENT '排序',
`CREATE_TIME` datetime DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`DEPT_ID`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of t_dept
-- ----------------------------
INSERT INTO `t_dept` VALUES ('1', '0', '开发部', null, '2018-01-04 15:42:26');
INSERT INTO `t_dept` VALUES ('2', '1', '开发一部', null, '2018-01-04 15:42:34');
INSERT INTO `t_dept` VALUES ('3', '1', '开发二部', null, '2018-01-04 15:42:29');
INSERT INTO `t_dept` VALUES ('4', '0', '市场部', null, '2018-01-04 15:42:36');
INSERT INTO `t_dept` VALUES ('5', '0', '人事部', null, '2018-01-04 15:42:32');
INSERT INTO `t_dept` VALUES ('6', '0', '测试部', null, '2018-01-04 15:42:38');
-- ----------------------------
-- Table structure for t_dict
-- ----------------------------
DROP TABLE IF EXISTS `t_dict`;
CREATE TABLE `t_dict` (
`DICT_ID` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '字典ID',
`KEYY` bigint(20) NOT NULL COMMENT '键',
`VALUEE` varchar(100) NOT NULL COMMENT '值',
`FIELD_NAME` varchar(100) NOT NULL COMMENT '字段名称',
`TABLE_NAME` varchar(100) NOT NULL COMMENT '表名',
PRIMARY KEY (`DICT_ID`)
) ENGINE=InnoDB AUTO_INCREMENT=35 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of t_dict
-- ----------------------------
INSERT INTO `t_dict` VALUES ('1', '0', '男', 'ssex', 't_user');
INSERT INTO `t_dict` VALUES ('2', '1', '女', 'ssex', 't_user');
INSERT INTO `t_dict` VALUES ('3', '2', '保密', 'ssex', 't_user');
INSERT INTO `t_dict` VALUES ('4', '1', '有效', 'status', 't_user');
INSERT INTO `t_dict` VALUES ('5', '0', '锁定', 'status', 't_user');
INSERT INTO `t_dict` VALUES ('6', '0', '菜单', 'type', 't_menu');
INSERT INTO `t_dict` VALUES ('7', '1', '按钮', 'type', 't_menu');
INSERT INTO `t_dict` VALUES ('30', '0', '正常', 'status', 't_job');
INSERT INTO `t_dict` VALUES ('31', '1', '暂停', 'status', 't_job');
INSERT INTO `t_dict` VALUES ('32', '0', '成功', 'status', 't_job_log');
INSERT INTO `t_dict` VALUES ('33', '1', '失败', 'status', 't_job_log');
-- ----------------------------
-- 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(100) NOT NULL COMMENT 'spring bean名称',
`METHOD_NAME` varchar(100) NOT NULL COMMENT '方法名',
`PARAMS` varchar(200) DEFAULT NULL COMMENT '参数',
`CRON_EXPRESSION` varchar(100) NOT NULL COMMENT 'cron表达式',
`STATUS` char(2) NOT NULL COMMENT '任务状态 0:正常 1:暂停',
`REMARK` varchar(200) DEFAULT NULL COMMENT '备注',
`CREATE_TIME` datetime DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`JOB_ID`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of t_job
-- ----------------------------
INSERT INTO `t_job` VALUES ('1', 'testTask', 'test', 'mrbird', '0/1 * * * * ?', '1', '有参任务调度测试', '2018-02-24 16:26:14');
INSERT INTO `t_job` VALUES ('2', 'testTask', 'test1', null, '0/10 * * * * ?', '1', '无参任务调度测试', '2018-02-24 17:06:23');
INSERT INTO `t_job` VALUES ('3', 'testTask', 'test', 'hello world', '0/1 * * * * ?', '1', '有参任务调度测试,每隔一秒触发', '2018-02-26 09:28:26');
INSERT INTO `t_job` VALUES ('11', 'testTask', 'test2', null, '0/5 * * * * ?', '1', '测试异常', '2018-02-26 11:15:30');
-- ----------------------------
-- 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`)
) ENGINE=InnoDB AUTO_INCREMENT=2485 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of t_job_log
-- ----------------------------
INSERT INTO `t_job_log` VALUES ('2448', '3', 'testTask', 'test', 'hello world', '0', null, '0', '2018-03-20 15:31:50');
INSERT INTO `t_job_log` VALUES ('2449', '3', 'testTask', 'test', 'hello world', '0', null, '1', '2018-03-20 15:31:51');
INSERT INTO `t_job_log` VALUES ('2450', '3', 'testTask', 'test', 'hello world', '0', null, '2', '2018-03-20 15:31:52');
INSERT INTO `t_job_log` VALUES ('2451', '3', 'testTask', 'test', 'hello world', '0', null, '0', '2018-03-20 15:31:53');
INSERT INTO `t_job_log` VALUES ('2452', '3', 'testTask', 'test', 'hello world', '0', null, '2', '2018-03-20 15:31:54');
INSERT INTO `t_job_log` VALUES ('2453', '3', 'testTask', 'test', 'hello world', '0', null, '1', '2018-03-20 15:31:55');
INSERT INTO `t_job_log` VALUES ('2454', '3', 'testTask', 'test', 'hello world', '0', null, '0', '2018-03-20 15:31:56');
INSERT INTO `t_job_log` VALUES ('2455', '3', 'testTask', 'test', 'hello world', '0', null, '1', '2018-03-20 15:31:57');
INSERT INTO `t_job_log` VALUES ('2456', '3', 'testTask', 'test', 'hello world', '0', null, '1', '2018-03-20 15:31:59');
INSERT INTO `t_job_log` VALUES ('2457', '3', 'testTask', 'test', 'hello world', '0', null, '1', '2018-03-20 15:31:59');
INSERT INTO `t_job_log` VALUES ('2458', '3', 'testTask', 'test', 'hello world', '0', null, '1', '2018-03-20 15:32:00');
INSERT INTO `t_job_log` VALUES ('2459', '3', 'testTask', 'test', 'hello world', '0', null, '0', '2018-03-20 15:32:01');
INSERT INTO `t_job_log` VALUES ('2460', '3', 'testTask', 'test', 'hello world', '0', null, '5', '2018-03-20 15:32:02');
INSERT INTO `t_job_log` VALUES ('2461', '3', 'testTask', 'test', 'hello world', '0', null, '1', '2018-03-20 15:32:03');
INSERT INTO `t_job_log` VALUES ('2462', '3', 'testTask', 'test', 'hello world', '0', null, '1', '2018-03-20 15:32:04');
INSERT INTO `t_job_log` VALUES ('2463', '3', 'testTask', 'test', 'hello world', '0', null, '1', '2018-03-20 15:32:05');
INSERT INTO `t_job_log` VALUES ('2464', '3', 'testTask', 'test', 'hello world', '0', null, '1', '2018-03-20 15:32:06');
INSERT INTO `t_job_log` VALUES ('2465', '11', 'testTask', 'test2', null, '1', 'java.lang.NoSuchMethodException: cc.mrbird.job.task.TestTask.test2()', '0', '2018-03-20 15:32:26');
INSERT INTO `t_job_log` VALUES ('2466', '2', 'testTask', 'test1', null, '0', null, '1', '2018-04-02 15:26:40');
INSERT INTO `t_job_log` VALUES ('2467', '2', 'testTask', 'test1', null, '0', null, '1', '2018-04-02 15:26:50');
INSERT INTO `t_job_log` VALUES ('2468', '2', 'testTask', 'test1', null, '0', null, '1', '2018-04-02 15:27:20');
INSERT INTO `t_job_log` VALUES ('2469', '2', 'testTask', 'test1', null, '0', null, '3', '2018-04-02 17:29:20');
INSERT INTO `t_job_log` VALUES ('2470', '2', 'testTask', 'test1', null, '0', null, '1', '2018-04-02 17:29:30');
INSERT INTO `t_job_log` VALUES ('2471', '2', 'testTask', 'test1', null, '0', null, '1', '2018-04-02 17:29:40');
INSERT INTO `t_job_log` VALUES ('2472', '2', 'testTask', 'test1', null, '0', null, '14', '2018-04-02 17:29:50');
INSERT INTO `t_job_log` VALUES ('2473', '2', 'testTask', 'test1', null, '0', null, '1', '2018-04-02 17:30:00');
INSERT INTO `t_job_log` VALUES ('2474', '2', 'testTask', 'test1', null, '0', null, '0', '2018-04-02 17:30:10');
INSERT INTO `t_job_log` VALUES ('2475', '2', 'testTask', 'test1', null, '0', null, '1', '2018-04-02 17:30:20');
INSERT INTO `t_job_log` VALUES ('2476', '3', 'testTask', 'test', 'hello world', '0', null, '4', '2018-09-06 14:15:40');
INSERT INTO `t_job_log` VALUES ('2477', '11', 'testTask', 'test2', null, '1', 'java.lang.NoSuchMethodException: cc.mrbird.quartz.task.TestTask.test2()', '11', '2018-09-06 14:15:50');
INSERT INTO `t_job_log` VALUES ('2478', '2', 'testTask', 'test1', null, '0', null, '1', '2018-09-06 14:16:10');
INSERT INTO `t_job_log` VALUES ('2479', '2', 'testTask', 'test1', null, '0', null, '1', '2018-09-06 14:16:19');
INSERT INTO `t_job_log` VALUES ('2480', '2', 'testTask', 'test1', null, '0', null, '1', '2018-09-06 14:16:20');
INSERT INTO `t_job_log` VALUES ('2481', '2', 'testTask', 'test1', null, '0', null, '1', '2018-09-06 14:16:30');
INSERT INTO `t_job_log` VALUES ('2482', '2', 'testTask', 'test1', null, '0', null, '1', '2018-09-06 14:16:40');
INSERT INTO `t_job_log` VALUES ('2483', '2', 'testTask', 'test1', null, '0', null, '1', '2018-09-06 14:16:50');
INSERT INTO `t_job_log` VALUES ('2484', '2', 'testTask', 'test1', null, '0', null, '1', '2018-09-06 14:17:00');
-- ----------------------------
-- 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`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of t_log
-- ----------------------------
-- ----------------------------
-- 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 '菜单/按钮名称',
`URL` varchar(100) DEFAULT NULL COMMENT '菜单URL',
`PERMS` text COMMENT '权限标识',
`ICON` varchar(50) DEFAULT NULL COMMENT '图标',
`TYPE` char(2) NOT NULL COMMENT '类型 0菜单 1按钮',
`ORDER_NUM` bigint(20) DEFAULT NULL COMMENT '排序',
`CREATE_TIME` datetime NOT NULL COMMENT '创建时间',
`MODIFY_TIME` datetime DEFAULT NULL COMMENT '修改时间',
PRIMARY KEY (`MENU_ID`)
) ENGINE=InnoDB AUTO_INCREMENT=117 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of t_menu
-- ----------------------------
INSERT INTO `t_menu` VALUES ('1', '0', '系统管理', null, null, 'zmdi zmdi-settings', '0', '1', '2017-12-27 16:39:07', null);
INSERT INTO `t_menu` VALUES ('2', '0', '系统监控', null, null, 'zmdi zmdi-shield-security', '0', '2', '2017-12-27 16:45:51', '2018-01-17 17:08:28');
INSERT INTO `t_menu` VALUES ('3', '1', '用户管理', 'user', 'user:list', '', '0', '1', '2017-12-27 16:47:13', '2018-04-25 09:00:01');
INSERT INTO `t_menu` VALUES ('4', '1', '角色管理', 'role', 'role:list', '', '0', '2', '2017-12-27 16:48:09', '2018-04-25 09:01:12');
INSERT INTO `t_menu` VALUES ('5', '1', '菜单管理', 'menu', 'menu:list', '', '0', '3', '2017-12-27 16:48:57', '2018-04-25 09:01:30');
INSERT INTO `t_menu` VALUES ('6', '1', '部门管理', 'dept', 'dept:list', '', '0', '4', '2017-12-27 16:57:33', '2018-04-25 09:01:40');
INSERT INTO `t_menu` VALUES ('8', '2', '在线用户', 'session', 'session:list', '', '0', '1', '2017-12-27 16:59:33', '2018-04-25 09:02:04');
INSERT INTO `t_menu` VALUES ('10', '2', '系统日志', 'log', 'log:list', '', '0', '3', '2017-12-27 17:00:50', '2018-04-25 09:02:18');
INSERT INTO `t_menu` VALUES ('11', '3', '新增用户', null, 'user:add', null, '1', null, '2017-12-27 17:02:58', null);
INSERT INTO `t_menu` VALUES ('12', '3', '修改用户', null, 'user:update', null, '1', null, '2017-12-27 17:04:07', null);
INSERT INTO `t_menu` VALUES ('13', '3', '删除用户', null, 'user:delete', null, '1', null, '2017-12-27 17:04:58', null);
INSERT INTO `t_menu` VALUES ('14', '4', '新增角色', null, 'role:add', null, '1', null, '2017-12-27 17:06:38', null);
INSERT INTO `t_menu` VALUES ('15', '4', '修改角色', null, 'role:update', null, '1', null, '2017-12-27 17:06:38', null);
INSERT INTO `t_menu` VALUES ('16', '4', '删除角色', null, 'role:delete', null, '1', null, '2017-12-27 17:06:38', null);
INSERT INTO `t_menu` VALUES ('17', '5', '新增菜单', null, 'menu:add', null, '1', null, '2017-12-27 17:08:02', null);
INSERT INTO `t_menu` VALUES ('18', '5', '修改菜单', null, 'menu:update', null, '1', null, '2017-12-27 17:08:02', null);
INSERT INTO `t_menu` VALUES ('19', '5', '删除菜单', null, 'menu:delete', null, '1', null, '2017-12-27 17:08:02', null);
INSERT INTO `t_menu` VALUES ('20', '6', '新增部门', null, 'dept:add', null, '1', null, '2017-12-27 17:09:24', null);
INSERT INTO `t_menu` VALUES ('21', '6', '修改部门', null, 'dept:update', null, '1', null, '2017-12-27 17:09:24', null);
INSERT INTO `t_menu` VALUES ('22', '6', '删除部门', null, 'dept:delete', null, '1', null, '2017-12-27 17:09:24', null);
INSERT INTO `t_menu` VALUES ('23', '8', '踢出用户', '', 'session:kickout', '', '1', null, '2017-12-27 17:11:13', '2018-09-06 18:45:27');
INSERT INTO `t_menu` VALUES ('24', '10', '删除日志', null, 'log:delete', null, '1', null, '2017-12-27 17:11:45', null);
INSERT INTO `t_menu` VALUES ('58', '0', '网络资源', null, null, 'zmdi zmdi-globe-alt', '0', null, '2018-01-12 15:28:48', '2018-01-22 19:49:26');
INSERT INTO `t_menu` VALUES ('59', '58', '天气查询', 'weather', 'weather:list', '', '0', null, '2018-01-12 15:40:02', '2018-04-25 09:02:57');
INSERT INTO `t_menu` VALUES ('61', '58', '每日一文', 'article', 'article:list', '', '0', null, '2018-01-15 17:17:14', '2018-04-25 09:03:08');
INSERT INTO `t_menu` VALUES ('64', '1', '字典管理', 'dict', 'dict:list', '', '0', null, '2018-01-18 10:38:25', '2018-09-07 21:23:58');
INSERT INTO `t_menu` VALUES ('65', '64', '新增字典', null, 'dict:add', null, '1', null, '2018-01-18 19:10:08', null);
INSERT INTO `t_menu` VALUES ('66', '64', '修改字典', null, 'dict:update', null, '1', null, '2018-01-18 19:10:27', null);
INSERT INTO `t_menu` VALUES ('67', '64', '删除字典', null, 'dict:delete', null, '1', null, '2018-01-18 19:10:47', null);
INSERT INTO `t_menu` VALUES ('81', '58', '影视资讯', null, null, null, '0', null, '2018-01-22 14:12:59', null);
INSERT INTO `t_menu` VALUES ('82', '81', '正在热映', 'movie/hot', 'movie:hot', '', '0', null, '2018-01-22 14:13:47', '2018-04-25 09:03:48');
INSERT INTO `t_menu` VALUES ('83', '81', '即将上映', 'movie/coming', 'movie:coming', '', '0', null, '2018-01-22 14:14:36', '2018-04-25 09:04:05');
INSERT INTO `t_menu` VALUES ('101', '0', '任务调度', null, null, 'zmdi zmdi-alarm', '0', null, '2018-02-24 15:52:57', null);
INSERT INTO `t_menu` VALUES ('102', '101', '定时任务', 'job', 'job:list', '', '0', null, '2018-02-24 15:53:53', '2018-04-25 09:05:12');
INSERT INTO `t_menu` VALUES ('103', '102', '新增任务', null, 'job:add', null, '1', null, '2018-02-24 15:55:10', null);
INSERT INTO `t_menu` VALUES ('104', '102', '修改任务', null, 'job:update', null, '1', null, '2018-02-24 15:55:53', null);
INSERT INTO `t_menu` VALUES ('105', '102', '删除任务', null, 'job:delete', null, '1', null, '2018-02-24 15:56:18', null);
INSERT INTO `t_menu` VALUES ('106', '102', '暂停任务', null, 'job:pause', null, '1', null, '2018-02-24 15:57:08', null);
INSERT INTO `t_menu` VALUES ('107', '102', '恢复任务', null, 'job:resume', null, '1', null, '2018-02-24 15:58:21', null);
INSERT INTO `t_menu` VALUES ('108', '102', '立即执行任务', null, 'job:run', null, '1', null, '2018-02-24 15:59:45', null);
INSERT INTO `t_menu` VALUES ('109', '101', '调度日志', 'jobLog', 'jobLog:list', '', '0', null, '2018-02-24 16:00:45', '2018-04-25 09:05:25');
INSERT INTO `t_menu` VALUES ('110', '109', '删除日志', null, 'jobLog:delete', null, '1', null, '2018-02-24 16:01:21', null);
INSERT INTO `t_menu` VALUES ('113', '2', 'Redis监控', 'redis/info', 'redis:list', '', '0', null, '2018-06-28 14:29:42', null);
INSERT INTO `t_menu` VALUES ('114', '2', 'Redis终端', 'redis/terminal', 'redis:terminal', '', '0', null, '2018-06-28 15:35:21', null);
-- ----------------------------
-- 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(100) 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`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of t_role
-- ----------------------------
INSERT INTO `t_role` VALUES ('1', '管理员', '管理员', '2017-12-27 16:23:11', '2018-02-24 16:01:45');
INSERT INTO `t_role` VALUES ('2', '注册用户', '注册用户', '2018-09-04 16:23:09', '2018-09-15 14:56:53');
-- ----------------------------
-- Table structure for t_role_menu
-- ----------------------------
DROP TABLE IF EXISTS `t_role_menu`;
CREATE TABLE `t_role_menu` (
`ROLE_ID` bigint(20) NOT NULL COMMENT '角色ID',
`MENU_ID` bigint(20) NOT NULL COMMENT '菜单/按钮ID'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of t_role_menu
-- ----------------------------
INSERT INTO `t_role_menu` VALUES ('1', '59');
INSERT INTO `t_role_menu` VALUES ('1', '2');
INSERT INTO `t_role_menu` VALUES ('1', '3');
INSERT INTO `t_role_menu` VALUES ('1', '67');
INSERT INTO `t_role_menu` VALUES ('1', '1');
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', '20');
INSERT INTO `t_role_menu` VALUES ('1', '21');
INSERT INTO `t_role_menu` VALUES ('1', '22');
INSERT INTO `t_role_menu` VALUES ('1', '10');
INSERT INTO `t_role_menu` VALUES ('1', '8');
INSERT INTO `t_role_menu` VALUES ('1', '58');
INSERT INTO `t_role_menu` VALUES ('1', '66');
INSERT INTO `t_role_menu` VALUES ('1', '11');
INSERT INTO `t_role_menu` VALUES ('1', '12');
INSERT INTO `t_role_menu` VALUES ('1', '64');
INSERT INTO `t_role_menu` VALUES ('1', '13');
INSERT INTO `t_role_menu` VALUES ('1', '14');
INSERT INTO `t_role_menu` VALUES ('1', '65');
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', '23');
INSERT INTO `t_role_menu` VALUES ('1', '81');
INSERT INTO `t_role_menu` VALUES ('1', '82');
INSERT INTO `t_role_menu` VALUES ('1', '83');
INSERT INTO `t_role_menu` VALUES ('1', '19');
INSERT INTO `t_role_menu` VALUES ('1', '24');
INSERT INTO `t_role_menu` VALUES ('1', '61');
INSERT INTO `t_role_menu` VALUES ('1', '101');
INSERT INTO `t_role_menu` VALUES ('1', '102');
INSERT INTO `t_role_menu` VALUES ('1', '103');
INSERT INTO `t_role_menu` VALUES ('1', '104');
INSERT INTO `t_role_menu` VALUES ('1', '105');
INSERT INTO `t_role_menu` VALUES ('1', '106');
INSERT INTO `t_role_menu` VALUES ('1', '107');
INSERT INTO `t_role_menu` VALUES ('1', '108');
INSERT INTO `t_role_menu` VALUES ('1', '109');
INSERT INTO `t_role_menu` VALUES ('1', '110');
INSERT INTO `t_role_menu` VALUES ('1', '113');
INSERT INTO `t_role_menu` VALUES ('1', '114');
INSERT INTO `t_role_menu` VALUES ('2', '1');
INSERT INTO `t_role_menu` VALUES ('2', '3');
INSERT INTO `t_role_menu` VALUES ('2', '4');
INSERT INTO `t_role_menu` VALUES ('2', '2');
INSERT INTO `t_role_menu` VALUES ('2', '8');
INSERT INTO `t_role_menu` VALUES ('2', '11');
INSERT INTO `t_role_menu` VALUES ('2', '14');
INSERT INTO `t_role_menu` VALUES ('2', '5');
INSERT INTO `t_role_menu` VALUES ('2', '17');
INSERT INTO `t_role_menu` VALUES ('2', '6');
INSERT INTO `t_role_menu` VALUES ('2', '20');
INSERT INTO `t_role_menu` VALUES ('2', '64');
INSERT INTO `t_role_menu` VALUES ('2', '65');
INSERT INTO `t_role_menu` VALUES ('2', '10');
INSERT INTO `t_role_menu` VALUES ('2', '113');
INSERT INTO `t_role_menu` VALUES ('2', '114');
INSERT INTO `t_role_menu` VALUES ('2', '58');
INSERT INTO `t_role_menu` VALUES ('2', '59');
INSERT INTO `t_role_menu` VALUES ('2', '61');
INSERT INTO `t_role_menu` VALUES ('2', '81');
INSERT INTO `t_role_menu` VALUES ('2', '82');
INSERT INTO `t_role_menu` VALUES ('2', '83');
INSERT INTO `t_role_menu` VALUES ('2', '101');
INSERT INTO `t_role_menu` VALUES ('2', '102');
INSERT INTO `t_role_menu` VALUES ('2', '103');
INSERT INTO `t_role_menu` VALUES ('2', '109');
-- ----------------------------
-- 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有效',
`CRATE_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女',
`THEME` varchar(10) DEFAULT NULL COMMENT '主题',
`AVATAR` varchar(100) DEFAULT NULL COMMENT '头像',
`DESCRIPTION` varchar(100) DEFAULT NULL COMMENT '描述',
PRIMARY KEY (`USER_ID`)
) ENGINE=InnoDB AUTO_INCREMENT=171 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of t_user
-- ----------------------------
INSERT INTO `t_user` VALUES ('1', 'mrbird', '$2a$10$WRUqPfZUAhRgwaiuBPE0XeUoPZKFgGTkRjaU04dHnL99leE4kBv1W', '1', 'mrbird@qq.com', '17788888888', '1', '2018-08-22 11:37:47', '2018-09-15 14:53:52', '2018-08-27 21:27:18', '2', 'green', '20180414165909.jpg', '我是创始人');
INSERT INTO `t_user` VALUES ('2', 'scott', '$2a$10$vtf0gsIpFnzs3x9kA/2fW.oV41aAXFt4e4S0vBURGuFdLJ5F7xx2W', '2', 'scott@qq.com', '', '1', '2018-08-22 11:37:47', '2018-09-15 14:54:36', '2018-08-27 21:27:18', '1', 'red', '20180414170003.jpg', '');
-- ----------------------------
-- Table structure for t_userconnection
-- ----------------------------
DROP TABLE IF EXISTS `t_userconnection`;
CREATE TABLE `t_userconnection` (
`userId` varchar(255) NOT NULL,
`providerId` varchar(255) NOT NULL,
`providerUserId` varchar(255) NOT NULL,
`rank` int(11) NOT NULL,
`displayName` varchar(255) DEFAULT NULL,
`profileUrl` varchar(512) DEFAULT NULL,
`imageUrl` varchar(512) DEFAULT NULL,
`accessToken` varchar(512) NOT NULL,
`secret` varchar(512) DEFAULT NULL,
`refreshToken` varchar(512) DEFAULT NULL,
`expireTime` bigint(20) DEFAULT NULL,
PRIMARY KEY (`userId`,`providerId`,`providerUserId`),
UNIQUE KEY `UserConnectionRank` (`userId`,`providerId`,`rank`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- 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'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of t_user_role
-- ----------------------------
INSERT INTO `t_user_role` VALUES ('1', '1');
INSERT INTO `t_user_role` VALUES ('2', '2');
commit; | the_stack |
-- 12.07.2016 16:49
-- 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,543131,0,'RfQ_InvitationWithoutQty_MailText_ID',TO_TIMESTAMP('2016-07-12 16:49:30','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.rfq','Y','RfQ without Qty Invitation mail text','RfQ without Qty Invitation mail text',TO_TIMESTAMP('2016-07-12 16:49:30','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 12.07.2016 16:49
-- 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=543131 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)
;
-- 12.07.2016 16:50
-- 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,543132,0,'RfQ_InvitationWithoutQty_PrintFormat_ID',TO_TIMESTAMP('2016-07-12 16:50:08','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.rfq','Y','RfQ without Qty Invitation Druck - Format','RfQ without Qty Invitation Druck - Format',TO_TIMESTAMP('2016-07-12 16:50:08','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 12.07.2016 16:50
-- 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=543132 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)
;
-- 12.07.2016 16:52
-- 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,554813,543131,0,18,274,671,'N','RfQ_InvitationWithoutQty_MailText_ID',TO_TIMESTAMP('2016-07-12 16:52:15','YYYY-MM-DD HH24:MI:SS'),100,'N','de.metas.rfq',10,'Y','N','Y','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','Y','N','RfQ without Qty Invitation mail text',0,TO_TIMESTAMP('2016-07-12 16:52:15','YYYY-MM-DD HH24:MI:SS'),100,0)
;
-- 12.07.2016 16:52
-- 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=554813 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)
;
-- 12.07.2016 16:52
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
ALTER TABLE C_RfQ_Topic ADD RfQ_InvitationWithoutQty_MailText_ID NUMERIC(10) DEFAULT NULL
;
-- 12.07.2016 16:52
-- 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,554814,543132,0,18,259,671,'N','RfQ_InvitationWithoutQty_PrintFormat_ID',TO_TIMESTAMP('2016-07-12 16:52:48','YYYY-MM-DD HH24:MI:SS'),100,'N','de.metas.rfq',10,'Y','N','Y','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','Y','N','RfQ without Qty Invitation Druck - Format',0,TO_TIMESTAMP('2016-07-12 16:52:48','YYYY-MM-DD HH24:MI:SS'),100,1)
;
-- 12.07.2016 16:52
-- 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=554814 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)
;
-- 12.07.2016 16:52
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
ALTER TABLE C_RfQ_Topic ADD RfQ_InvitationWithoutQty_PrintFormat_ID NUMERIC(10) DEFAULT NULL
;
-- 12.07.2016 16:53
-- 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,554813,557046,0,619,TO_TIMESTAMP('2016-07-12 16:53:23','YYYY-MM-DD HH24:MI:SS'),100,10,'de.metas.rfq','Y','Y','Y','N','N','N','N','N','RfQ without Qty Invitation mail text',TO_TIMESTAMP('2016-07-12 16:53:23','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 12.07.2016 16:53
-- 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=557046 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)
;
-- 12.07.2016 16:53
-- 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,554814,557047,0,619,TO_TIMESTAMP('2016-07-12 16:53:23','YYYY-MM-DD HH24:MI:SS'),100,10,'de.metas.rfq','Y','Y','Y','N','N','N','N','N','RfQ without Qty Invitation Druck - Format',TO_TIMESTAMP('2016-07-12 16:53:23','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 12.07.2016 16:53
-- 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=557047 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)
;
-- 12.07.2016 16:53
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=90,Updated=TO_TIMESTAMP('2016-07-12 16:53:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557046
;
-- 12.07.2016 16:53
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=100,Updated=TO_TIMESTAMP('2016-07-12 16:53:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557047
;
-- 12.07.2016 16:53
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=110,Updated=TO_TIMESTAMP('2016-07-12 16:53:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557003
;
-- 12.07.2016 16:53
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=120,Updated=TO_TIMESTAMP('2016-07-12 16:53:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557017
;
-- 12.07.2016 16:53
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=130,Updated=TO_TIMESTAMP('2016-07-12 16:53:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557004
;
-- 12.07.2016 16:53
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=140,Updated=TO_TIMESTAMP('2016-07-12 16:53:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557018
;
-- 12.07.2016 16:53
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=150,Updated=TO_TIMESTAMP('2016-07-12 16:53:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557032
;
-- 12.07.2016 16:53
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=160,Updated=TO_TIMESTAMP('2016-07-12 16:53:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557033
;
-- 12.07.2016 16:53
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayedGrid='Y', SeqNoGrid=110,Updated=TO_TIMESTAMP('2016-07-12 16:53:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557003
;
-- 12.07.2016 16:53
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayedGrid='Y', SeqNoGrid=130,Updated=TO_TIMESTAMP('2016-07-12 16:53:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557004
;
-- 12.07.2016 16:53
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayedGrid='Y', SeqNoGrid=120,Updated=TO_TIMESTAMP('2016-07-12 16:53:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557017
;
-- 12.07.2016 16:53
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayedGrid='Y', SeqNoGrid=140,Updated=TO_TIMESTAMP('2016-07-12 16:53:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557018
;
-- 12.07.2016 16:53
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayedGrid='Y', SeqNoGrid=150,Updated=TO_TIMESTAMP('2016-07-12 16:53:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557032
;
-- 12.07.2016 16:53
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayedGrid='Y', SeqNoGrid=160,Updated=TO_TIMESTAMP('2016-07-12 16:53:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557033
;
-- 12.07.2016 16:53
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayedGrid='Y', SeqNoGrid=90,Updated=TO_TIMESTAMP('2016-07-12 16:53:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557046
;
-- 12.07.2016 16:53
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayedGrid='Y', SeqNoGrid=100,Updated=TO_TIMESTAMP('2016-07-12 16:53:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557047
;
-- 12.07.2016 16:54
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET AD_FieldGroup_ID=540085,Updated=TO_TIMESTAMP('2016-07-12 16:54:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557016
;
-- 12.07.2016 16:54
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET AD_FieldGroup_ID=540085,Updated=TO_TIMESTAMP('2016-07-12 16:54:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557046
;
-- 12.07.2016 16:54
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET AD_FieldGroup_ID=540085, IsSameLine='Y',Updated=TO_TIMESTAMP('2016-07-12 16:54:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557047
;
-- 12.07.2016 16:54
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET AD_FieldGroup_ID=540085,Updated=TO_TIMESTAMP('2016-07-12 16:54:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557017
;
-- 12.07.2016 16:54
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET AD_FieldGroup_ID=540085,Updated=TO_TIMESTAMP('2016-07-12 16:54:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=557018
;
-- 12.07.2016 17:01
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET DefaultValue='0', IsMandatory='Y',Updated=TO_TIMESTAMP('2016-07-12 17:01:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=554459
;
-- 12.07.2016 17:01
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO t_alter_column values('c_rfqresponseline','QtyRequiered','NUMERIC',null,'0')
;
-- 12.07.2016 17:01
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE C_RfQResponseLine SET QtyRequiered=0 WHERE QtyRequiered IS NULL
;
-- 12.07.2016 17:01
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO t_alter_column values('c_rfqresponseline','QtyRequiered',null,'NOT NULL',null)
; | the_stack |
-- create schema
CREATE SCHEMA IF NOT EXISTS recall;
--
-- update the config table
--
ALTER TABLE _recall_config ADD tpl_table REGCLASS;
ALTER TABLE _recall_config ADD log_table REGCLASS;
-- fetch the table OIDs
UPDATE _recall_config SET tpl_table = oid FROM pg_class l WHERE relname = tblid||'_tpl';
UPDATE _recall_config SET log_table = oid FROM pg_class l WHERE relname = tblid||'_log';
-- set new columns non-null
ALTER TABLE _recall_config ALTER tpl_table SET NOT NULL;
ALTER TABLE _recall_config ALTER log_table SET NOT NULL;
-- move it to the recall schema
ALTER TABLE _recall_config SET SCHEMA recall;
ALTER TABLE recall._recall_config RENAME TO _config;
-- TODO move log and tpl tables
CREATE FUNCTION recall.__migrate_tables() RETURNS VOID AS $$
DECLARE
tbl REGCLASS;
overlapPkeys TEXT[];
k NAME;
BEGIN
FOR tbl IN SELECT tblid FROM recall._config
LOOP
EXECUTE format('ALTER TABLE %I SET SCHEMA recall', tbl||'_log');
EXECUTE format('ALTER TABLE %I SET SCHEMA recall', tbl||'_tpl');
-- init overlapPkeys
overlapPkeys = ARRAY[]::TEXT[];
FOR k IN SELECT unnest(pkey_cols) FROM recall._config WHERE tblid = tbl
LOOP
overlapPkeys = array_append(overlapPkeys, format('%I WITH =', k));
END LOOP;
-- drop primary key
EXECUTE format('ALTER TABLE recall.%I DROP CONSTRAINT %I', tbl||'_log', tbl||'_log_pkey');
-- replace timestamp columns
EXECUTE format('ALTER TABLE recall.%I ADD _log_time TSTZRANGE DEFAULT tstzrange(now(), NULL)', tbl||'_log');
EXECUTE format('UPDATE recall.%I SET _log_time = tstzrange(_log_start, _log_end)', tbl||'_log');
EXECUTE format('ALTER TABLE recall.%I DROP COLUMN _log_start', tbl||'_log');
EXECUTE format('ALTER TABLE recall.%I DROP COLUMN _log_end', tbl||'_log');
EXECUTE format('ALTER TABLE recall.%I ALTER _log_time SET NOT NULL', tbl||'_log');
-- add EXCLUDE and CHECK constraints to the log tables
EXECUTE format('ALTER TABLE recall.%I ADD CONSTRAINT %I EXCLUDE USING gist (%s, _log_time WITH &&)',
tbl||'_log',
tbl||'_log_no_overlays',
array_to_string(overlapPkeys, ', '));
EXECUTE format('ALTER TABLE recall.%I ADD CONSTRAINT %I CHECK (NOT isempty(_log_time))',
tbl||'_log',
tbl||'_log_not_empty');
END LOOP;
END;
$$ LANGUAGE plpgsql;
SELECT recall.__migrate_tables();
DROP FUNCTION recall.__migrate_tables();
--
-- move and rename the functions (we're moving them to make sure
--
-- move the functions to the 'recall' schema
ALTER FUNCTION recall_enable(REGCLASS, INTERVAL) SET SCHEMA recall;
ALTER FUNCTION recall_disable(REGCLASS) SET SCHEMA recall;
ALTER FUNCTION recall_trigfn() SET SCHEMA recall;
ALTER FUNCTION recall_cleanup(REGCLASS) SET SCHEMA recall;
ALTER FUNCTION recall_cleanup_all() SET SCHEMA recall;
ALTER FUNCTION recall_at(REGCLASS,TIMESTAMPTZ) SET SCHEMA recall;
-- remove the table prefixes
ALTER FUNCTION recall.recall_enable(tbl REGCLASS, logInterval INTERVAL) RENAME TO enable;
ALTER FUNCTION recall.recall_disable(REGCLASS) RENAME TO disable;
ALTER FUNCTION recall.recall_trigfn() RENAME TO _trigfn;
ALTER FUNCTION recall.recall_cleanup(REGCLASS) RENAME TO cleanup;
ALTER FUNCTION recall.recall_cleanup_all() RENAME TO cleanup_all;
ALTER FUNCTION recall.recall_at(REGCLASS,TIMESTAMPTZ) RENAME TO at;
--
-- helper view (translates table OIDs to their name + schema (and back))
--
CREATE VIEW recall._tablemapping AS
SELECT t.oid AS id, n.nspname AS schema, t.relname AS name
FROM pg_class t INNER JOIN pg_namespace n ON (t.relnamespace = n.oid);
--
-- installer function
--
CREATE FUNCTION recall.enable(tbl REGCLASS, logInterval INTERVAL, tgtSchema NAME) RETURNS VOID AS $$
DECLARE
pkeyCols NAME[];
overlapPkeys TEXT[]; -- list of pkey checks (in the form of 'colName WITH =') to be used in the EXCLUDE constraint of the log table
cols TEXT[];
k NAME;
tblSchema NAME; tblName NAME;
prefix NAME;
tplTable REGCLASS;
logTable REGCLASS;
BEGIN
-- get the schema and local table name for tbl (and construct tplTable and logTable from them)
SELECT schema, name INTO tblSchema, tblName FROM recall._tablemapping WHERE id = tbl;
IF tblSchema = 'public' OR tblSchema = tgtSchema THEN
prefix := tblName;
ELSE
prefix := tblSchema||'__'||tblName;
END IF;
-- fetch the table's primary key columns (source: https://wiki.postgresql.org/wiki/Retrieve_primary_key_columns )
SELECT ARRAY(
SELECT a.attname INTO pkeyCols FROM pg_index i JOIN pg_attribute a ON (a.attrelid = i.indrelid AND a.attnum = ANY(i.indkey))
WHERE i.indrelid = tbl AND i.indisprimary
);
IF COALESCE(array_ndims(pkeyCols), 0) < 1 THEN
RAISE EXCEPTION 'You need a primary key on your table if you want to use pg_recall (table: %)!', tbl;
END IF;
-- update existing entry if exists (and return in that case)
UPDATE recall._config SET log_interval = logInterval, pkey_cols = pkeyCols, last_cleanup = NULL WHERE tblid = tbl;
IF FOUND THEN
RAISE NOTICE 'recall.enable(%, %) called on an already managed table. Updating log_interval and pkey_cols, clearing last_cleanup', tbl, logInterval;
RETURN;
END IF;
-- init overlapPkeys
FOREACH k IN ARRAY pkeyCols
LOOP
overlapPkeys = array_append(overlapPkeys, format('%I WITH =', k));
END LOOP;
-- create the _tpl table (without constraints)
EXECUTE format('CREATE TABLE %I.%I (LIKE %I.%I)', tgtSchema, prefix||'_tpl', tblSchema, tblName);
-- create the _log table
EXECUTE format('CREATE TABLE %I.%I (
_log_time TSTZRANGE NOT NULL DEFAULT tstzrange(now(), NULL),
EXCLUDE USING gist (%s, _log_time WITH &&),
CHECK (NOT isempty(_log_time))
) INHERITS (%I.%I)',
tgtSchema, prefix||'_log',
array_to_string(overlapPkeys, ', '),
tgtSchema, prefix||'_tpl'
);
-- make the _tpl table the parent of the data table
EXECUTE format('ALTER TABLE %I.%I INHERIT %I.%I', tblSchema, tblName, tgtSchema, prefix||'_tpl');
-- set the trigger
EXECUTE format('CREATE TRIGGER trig_recall AFTER INSERT OR UPDATE OR DELETE ON %I.%I
FOR EACH ROW EXECUTE PROCEDURE recall._trigfn()', tblSchema, tblName);
-- add config table entry
tplTable = format('%I.%I', tgtSchema, prefix||'_tpl');
logTable = format('%I.%I', tgtSchema, prefix||'_log');
INSERT INTO recall._config (tblid, log_interval, pkey_cols, tpl_table, log_table) VALUES (tbl, logInterval, pkeyCols, tplTable, logTable);
-- get list of columns and insert current database state into the log table
SELECT ARRAY(
SELECT format('%I', attname) INTO cols FROM pg_attribute WHERE attrelid = tplTable AND attnum > 0 AND attisdropped = false
);
EXECUTE format('INSERT INTO %I.%I (%s) SELECT %s FROM %I.%I',
tgtSchema, prefix||'_log',
array_to_string(cols, ', '),
array_to_string(cols, ', '),
tblSchema, tblName);
END;
$$ LANGUAGE plpgsql;
CREATE OR REPLACE FUNCTION recall.enable(tbl REGCLASS, logInterval INTERVAL) RETURNS VOID AS $$
BEGIN
PERFORM recall.enable(tbl, logInterval, 'recall');
END;
$$ LANGUAGE plpgsql;
--
-- uninstaller function
--
CREATE OR REPLACE FUNCTION recall.disable(tbl REGCLASS) RETURNS VOID AS $$
DECLARE
tplTable REGCLASS;
logTable REGCLASS;
tblSchema NAME; tblName NAME;
tplSchema NAME; tplName NAME;
logSchema NAME; logName NAME;
BEGIN
-- remove config table entry (and raise an exception if there was none)
DELETE FROM recall._config WHERE tblid = tbl RETURNING tpl_table, log_table INTO tplTable, logTable;
IF NOT FOUND THEN
RAISE EXCEPTION 'The table "%" is not managed by pg_recall', tbl;
END IF;
-- get schema and table names
SELECT schema, name INTO tblSchema, tblName FROM recall._tablemapping WHERE id = tbl;
SELECT schema, name INTO tplSchema, tplName FROM recall._tablemapping WHERE id = tplTable;
SELECT schema, name INTO logSchema, logName FROM recall._tablemapping WHERE id = logTable;
-- drop temp view created by recall.at (if it exists)
EXECUTE format('DROP VIEW IF EXISTS %I', tbl||'_past');
-- remove inheritance
EXECUTE format('ALTER TABLE %I.%I NO INHERIT %I.%I', tblSchema, tblName, tplSchema, tplName);
-- drop extra tables
EXECUTE format('DROP TABLE %I.%I', logSchema, logName);
EXECUTE format('DROP TABLE %I.%I', tplSchema, tplName);
-- delete trigger
EXECUTE format('DROP TRIGGER trig_recall ON %I', tbl);
END;
$$ LANGUAGE plpgsql;
--
-- Trigger function
--
CREATE OR REPLACE FUNCTION recall._trigfn() RETURNS TRIGGER AS $$
DECLARE
tplTable REGCLASS;
logTable REGCLASS;
tblSchema NAME; tblName NAME;
logSchema NAME; logName NAME;
pkeyCols TEXT[];
pkeyChecks TEXT[]; -- array of 'colName = $1.colName' strings
assignments TEXT[]; -- array of 'colname = $2.colName' strings (for the UPDATE statement)
cols TEXT[]; -- will be filled with escaped column names (in the same order as the vals below)
vals TEXT[]; -- will contain the equivalent of NEW.<colName> for each of the columns in the _tpl table
col TEXT; -- loop variable
updateCount INTEGER;
BEGIN
if TG_OP = 'UPDATE' AND OLD = NEW THEN
RAISE INFO 'pg_recall: row unchanged, no need to write to log';
RETURN NEW;
END IF;
-- Fetch the table's config
SELECT pkey_cols, tpl_table, log_table INTO pkeyCols, tplTable, logTable FROM recall._config WHERE tblid = TG_RELID;
-- fetch table schema and names
SELECT schema, name INTO tblSchema, tblName FROM recall._tablemapping WHERE id = TG_RELID;
SELECT schema, name INTO logSchema, logName FROM recall._tablemapping WHERE id = logTable;
IF TG_OP IN ('UPDATE', 'DELETE') THEN
-- build WHERE clauses in the form of 'pkeyCol = OLD.pkeyCol' for each of the primary key columns
-- (they will later be joined with ' AND ' inbetween)
FOREACH col IN ARRAY pkeyCols
LOOP
pkeyChecks = array_append(pkeyChecks, format('%I = $1.%I', col, col));
END LOOP;
-- mark old log entries as outdated
EXECUTE format('UPDATE %I.%I SET _log_time = tstzrange(LOWER(_log_time), now()) WHERE %s AND upper_inf(_log_time) AND LOWER(_log_time) != now()',
logSchema, logName,
array_to_string(pkeyChecks, ' AND ')) USING OLD;
END IF;
IF TG_OP IN ('INSERT', 'UPDATE') THEN
-- get all columns of the _tpl table and put them into the cols and vals arrays
-- (source: http://dba.stackexchange.com/a/22420/85760 )
FOR col IN SELECT attname FROM pg_attribute WHERE attrelid = tplTable AND attnum > 0 AND attisdropped = false
LOOP
-- for the INSERT
cols = array_append(cols, format('%I', col));
vals = array_append(vals, format('$1.%I', col));
-- for the UPDATE
assignments = array_append(assignments, format('%I = $2.%I', col, col));
END LOOP;
-- for UPDATE statements, check if the value's been changed before (see #16)
updateCount := 0;
IF TG_OP = 'UPDATE' THEN
-- we can reuse pkeyChecks here
EXECUTE format('UPDATE %I.%I SET %s WHERE %s AND LOWER(_log_time) = now()',
logSchema, logName,
array_to_string(assignments, ', '),
array_to_string(pkeyChecks, ' AND ')
) USING OLD, NEW;
GET DIAGNOSTICS updateCount = ROW_COUNT;
END IF;
IF updateCount = 0 THEN
-- create the log entry (as there was nothing to update)
EXECUTE format('INSERT INTO %I.%I (%s) VALUES (%s)',
logSchema, logName,
array_to_string(cols, ', '),
array_to_string(vals, ', ')
) USING NEW;
END IF;
END IF;
RETURN new;
END;
$$ LANGUAGE plpgsql;
--
-- Cleanup functions (return the number of deleted rows)
--
CREATE OR REPLACE FUNCTION recall.cleanup(tbl REGCLASS) RETURNS INTEGER AS $$
DECLARE
logInterval INTERVAL;
rc INTEGER;
logTable REGCLASS;
logSchema NAME;
logName NAME;
BEGIN
-- get the log table and interval (and update last_cleanup while we're at it)
UPDATE recall._config SET last_cleanup = now() WHERE tblId = tbl RETURNING log_interval, log_table INTO logInterval, logTable;
-- resolve the log table's schema and name
SELECT schema, name INTO logSchema, logName FROM recall._tablemapping WHERE id = logTable;
RAISE NOTICE 'recall: Cleaning up table %', tbl;
-- Remove old entries
EXECUTE format('DELETE FROM %I.%I WHERE UPPER(_log_time) < now() - $1', logSchema, logName) USING logInterval;
GET DIAGNOSTICS rc = ROW_COUNT;
RETURN rc;
END;
$$ LANGUAGE plpgsql;
-- convenience cleanup function
CREATE OR REPLACE FUNCTION recall.cleanup_all() RETURNS VOID AS $$
DECLARE
tbl REGCLASS;
BEGIN
FOR tbl in SELECT tblid FROM recall._config
LOOP
PERFORM recall.cleanup(tbl);
END LOOP;
END;
$$ LANGUAGE plpgsql;
--
-- Query past state
--
CREATE OR REPLACE FUNCTION recall.at(tbl REGCLASS, ts TIMESTAMPTZ) RETURNS REGCLASS AS $$
DECLARE
tplTable REGCLASS;
logTable REGCLASS;
tblSchema NAME; tblName NAME;
logSchema NAME; logName NAME;
viewName NAME;
cols TEXT[];
BEGIN
-- initialize vars
SELECT tpl_table, log_table INTO tplTable, logTable FROM recall._config WHERE tblid = tbl;
SELECT schema, name INTO tblSchema, tblName FROM recall._tablemapping WHERE id = tbl;
SELECT schema, name INTO logSchema, logName FROM recall._tablemapping WHERE id = logTable;
viewName := tblName||'_past';
-- get (escaped) list of columns
SELECT ARRAY(
SELECT format('%I', attname) INTO cols FROM pg_attribute WHERE attrelid = tplTable AND attnum > 0 AND attisdropped = false
);
EXECUTE format('CREATE OR REPLACE TEMPORARY VIEW %I AS SELECT %s FROM %I.%I WHERE _log_time @> %L::timestamptz',
viewName,
array_to_string(cols, ', '),
logSchema, logName,
ts
);
return viewName;
END;
$$ LANGUAGE plpgsql; | the_stack |
SET NOCOUNT ON
-- DBCC TRACEON(3656, -1) WITH NO_INFOMSGS
GO
IF OBJECT_ID('tempdb..#filename') IS NOT NULL
BEGIN
DROP TABLE #filename
END
DECLARE @sessoin_id int = (SELECT @@SPID)
SELECT N'query_analyze_' + CAST(@sessoin_id AS varchar(6)) + '_' + FORMAT(GETDATE(), 'yyyyMMddHHmmss') AS filename INTO #filename
DECLARE @file_name sysname =(SELECT filename FROM #filename)
/******************************************************************/
-- 前処理
/******************************************************************/
-- 拡張イベントの存在確認 (存在している場合は削除)
IF EXISTS (SELECT 1 FROM sys.server_event_sessions WHERE name = 'query_analyze')
BEGIN
DROP EVENT SESSION [query_analyze] ON SERVER
END
-- 自セッションの ID でフィルターした拡張イベントを作成
DECLARE @sql nvarchar(max) = N'
CREATE EVENT SESSION [query_analyze] ON SERVER
ADD EVENT sqlserver.lock_acquired(SET collect_database_name=(1),collect_resource_description=(1)
ACTION(package0.callstack,sqlserver.session_id,sqlserver.query_hash,sqlserver.query_plan_hash,sql_text)
WHERE ([sqlserver].[session_id]=(@@session_id))),
ADD EVENT sqlserver.lock_released(SET collect_database_name=(1),collect_resource_description=(1)
ACTION(package0.callstack,sqlserver.session_id,sqlserver.query_hash,sqlserver.query_plan_hash,sql_text)
WHERE ([sqlserver].[session_id]=(@@session_id))),
ADD EVENT sqlserver.rpc_completed(
ACTION(package0.callstack,sqlserver.session_id,sqlserver.query_hash,sqlserver.query_plan_hash)
WHERE ([sqlserver].[session_id]=(@@session_id))),
ADD EVENT sqlserver.sp_statement_completed(SET collect_statement=(1)
ACTION(package0.callstack,sqlserver.session_id,sqlserver.query_hash,sqlserver.query_plan_hash)
WHERE ([sqlserver].[session_id]=(@@session_id))),
ADD EVENT sqlos.wait_info(
ACTION(package0.callstack,sqlserver.session_id,sqlserver.query_hash,sqlserver.query_plan_hash)
WHERE ([sqlserver].[session_id]=(@@session_id))),
ADD EVENT sqlserver.sql_statement_completed(
ACTION(package0.callstack,sqlserver.session_id,sqlserver.query_hash,sqlserver.query_plan_hash)
WHERE ([sqlserver].[session_id]=(@@session_id))),
ADD EVENT sqlserver.query_post_execution_showplan(
ACTION(package0.callstack,sqlserver.query_hash,sqlserver.query_plan_hash,sqlserver.session_id)
WHERE ([sqlserver].[session_id]=(@@session_id)))
-- ADD TARGET package0.ring_buffer(SET max_events_limit=(20000),max_memory=(0))
ADD TARGET package0.event_file(SET filename=N''@@file_name'',max_file_size=(1000))
'
SET @sql = REPLACE(@sql, '@@session_id', @sessoin_id)
SET @sql = REPLACE(@sql, '@@file_name', @file_name)
EXECUTE(@sql)
---- 実行統計の取得
--SET STATISTICS TIME ON
--SET STATISTICS IO ON
-- 各種累計値の実行前の状態を取得
IF OBJECT_ID('tempdb..#session_tempdb_before') IS NOT NULL
BEGIN
DROP TABLE #session_tempdb_before
END
SELECT * INTO #session_tempdb_before FROM sys.dm_db_session_space_usage WHERE session_id = @sessoin_id
IF OBJECT_ID('tempdb..#session_before') IS NOT NULL
BEGIN
DROP TABLE #session_before
END
SELECT * INTO #session_before FROM sys.dm_exec_sessions WHERE session_id = @sessoin_id
-- イベントセッションの開始
ALTER EVENT SESSION [query_analyze] ON SERVER STATE = START
/******************************************************************/
GO
DECLARE @start datetime2
SET @start = (SELECT GETDATE())
/***********************************************************************/
-- 情報を確認するクエリを以下に記載して実行
use tpch;
SELECT * FROM REGION OPTION(RECOMPILE)
--DBCC FREEPROCCACHE WITH NO_INFOMSGS
--DBCC DROPCLEANBUFFERS WITH NO_INFOMSGS
--SELECT TOP 100 S_ACCTBAL, S_NAME, N_NAME, P_PARTKEY, P_MFGR, S_ADDRESS, S_PHONE, S_COMMENT
--FROM PART, SUPPLIER, PARTSUPP, NATION, REGION
--WHERE P_PARTKEY = PS_PARTKEY AND S_SUPPKEY = PS_SUPPKEY AND P_SIZE = 15 AND
--P_TYPE LIKE '%%BRASS' AND S_NATIONKEY = N_NATIONKEY AND N_REGIONKEY = R_REGIONKEY AND
--R_NAME = 'EUROPE' AND
--PS_SUPPLYCOST = (SELECT MIN(PS_SUPPLYCOST) FROM PARTSUPP, SUPPLIER, NATION, REGION
-- WHERE P_PARTKEY = PS_PARTKEY AND S_SUPPKEY = PS_SUPPKEY
-- AND S_NATIONKEY = N_NATIONKEY AND N_REGIONKEY = R_REGIONKEY AND R_NAME = 'EUROPE')
--ORDER BY S_ACCTBAL DESC, N_NAME, S_NAME, P_PARTKEY
--OPTION(QUERYTRACEON 8675, QUERYTRACEON 3604);
----DBCC FREEPROCCACHE WITH NO_INFOMSGS
--DBCC DROPCLEANBUFFERS WITH NO_INFOMSGS
--SELECT TOP 100 S_ACCTBAL, S_NAME, N_NAME, P_PARTKEY, P_MFGR, S_ADDRESS, S_PHONE, S_COMMENT
--FROM PART, SUPPLIER, PARTSUPP, NATION, REGION
--WHERE P_PARTKEY = PS_PARTKEY AND S_SUPPKEY = PS_SUPPKEY AND P_SIZE = 15 AND
--P_TYPE LIKE '%%BRASS' AND S_NATIONKEY = N_NATIONKEY AND N_REGIONKEY = R_REGIONKEY AND
--R_NAME = 'EUROPE' AND
--PS_SUPPLYCOST = (SELECT MIN(PS_SUPPLYCOST) FROM PARTSUPP, SUPPLIER, NATION, REGION
-- WHERE P_PARTKEY = PS_PARTKEY AND S_SUPPKEY = PS_SUPPKEY
-- AND S_NATIONKEY = N_NATIONKEY AND N_REGIONKEY = R_REGIONKEY AND R_NAME = 'EUROPE')
--ORDER BY S_ACCTBAL DESC, N_NAME, S_NAME, P_PARTKEY
--OPTION(QUERYTRACEON 8780,QUERYTRACEON 8757, QUERYTRACEON 8675, QUERYTRACEON 3604);
/***********************************************************************/
PRINT 'Queyr End : Elapsed Time (ms) : ' + CAST(DATEDIFF(MILLISECOND, @start, GETDATE()) AS varchar(20))
GO
/******************************************************************/
-- 後処理
/******************************************************************/
--SET STATISTICS TIME OFF
--SET STATISTICS IO OFF
-- イベントセッションの停止
ALTER EVENT SESSION [query_analyze] ON SERVER STATE = STOP
/******************************************************************/
GO
/******************************************************************/
-- 取得情報の分析
-- 分析のための tempdb への情報出力等があるため、情報の正確性には留意する
/******************************************************************/
-- ファイル名の設定
DECLARE @sessoin_id int = (SELECT @@SPID)
DECLARE @file_name sysname =(SELECT filename FROM #filename)
DECLARE @start datetime2
-- セッション情報を出力
SET @start = (SELECT GETDATE())
SELECT
'session_info' AS info_type,
T1.last_request_start_time,
T1.last_request_end_time,
T1.login_time,
T1.session_id,
(T1.cpu_time - T2.cpu_time) / 1000.0 AS cpu_time_sec,
(T1.total_scheduled_time - T2.total_scheduled_time) / 1000.0 AS total_scheduled_time_sec,
(T1.total_elapsed_time - T2.total_elapsed_time) / 1000.0 AS total_elapsed_time_sec,
(T1.memory_usage - T2.memory_usage) * 8.0 / 1024 AS memory_usage_mb,
(T1.reads - T2.reads) * 8.0 / 1024.0 AS physical_reads_mb,
(T1.logical_reads - T2.logical_reads) * 8.0 / 1024 AS logical_reads_mb,
(T1.writes - T2.writes) * 8.0 / 1024.0 AS writes_mb
FROM
sys.dm_exec_sessions AS T1
LEFT JOIN
#session_before AS T2
ON
T1.session_id = T2.session_id
WHERE
T1.session_id = @@SPID
PRINT 'session_info : Elapsed Time (ms) : ' + CAST(DATEDIFF(MILLISECOND, @start, GETDATE()) AS varchar(20))
-- tempdb の使用状況を取得
SET @start = (SELECT GETDATE())
SELECT
'tempdb_info' AS info_type,
(T1.user_objects_alloc_page_count - T2.user_objects_alloc_page_count) * 8.0 / 1024.0 AS user_objects_alloc_mb_count,
(T1.user_objects_dealloc_page_count - T2.user_objects_dealloc_page_count) * 8.0 / 1024.0 AS user_objects_dealloc_mb_count,
(T1.internal_objects_alloc_page_count - T2.internal_objects_alloc_page_count) * 8.0 / 1024.0 AS internal_objects_alloc_mb_count,
(T1.internal_objects_dealloc_page_count - T2.internal_objects_dealloc_page_count) * 8.0 / 1024.0 AS internal_objects_dealloc_mb_count
FROM
sys.dm_db_session_space_usage AS T1
LEFT JOIN
#session_tempdb_before AS T2
ON
T1.session_id = T2.session_id
WHERE
T1.session_id = @@SPID
PRINT 'tempdb_info elapsed time (ms) : ' + CAST(DATEDIFF(MILLISECOND, @start, GETDATE()) AS varchar(20))
-- ######### 以下、拡張イベントの分析 #########
-- 取得した拡張イベントのログを一時テーブルに格納
SET @start = (SELECT GETDATE())
IF OBJECT_ID('tempdb..#tmp') IS NOT NULL
BEGIN
DROP TABLE #tmp
END
SELECT
ROW_NUMBER() OVER(ORDER BY object_name ASC) AS No,
-- timestamp_utc,
object_name,
CAST(event_data AS xml) AS event_data
INTO #tmp
FROM
sys.fn_xe_file_target_read_file (@file_name + '*.xel', NULL, NULL, NULL);
PRINT 'xevent load : Elapsed Time (ms) : ' + CAST(DATEDIFF(MILLISECOND, @start, GETDATE()) AS varchar(20))
-- 後続の拡張イベントの XML の分析の最適化のため、XML インデックスを設定
SET @start = (SELECT GETDATE())
ALTER TABLE #tmp ALTER COLUMN object_name nvarchar(60) NOT NULL
ALTER TABLE #tmp ALTER COLUMN No int NOT NULL
ALTER TABLE #tmp ADD CONSTRAINT PK_xevent_trace_tmp_index PRIMARY KEY CLUSTERED (object_name, No)
CREATE PRIMARY XML INDEX IX_xevent_trace_xml_index ON #tmp(event_data)
PRINT 'xevent create index : Elapsed Time (ms) : ' + CAST(DATEDIFF(MILLISECOND, @start, GETDATE()) AS varchar(20))
-- ステートメントの情報を確認
SET @start = (SELECT GETDATE())
SELECT
'xevent_statement_info' AS info_type,
T.statemet_text,
T2.query_object_name,
T2.query_object_type,
T2.query_plan,
T2.missing_index,
T.duration_sec,
T2.duration_sec AS plan_duration_sec,
T.cpu_time_sec,
T2.cpu_time_sec as plan_cpu_time_sec,
T2.CompileTime,
T2.CompileCPU,
T2.StatementOptmEarlyAbortReason,
T2.UsedThreads,
T2.estimated_cost,
T2.ideal_memory_kb,
T2.granted_memory_kb,
T2.used_memory_kb,
T.logical_reads_mb,
T.physical_reads_mb,
T.writes_mb,
T.spills_mb,
T.row_count,
T2.estimated_rows,
T2.dop
FROM(
SELECT
*
FROM(
SELECT
--timestamp_utc,
object_name,
event_data.value('(/event/@timestamp)[1]', 'datetime') AS query_timestamp,
event_data.value('(/event/action[@name="query_hash"])[1]', 'varchar(30)') AS query_hash,
event_data.value('(/event/action[@name="query_plan_hash"])[1]', 'varchar(30)') AS query_plan_hash,
event_data.value('(/event/data[@name="statement"]/value)[1]', 'nvarchar(max)') AS statemet_text,
event_data.value('(/event/data[@name="duration"]/value)[1]', 'int') / 1000000.0 AS duration_sec,
event_data.value('(/event/data[@name="cpu_time"]/value)[1]', 'int') / 1000000.0 AS cpu_time_sec,
event_data.value('(/event/data[@name="logical_reads"]/value)[1]', 'bigint') * 8.0 / 1024.0 AS logical_reads_mb,
event_data.value('(/event/data[@name="physical_reads"]/value)[1]', 'bigint') * 8.0 / 1024.0 AS physical_reads_mb,
event_data.value('(/event/data[@name="writes"]/value)[1]', 'bigint') * 8.0 / 1024.0 AS writes_mb,
event_data.value('(/event/data[@name="spills"]/value)[1]', 'bigint') * 8.0 / 1024.0 AS spills_mb,
event_data.value('(/event/data[@name="row_count"]/value)[1]', 'bigint') AS row_count
-- ,event_Data
FROM
#tmp
WHERE
object_name = 'sql_statement_completed'
OR
object_name = 'rpc_completed'
OR
object_name = 'sp_statement_completed'
) AS T
WHERE
query_hash <> '0'
) AS T
LEFT JOIN (
SELECT
*
FROM(
SELECT
'xevent_statement_info' AS info_type,
--timestamp_utc,
object_name,
T.query_plan.query('.') AS query_plan,
T.query_plan.query('declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/showplan";
./descendant::MissingIndexes') AS missing_index,
T.query_plan.value('declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/showplan";
(./descendant::StmtSimple/@StatementOptmEarlyAbortReason)[1]', 'sysname') AS StatementOptmEarlyAbortReason,
T.query_plan.value('declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/showplan";
(./descendant::StmtSimple/QueryPlan/@CachedPlanSize)[1]', 'int') AS CachedPlanSize,
event_data.value('(/event/@timestamp)[1]', 'datetime') AS query_timestamp,
T.query_plan.value('declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/showplan";
(./descendant::StmtSimple/QueryPlan/@CompileTime)[1]', 'int') AS CompileTime,
T.query_plan.value('declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/showplan";
(./descendant::StmtSimple/QueryPlan/@CompileCPU)[1]', 'int') AS CompileCPU,
T.query_plan.value('declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/showplan";
(./descendant::StmtSimple/QueryPlan/@CompileMemory)[1]', 'int') AS CompileMemory,
T.query_plan.value('declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/showplan";
(./descendant::StmtSimple/QueryPlan/ThreadStat/@UsedThreads)[1]', 'int') AS UsedThreads,
event_data.value('(/event/action[@name="query_hash"])[1]', 'varchar(30)') AS query_hash,
event_data.value('(/event/action[@name="query_plan_hash"])[1]', 'varchar(30)') AS query_plan_hash,
event_data.value('(/event/data[@name="dop"]/value)[1]', 'int') AS dop,
event_data.value('(/event/data[@name="cpu_time"]/value)[1]', 'int')/ 1000000.0 AS cpu_time_sec,
event_data.value('(/event/data[@name="estimated_rows"]/value)[1]', 'int') AS estimated_rows,
event_data.value('(/event/data[@name="estimated_cost"]/value)[1]', 'int') AS estimated_cost,
event_data.value('(/event/data[@name="serial_ideal_memory_kb"]/value)[1]', 'int') AS serial_ideal_memory_kb,
event_data.value('(/event/data[@name="requested_memory_kb"]/value)[1]', 'int') AS requested_memory_kb,
event_data.value('(/event/data[@name="used_memory_kb"]/value)[1]', 'int') AS used_memory_kb,
event_data.value('(/event/data[@name="ideal_memory_kb"]/value)[1]', 'int') AS ideal_memory_kb,
event_data.value('(/event/data[@name="granted_memory_kb"]/value)[1]', 'int') AS granted_memory_kb,
event_data.value('(/event/data[@name="duration"]/value)[1]', 'int') / 1000000.0 AS duration_sec,
event_data.value('(/event/data[@name="object_name"]/value)[1]', 'sysname') AS query_object_name,
event_data.value('(/event/data[@name="object_type"]/text)[1]', 'sysname') AS query_object_type,
event_Data
FROM
#tmp
OUTER APPLY #tmp.event_data.nodes('/event/data[@name="showplan_xml"]/value/*') as T(query_plan)
WHERE
object_name = 'query_post_execution_showplan'
) AS T
WHERE
query_hash <> '0'
) AS T2
ON
T2.query_hash = T.query_hash
AND
T2.query_plan_hash =T.query_plan_hash
ORDER BY T.query_timestamp ASC
PRINT 'xevent_statement_info : Elapsed Time (ms) : ' + CAST(DATEDIFF(MILLISECOND, @start, GETDATE()) AS varchar(20))
-- 待ち事象の情報を確認
SET @start = (SELECT GETDATE())
SELECT
'xevent_wait_info' AS info_type,
T.query_hash,
T.query_plan_hash,
Q.statemet_text,
T.wait_type,
COUNT(*) AS wait_count,
(SUM(T.duration_ms)) / 1000.0 AS total_duration_sec
FROM
(
SELECT
No,
--timestamp_utc,
object_name,
event_data.value('(/event/action[@name="query_hash"])[1]', 'varchar(30)') AS query_hash,
event_data.value('(/event/action[@name="query_plan_hash"])[1]', 'varchar(30)') AS query_plan_hash,
event_data.value('(/event/data[@name="wait_type"]/text)[1]', 'sysname') AS wait_type,
event_data.value('(/event/data[@name="duration"]/value)[1]', 'int') AS duration_ms
FROM
#tmp
WHERE
object_name = 'wait_info'
) AS T
LEFT JOIN
(
SELECT
*
FROM(
SELECT
event_data.value('(/event/action[@name="query_hash"])[1]', 'varchar(30)') AS query_hash,
event_data.value('(/event/action[@name="query_plan_hash"])[1]', 'varchar(30)') AS query_plan_hash,
event_data.value('(/event/data[@name="statement"]/value)[1]', 'nvarchar(max)') AS statemet_text
FROM
#tmp
WHERE
object_name = 'sql_statement_completed'
OR
object_name = 'rpc_completed'
OR
object_name = 'sp_statement_completed'
) AS T2
) AS Q
ON
T.query_hash = Q.query_hash
AND
T.query_plan_hash = Q.query_plan_hash
WHERE
T.query_hash <> '0'
GROUP BY
Q.statemet_text,
T.wait_type,
T.query_hash,
T.query_plan_hash
ORDER BY
Q.statemet_text,
SUM(T.duration_ms) DESC
PRINT 'xevent_wait_info : Elapsed Time (ms) : ' + CAST(DATEDIFF(MILLISECOND, @start, GETDATE()) AS varchar(20))
-- 取得した拡張イベントからロックの情報を取得
SET @start = (SELECT GETDATE())
SELECT
'xevent_lock_info' AS info_type,
xevent_object_name,
event_timestamp,
database_name,
resource_type,
mode,
CASE
WHEN database_name = DB_NAME(DB_ID()) THEN
CASE
WHEN resource_type = 'OBJECT' THEN
OBJECT_NAME(object_id)
WHEN resource_type = 'METADATA' THEN
OBJECT_NAME(resource_description_object_id)
ELSE object_id
END
WHEN database_name = 'master' AND resource_type = 'OBJECT' THEN
OBJECT_NAME(object_id)
ELSE
object_id
END AS object_name,
CASE
WHEN resource_description_stats_id IS NOT NULL THEN
(SELECT name FROM sys.stats AS s WHERE s.object_id = resource_description_object_id AND s.stats_id = resource_description_stats_id)
WHEN resource_description_index_or_stats_id IS NOT NULL THEN
(SELECT name FROM sys.stats AS s WHERE s.object_id = resource_description_object_id AND s.stats_id = resource_description_index_or_stats_id)
ELSE
NULL
END AS index_or_stats_name,
resource_description,
duration,
sql_text
--,SUM(duration) / 1000 AS total_duration_ms
--,COUNT(*) AS count
FROM
(
SELECT
No,
--timestamp_utc,
object_name AS xevent_object_name,
event_data.value('(/event/@timestamp)[1]', 'varchar(24)') as event_timestamp,
event_data.value('(/event/data[@name="resource_type"]/text)[1]', 'sysname') AS resource_type,
event_data.value('(/event/data[@name="database_name"]/value)[1]', 'sysname') AS database_name,
event_data.value('(/event/data[@name="mode"]/text)[1]', 'sysname') AS mode,
event_data.value('(/event/data[@name="object_id"]/value)[1]', 'sysname') AS object_id,
event_data.value('(/event/data[@name="duration"]/value)[1]', 'int') AS duration,
event_data.value('(/event/data[@name="resource_0"]/value)[1]', 'sysname') AS resource_0,
event_data.value('(/event/data[@name="resource_1"]/value)[1]', 'sysname') AS resource_1,
event_data.value('(/event/data[@name="resource_2"]/value)[1]', 'sysname') AS resource_2,
event_data.value('(/event/data[@name="resource_description"]/value)[1]', 'sysname') AS resource_description,
CASE
WHEN
CHARINDEX('object_id = ', event_data.value('(/event/data[@name="resource_description"]/value)[1]', 'sysname')) > 0
THEN
SUBSTRING(
event_data.value('(/event/data[@name="resource_description"]/value)[1]', 'sysname'),
CHARINDEX('=', event_data.value('(/event/data[@name="resource_description"]/value)[1]', 'sysname')) + 2,
CHARINDEX(',', event_data.value('(/event/data[@name="resource_description"]/value)[1]', 'sysname'))
-
(CHARINDEX('=', event_data.value('(/event/data[@name="resource_description"]/value)[1]', 'sysname')) + 2)
)
ELSE
event_data.value('(/event/data[@name="object_id"]/value)[1]', 'sysname')
END AS resource_description_object_id,
CASE
WHEN
CHARINDEX(', stats_id = ', event_data.value('(/event/data[@name="resource_description"]/value)[1]', 'sysname')) > 0
THEN
SUBSTRING(
event_data.value('(/event/data[@name="resource_description"]/value)[1]', 'sysname'),
CHARINDEX(', stats_id = ', event_data.value('(/event/data[@name="resource_description"]/value)[1]', 'sysname')) + LEN(', stats_id = ') + 1,
LEN(event_data.value('(/event/data[@name="resource_description"]/value)[1]', 'sysname'))
-
CHARINDEX(', stats_id = ', event_data.value('(/event/data[@name="resource_description"]/value)[1]', 'sysname')) + LEN(', stats_id = ') + 1
)
ELSE
NULL
END AS resource_description_stats_id,
CASE
WHEN
CHARINDEX(', index_id or stats_id = ', event_data.value('(/event/data[@name="resource_description"]/value)[1]', 'sysname')) > 0
THEN
SUBSTRING(
event_data.value('(/event/data[@name="resource_description"]/value)[1]', 'sysname'),
CHARINDEX(', index_id or stats_id = ', event_data.value('(/event/data[@name="resource_description"]/value)[1]', 'sysname')) + LEN(', index_id or stats_id = ') + 1,
LEN(event_data.value('(/event/data[@name="resource_description"]/value)[1]', 'sysname'))
-
CHARINDEX(', index_id or stats_id = ', event_data.value('(/event/data[@name="resource_description"]/value)[1]', 'sysname')) + LEN(', index_id or stats_id = ') + 1
)
ELSE
NULL
END AS resource_description_index_or_stats_id,
event_data.value('(/event/action[@name="sql_text"]/value)[1]', 'nvarchar(max)') AS sql_text,
event_data
FROM
#tmp
WHERE
object_name IN('lock_acquired', 'lock_released')
--AND event_data.value('(/event/data[@name="resource_type"]/text)[1]', 'sysname') = 'METADATA'
) AS T
--GROUP BY
-- resource_type,
-- database_name,
-- mode,
-- object_id,
-- resource_description_object_id,
-- resource_description_stats_id,
-- resource_description_index_or_stats_id
ORDER BY
event_timestamp
--database_name,
--resource_type,
--mode,
--index_or_stats_name
PRINT 'xevent_lock_info : Elapsed Time (ms) : ' + CAST(DATEDIFF(MILLISECOND, @start, GETDATE()) AS varchar(20))
---- 使用した拡張イベントの削除
--IF EXISTS (SELECT 1 FROM sys.server_event_sessions WHERE name = 'query_analyze')
--BEGIN
-- DROP EVENT SESSION [query_analyze] ON SERVER
--END
/******************************************************************/ | the_stack |
-- ----------------------------
-- Table structure for sys_auditlog
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[sys_auditlog]') AND type IN ('U'))
DROP TABLE [dbo].[sys_auditlog]
GO
CREATE TABLE [dbo].[sys_auditlog] (
[Id] bigint IDENTITY(1,1) NOT NULL,
[Key] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[IP] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[Browser] nvarchar(200) COLLATE Chinese_PRC_CI_AS NULL,
[Os] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[Device] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[BrowserInfo] nvarchar(300) COLLATE Chinese_PRC_CI_AS NULL,
[ElapsedMilliseconds] bigint NULL,
[TenantId] int NULL,
[UserId] bigint NULL,
[UserAccount] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[ParamsString] nvarchar(max) COLLATE Chinese_PRC_CI_AS NULL,
[StartTime] datetime2(0) NULL,
[StopTime] datetime2(0) NULL,
[RequestMethod] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[RequestApi] nvarchar(300) COLLATE Chinese_PRC_CI_AS NULL,
[CreationTime] datetime2(0) NULL,
[ResponseState] varchar(1) COLLATE Chinese_PRC_CI_AS NULL,
[ResponseData] nvarchar(max) COLLATE Chinese_PRC_CI_AS NULL
)
GO
ALTER TABLE [dbo].[sys_auditlog] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'主键Id',
'SCHEMA', N'dbo',
'TABLE', N'sys_auditlog',
'COLUMN', N'Id'
GO
EXEC sp_addextendedproperty
'MS_Description', N'拦截Key',
'SCHEMA', N'dbo',
'TABLE', N'sys_auditlog',
'COLUMN', N'Key'
GO
EXEC sp_addextendedproperty
'MS_Description', N'IP',
'SCHEMA', N'dbo',
'TABLE', N'sys_auditlog',
'COLUMN', N'IP'
GO
EXEC sp_addextendedproperty
'MS_Description', N'浏览器',
'SCHEMA', N'dbo',
'TABLE', N'sys_auditlog',
'COLUMN', N'Browser'
GO
EXEC sp_addextendedproperty
'MS_Description', N'操作系统',
'SCHEMA', N'dbo',
'TABLE', N'sys_auditlog',
'COLUMN', N'Os'
GO
EXEC sp_addextendedproperty
'MS_Description', N'设备',
'SCHEMA', N'dbo',
'TABLE', N'sys_auditlog',
'COLUMN', N'Device'
GO
EXEC sp_addextendedproperty
'MS_Description', N'浏览器信息',
'SCHEMA', N'dbo',
'TABLE', N'sys_auditlog',
'COLUMN', N'BrowserInfo'
GO
EXEC sp_addextendedproperty
'MS_Description', N'耗时(毫秒)',
'SCHEMA', N'dbo',
'TABLE', N'sys_auditlog',
'COLUMN', N'ElapsedMilliseconds'
GO
EXEC sp_addextendedproperty
'MS_Description', N'租户Id',
'SCHEMA', N'dbo',
'TABLE', N'sys_auditlog',
'COLUMN', N'TenantId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'用户id',
'SCHEMA', N'dbo',
'TABLE', N'sys_auditlog',
'COLUMN', N'UserId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'用户账号',
'SCHEMA', N'dbo',
'TABLE', N'sys_auditlog',
'COLUMN', N'UserAccount'
GO
EXEC sp_addextendedproperty
'MS_Description', N'请求参数',
'SCHEMA', N'dbo',
'TABLE', N'sys_auditlog',
'COLUMN', N'ParamsString'
GO
EXEC sp_addextendedproperty
'MS_Description', N'开始执行时间',
'SCHEMA', N'dbo',
'TABLE', N'sys_auditlog',
'COLUMN', N'StartTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'结束执行时间',
'SCHEMA', N'dbo',
'TABLE', N'sys_auditlog',
'COLUMN', N'StopTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'请求方式',
'SCHEMA', N'dbo',
'TABLE', N'sys_auditlog',
'COLUMN', N'RequestMethod'
GO
EXEC sp_addextendedproperty
'MS_Description', N'请求Api',
'SCHEMA', N'dbo',
'TABLE', N'sys_auditlog',
'COLUMN', N'RequestApi'
GO
EXEC sp_addextendedproperty
'MS_Description', N' 创建时间',
'SCHEMA', N'dbo',
'TABLE', N'sys_auditlog',
'COLUMN', N'CreationTime'
GO
-- ----------------------------
-- Records of sys_auditlog
-- ----------------------------
SET IDENTITY_INSERT [dbo].[sys_auditlog] ON
GO
INSERT INTO [dbo].[sys_auditlog] ([Id], [Key], [IP], [Browser], [Os], [Device], [BrowserInfo], [ElapsedMilliseconds], [TenantId], [UserId], [UserAccount], [ParamsString], [StartTime], [StopTime], [RequestMethod], [RequestApi], [CreationTime], [ResponseState], [ResponseData]) VALUES (N'1', N'ac4d7331-da63-4ffc-8b5c-b16a3e5e0903', N'127.0.0.1', N'Chrome', N'Windows', N'', N'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36', N'85', N'0', N'0', NULL, N'{}', N'2021-10-10 11:19:23', N'2021-10-10 11:19:23', N'post', N'api/identity/getguid', N'2021-10-10 11:19:23', N'1', NULL)
GO
INSERT INTO [dbo].[sys_auditlog] ([Id], [Key], [IP], [Browser], [Os], [Device], [BrowserInfo], [ElapsedMilliseconds], [TenantId], [UserId], [UserAccount], [ParamsString], [StartTime], [StopTime], [RequestMethod], [RequestApi], [CreationTime], [ResponseState], [ResponseData]) VALUES (N'2', N'49620026-8070-4188-8551-8b349a3b8aa1', N'127.0.0.1', N'Chrome', N'Windows', N'', N'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36', N'82', N'0', N'0', NULL, N'{
"guidKey": "4029e649-f08a-413f-bfb2-d4575ceb6214"
}', N'2021-10-10 11:19:23', N'2021-10-10 11:19:23', N'get', N'api/identity/getverificationcode', N'2021-10-10 11:19:23', N'0', NULL)
GO
INSERT INTO [dbo].[sys_auditlog] ([Id], [Key], [IP], [Browser], [Os], [Device], [BrowserInfo], [ElapsedMilliseconds], [TenantId], [UserId], [UserAccount], [ParamsString], [StartTime], [StopTime], [RequestMethod], [RequestApi], [CreationTime], [ResponseState], [ResponseData]) VALUES (N'3', N'f0256853-c3cf-4feb-87b7-38b8a14a2d82', N'127.0.0.1', N'Chrome', N'Windows', N'', N'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36', N'518', N'0', N'0', NULL, N'{
"loginUserDto": {
"userId": "admin",
"pwd": "123456",
"TenantId": 1,
"validateCode": "bqwi",
"GuidKey": "4029e649-f08a-413f-bfb2-d4575ceb6214"
}
}', N'2021-10-10 11:19:28', N'2021-10-10 11:19:29', N'post', N'api/identity/gettokenbylogin', N'2021-10-10 11:19:29', N'1', NULL)
GO
INSERT INTO [dbo].[sys_auditlog] ([Id], [Key], [IP], [Browser], [Os], [Device], [BrowserInfo], [ElapsedMilliseconds], [TenantId], [UserId], [UserAccount], [ParamsString], [StartTime], [StopTime], [RequestMethod], [RequestApi], [CreationTime], [ResponseState], [ResponseData]) VALUES (N'4', N'881023ac-8e15-4fb2-ac96-eb301fe22525', N'127.0.0.1', N'Chrome', N'Windows', N'', N'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36', N'77', N'0', N'1', N'admin', N'{
"input": {
"CurrentPage": 1,
"PageSize": 10,
"Filter": {
"QueryString": ""
}
}
}', N'2021-10-10 11:19:30', N'2021-10-10 11:19:30', N'post', N'api/sysuser/getpageuserlist', N'2021-10-10 11:19:30', N'1', NULL)
GO
INSERT INTO [dbo].[sys_auditlog] ([Id], [Key], [IP], [Browser], [Os], [Device], [BrowserInfo], [ElapsedMilliseconds], [TenantId], [UserId], [UserAccount], [ParamsString], [StartTime], [StopTime], [RequestMethod], [RequestApi], [CreationTime], [ResponseState], [ResponseData]) VALUES (N'5', N'ae2dd798-00d1-4018-b05a-f256eb30de0f', N'127.0.0.1', N'Chrome', N'Windows', N'', N'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36', N'52', N'0', N'1', N'admin', N'{
"input": {
"QueryString": ""
}
}', N'2021-10-10 11:19:32', N'2021-10-10 11:19:32', N'post', N'api/sysdatadictionary/getsysdatadictionarylist', N'2021-10-10 11:19:32', N'1', NULL)
GO
INSERT INTO [dbo].[sys_auditlog] ([Id], [Key], [IP], [Browser], [Os], [Device], [BrowserInfo], [ElapsedMilliseconds], [TenantId], [UserId], [UserAccount], [ParamsString], [StartTime], [StopTime], [RequestMethod], [RequestApi], [CreationTime], [ResponseState], [ResponseData]) VALUES (N'6', N'f8437997-65dc-469e-8792-bce9cb8c8e92', N'127.0.0.1', N'Chrome', N'Windows', N'', N'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36', N'91', N'0', N'1', N'admin', N'{
"input": {
"QueryString": ""
}
}', N'2021-10-10 11:19:33', N'2021-10-10 11:19:33', N'post', N'api/sysorganization/getsysorganizationlist', N'2021-10-10 11:19:33', N'1', NULL)
GO
INSERT INTO [dbo].[sys_auditlog] ([Id], [Key], [IP], [Browser], [Os], [Device], [BrowserInfo], [ElapsedMilliseconds], [TenantId], [UserId], [UserAccount], [ParamsString], [StartTime], [StopTime], [RequestMethod], [RequestApi], [CreationTime], [ResponseState], [ResponseData]) VALUES (N'7', N'e1d16891-05fd-450c-b08a-154e79ce89ca', N'127.0.0.1', N'Chrome', N'Windows', N'', N'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36', N'57', N'0', N'1', N'admin', N'{
"input": {
"CurrentPage": 1,
"PageSize": 10,
"Filter": {
"QueryString": ""
}
}
}', N'2021-10-10 11:19:35', N'2021-10-10 11:19:35', N'post', N'api/sysrole/getpagesysrolelist', N'2021-10-10 11:19:35', N'1', NULL)
GO
INSERT INTO [dbo].[sys_auditlog] ([Id], [Key], [IP], [Browser], [Os], [Device], [BrowserInfo], [ElapsedMilliseconds], [TenantId], [UserId], [UserAccount], [ParamsString], [StartTime], [StopTime], [RequestMethod], [RequestApi], [CreationTime], [ResponseState], [ResponseData]) VALUES (N'8', N'bc826ca5-0bac-4a9f-87f2-b48e4a5becb5', N'127.0.0.1', N'Chrome', N'Windows', N'', N'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36', N'740', N'0', N'1', N'admin', N'{
"input": {
"CurrentPage": 1,
"PageSize": 10,
"Filter": {
"QueryString": ""
},
"PublishDateRange": null
}
}', N'2021-10-10 11:19:38', N'2021-10-10 11:19:39', N'post', N'api/book/getpagebooklist', N'2021-10-10 11:19:39', N'1', NULL)
GO
INSERT INTO [dbo].[sys_auditlog] ([Id], [Key], [IP], [Browser], [Os], [Device], [BrowserInfo], [ElapsedMilliseconds], [TenantId], [UserId], [UserAccount], [ParamsString], [StartTime], [StopTime], [RequestMethod], [RequestApi], [CreationTime], [ResponseState], [ResponseData]) VALUES (N'9', N'bc826ca5-0bac-4a9f-87f2-b48e4a5becb5', N'127.0.0.1', N'Chrome', N'Windows', N'', N'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36', N'634', N'0', N'1', N'admin', N'{
"input": {
"CurrentPage": 1,
"PageSize": 10,
"Filter": {
"QueryString": "罗斯柴尔德家族"
},
"PublishDateRange": null
}
}', N'2021-10-10 11:19:43', N'2021-10-10 11:19:43', N'post', N'api/book/getpagebooklist', N'2021-10-10 11:19:43', N'1', NULL)
GO
INSERT INTO [dbo].[sys_auditlog] ([Id], [Key], [IP], [Browser], [Os], [Device], [BrowserInfo], [ElapsedMilliseconds], [TenantId], [UserId], [UserAccount], [ParamsString], [StartTime], [StopTime], [RequestMethod], [RequestApi], [CreationTime], [ResponseState], [ResponseData]) VALUES (N'10', N'bc826ca5-0bac-4a9f-87f2-b48e4a5becb5', N'127.0.0.1', N'Chrome', N'Windows', N'', N'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36', N'721', N'0', N'1', N'admin', N'{
"input": {
"CurrentPage": 1,
"PageSize": 10,
"Filter": {
"QueryString": "罗斯柴尔德家族"
},
"PublishDateRange": [
"1900-09-30T15:54:17.000Z",
"2021-11-22T16:00:00.000Z"
]
}
}', N'2021-10-10 11:19:52', N'2021-10-10 11:19:53', N'post', N'api/book/getpagebooklist', N'2021-10-10 11:19:53', N'1', NULL)
GO
INSERT INTO [dbo].[sys_auditlog] ([Id], [Key], [IP], [Browser], [Os], [Device], [BrowserInfo], [ElapsedMilliseconds], [TenantId], [UserId], [UserAccount], [ParamsString], [StartTime], [StopTime], [RequestMethod], [RequestApi], [CreationTime], [ResponseState], [ResponseData]) VALUES (N'11', N'bc826ca5-0bac-4a9f-87f2-b48e4a5becb5', N'127.0.0.1', N'Chrome', N'Windows', N'', N'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36', N'714', N'0', N'1', N'admin', N'{
"input": {
"CurrentPage": 1,
"PageSize": 10,
"Filter": {
"QueryString": "罗斯柴尔德家族"
},
"PublishDateRange": [
"1900-09-30T15:54:17.000Z",
"2021-11-22T16:00:00.000Z"
]
}
}', N'2021-10-10 11:19:53', N'2021-10-10 11:19:54', N'post', N'api/book/getpagebooklist', N'2021-10-10 11:19:54', N'1', NULL)
GO
INSERT INTO [dbo].[sys_auditlog] ([Id], [Key], [IP], [Browser], [Os], [Device], [BrowserInfo], [ElapsedMilliseconds], [TenantId], [UserId], [UserAccount], [ParamsString], [StartTime], [StopTime], [RequestMethod], [RequestApi], [CreationTime], [ResponseState], [ResponseData]) VALUES (N'12', N'bc826ca5-0bac-4a9f-87f2-b48e4a5becb5', N'127.0.0.1', N'Chrome', N'Windows', N'', N'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36', N'714', N'0', N'1', N'admin', N'{
"input": {
"CurrentPage": 1,
"PageSize": 10,
"Filter": {
"QueryString": "罗斯柴尔德家族"
},
"PublishDateRange": [
"1900-09-30T15:54:17.000Z",
"2021-11-22T16:00:00.000Z"
]
}
}', N'2021-10-10 11:19:54', N'2021-10-10 11:19:55', N'post', N'api/book/getpagebooklist', N'2021-10-10 11:19:55', N'1', NULL)
GO
INSERT INTO [dbo].[sys_auditlog] ([Id], [Key], [IP], [Browser], [Os], [Device], [BrowserInfo], [ElapsedMilliseconds], [TenantId], [UserId], [UserAccount], [ParamsString], [StartTime], [StopTime], [RequestMethod], [RequestApi], [CreationTime], [ResponseState], [ResponseData]) VALUES (N'13', N'bc826ca5-0bac-4a9f-87f2-b48e4a5becb5', N'127.0.0.1', N'Chrome', N'Windows', N'', N'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36', N'748', N'0', N'1', N'admin', N'{
"input": {
"CurrentPage": 1,
"PageSize": 10,
"Filter": {
"QueryString": "罗斯柴尔德家族"
},
"PublishDateRange": [
"1900-09-30T15:54:17.000Z",
"2021-11-22T16:00:00.000Z"
]
}
}', N'2021-10-10 11:19:55', N'2021-10-10 11:19:56', N'post', N'api/book/getpagebooklist', N'2021-10-10 11:19:56', N'1', NULL)
GO
INSERT INTO [dbo].[sys_auditlog] ([Id], [Key], [IP], [Browser], [Os], [Device], [BrowserInfo], [ElapsedMilliseconds], [TenantId], [UserId], [UserAccount], [ParamsString], [StartTime], [StopTime], [RequestMethod], [RequestApi], [CreationTime], [ResponseState], [ResponseData]) VALUES (N'14', N'ac4d7331-da63-4ffc-8b5c-b16a3e5e0903', N'127.0.0.1', N'Chrome', N'Windows', N'', N'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36', N'32', N'0', N'0', NULL, N'{}', N'2021-10-10 11:19:59', N'2021-10-10 11:19:59', N'post', N'api/identity/getguid', N'2021-10-10 11:19:59', N'1', NULL)
GO
INSERT INTO [dbo].[sys_auditlog] ([Id], [Key], [IP], [Browser], [Os], [Device], [BrowserInfo], [ElapsedMilliseconds], [TenantId], [UserId], [UserAccount], [ParamsString], [StartTime], [StopTime], [RequestMethod], [RequestApi], [CreationTime], [ResponseState], [ResponseData]) VALUES (N'15', N'49620026-8070-4188-8551-8b349a3b8aa1', N'127.0.0.1', N'Chrome', N'Windows', N'', N'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36', N'31', N'0', N'0', NULL, N'{
"guidKey": "ef387683-f387-4dbb-821e-91cd84be5f55"
}', N'2021-10-10 11:19:59', N'2021-10-10 11:19:59', N'get', N'api/identity/getverificationcode', N'2021-10-10 11:19:59', N'0', NULL)
GO
INSERT INTO [dbo].[sys_auditlog] ([Id], [Key], [IP], [Browser], [Os], [Device], [BrowserInfo], [ElapsedMilliseconds], [TenantId], [UserId], [UserAccount], [ParamsString], [StartTime], [StopTime], [RequestMethod], [RequestApi], [CreationTime], [ResponseState], [ResponseData]) VALUES (N'16', N'ac4d7331-da63-4ffc-8b5c-b16a3e5e0903', N'127.0.0.1', N'Chrome', N'Windows', N'', N'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36', N'46', N'0', N'0', NULL, N'{}', N'2021-10-10 11:20:08', N'2021-10-10 11:20:08', N'post', N'api/identity/getguid', N'2021-10-10 11:20:08', N'1', NULL)
GO
INSERT INTO [dbo].[sys_auditlog] ([Id], [Key], [IP], [Browser], [Os], [Device], [BrowserInfo], [ElapsedMilliseconds], [TenantId], [UserId], [UserAccount], [ParamsString], [StartTime], [StopTime], [RequestMethod], [RequestApi], [CreationTime], [ResponseState], [ResponseData]) VALUES (N'17', N'49620026-8070-4188-8551-8b349a3b8aa1', N'127.0.0.1', N'Chrome', N'Windows', N'', N'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36', N'36', N'0', N'0', NULL, N'{
"guidKey": "9f6eb912-95fc-4ced-b0da-077b785281a2"
}', N'2021-10-10 11:20:09', N'2021-10-10 11:20:09', N'get', N'api/identity/getverificationcode', N'2021-10-10 11:20:09', N'0', NULL)
GO
INSERT INTO [dbo].[sys_auditlog] ([Id], [Key], [IP], [Browser], [Os], [Device], [BrowserInfo], [ElapsedMilliseconds], [TenantId], [UserId], [UserAccount], [ParamsString], [StartTime], [StopTime], [RequestMethod], [RequestApi], [CreationTime], [ResponseState], [ResponseData]) VALUES (N'18', N'766d5f04-3082-44bd-835a-11f9e8d82e87', N'127.0.0.1', N'Chrome', N'Windows', N'', N'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36', N'94', N'0', N'0', NULL, N'{}', N'2021-10-10 11:21:53', N'2021-10-10 11:21:53', N'post', N'api/identity/getguid', N'2021-10-10 11:21:53', N'1', NULL)
GO
INSERT INTO [dbo].[sys_auditlog] ([Id], [Key], [IP], [Browser], [Os], [Device], [BrowserInfo], [ElapsedMilliseconds], [TenantId], [UserId], [UserAccount], [ParamsString], [StartTime], [StopTime], [RequestMethod], [RequestApi], [CreationTime], [ResponseState], [ResponseData]) VALUES (N'19', N'56e982ce-f2fd-40ce-b7b3-d0b7da048682', N'127.0.0.1', N'Chrome', N'Windows', N'', N'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36', N'97', N'0', N'0', NULL, N'{
"guidKey": "6b1c83e2-b480-4db4-8bc7-d47fcbd597fd"
}', N'2021-10-10 11:21:53', N'2021-10-10 11:21:54', N'get', N'api/identity/getverificationcode', N'2021-10-10 11:21:54', N'0', NULL)
GO
INSERT INTO [dbo].[sys_auditlog] ([Id], [Key], [IP], [Browser], [Os], [Device], [BrowserInfo], [ElapsedMilliseconds], [TenantId], [UserId], [UserAccount], [ParamsString], [StartTime], [StopTime], [RequestMethod], [RequestApi], [CreationTime], [ResponseState], [ResponseData]) VALUES (N'20', N'8ad4c4c5-645c-42c8-a680-b434d9636280', N'127.0.0.1', N'Chrome', N'Windows', N'', N'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36', N'462', N'0', N'0', NULL, N'{
"loginUserDto": {
"userId": "admin",
"pwd": "123456",
"TenantId": 0,
"validateCode": "m391",
"GuidKey": "6b1c83e2-b480-4db4-8bc7-d47fcbd597fd"
}
}', N'2021-10-10 11:22:00', N'2021-10-10 11:22:00', N'post', N'api/identity/gettokenbylogin', N'2021-10-10 11:22:00', N'1', NULL)
GO
INSERT INTO [dbo].[sys_auditlog] ([Id], [Key], [IP], [Browser], [Os], [Device], [BrowserInfo], [ElapsedMilliseconds], [TenantId], [UserId], [UserAccount], [ParamsString], [StartTime], [StopTime], [RequestMethod], [RequestApi], [CreationTime], [ResponseState], [ResponseData]) VALUES (N'21', N'3e7b792c-f7ba-4e2e-a744-790cbb0d7399', N'127.0.0.1', N'Chrome', N'Windows', N'', N'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36', N'795', N'0', N'1', N'admin', N'{
"input": {
"CurrentPage": 1,
"PageSize": 10,
"Filter": {
"QueryString": ""
},
"PublishDateRange": null
}
}', N'2021-10-10 11:22:02', N'2021-10-10 11:22:03', N'post', N'api/book/getpagebooklist', N'2021-10-10 11:22:03', N'1', NULL)
GO
INSERT INTO [dbo].[sys_auditlog] ([Id], [Key], [IP], [Browser], [Os], [Device], [BrowserInfo], [ElapsedMilliseconds], [TenantId], [UserId], [UserAccount], [ParamsString], [StartTime], [StopTime], [RequestMethod], [RequestApi], [CreationTime], [ResponseState], [ResponseData]) VALUES (N'22', N'f660ae61-d8a3-405d-b201-013d28ae039f', N'127.0.0.1', N'Chrome', N'Windows', N'', N'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36', N'93', N'0', N'1', N'admin', N'{
"input": {
"CurrentPage": 1,
"PageSize": 10,
"Filter": {
"QueryString": ""
}
}
}', N'2021-10-10 11:22:07', N'2021-10-10 11:22:07', N'post', N'api/sysrole/getpagesysrolelist', N'2021-10-10 11:22:07', N'1', NULL)
GO
INSERT INTO [dbo].[sys_auditlog] ([Id], [Key], [IP], [Browser], [Os], [Device], [BrowserInfo], [ElapsedMilliseconds], [TenantId], [UserId], [UserAccount], [ParamsString], [StartTime], [StopTime], [RequestMethod], [RequestApi], [CreationTime], [ResponseState], [ResponseData]) VALUES (N'23', N'd5d98aab-80d4-4a3e-8d12-34c2b3494f39', N'127.0.0.1', N'Chrome', N'Windows', N'', N'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36', N'43', N'0', N'1', N'admin', N'{
"input": {
"CurrentPage": 1,
"PageSize": 10,
"Filter": {
"QueryString": ""
}
}
}', N'2021-10-10 11:22:07', N'2021-10-10 11:22:07', N'post', N'api/sysuser/getpageuserlist', N'2021-10-10 11:22:07', N'1', NULL)
GO
INSERT INTO [dbo].[sys_auditlog] ([Id], [Key], [IP], [Browser], [Os], [Device], [BrowserInfo], [ElapsedMilliseconds], [TenantId], [UserId], [UserAccount], [ParamsString], [StartTime], [StopTime], [RequestMethod], [RequestApi], [CreationTime], [ResponseState], [ResponseData]) VALUES (N'24', N'113a3e7d-af25-4dbc-884d-17a215471a27', N'127.0.0.1', N'Chrome', N'Windows', N'', N'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36', N'67', N'0', N'1', N'admin', N'{
"input": {
"QueryString": ""
}
}', N'2021-10-10 11:22:08', N'2021-10-10 11:22:09', N'post', N'api/sysdatadictionary/getsysdatadictionarylist', N'2021-10-10 11:22:09', N'1', NULL)
GO
SET IDENTITY_INSERT [dbo].[sys_auditlog] OFF
GO
-- ----------------------------
-- Table structure for sys_datadictionary
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[sys_datadictionary]') AND type IN ('U'))
DROP TABLE [dbo].[sys_datadictionary]
GO
CREATE TABLE [dbo].[sys_datadictionary] (
[Key] nvarchar(32) COLLATE Chinese_PRC_CI_AS NULL,
[ParentId] bigint NULL,
[Memoni] nvarchar(32) COLLATE Chinese_PRC_CI_AS NULL,
[Sort] int NULL,
[Value] nvarchar(128) COLLATE Chinese_PRC_CI_AS NULL,
[Id] bigint IDENTITY(1,1) NOT NULL,
[IsActive] varchar(1) COLLATE Chinese_PRC_CI_AS NULL,
[IsDeleted] varchar(1) COLLATE Chinese_PRC_CI_AS NULL,
[CreationTime] datetime2(0) NULL,
[CreatorUserId] bigint NULL,
[TenantId] int NULL,
[Type] int NULL,
[Label] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL
)
GO
ALTER TABLE [dbo].[sys_datadictionary] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'名称',
'SCHEMA', N'dbo',
'TABLE', N'sys_datadictionary',
'COLUMN', N'Key'
GO
EXEC sp_addextendedproperty
'MS_Description', N'父节点',
'SCHEMA', N'dbo',
'TABLE', N'sys_datadictionary',
'COLUMN', N'ParentId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'助记符',
'SCHEMA', N'dbo',
'TABLE', N'sys_datadictionary',
'COLUMN', N'Memoni'
GO
EXEC sp_addextendedproperty
'MS_Description', N'排序',
'SCHEMA', N'dbo',
'TABLE', N'sys_datadictionary',
'COLUMN', N'Sort'
GO
EXEC sp_addextendedproperty
'MS_Description', N'备注',
'SCHEMA', N'dbo',
'TABLE', N'sys_datadictionary',
'COLUMN', N'Value'
GO
EXEC sp_addextendedproperty
'MS_Description', N'主键Id',
'SCHEMA', N'dbo',
'TABLE', N'sys_datadictionary',
'COLUMN', N'Id'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否启用标识',
'SCHEMA', N'dbo',
'TABLE', N'sys_datadictionary',
'COLUMN', N'IsActive'
GO
EXEC sp_addextendedproperty
'MS_Description', N' 是否删除标识',
'SCHEMA', N'dbo',
'TABLE', N'sys_datadictionary',
'COLUMN', N'IsDeleted'
GO
EXEC sp_addextendedproperty
'MS_Description', N' 创建时间',
'SCHEMA', N'dbo',
'TABLE', N'sys_datadictionary',
'COLUMN', N'CreationTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N' 创建ID',
'SCHEMA', N'dbo',
'TABLE', N'sys_datadictionary',
'COLUMN', N'CreatorUserId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'租户名',
'SCHEMA', N'dbo',
'TABLE', N'sys_datadictionary',
'COLUMN', N'TenantId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'类别:0 分组, 1叶子节点',
'SCHEMA', N'dbo',
'TABLE', N'sys_datadictionary',
'COLUMN', N'Type'
GO
EXEC sp_addextendedproperty
'MS_Description', N'名称',
'SCHEMA', N'dbo',
'TABLE', N'sys_datadictionary',
'COLUMN', N'Label'
GO
-- ----------------------------
-- Records of sys_datadictionary
-- ----------------------------
SET IDENTITY_INSERT [dbo].[sys_datadictionary] ON
GO
INSERT INTO [dbo].[sys_datadictionary] ([Key], [ParentId], [Memoni], [Sort], [Value], [Id], [IsActive], [IsDeleted], [CreationTime], [CreatorUserId], [TenantId], [Type], [Label]) VALUES (N'MenuType.Common', N'2', NULL, NULL, N'1', N'1', NULL, NULL, NULL, NULL, NULL, NULL, N'公共菜单')
GO
INSERT INTO [dbo].[sys_datadictionary] ([Key], [ParentId], [Memoni], [Sort], [Value], [Id], [IsActive], [IsDeleted], [CreationTime], [CreatorUserId], [TenantId], [Type], [Label]) VALUES (N'MenuType', N'0', NULL, NULL, NULL, N'2', NULL, NULL, NULL, NULL, NULL, N'0', N'菜单类别')
GO
SET IDENTITY_INSERT [dbo].[sys_datadictionary] OFF
GO
-- ----------------------------
-- Table structure for sys_organization
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[sys_organization]') AND type IN ('U'))
DROP TABLE [dbo].[sys_organization]
GO
CREATE TABLE [dbo].[sys_organization] (
[Label] nvarchar(32) COLLATE Chinese_PRC_CI_AS NULL,
[ParentId] bigint NULL,
[OrganType] int NULL,
[Sort] int NULL,
[PostId] int NULL,
[Fax] nvarchar(16) COLLATE Chinese_PRC_CI_AS NULL,
[Telephone] nvarchar(16) COLLATE Chinese_PRC_CI_AS NULL,
[Address] nvarchar(64) COLLATE Chinese_PRC_CI_AS NULL,
[Memoni] nvarchar(32) COLLATE Chinese_PRC_CI_AS NULL,
[Remark] nvarchar(128) COLLATE Chinese_PRC_CI_AS NULL,
[RangeType] int NULL,
[Range] nvarchar(128) COLLATE Chinese_PRC_CI_AS NULL,
[Linkman] nvarchar(32) COLLATE Chinese_PRC_CI_AS NULL,
[CreatorUserId] bigint NULL,
[CreationTime] datetime2(0) NULL,
[Id] bigint IDENTITY(1,1) NOT NULL,
[IsActive] varchar(1) COLLATE Chinese_PRC_CI_AS NULL,
[IsDeleted] varchar(1) COLLATE Chinese_PRC_CI_AS NULL,
[TenantId] int NULL
)
GO
ALTER TABLE [dbo].[sys_organization] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'名称',
'SCHEMA', N'dbo',
'TABLE', N'sys_organization',
'COLUMN', N'Label'
GO
EXEC sp_addextendedproperty
'MS_Description', N'所属上级',
'SCHEMA', N'dbo',
'TABLE', N'sys_organization',
'COLUMN', N'ParentId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'节点类型',
'SCHEMA', N'dbo',
'TABLE', N'sys_organization',
'COLUMN', N'OrganType'
GO
EXEC sp_addextendedproperty
'MS_Description', N'序号',
'SCHEMA', N'dbo',
'TABLE', N'sys_organization',
'COLUMN', N'Sort'
GO
EXEC sp_addextendedproperty
'MS_Description', N'岗位编号',
'SCHEMA', N'dbo',
'TABLE', N'sys_organization',
'COLUMN', N'PostId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'传真',
'SCHEMA', N'dbo',
'TABLE', N'sys_organization',
'COLUMN', N'Fax'
GO
EXEC sp_addextendedproperty
'MS_Description', N'联系电话',
'SCHEMA', N'dbo',
'TABLE', N'sys_organization',
'COLUMN', N'Telephone'
GO
EXEC sp_addextendedproperty
'MS_Description', N'通讯地址',
'SCHEMA', N'dbo',
'TABLE', N'sys_organization',
'COLUMN', N'Address'
GO
EXEC sp_addextendedproperty
'MS_Description', N'助记符',
'SCHEMA', N'dbo',
'TABLE', N'sys_organization',
'COLUMN', N'Memoni'
GO
EXEC sp_addextendedproperty
'MS_Description', N'备注',
'SCHEMA', N'dbo',
'TABLE', N'sys_organization',
'COLUMN', N'Remark'
GO
EXEC sp_addextendedproperty
'MS_Description', N'权限',
'SCHEMA', N'dbo',
'TABLE', N'sys_organization',
'COLUMN', N'RangeType'
GO
EXEC sp_addextendedproperty
'MS_Description', N'权限范围',
'SCHEMA', N'dbo',
'TABLE', N'sys_organization',
'COLUMN', N'Range'
GO
EXEC sp_addextendedproperty
'MS_Description', N'联系人',
'SCHEMA', N'dbo',
'TABLE', N'sys_organization',
'COLUMN', N'Linkman'
GO
EXEC sp_addextendedproperty
'MS_Description', N' 创建ID',
'SCHEMA', N'dbo',
'TABLE', N'sys_organization',
'COLUMN', N'CreatorUserId'
GO
EXEC sp_addextendedproperty
'MS_Description', N' 创建时间',
'SCHEMA', N'dbo',
'TABLE', N'sys_organization',
'COLUMN', N'CreationTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'主键Id',
'SCHEMA', N'dbo',
'TABLE', N'sys_organization',
'COLUMN', N'Id'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否启用标识',
'SCHEMA', N'dbo',
'TABLE', N'sys_organization',
'COLUMN', N'IsActive'
GO
EXEC sp_addextendedproperty
'MS_Description', N' 是否删除标识',
'SCHEMA', N'dbo',
'TABLE', N'sys_organization',
'COLUMN', N'IsDeleted'
GO
EXEC sp_addextendedproperty
'MS_Description', N'租户名',
'SCHEMA', N'dbo',
'TABLE', N'sys_organization',
'COLUMN', N'TenantId'
GO
-- ----------------------------
-- Records of sys_organization
-- ----------------------------
SET IDENTITY_INSERT [dbo].[sys_organization] ON
GO
INSERT INTO [dbo].[sys_organization] ([Label], [ParentId], [OrganType], [Sort], [PostId], [Fax], [Telephone], [Address], [Memoni], [Remark], [RangeType], [Range], [Linkman], [CreatorUserId], [CreationTime], [Id], [IsActive], [IsDeleted], [TenantId]) VALUES (N'xxx事业部', N'0', N'0', N'2', N'0', N'', N'', N'', N'', N'', N'0', N'', N'', N'0', NULL, N'22', N'0', N'0', NULL)
GO
INSERT INTO [dbo].[sys_organization] ([Label], [ParentId], [OrganType], [Sort], [PostId], [Fax], [Telephone], [Address], [Memoni], [Remark], [RangeType], [Range], [Linkman], [CreatorUserId], [CreationTime], [Id], [IsActive], [IsDeleted], [TenantId]) VALUES (N'研发部', N'22', N'0', N'0', N'0', N'', N'', N'', N'', N'', N'0', N'', N'', N'0', NULL, N'23', N'0', N'0', NULL)
GO
INSERT INTO [dbo].[sys_organization] ([Label], [ParentId], [OrganType], [Sort], [PostId], [Fax], [Telephone], [Address], [Memoni], [Remark], [RangeType], [Range], [Linkman], [CreatorUserId], [CreationTime], [Id], [IsActive], [IsDeleted], [TenantId]) VALUES (N'企划部', N'22', N'0', N'0', N'0', N'', N'', N'', N'', N'', N'0', N'', N'', N'0', NULL, N'24', N'0', N'0', NULL)
GO
INSERT INTO [dbo].[sys_organization] ([Label], [ParentId], [OrganType], [Sort], [PostId], [Fax], [Telephone], [Address], [Memoni], [Remark], [RangeType], [Range], [Linkman], [CreatorUserId], [CreationTime], [Id], [IsActive], [IsDeleted], [TenantId]) VALUES (N'开发一组', N'23', N'0', N'0', N'0', N'', N'', N'', N'', N'', N'0', N'', N'', N'0', NULL, N'25', N'0', N'0', NULL)
GO
SET IDENTITY_INSERT [dbo].[sys_organization] OFF
GO
-- ----------------------------
-- Table structure for sys_permission
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[sys_permission]') AND type IN ('U'))
DROP TABLE [dbo].[sys_permission]
GO
CREATE TABLE [dbo].[sys_permission] (
[Id] bigint IDENTITY(1,1) NOT NULL,
[ParentId] bigint NOT NULL,
[Label] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[Code] nvarchar(550) COLLATE Chinese_PRC_CI_AS NULL,
[Type] int NOT NULL,
[View] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[Api] nvarchar(500) COLLATE Chinese_PRC_CI_AS NULL,
[Path] nvarchar(500) COLLATE Chinese_PRC_CI_AS NULL,
[Icon] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[Hidden] varchar(1) COLLATE Chinese_PRC_CI_AS NOT NULL,
[IsActive] varchar(1) COLLATE Chinese_PRC_CI_AS NULL,
[Closable] varchar(1) COLLATE Chinese_PRC_CI_AS NULL,
[Opened] varchar(1) COLLATE Chinese_PRC_CI_AS NULL,
[NewWindow] varchar(1) COLLATE Chinese_PRC_CI_AS NULL,
[External] varchar(1) COLLATE Chinese_PRC_CI_AS NULL,
[Sort] int NULL,
[Description] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[TenantId] bigint NULL,
[IsDeleted] varchar(1) COLLATE Chinese_PRC_CI_AS NULL,
[CreatorUserId] bigint NULL,
[CreationTime] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[CreatedTime] datetime2(0) NULL,
[LastModifierUserId] int NULL,
[LastModificationTime] datetime2(0) NULL
)
GO
ALTER TABLE [dbo].[sys_permission] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'主键Id',
'SCHEMA', N'dbo',
'TABLE', N'sys_permission',
'COLUMN', N'Id'
GO
EXEC sp_addextendedproperty
'MS_Description', N'父级节点',
'SCHEMA', N'dbo',
'TABLE', N'sys_permission',
'COLUMN', N'ParentId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'权限名称',
'SCHEMA', N'dbo',
'TABLE', N'sys_permission',
'COLUMN', N'Label'
GO
EXEC sp_addextendedproperty
'MS_Description', N'权限编码',
'SCHEMA', N'dbo',
'TABLE', N'sys_permission',
'COLUMN', N'Code'
GO
EXEC sp_addextendedproperty
'MS_Description', N'权限类型',
'SCHEMA', N'dbo',
'TABLE', N'sys_permission',
'COLUMN', N'Type'
GO
EXEC sp_addextendedproperty
'MS_Description', N'视图',
'SCHEMA', N'dbo',
'TABLE', N'sys_permission',
'COLUMN', N'View'
GO
EXEC sp_addextendedproperty
'MS_Description', N'接口',
'SCHEMA', N'dbo',
'TABLE', N'sys_permission',
'COLUMN', N'Api'
GO
EXEC sp_addextendedproperty
'MS_Description', N'菜单访问地址',
'SCHEMA', N'dbo',
'TABLE', N'sys_permission',
'COLUMN', N'Path'
GO
EXEC sp_addextendedproperty
'MS_Description', N'图标',
'SCHEMA', N'dbo',
'TABLE', N'sys_permission',
'COLUMN', N'Icon'
GO
EXEC sp_addextendedproperty
'MS_Description', N'隐藏',
'SCHEMA', N'dbo',
'TABLE', N'sys_permission',
'COLUMN', N'Hidden'
GO
EXEC sp_addextendedproperty
'MS_Description', N'启用',
'SCHEMA', N'dbo',
'TABLE', N'sys_permission',
'COLUMN', N'IsActive'
GO
EXEC sp_addextendedproperty
'MS_Description', N'可关闭',
'SCHEMA', N'dbo',
'TABLE', N'sys_permission',
'COLUMN', N'Closable'
GO
EXEC sp_addextendedproperty
'MS_Description', N'打开组',
'SCHEMA', N'dbo',
'TABLE', N'sys_permission',
'COLUMN', N'Opened'
GO
EXEC sp_addextendedproperty
'MS_Description', N'打开新窗口',
'SCHEMA', N'dbo',
'TABLE', N'sys_permission',
'COLUMN', N'NewWindow'
GO
EXEC sp_addextendedproperty
'MS_Description', N'链接外显',
'SCHEMA', N'dbo',
'TABLE', N'sys_permission',
'COLUMN', N'External'
GO
EXEC sp_addextendedproperty
'MS_Description', N'排序',
'SCHEMA', N'dbo',
'TABLE', N'sys_permission',
'COLUMN', N'Sort'
GO
EXEC sp_addextendedproperty
'MS_Description', N'描述',
'SCHEMA', N'dbo',
'TABLE', N'sys_permission',
'COLUMN', N'Description'
GO
EXEC sp_addextendedproperty
'MS_Description', N'租户Id',
'SCHEMA', N'dbo',
'TABLE', N'sys_permission',
'COLUMN', N'TenantId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否删除',
'SCHEMA', N'dbo',
'TABLE', N'sys_permission',
'COLUMN', N'IsDeleted'
GO
EXEC sp_addextendedproperty
'MS_Description', N'创建者Id',
'SCHEMA', N'dbo',
'TABLE', N'sys_permission',
'COLUMN', N'CreatorUserId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'创建者',
'SCHEMA', N'dbo',
'TABLE', N'sys_permission',
'COLUMN', N'CreationTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'sys_permission',
'COLUMN', N'CreatedTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'修改者Id',
'SCHEMA', N'dbo',
'TABLE', N'sys_permission',
'COLUMN', N'LastModifierUserId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'sys_permission',
'COLUMN', N'LastModificationTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'权限',
'SCHEMA', N'dbo',
'TABLE', N'sys_permission'
GO
-- ----------------------------
-- Records of sys_permission
-- ----------------------------
SET IDENTITY_INSERT [dbo].[sys_permission] ON
GO
INSERT INTO [dbo].[sys_permission] ([Id], [ParentId], [Label], [Code], [Type], [View], [Api], [Path], [Icon], [Hidden], [IsActive], [Closable], [Opened], [NewWindow], [External], [Sort], [Description], [TenantId], [IsDeleted], [CreatorUserId], [CreationTime], [CreatedTime], [LastModifierUserId], [LastModificationTime]) VALUES (N'111', N'0', N'系统管理', N'systemManager', N'1', N'', N'', N'', N'el-icon-setting', N'1', N'1', N'1', N'1', N'1', N'1', N'8', N'', N'1', N'0', N'1', N'2021-05-02 18:35:03.773', NULL, N'0', N'2021-05-03 11:14:36')
GO
INSERT INTO [dbo].[sys_permission] ([Id], [ParentId], [Label], [Code], [Type], [View], [Api], [Path], [Icon], [Hidden], [IsActive], [Closable], [Opened], [NewWindow], [External], [Sort], [Description], [TenantId], [IsDeleted], [CreatorUserId], [CreationTime], [CreatedTime], [LastModifierUserId], [LastModificationTime]) VALUES (N'112', N'0', N'用户管理', N'userManager', N'2', N'Users', N'', N'/users', N'el-icon-user', N'1', N'1', N'1', N'1', N'1', N'1', N'3', N'', N'1', N'0', N'1', N'2021-05-02 18:37:37.656', NULL, N'0', N'2021-05-03 10:34:10')
GO
INSERT INTO [dbo].[sys_permission] ([Id], [ParentId], [Label], [Code], [Type], [View], [Api], [Path], [Icon], [Hidden], [IsActive], [Closable], [Opened], [NewWindow], [External], [Sort], [Description], [TenantId], [IsDeleted], [CreatorUserId], [CreationTime], [CreatedTime], [LastModifierUserId], [LastModificationTime]) VALUES (N'113', N'111', N'角色管理', N'system.roleManager', N'2', N'SysRoles', N'', N'/sysRoles', N'el-icon-share', N'1', N'1', N'1', N'1', N'1', N'1', N'4', N'', N'1', N'0', N'1', N'2021-05-02 18:39:33.200', NULL, N'0', N'2021-05-05 17:08:02')
GO
INSERT INTO [dbo].[sys_permission] ([Id], [ParentId], [Label], [Code], [Type], [View], [Api], [Path], [Icon], [Hidden], [IsActive], [Closable], [Opened], [NewWindow], [External], [Sort], [Description], [TenantId], [IsDeleted], [CreatorUserId], [CreationTime], [CreatedTime], [LastModifierUserId], [LastModificationTime]) VALUES (N'114', N'111', N'权限管理', N'permissionManager', N'2', N'SysPermissions', N'', N'/sysPermissions', N'el-icon-s-operation', N'1', N'1', N'1', N'1', N'1', N'1', N'5', N'', N'1', N'0', N'1', N'2021-05-02 18:40:20.539', NULL, N'0', N'2021-05-05 17:08:15')
GO
INSERT INTO [dbo].[sys_permission] ([Id], [ParentId], [Label], [Code], [Type], [View], [Api], [Path], [Icon], [Hidden], [IsActive], [Closable], [Opened], [NewWindow], [External], [Sort], [Description], [TenantId], [IsDeleted], [CreatorUserId], [CreationTime], [CreatedTime], [LastModifierUserId], [LastModificationTime]) VALUES (N'115', N'0', N'数据字典', N'dataDictionaryManager', N'2', N'SysDataDictionarys', N'', N'/sysDataDictionarys', N'el-icon-share', N'1', N'1', N'1', N'1', N'1', N'1', N'6', N'', N'1', N'0', N'1', N'2021-05-02 18:41:16.319', NULL, N'0', N'2021-05-03 11:11:33')
GO
INSERT INTO [dbo].[sys_permission] ([Id], [ParentId], [Label], [Code], [Type], [View], [Api], [Path], [Icon], [Hidden], [IsActive], [Closable], [Opened], [NewWindow], [External], [Sort], [Description], [TenantId], [IsDeleted], [CreatorUserId], [CreationTime], [CreatedTime], [LastModifierUserId], [LastModificationTime]) VALUES (N'116', N'0', N'日志管理', N'logManager', N'1', N'', N'', N'', N'el-icon-document', N'1', N'1', N'1', N'1', N'1', N'1', N'8', N'', N'1', N'0', N'1', N'2021-05-02 18:43:29.923', NULL, N'0', N'2021-05-03 11:14:49')
GO
INSERT INTO [dbo].[sys_permission] ([Id], [ParentId], [Label], [Code], [Type], [View], [Api], [Path], [Icon], [Hidden], [IsActive], [Closable], [Opened], [NewWindow], [External], [Sort], [Description], [TenantId], [IsDeleted], [CreatorUserId], [CreationTime], [CreatedTime], [LastModifierUserId], [LastModificationTime]) VALUES (N'117', N'116', N'审计日志', N'sysAuditLogManager', N'2', N'SysAuditLogs', N'', N'/sysAuditLogs', N'', N'1', N'1', N'1', N'1', N'1', N'1', N'0', N'', N'1', N'0', N'1', N'2021-05-02 18:44:24.935', NULL, N'0', N'2021-05-05 13:47:54')
GO
INSERT INTO [dbo].[sys_permission] ([Id], [ParentId], [Label], [Code], [Type], [View], [Api], [Path], [Icon], [Hidden], [IsActive], [Closable], [Opened], [NewWindow], [External], [Sort], [Description], [TenantId], [IsDeleted], [CreatorUserId], [CreationTime], [CreatedTime], [LastModifierUserId], [LastModificationTime]) VALUES (N'118', N'112', N'新增用户', N'userManager.createUser', N'3', N'', N'SysUser/CreateUser', N'', N'', N'1', N'1', N'1', N'1', N'1', N'1', N'0', N'', N'1', N'0', N'1', N'2021-05-02 18:46:06.639', NULL, N'0', N'2021-05-03 10:34:57')
GO
INSERT INTO [dbo].[sys_permission] ([Id], [ParentId], [Label], [Code], [Type], [View], [Api], [Path], [Icon], [Hidden], [IsActive], [Closable], [Opened], [NewWindow], [External], [Sort], [Description], [TenantId], [IsDeleted], [CreatorUserId], [CreationTime], [CreatedTime], [LastModifierUserId], [LastModificationTime]) VALUES (N'119', N'112', N'查看用户列表', N'userManager.viewUser', N'3', N'', N'SysUser/GetPageUserList', N'', N'', N'1', N'1', N'1', N'1', N'1', N'1', N'0', N'', N'1', N'0', N'1', N'2021-05-02 18:50:42.411', NULL, N'0', N'2021-05-03 10:32:26')
GO
INSERT INTO [dbo].[sys_permission] ([Id], [ParentId], [Label], [Code], [Type], [View], [Api], [Path], [Icon], [Hidden], [IsActive], [Closable], [Opened], [NewWindow], [External], [Sort], [Description], [TenantId], [IsDeleted], [CreatorUserId], [CreationTime], [CreatedTime], [LastModifierUserId], [LastModificationTime]) VALUES (N'120', N'112', N'编辑用户', N'userManager.editUser', N'3', N'', N'SysUser/UpdateUser', N'', N'', N'1', N'1', N'1', N'1', N'1', N'1', N'0', N'', N'1', N'0', N'1', N'2021-05-03 10:27:32.738', NULL, N'0', N'0001-01-01 00:00:00')
GO
INSERT INTO [dbo].[sys_permission] ([Id], [ParentId], [Label], [Code], [Type], [View], [Api], [Path], [Icon], [Hidden], [IsActive], [Closable], [Opened], [NewWindow], [External], [Sort], [Description], [TenantId], [IsDeleted], [CreatorUserId], [CreationTime], [CreatedTime], [LastModifierUserId], [LastModificationTime]) VALUES (N'121', N'112', N'删除用户', N'userManager.deleteUser', N'3', N'', N'SysUser/DeleteUserById', N'', N'', N'1', N'1', N'1', N'1', N'1', N'1', N'0', N'', N'1', N'0', N'1', N'2021-05-03 10:35:40.971', NULL, N'0', N'2021-05-03 10:35:52')
GO
INSERT INTO [dbo].[sys_permission] ([Id], [ParentId], [Label], [Code], [Type], [View], [Api], [Path], [Icon], [Hidden], [IsActive], [Closable], [Opened], [NewWindow], [External], [Sort], [Description], [TenantId], [IsDeleted], [CreatorUserId], [CreationTime], [CreatedTime], [LastModifierUserId], [LastModificationTime]) VALUES (N'122', N'114', N'新增权限', N'permissionManager.createPermission', N'3', N'', N'SysPermission/CreateSysPermission', N'', N'', N'1', N'0', N'1', N'1', N'1', N'1', N'0', N'', N'1', N'0', N'1', N'2021-05-03 10:46:41.669', NULL, N'0', N'0001-01-01 00:00:00')
GO
INSERT INTO [dbo].[sys_permission] ([Id], [ParentId], [Label], [Code], [Type], [View], [Api], [Path], [Icon], [Hidden], [IsActive], [Closable], [Opened], [NewWindow], [External], [Sort], [Description], [TenantId], [IsDeleted], [CreatorUserId], [CreationTime], [CreatedTime], [LastModifierUserId], [LastModificationTime]) VALUES (N'123', N'114', N'编辑权限', N'permissionManager.editPermission', N'3', N'', N'SysPermission/UpdateSysPermission', N'', N'', N'1', N'0', N'1', N'1', N'1', N'1', N'0', N'', N'1', N'0', N'1', N'2021-05-03 10:47:11.061', NULL, N'0', N'0001-01-01 00:00:00')
GO
INSERT INTO [dbo].[sys_permission] ([Id], [ParentId], [Label], [Code], [Type], [View], [Api], [Path], [Icon], [Hidden], [IsActive], [Closable], [Opened], [NewWindow], [External], [Sort], [Description], [TenantId], [IsDeleted], [CreatorUserId], [CreationTime], [CreatedTime], [LastModifierUserId], [LastModificationTime]) VALUES (N'124', N'114', N'删除权限', N'permissionManager.deletePermission', N'3', N'', N'SysPermission/DeleteSysPermissionById', N'', N'', N'1', N'0', N'1', N'1', N'1', N'1', N'0', N'', N'1', N'0', N'1', N'2021-05-03 10:47:39.828', NULL, N'0', N'0001-01-01 00:00:00')
GO
INSERT INTO [dbo].[sys_permission] ([Id], [ParentId], [Label], [Code], [Type], [View], [Api], [Path], [Icon], [Hidden], [IsActive], [Closable], [Opened], [NewWindow], [External], [Sort], [Description], [TenantId], [IsDeleted], [CreatorUserId], [CreationTime], [CreatedTime], [LastModifierUserId], [LastModificationTime]) VALUES (N'125', N'114', N'查看权限列表', N'permissionManager.viewPermission', N'3', N'', N'SysPermission/GetSysPermissionList,SysPermission/Get,SysPermission/GetSysPermissionFilterByPid', N'', N'', N'1', N'0', N'1', N'1', N'1', N'1', N'0', N'', N'1', N'0', N'1', N'2021-05-03 10:49:20.263', NULL, N'0', N'0001-01-01 00:00:00')
GO
INSERT INTO [dbo].[sys_permission] ([Id], [ParentId], [Label], [Code], [Type], [View], [Api], [Path], [Icon], [Hidden], [IsActive], [Closable], [Opened], [NewWindow], [External], [Sort], [Description], [TenantId], [IsDeleted], [CreatorUserId], [CreationTime], [CreatedTime], [LastModifierUserId], [LastModificationTime]) VALUES (N'126', N'113', N'查看角色列表', N'roleManager.viewRole', N'3', N'', N'SysRole/GetPageSysRoleList', N'', N'', N'1', N'0', N'1', N'1', N'1', N'1', N'0', N'', N'1', N'0', N'1', N'2021-05-03 10:52:19.301', NULL, N'0', N'2021-05-03 10:55:28')
GO
INSERT INTO [dbo].[sys_permission] ([Id], [ParentId], [Label], [Code], [Type], [View], [Api], [Path], [Icon], [Hidden], [IsActive], [Closable], [Opened], [NewWindow], [External], [Sort], [Description], [TenantId], [IsDeleted], [CreatorUserId], [CreationTime], [CreatedTime], [LastModifierUserId], [LastModificationTime]) VALUES (N'127', N'113', N'编辑角色', N'roleManager.editRole', N'3', N'', N'SysRole/UpdateSysRole', N'', N'', N'1', N'0', N'1', N'1', N'1', N'1', N'0', N'', N'1', N'0', N'1', N'2021-05-03 10:53:49.424', NULL, N'0', N'2021-05-03 10:54:54')
GO
INSERT INTO [dbo].[sys_permission] ([Id], [ParentId], [Label], [Code], [Type], [View], [Api], [Path], [Icon], [Hidden], [IsActive], [Closable], [Opened], [NewWindow], [External], [Sort], [Description], [TenantId], [IsDeleted], [CreatorUserId], [CreationTime], [CreatedTime], [LastModifierUserId], [LastModificationTime]) VALUES (N'128', N'113', N'新增角色', N'roleManager.createRole', N'3', N'', N'SysRole/CreateSysRole', N'', N'', N'1', N'0', N'1', N'1', N'1', N'1', N'0', N'', N'1', N'0', N'1', N'2021-05-03 10:54:40.920', NULL, N'0', N'0001-01-01 00:00:00')
GO
INSERT INTO [dbo].[sys_permission] ([Id], [ParentId], [Label], [Code], [Type], [View], [Api], [Path], [Icon], [Hidden], [IsActive], [Closable], [Opened], [NewWindow], [External], [Sort], [Description], [TenantId], [IsDeleted], [CreatorUserId], [CreationTime], [CreatedTime], [LastModifierUserId], [LastModificationTime]) VALUES (N'129', N'113', N'删除角色', N'roleManager.deleteRole', N'3', N'', N'SysRole/DeleteSysRoleById', N'', N'', N'1', N'0', N'1', N'1', N'1', N'1', N'0', N'', N'1', N'0', N'1', N'2021-05-03 10:56:37.772', NULL, N'0', N'0001-01-01 00:00:00')
GO
INSERT INTO [dbo].[sys_permission] ([Id], [ParentId], [Label], [Code], [Type], [View], [Api], [Path], [Icon], [Hidden], [IsActive], [Closable], [Opened], [NewWindow], [External], [Sort], [Description], [TenantId], [IsDeleted], [CreatorUserId], [CreationTime], [CreatedTime], [LastModifierUserId], [LastModificationTime]) VALUES (N'130', N'111', N'角色权限', N'rolePermissionManager', N'2', N'SysRolePermissions', N'', N'/sysRolePemissions', N'el-icon-share', N'1', N'0', N'1', N'1', N'1', N'1', N'7', N'', N'1', N'0', N'1', N'2021-05-03 10:59:13.100', NULL, N'0', N'2021-05-05 17:08:31')
GO
INSERT INTO [dbo].[sys_permission] ([Id], [ParentId], [Label], [Code], [Type], [View], [Api], [Path], [Icon], [Hidden], [IsActive], [Closable], [Opened], [NewWindow], [External], [Sort], [Description], [TenantId], [IsDeleted], [CreatorUserId], [CreationTime], [CreatedTime], [LastModifierUserId], [LastModificationTime]) VALUES (N'131', N'130', N'配置角色权限', N'rolePermissionManager.editRolePermission', N'3', N'', N'SysRole/UpdateSysRolePermissions', N'', N'', N'1', N'0', N'1', N'1', N'1', N'1', N'0', N'', N'1', N'0', N'1', N'2021-05-03 11:00:38.300', NULL, N'0', N'2021-05-03 11:08:25')
GO
INSERT INTO [dbo].[sys_permission] ([Id], [ParentId], [Label], [Code], [Type], [View], [Api], [Path], [Icon], [Hidden], [IsActive], [Closable], [Opened], [NewWindow], [External], [Sort], [Description], [TenantId], [IsDeleted], [CreatorUserId], [CreationTime], [CreatedTime], [LastModifierUserId], [LastModificationTime]) VALUES (N'132', N'115', N'新增数据字典', N'dataDictionaryManager.createDataDictionary', N'3', N'', N'SysDataDictionary/CreateSysDataDictionary', N'', N'', N'1', N'0', N'1', N'1', N'1', N'1', N'0', N'', N'1', N'0', N'1', N'2021-05-03 11:07:23.817', NULL, N'0', N'2021-05-03 11:08:44')
GO
INSERT INTO [dbo].[sys_permission] ([Id], [ParentId], [Label], [Code], [Type], [View], [Api], [Path], [Icon], [Hidden], [IsActive], [Closable], [Opened], [NewWindow], [External], [Sort], [Description], [TenantId], [IsDeleted], [CreatorUserId], [CreationTime], [CreatedTime], [LastModifierUserId], [LastModificationTime]) VALUES (N'133', N'115', N'编辑数据字典', N'dataDictionaryManager.editDataDictionary', N'3', N'', N'SysDataDictionary/UpdateSysDataDictionary', N'', N'', N'1', N'0', N'1', N'1', N'1', N'1', N'0', N'', N'1', N'0', N'1', N'2021-05-03 11:09:27.438', NULL, N'0', N'0001-01-01 00:00:00')
GO
INSERT INTO [dbo].[sys_permission] ([Id], [ParentId], [Label], [Code], [Type], [View], [Api], [Path], [Icon], [Hidden], [IsActive], [Closable], [Opened], [NewWindow], [External], [Sort], [Description], [TenantId], [IsDeleted], [CreatorUserId], [CreationTime], [CreatedTime], [LastModifierUserId], [LastModificationTime]) VALUES (N'134', N'115', N'删除数据字典', N'dataDictionaryManager.deleteDataDictionary', N'3', N'', N'SysDataDictionary/DeleteSysDataDictionaryById', N'', N'', N'1', N'0', N'1', N'1', N'1', N'1', N'0', N'', N'1', N'0', N'1', N'2021-05-03 11:10:11.542', NULL, N'0', N'0001-01-01 00:00:00')
GO
INSERT INTO [dbo].[sys_permission] ([Id], [ParentId], [Label], [Code], [Type], [View], [Api], [Path], [Icon], [Hidden], [IsActive], [Closable], [Opened], [NewWindow], [External], [Sort], [Description], [TenantId], [IsDeleted], [CreatorUserId], [CreationTime], [CreatedTime], [LastModifierUserId], [LastModificationTime]) VALUES (N'135', N'115', N'查看数据字典列表', N'dataDictionaryManager.viewDataDictionary', N'3', N'', N'SysDataDictionary/GetSysDataDictionaryList,SysDataDictionary/GetSysDataDictionaryFilterByPid', N'', N'', N'1', N'0', N'1', N'1', N'1', N'1', N'0', N'', N'1', N'0', N'1', N'2021-05-03 11:10:46.715', NULL, N'0', N'0001-01-01 00:00:00')
GO
INSERT INTO [dbo].[sys_permission] ([Id], [ParentId], [Label], [Code], [Type], [View], [Api], [Path], [Icon], [Hidden], [IsActive], [Closable], [Opened], [NewWindow], [External], [Sort], [Description], [TenantId], [IsDeleted], [CreatorUserId], [CreationTime], [CreatedTime], [LastModifierUserId], [LastModificationTime]) VALUES (N'136', N'0', N'首页', N'welcomePage', N'2', N'Welcome', N'', N'/welcome', N'el-icon-s-home', N'1', N'0', N'1', N'1', N'1', N'1', N'1', N'', N'1', N'0', N'1', N'2021-05-03 11:16:56.241', NULL, N'0', N'2021-05-04 15:01:24')
GO
INSERT INTO [dbo].[sys_permission] ([Id], [ParentId], [Label], [Code], [Type], [View], [Api], [Path], [Icon], [Hidden], [IsActive], [Closable], [Opened], [NewWindow], [External], [Sort], [Description], [TenantId], [IsDeleted], [CreatorUserId], [CreationTime], [CreatedTime], [LastModifierUserId], [LastModificationTime]) VALUES (N'137', N'130', N'查看角色权限列表', N'rolePermissionManager.viewRolePermission', N'3', N'', N'SysRole/GetSysRoleList,SysPermission/GetSysPermissionList', N'', N'', N'1', N'0', N'1', N'1', N'1', N'1', N'0', N'', N'1', N'0', N'1', N'2021-05-03 11:19:55.125', NULL, N'0', N'2021-05-03 11:23:45')
GO
INSERT INTO [dbo].[sys_permission] ([Id], [ParentId], [Label], [Code], [Type], [View], [Api], [Path], [Icon], [Hidden], [IsActive], [Closable], [Opened], [NewWindow], [External], [Sort], [Description], [TenantId], [IsDeleted], [CreatorUserId], [CreationTime], [CreatedTime], [LastModifierUserId], [LastModificationTime]) VALUES (N'138', N'117', N'查看审计日志列表', N'sysAuditLogManager.viewSysAuditLog', N'3', N'', N'SysAuditLog/GetPageSysAuditLogList,SysAuditLog/Get', N'', N'', N'1', N'0', N'1', N'1', N'1', N'1', N'0', N'', N'1', N'0', N'1', N'2021-05-05 12:59:33.332', NULL, N'0', N'0001-01-01 00:00:00')
GO
INSERT INTO [dbo].[sys_permission] ([Id], [ParentId], [Label], [Code], [Type], [View], [Api], [Path], [Icon], [Hidden], [IsActive], [Closable], [Opened], [NewWindow], [External], [Sort], [Description], [TenantId], [IsDeleted], [CreatorUserId], [CreationTime], [CreatedTime], [LastModifierUserId], [LastModificationTime]) VALUES (N'139', N'0', N'机构管理', N'sysOrganizationManager', N'2', N'SysOrganizations', N'', N'/sysOrganizations', N'el-icon-s-custom', N'1', N'0', N'1', N'1', N'1', N'1', N'999', N'', N'1', N'0', N'1', N'2021-05-05 17:12:30.131', NULL, N'0', N'2021-05-05 17:24:55')
GO
INSERT INTO [dbo].[sys_permission] ([Id], [ParentId], [Label], [Code], [Type], [View], [Api], [Path], [Icon], [Hidden], [IsActive], [Closable], [Opened], [NewWindow], [External], [Sort], [Description], [TenantId], [IsDeleted], [CreatorUserId], [CreationTime], [CreatedTime], [LastModifierUserId], [LastModificationTime]) VALUES (N'140', N'139', N'查看组织机构列表', N'sysOrganizationManager.viewSysOrganization', N'3', N'', N'SysOrganization/GetSysOrganizationList,SysOrganization/Get,SysOrganization/GetSysOrganizationFilterByPid', N'', N'', N'1', N'0', N'1', N'1', N'1', N'1', N'0', N'', N'1', N'0', N'1', N'2021-05-05 17:13:51.264', NULL, N'0', N'0001-01-01 00:00:00')
GO
INSERT INTO [dbo].[sys_permission] ([Id], [ParentId], [Label], [Code], [Type], [View], [Api], [Path], [Icon], [Hidden], [IsActive], [Closable], [Opened], [NewWindow], [External], [Sort], [Description], [TenantId], [IsDeleted], [CreatorUserId], [CreationTime], [CreatedTime], [LastModifierUserId], [LastModificationTime]) VALUES (N'141', N'139', N'新增组织机构', N'sysOrganizationManager.createSysOrganization', N'3', N'', N'SysOrganization/CreateSysOrganization', N'', N'', N'1', N'0', N'1', N'1', N'1', N'1', N'0', N'', N'1', N'0', N'1', N'2021-05-05 17:14:29.066', NULL, N'0', N'0001-01-01 00:00:00')
GO
INSERT INTO [dbo].[sys_permission] ([Id], [ParentId], [Label], [Code], [Type], [View], [Api], [Path], [Icon], [Hidden], [IsActive], [Closable], [Opened], [NewWindow], [External], [Sort], [Description], [TenantId], [IsDeleted], [CreatorUserId], [CreationTime], [CreatedTime], [LastModifierUserId], [LastModificationTime]) VALUES (N'142', N'139', N'编辑组织机构', N'sysOrganizationManager.editSysOrganization', N'3', N'', N'SysOrganization/UpdateSysOrganization', N'', N'', N'1', N'0', N'1', N'1', N'1', N'1', N'0', N'', N'1', N'0', N'1', N'2021-05-05 17:22:03.526', NULL, N'0', N'0001-01-01 00:00:00')
GO
INSERT INTO [dbo].[sys_permission] ([Id], [ParentId], [Label], [Code], [Type], [View], [Api], [Path], [Icon], [Hidden], [IsActive], [Closable], [Opened], [NewWindow], [External], [Sort], [Description], [TenantId], [IsDeleted], [CreatorUserId], [CreationTime], [CreatedTime], [LastModifierUserId], [LastModificationTime]) VALUES (N'143', N'139', N'删除组织机构', N'sysOrganizationManager.deleteSysOrganization', N'3', N'', N'SysOrganization/DeleteSysOrganizationById', N'', N'', N'1', N'0', N'1', N'1', N'1', N'1', N'0', N'', N'1', N'0', N'1', N'2021-05-05 17:22:51.792', NULL, N'0', N'0001-01-01 00:00:00')
GO
INSERT INTO [dbo].[sys_permission] ([Id], [ParentId], [Label], [Code], [Type], [View], [Api], [Path], [Icon], [Hidden], [IsActive], [Closable], [Opened], [NewWindow], [External], [Sort], [Description], [TenantId], [IsDeleted], [CreatorUserId], [CreationTime], [CreatedTime], [LastModifierUserId], [LastModificationTime]) VALUES (N'145', N'0', N'看板', N'Board', N'2', N'board', N'', N'/board', N'el-icon-s-marketing', N'0', N'0', N'1', N'1', N'1', N'1', N'2', N'', NULL, N'0', N'0', NULL, NULL, N'0', N'0001-01-01 00:00:00')
GO
INSERT INTO [dbo].[sys_permission] ([Id], [ParentId], [Label], [Code], [Type], [View], [Api], [Path], [Icon], [Hidden], [IsActive], [Closable], [Opened], [NewWindow], [External], [Sort], [Description], [TenantId], [IsDeleted], [CreatorUserId], [CreationTime], [CreatedTime], [LastModifierUserId], [LastModificationTime]) VALUES (N'151', N'0', N'大数据组件', N'BigData', N'1', N'', N'', N'', N'el-icon-box', N'0', N'0', N'1', N'1', N'1', N'1', N'15', N'', NULL, N'0', N'0', NULL, NULL, N'0', N'0001-01-01 00:00:00')
GO
INSERT INTO [dbo].[sys_permission] ([Id], [ParentId], [Label], [Code], [Type], [View], [Api], [Path], [Icon], [Hidden], [IsActive], [Closable], [Opened], [NewWindow], [External], [Sort], [Description], [TenantId], [IsDeleted], [CreatorUserId], [CreationTime], [CreatedTime], [LastModifierUserId], [LastModificationTime]) VALUES (N'152', N'151', N'ES 大数据检索示例', N'bookManager', N'2', N'Books', N'', N'/books', N'el-icon-search', N'0', N'0', N'1', N'1', N'1', N'1', N'0', N'', NULL, N'0', N'0', NULL, NULL, N'0', N'0001-01-01 00:00:00')
GO
INSERT INTO [dbo].[sys_permission] ([Id], [ParentId], [Label], [Code], [Type], [View], [Api], [Path], [Icon], [Hidden], [IsActive], [Closable], [Opened], [NewWindow], [External], [Sort], [Description], [TenantId], [IsDeleted], [CreatorUserId], [CreationTime], [CreatedTime], [LastModifierUserId], [LastModificationTime]) VALUES (N'153', N'152', N'查看列表', N'bookManager.viewBook', N'3', N'', N'Book/GetPageBookList', N'', N'', N'0', N'0', N'1', N'1', N'1', N'1', N'0', N'', NULL, N'0', N'0', NULL, NULL, N'0', N'0001-01-01 00:00:00')
GO
SET IDENTITY_INSERT [dbo].[sys_permission] OFF
GO
-- ----------------------------
-- Table structure for sys_role
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[sys_role]') AND type IN ('U'))
DROP TABLE [dbo].[sys_role]
GO
CREATE TABLE [dbo].[sys_role] (
[Id] bigint IDENTITY(1,1) NOT NULL,
[Name] nvarchar(32) COLLATE Chinese_PRC_CI_AS NOT NULL,
[IsActive] tinyint NULL,
[Memoni] nvarchar(32) COLLATE Chinese_PRC_CI_AS NULL,
[Sort] int NULL,
[IsDeleted] tinyint NULL,
[LastModificationTime] datetime2(0) NULL,
[LastModifierUserId] bigint NULL,
[OrgId] int NULL,
[TenantId] int NULL
)
GO
ALTER TABLE [dbo].[sys_role] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'编号',
'SCHEMA', N'dbo',
'TABLE', N'sys_role',
'COLUMN', N'Id'
GO
EXEC sp_addextendedproperty
'MS_Description', N'名称',
'SCHEMA', N'dbo',
'TABLE', N'sys_role',
'COLUMN', N'Name'
GO
EXEC sp_addextendedproperty
'MS_Description', N'启用',
'SCHEMA', N'dbo',
'TABLE', N'sys_role',
'COLUMN', N'IsActive'
GO
EXEC sp_addextendedproperty
'MS_Description', N'助记符',
'SCHEMA', N'dbo',
'TABLE', N'sys_role',
'COLUMN', N'Memoni'
GO
EXEC sp_addextendedproperty
'MS_Description', N'排序',
'SCHEMA', N'dbo',
'TABLE', N'sys_role',
'COLUMN', N'Sort'
GO
EXEC sp_addextendedproperty
'MS_Description', N'删除标记',
'SCHEMA', N'dbo',
'TABLE', N'sys_role',
'COLUMN', N'IsDeleted'
GO
EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'sys_role',
'COLUMN', N'LastModificationTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'sys_role',
'COLUMN', N'LastModifierUserId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'组织',
'SCHEMA', N'dbo',
'TABLE', N'sys_role',
'COLUMN', N'OrgId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'用户角色',
'SCHEMA', N'dbo',
'TABLE', N'sys_role'
GO
-- ----------------------------
-- Records of sys_role
-- ----------------------------
SET IDENTITY_INSERT [dbo].[sys_role] ON
GO
INSERT INTO [dbo].[sys_role] ([Id], [Name], [IsActive], [Memoni], [Sort], [IsDeleted], [LastModificationTime], [LastModifierUserId], [OrgId], [TenantId]) VALUES (N'1', N'超级管理员', N'0', N'superAdmin', NULL, N'0', N'2021-05-04 12:53:12', N'0', NULL, N'1')
GO
INSERT INTO [dbo].[sys_role] ([Id], [Name], [IsActive], [Memoni], [Sort], [IsDeleted], [LastModificationTime], [LastModifierUserId], [OrgId], [TenantId]) VALUES (N'2', N'运维管理员', N'0', N'222', N'2', N'0', N'2021-05-04 12:53:03', N'0', NULL, N'1')
GO
SET IDENTITY_INSERT [dbo].[sys_role] OFF
GO
-- ----------------------------
-- Table structure for sys_rolepermission
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[sys_rolepermission]') AND type IN ('U'))
DROP TABLE [dbo].[sys_rolepermission]
GO
CREATE TABLE [dbo].[sys_rolepermission] (
[Id] bigint IDENTITY(1,1) NOT NULL,
[RoleId] bigint NOT NULL,
[PermissionId] bigint NOT NULL,
[CreatorUserId] bigint NULL,
[CreationTime] datetime2(0) NULL
)
GO
ALTER TABLE [dbo].[sys_rolepermission] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'主键Id',
'SCHEMA', N'dbo',
'TABLE', N'sys_rolepermission',
'COLUMN', N'Id'
GO
EXEC sp_addextendedproperty
'MS_Description', N'角色Id',
'SCHEMA', N'dbo',
'TABLE', N'sys_rolepermission',
'COLUMN', N'RoleId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'权限Id',
'SCHEMA', N'dbo',
'TABLE', N'sys_rolepermission',
'COLUMN', N'PermissionId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'创建者Id',
'SCHEMA', N'dbo',
'TABLE', N'sys_rolepermission',
'COLUMN', N'CreatorUserId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'sys_rolepermission',
'COLUMN', N'CreationTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'角色权限',
'SCHEMA', N'dbo',
'TABLE', N'sys_rolepermission'
GO
-- ----------------------------
-- Records of sys_rolepermission
-- ----------------------------
SET IDENTITY_INSERT [dbo].[sys_rolepermission] ON
GO
INSERT INTO [dbo].[sys_rolepermission] ([Id], [RoleId], [PermissionId], [CreatorUserId], [CreationTime]) VALUES (N'1244', N'2', N'113', N'1', N'2021-09-09 17:42:13')
GO
INSERT INTO [dbo].[sys_rolepermission] ([Id], [RoleId], [PermissionId], [CreatorUserId], [CreationTime]) VALUES (N'1245', N'2', N'126', N'1', N'2021-09-09 17:42:13')
GO
INSERT INTO [dbo].[sys_rolepermission] ([Id], [RoleId], [PermissionId], [CreatorUserId], [CreationTime]) VALUES (N'1246', N'2', N'114', N'1', N'2021-09-09 17:42:13')
GO
INSERT INTO [dbo].[sys_rolepermission] ([Id], [RoleId], [PermissionId], [CreatorUserId], [CreationTime]) VALUES (N'1247', N'2', N'125', N'1', N'2021-09-09 17:42:13')
GO
INSERT INTO [dbo].[sys_rolepermission] ([Id], [RoleId], [PermissionId], [CreatorUserId], [CreationTime]) VALUES (N'1248', N'2', N'130', N'1', N'2021-09-09 17:42:13')
GO
INSERT INTO [dbo].[sys_rolepermission] ([Id], [RoleId], [PermissionId], [CreatorUserId], [CreationTime]) VALUES (N'1249', N'2', N'137', N'1', N'2021-09-09 17:42:13')
GO
INSERT INTO [dbo].[sys_rolepermission] ([Id], [RoleId], [PermissionId], [CreatorUserId], [CreationTime]) VALUES (N'1250', N'2', N'116', N'1', N'2021-09-09 17:42:13')
GO
INSERT INTO [dbo].[sys_rolepermission] ([Id], [RoleId], [PermissionId], [CreatorUserId], [CreationTime]) VALUES (N'1251', N'2', N'117', N'1', N'2021-09-09 17:42:13')
GO
INSERT INTO [dbo].[sys_rolepermission] ([Id], [RoleId], [PermissionId], [CreatorUserId], [CreationTime]) VALUES (N'1252', N'2', N'138', N'1', N'2021-09-09 17:42:13')
GO
INSERT INTO [dbo].[sys_rolepermission] ([Id], [RoleId], [PermissionId], [CreatorUserId], [CreationTime]) VALUES (N'1253', N'2', N'112', N'1', N'2021-09-09 17:42:13')
GO
INSERT INTO [dbo].[sys_rolepermission] ([Id], [RoleId], [PermissionId], [CreatorUserId], [CreationTime]) VALUES (N'1254', N'2', N'119', N'1', N'2021-09-09 17:42:13')
GO
INSERT INTO [dbo].[sys_rolepermission] ([Id], [RoleId], [PermissionId], [CreatorUserId], [CreationTime]) VALUES (N'1255', N'2', N'115', N'1', N'2021-09-09 17:42:13')
GO
INSERT INTO [dbo].[sys_rolepermission] ([Id], [RoleId], [PermissionId], [CreatorUserId], [CreationTime]) VALUES (N'1256', N'2', N'135', N'1', N'2021-09-09 17:42:13')
GO
INSERT INTO [dbo].[sys_rolepermission] ([Id], [RoleId], [PermissionId], [CreatorUserId], [CreationTime]) VALUES (N'1257', N'2', N'136', N'1', N'2021-09-09 17:42:13')
GO
INSERT INTO [dbo].[sys_rolepermission] ([Id], [RoleId], [PermissionId], [CreatorUserId], [CreationTime]) VALUES (N'1258', N'2', N'139', N'1', N'2021-09-09 17:42:13')
GO
INSERT INTO [dbo].[sys_rolepermission] ([Id], [RoleId], [PermissionId], [CreatorUserId], [CreationTime]) VALUES (N'1259', N'2', N'140', N'1', N'2021-09-09 17:42:13')
GO
INSERT INTO [dbo].[sys_rolepermission] ([Id], [RoleId], [PermissionId], [CreatorUserId], [CreationTime]) VALUES (N'1260', N'2', N'141', N'1', N'2021-09-09 17:42:13')
GO
INSERT INTO [dbo].[sys_rolepermission] ([Id], [RoleId], [PermissionId], [CreatorUserId], [CreationTime]) VALUES (N'1261', N'2', N'142', N'1', N'2021-09-09 17:42:13')
GO
INSERT INTO [dbo].[sys_rolepermission] ([Id], [RoleId], [PermissionId], [CreatorUserId], [CreationTime]) VALUES (N'1262', N'2', N'143', N'1', N'2021-09-09 17:42:13')
GO
INSERT INTO [dbo].[sys_rolepermission] ([Id], [RoleId], [PermissionId], [CreatorUserId], [CreationTime]) VALUES (N'1263', N'2', N'111', N'1', N'2021-09-09 17:42:13')
GO
INSERT INTO [dbo].[sys_rolepermission] ([Id], [RoleId], [PermissionId], [CreatorUserId], [CreationTime]) VALUES (N'1298', N'1', N'111', N'1', N'2021-10-09 19:31:41')
GO
INSERT INTO [dbo].[sys_rolepermission] ([Id], [RoleId], [PermissionId], [CreatorUserId], [CreationTime]) VALUES (N'1299', N'1', N'113', N'1', N'2021-10-09 19:31:41')
GO
INSERT INTO [dbo].[sys_rolepermission] ([Id], [RoleId], [PermissionId], [CreatorUserId], [CreationTime]) VALUES (N'1300', N'1', N'126', N'1', N'2021-10-09 19:31:41')
GO
INSERT INTO [dbo].[sys_rolepermission] ([Id], [RoleId], [PermissionId], [CreatorUserId], [CreationTime]) VALUES (N'1301', N'1', N'127', N'1', N'2021-10-09 19:31:41')
GO
INSERT INTO [dbo].[sys_rolepermission] ([Id], [RoleId], [PermissionId], [CreatorUserId], [CreationTime]) VALUES (N'1302', N'1', N'128', N'1', N'2021-10-09 19:31:41')
GO
INSERT INTO [dbo].[sys_rolepermission] ([Id], [RoleId], [PermissionId], [CreatorUserId], [CreationTime]) VALUES (N'1303', N'1', N'129', N'1', N'2021-10-09 19:31:41')
GO
INSERT INTO [dbo].[sys_rolepermission] ([Id], [RoleId], [PermissionId], [CreatorUserId], [CreationTime]) VALUES (N'1304', N'1', N'114', N'1', N'2021-10-09 19:31:41')
GO
INSERT INTO [dbo].[sys_rolepermission] ([Id], [RoleId], [PermissionId], [CreatorUserId], [CreationTime]) VALUES (N'1305', N'1', N'122', N'1', N'2021-10-09 19:31:41')
GO
INSERT INTO [dbo].[sys_rolepermission] ([Id], [RoleId], [PermissionId], [CreatorUserId], [CreationTime]) VALUES (N'1306', N'1', N'123', N'1', N'2021-10-09 19:31:41')
GO
INSERT INTO [dbo].[sys_rolepermission] ([Id], [RoleId], [PermissionId], [CreatorUserId], [CreationTime]) VALUES (N'1307', N'1', N'124', N'1', N'2021-10-09 19:31:41')
GO
INSERT INTO [dbo].[sys_rolepermission] ([Id], [RoleId], [PermissionId], [CreatorUserId], [CreationTime]) VALUES (N'1308', N'1', N'125', N'1', N'2021-10-09 19:31:41')
GO
INSERT INTO [dbo].[sys_rolepermission] ([Id], [RoleId], [PermissionId], [CreatorUserId], [CreationTime]) VALUES (N'1309', N'1', N'130', N'1', N'2021-10-09 19:31:41')
GO
INSERT INTO [dbo].[sys_rolepermission] ([Id], [RoleId], [PermissionId], [CreatorUserId], [CreationTime]) VALUES (N'1310', N'1', N'131', N'1', N'2021-10-09 19:31:41')
GO
INSERT INTO [dbo].[sys_rolepermission] ([Id], [RoleId], [PermissionId], [CreatorUserId], [CreationTime]) VALUES (N'1311', N'1', N'137', N'1', N'2021-10-09 19:31:41')
GO
INSERT INTO [dbo].[sys_rolepermission] ([Id], [RoleId], [PermissionId], [CreatorUserId], [CreationTime]) VALUES (N'1312', N'1', N'116', N'1', N'2021-10-09 19:31:41')
GO
INSERT INTO [dbo].[sys_rolepermission] ([Id], [RoleId], [PermissionId], [CreatorUserId], [CreationTime]) VALUES (N'1313', N'1', N'117', N'1', N'2021-10-09 19:31:41')
GO
INSERT INTO [dbo].[sys_rolepermission] ([Id], [RoleId], [PermissionId], [CreatorUserId], [CreationTime]) VALUES (N'1314', N'1', N'138', N'1', N'2021-10-09 19:31:41')
GO
INSERT INTO [dbo].[sys_rolepermission] ([Id], [RoleId], [PermissionId], [CreatorUserId], [CreationTime]) VALUES (N'1315', N'1', N'151', N'1', N'2021-10-09 19:31:41')
GO
INSERT INTO [dbo].[sys_rolepermission] ([Id], [RoleId], [PermissionId], [CreatorUserId], [CreationTime]) VALUES (N'1316', N'1', N'152', N'1', N'2021-10-09 19:31:41')
GO
INSERT INTO [dbo].[sys_rolepermission] ([Id], [RoleId], [PermissionId], [CreatorUserId], [CreationTime]) VALUES (N'1317', N'1', N'153', N'1', N'2021-10-09 19:31:41')
GO
INSERT INTO [dbo].[sys_rolepermission] ([Id], [RoleId], [PermissionId], [CreatorUserId], [CreationTime]) VALUES (N'1318', N'1', N'112', N'1', N'2021-10-09 19:31:41')
GO
INSERT INTO [dbo].[sys_rolepermission] ([Id], [RoleId], [PermissionId], [CreatorUserId], [CreationTime]) VALUES (N'1319', N'1', N'118', N'1', N'2021-10-09 19:31:41')
GO
INSERT INTO [dbo].[sys_rolepermission] ([Id], [RoleId], [PermissionId], [CreatorUserId], [CreationTime]) VALUES (N'1320', N'1', N'119', N'1', N'2021-10-09 19:31:41')
GO
INSERT INTO [dbo].[sys_rolepermission] ([Id], [RoleId], [PermissionId], [CreatorUserId], [CreationTime]) VALUES (N'1321', N'1', N'120', N'1', N'2021-10-09 19:31:41')
GO
INSERT INTO [dbo].[sys_rolepermission] ([Id], [RoleId], [PermissionId], [CreatorUserId], [CreationTime]) VALUES (N'1322', N'1', N'121', N'1', N'2021-10-09 19:31:41')
GO
INSERT INTO [dbo].[sys_rolepermission] ([Id], [RoleId], [PermissionId], [CreatorUserId], [CreationTime]) VALUES (N'1323', N'1', N'115', N'1', N'2021-10-09 19:31:41')
GO
INSERT INTO [dbo].[sys_rolepermission] ([Id], [RoleId], [PermissionId], [CreatorUserId], [CreationTime]) VALUES (N'1324', N'1', N'132', N'1', N'2021-10-09 19:31:41')
GO
INSERT INTO [dbo].[sys_rolepermission] ([Id], [RoleId], [PermissionId], [CreatorUserId], [CreationTime]) VALUES (N'1325', N'1', N'133', N'1', N'2021-10-09 19:31:41')
GO
INSERT INTO [dbo].[sys_rolepermission] ([Id], [RoleId], [PermissionId], [CreatorUserId], [CreationTime]) VALUES (N'1326', N'1', N'134', N'1', N'2021-10-09 19:31:41')
GO
INSERT INTO [dbo].[sys_rolepermission] ([Id], [RoleId], [PermissionId], [CreatorUserId], [CreationTime]) VALUES (N'1327', N'1', N'135', N'1', N'2021-10-09 19:31:41')
GO
INSERT INTO [dbo].[sys_rolepermission] ([Id], [RoleId], [PermissionId], [CreatorUserId], [CreationTime]) VALUES (N'1328', N'1', N'136', N'1', N'2021-10-09 19:31:41')
GO
INSERT INTO [dbo].[sys_rolepermission] ([Id], [RoleId], [PermissionId], [CreatorUserId], [CreationTime]) VALUES (N'1329', N'1', N'139', N'1', N'2021-10-09 19:31:41')
GO
INSERT INTO [dbo].[sys_rolepermission] ([Id], [RoleId], [PermissionId], [CreatorUserId], [CreationTime]) VALUES (N'1330', N'1', N'140', N'1', N'2021-10-09 19:31:41')
GO
INSERT INTO [dbo].[sys_rolepermission] ([Id], [RoleId], [PermissionId], [CreatorUserId], [CreationTime]) VALUES (N'1331', N'1', N'141', N'1', N'2021-10-09 19:31:41')
GO
INSERT INTO [dbo].[sys_rolepermission] ([Id], [RoleId], [PermissionId], [CreatorUserId], [CreationTime]) VALUES (N'1332', N'1', N'142', N'1', N'2021-10-09 19:31:41')
GO
INSERT INTO [dbo].[sys_rolepermission] ([Id], [RoleId], [PermissionId], [CreatorUserId], [CreationTime]) VALUES (N'1333', N'1', N'143', N'1', N'2021-10-09 19:31:41')
GO
INSERT INTO [dbo].[sys_rolepermission] ([Id], [RoleId], [PermissionId], [CreatorUserId], [CreationTime]) VALUES (N'1334', N'1', N'145', N'1', N'2021-10-09 19:31:41')
GO
SET IDENTITY_INSERT [dbo].[sys_rolepermission] OFF
GO
-- ----------------------------
-- Table structure for sys_user
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[sys_user]') AND type IN ('U'))
DROP TABLE [dbo].[sys_user]
GO
CREATE TABLE [dbo].[sys_user] (
[Id] bigint IDENTITY(1,1) NOT NULL,
[NO] nvarchar(32) COLLATE Chinese_PRC_CI_AS NULL,
[Name] nvarchar(32) COLLATE Chinese_PRC_CI_AS NOT NULL,
[Account] nvarchar(64) COLLATE Chinese_PRC_CI_AS NOT NULL,
[Password] nvarchar(64) COLLATE Chinese_PRC_CI_AS NOT NULL,
[Sex] tinyint NULL,
[Mobile] nvarchar(16) COLLATE Chinese_PRC_CI_AS NULL,
[Email] nvarchar(64) COLLATE Chinese_PRC_CI_AS NULL,
[Remark] nvarchar(128) COLLATE Chinese_PRC_CI_AS NULL,
[IsActive] tinyint NULL,
[LoginCount] int NULL,
[Memoni] nvarchar(32) COLLATE Chinese_PRC_CI_AS NULL,
[IsDeleted] tinyint NULL,
[OrgId] int NULL,
[LastModificationTime] datetime2(0) NULL,
[ModifyUserId] int NULL,
[UserType] tinyint NULL,
[InterDepartmental] tinyint NULL,
[LastModifierUserId] bigint NULL,
[DeletionTime] datetime2(0) NULL,
[DeleterUserId] int NULL,
[CreationTime] datetime2(0) NULL,
[CreatorUserId] bigint NULL,
[TenantId] int NULL
)
GO
ALTER TABLE [dbo].[sys_user] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'编号',
'SCHEMA', N'dbo',
'TABLE', N'sys_user',
'COLUMN', N'Id'
GO
EXEC sp_addextendedproperty
'MS_Description', N'员工编号',
'SCHEMA', N'dbo',
'TABLE', N'sys_user',
'COLUMN', N'NO'
GO
EXEC sp_addextendedproperty
'MS_Description', N'员工名称',
'SCHEMA', N'dbo',
'TABLE', N'sys_user',
'COLUMN', N'Name'
GO
EXEC sp_addextendedproperty
'MS_Description', N'登录账号',
'SCHEMA', N'dbo',
'TABLE', N'sys_user',
'COLUMN', N'Account'
GO
EXEC sp_addextendedproperty
'MS_Description', N'密码',
'SCHEMA', N'dbo',
'TABLE', N'sys_user',
'COLUMN', N'Password'
GO
EXEC sp_addextendedproperty
'MS_Description', N'性别',
'SCHEMA', N'dbo',
'TABLE', N'sys_user',
'COLUMN', N'Sex'
GO
EXEC sp_addextendedproperty
'MS_Description', N'手机号码',
'SCHEMA', N'dbo',
'TABLE', N'sys_user',
'COLUMN', N'Mobile'
GO
EXEC sp_addextendedproperty
'MS_Description', N'信箱',
'SCHEMA', N'dbo',
'TABLE', N'sys_user',
'COLUMN', N'Email'
GO
EXEC sp_addextendedproperty
'MS_Description', N'备注',
'SCHEMA', N'dbo',
'TABLE', N'sys_user',
'COLUMN', N'Remark'
GO
EXEC sp_addextendedproperty
'MS_Description', N'启用',
'SCHEMA', N'dbo',
'TABLE', N'sys_user',
'COLUMN', N'IsActive'
GO
EXEC sp_addextendedproperty
'MS_Description', N'登录次数',
'SCHEMA', N'dbo',
'TABLE', N'sys_user',
'COLUMN', N'LoginCount'
GO
EXEC sp_addextendedproperty
'MS_Description', N'助记符',
'SCHEMA', N'dbo',
'TABLE', N'sys_user',
'COLUMN', N'Memoni'
GO
EXEC sp_addextendedproperty
'MS_Description', N'删除标记',
'SCHEMA', N'dbo',
'TABLE', N'sys_user',
'COLUMN', N'IsDeleted'
GO
EXEC sp_addextendedproperty
'MS_Description', N'组织',
'SCHEMA', N'dbo',
'TABLE', N'sys_user',
'COLUMN', N'OrgId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'sys_user',
'COLUMN', N'LastModificationTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'sys_user',
'COLUMN', N'ModifyUserId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'跨部门数据查看',
'SCHEMA', N'dbo',
'TABLE', N'sys_user',
'COLUMN', N'InterDepartmental'
GO
-- ----------------------------
-- Records of sys_user
-- ----------------------------
SET IDENTITY_INSERT [dbo].[sys_user] ON
GO
INSERT INTO [dbo].[sys_user] ([Id], [NO], [Name], [Account], [Password], [Sex], [Mobile], [Email], [Remark], [IsActive], [LoginCount], [Memoni], [IsDeleted], [OrgId], [LastModificationTime], [ModifyUserId], [UserType], [InterDepartmental], [LastModifierUserId], [DeletionTime], [DeleterUserId], [CreationTime], [CreatorUserId], [TenantId]) VALUES (N'1', N'admin', N'超级管理员', N'admin', N'e10adc3949ba59abbe56e057f20f883e', N'1', N'13699856947', N'1@qq.con', N'abc', N'1', N'6', N'234', N'0', NULL, N'2021-05-04 13:17:00', N'1', N'0', NULL, NULL, NULL, NULL, NULL, NULL, N'1')
GO
SET IDENTITY_INSERT [dbo].[sys_user] OFF
GO
-- ----------------------------
-- Table structure for sys_usersysorganization
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[sys_usersysorganization]') AND type IN ('U'))
DROP TABLE [dbo].[sys_usersysorganization]
GO
CREATE TABLE [dbo].[sys_usersysorganization] (
[Id] bigint IDENTITY(1,1) NOT NULL,
[SysUser_ID] int NULL,
[SysOrganization_ID] int NULL
)
GO
ALTER TABLE [dbo].[sys_usersysorganization] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'主键Id',
'SCHEMA', N'dbo',
'TABLE', N'sys_usersysorganization',
'COLUMN', N'Id'
GO
EXEC sp_addextendedproperty
'MS_Description', N'用户Id',
'SCHEMA', N'dbo',
'TABLE', N'sys_usersysorganization',
'COLUMN', N'SysUser_ID'
GO
EXEC sp_addextendedproperty
'MS_Description', N'组织Id',
'SCHEMA', N'dbo',
'TABLE', N'sys_usersysorganization',
'COLUMN', N'SysOrganization_ID'
GO
-- ----------------------------
-- Records of sys_usersysorganization
-- ----------------------------
SET IDENTITY_INSERT [dbo].[sys_usersysorganization] ON
GO
SET IDENTITY_INSERT [dbo].[sys_usersysorganization] OFF
GO
-- ----------------------------
-- Table structure for sys_usersysrole
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[sys_usersysrole]') AND type IN ('U'))
DROP TABLE [dbo].[sys_usersysrole]
GO
CREATE TABLE [dbo].[sys_usersysrole] (
[SysRole_ID] bigint NOT NULL,
[SysUser_ID] bigint NOT NULL,
[SysRole_Type] bigint NULL,
[Id] bigint IDENTITY(1,1) NOT NULL
)
GO
ALTER TABLE [dbo].[sys_usersysrole] SET (LOCK_ESCALATION = TABLE)
GO
-- ----------------------------
-- Records of sys_usersysrole
-- ----------------------------
SET IDENTITY_INSERT [dbo].[sys_usersysrole] ON
GO
INSERT INTO [dbo].[sys_usersysrole] ([SysRole_ID], [SysUser_ID], [SysRole_Type], [Id]) VALUES (N'1', N'1', N'0', N'5')
GO
INSERT INTO [dbo].[sys_usersysrole] ([SysRole_ID], [SysUser_ID], [SysRole_Type], [Id]) VALUES (N'2', N'1', N'0', N'6')
GO
SET IDENTITY_INSERT [dbo].[sys_usersysrole] OFF
GO
-- ----------------------------
-- Auto increment value for sys_auditlog
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[sys_auditlog]', RESEED, 24)
GO
-- ----------------------------
-- Primary Key structure for table sys_auditlog
-- ----------------------------
ALTER TABLE [dbo].[sys_auditlog] ADD CONSTRAINT [PK__sys_audi__3214EC070AA212B2] 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
-- ----------------------------
-- Auto increment value for sys_datadictionary
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[sys_datadictionary]', RESEED, 2)
GO
-- ----------------------------
-- Primary Key structure for table sys_datadictionary
-- ----------------------------
ALTER TABLE [dbo].[sys_datadictionary] ADD CONSTRAINT [PK__sys_data__3214EC079289FB62] 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
-- ----------------------------
-- Auto increment value for sys_organization
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[sys_organization]', RESEED, 25)
GO
-- ----------------------------
-- Primary Key structure for table sys_organization
-- ----------------------------
ALTER TABLE [dbo].[sys_organization] ADD CONSTRAINT [PK__sys_orga__3214EC071C64BE2E] 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
-- ----------------------------
-- Auto increment value for sys_permission
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[sys_permission]', RESEED, 153)
GO
-- ----------------------------
-- Indexes structure for table sys_permission
-- ----------------------------
CREATE UNIQUE NONCLUSTERED INDEX [idx_ad_permission_01]
ON [dbo].[sys_permission] (
[ParentId] ASC,
[Label] ASC
)
GO
-- ----------------------------
-- Primary Key structure for table sys_permission
-- ----------------------------
ALTER TABLE [dbo].[sys_permission] ADD CONSTRAINT [PK__sys_perm__3214EC070D57C3F8] 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
-- ----------------------------
-- Auto increment value for sys_role
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[sys_role]', RESEED, 2)
GO
-- ----------------------------
-- Indexes structure for table sys_role
-- ----------------------------
CREATE NONCLUSTERED INDEX [Id]
ON [dbo].[sys_role] (
[Id] ASC
)
GO
CREATE NONCLUSTERED INDEX [Id_2]
ON [dbo].[sys_role] (
[Id] ASC
)
GO
CREATE NONCLUSTERED INDEX [Id_3]
ON [dbo].[sys_role] (
[Id] ASC
)
GO
CREATE NONCLUSTERED INDEX [Id_4]
ON [dbo].[sys_role] (
[Id] ASC
)
GO
-- ----------------------------
-- Primary Key structure for table sys_role
-- ----------------------------
ALTER TABLE [dbo].[sys_role] ADD CONSTRAINT [PK__sys_role__3214EC077E2D3BC4] 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
-- ----------------------------
-- Auto increment value for sys_rolepermission
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[sys_rolepermission]', RESEED, 1334)
GO
-- ----------------------------
-- Indexes structure for table sys_rolepermission
-- ----------------------------
CREATE UNIQUE NONCLUSTERED INDEX [idx_ad_role_permission_01]
ON [dbo].[sys_rolepermission] (
[RoleId] ASC,
[PermissionId] ASC
)
GO
-- ----------------------------
-- Primary Key structure for table sys_rolepermission
-- ----------------------------
ALTER TABLE [dbo].[sys_rolepermission] ADD CONSTRAINT [PK__sys_role__3214EC074852CB5B] 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
-- ----------------------------
-- Auto increment value for sys_user
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[sys_user]', RESEED, 1)
GO
-- ----------------------------
-- Indexes structure for table sys_user
-- ----------------------------
CREATE NONCLUSTERED INDEX [Id]
ON [dbo].[sys_user] (
[Id] ASC
)
GO
-- ----------------------------
-- Primary Key structure for table sys_user
-- ----------------------------
ALTER TABLE [dbo].[sys_user] ADD CONSTRAINT [PK__sys_user__3214EC07911714CD] 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
-- ----------------------------
-- Auto increment value for sys_usersysorganization
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[sys_usersysorganization]', RESEED, 1)
GO
-- ----------------------------
-- Primary Key structure for table sys_usersysorganization
-- ----------------------------
ALTER TABLE [dbo].[sys_usersysorganization] ADD CONSTRAINT [PK__sys_user__3214EC077FB36851] 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
-- ----------------------------
-- Auto increment value for sys_usersysrole
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[sys_usersysrole]', RESEED, 6)
GO
-- ----------------------------
-- Indexes structure for table sys_usersysrole
-- ----------------------------
CREATE NONCLUSTERED INDEX [FK_SYSUSERS_REFERENCE_SYSUSER]
ON [dbo].[sys_usersysrole] (
[SysUser_ID] ASC
)
GO
-- ----------------------------
-- Primary Key structure for table sys_usersysrole
-- ----------------------------
ALTER TABLE [dbo].[sys_usersysrole] ADD CONSTRAINT [PK__sys_user__3214EC070BEBDC1F] 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 |
-- ----------------------------------------------------------------------------
-- MySQL Workbench Migration
-- Migrated Schemata: Northwind
-- Source Schemata: Northwind
-- Created: Sun Feb 08 20:55:46 2015
-- ----------------------------------------------------------------------------
SET FOREIGN_KEY_CHECKS = 0;;
-- ----------------------------------------------------------------------------
-- Schema Northwind
-- ----------------------------------------------------------------------------
DROP SCHEMA IF EXISTS `Northwind` ;
CREATE SCHEMA IF NOT EXISTS `Northwind` ;
-- ----------------------------------------------------------------------------
-- Table Northwind.Suppliers
-- ----------------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `Northwind`.`Suppliers` (
`SupplierID` INT(10) NULL,
`CompanyName` VARCHAR(50) NULL,
`ContactName` VARCHAR(50) NULL,
`ContactTitle` VARCHAR(50) NULL,
`Address` VARCHAR(50) NULL,
`City` VARCHAR(50) NULL,
`Region` VARCHAR(50) NULL,
`PostalCode` VARCHAR(50) NULL,
`Country` VARCHAR(50) NULL,
`Phone` VARCHAR(50) NULL,
`Fax` VARCHAR(50) NULL,
`HomePage` VARCHAR(50) NULL);
-- ----------------------------------------------------------------------------
-- Table Northwind.Current Product List
-- ----------------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `Northwind`.`Current Product List` (
`ProductID` INT(10) NULL,
`ProductName` VARCHAR(50) NULL);
-- ----------------------------------------------------------------------------
-- Table Northwind.Alphabetical list of products
-- ----------------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `Northwind`.`Alphabetical list of products` (
`ProductID` INT(10) NULL,
`ProductName` LONGTEXT NULL,
`SupplierID` INT(10) NULL,
`CategoryID` INT(10) NULL,
`QuantityPerUnit` LONGTEXT NULL,
`UnitPrice` DECIMAL(19,4) NULL,
`UnitsInStock` SMALLINT(5) NULL,
`UnitsOnOrder` SMALLINT(5) NULL,
`ReorderLevel` SMALLINT(5) NULL,
`Discontinued` SMALLINT(5) NULL,
`CategoryName` LONGTEXT NULL);
-- ----------------------------------------------------------------------------
-- Table Northwind.Territories
-- ----------------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `Northwind`.`Territories` (
`TerritoryID` VARCHAR(50) NULL,
`TerritoryDescription` VARCHAR(50) NULL,
`RegionID` INT(10) NULL);
-- ----------------------------------------------------------------------------
-- Table Northwind.TestMoney
-- ----------------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `Northwind`.`TestMoney` (
`cola` INT(10) NULL,
`mon` DECIMAL(19,4) NULL,
`i` INT(10) NULL,
`dec` DECIMAL(18,0) NULL);
-- ----------------------------------------------------------------------------
-- Table Northwind.Category Sales for 1997
-- ----------------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `Northwind`.`Category Sales for 1997` (
`CategoryName` LONGTEXT NULL,
`CategorySales` DECIMAL(19,4) NULL);
-- ----------------------------------------------------------------------------
-- Table Northwind.Product Sales for 1997
-- ----------------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `Northwind`.`Product Sales for 1997` (
`CategoryName` LONGTEXT NULL,
`ProductName` LONGTEXT NULL,
`ProductSales` DECIMAL(19,4) NULL);
-- ----------------------------------------------------------------------------
-- Table Northwind.Sales Totals by Amount
-- ----------------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `Northwind`.`Sales Totals by Amount` (
`SaleAmount` DECIMAL(19,4) NULL,
`OrderID` INT(10) NULL,
`CompanyName` LONGTEXT NULL,
`ShippedDate` DATETIME NULL);
-- ----------------------------------------------------------------------------
-- Table Northwind.Sales by Category
-- ----------------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `Northwind`.`Sales by Category` (
`CategoryID` INT(10) NULL,
`CategoryName` LONGTEXT NULL,
`ProductName` LONGTEXT NULL,
`ProductSales` DECIMAL(19,4) NULL);
-- ----------------------------------------------------------------------------
-- Table Northwind.Customers
-- ----------------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `Northwind`.`Customers` (
`CustomerID` VARCHAR(5) NULL,
`CompanyName` VARCHAR(50) NULL,
`ContactName` VARCHAR(50) NULL,
`ContactTitle` VARCHAR(50) NULL,
`Address` VARCHAR(50) NULL,
`City` VARCHAR(50) NULL,
`Region` VARCHAR(50) NULL,
`PostalCode` VARCHAR(50) NULL,
`Country` VARCHAR(50) NULL,
`Phone` VARCHAR(50) NULL,
`Fax` VARCHAR(50) NULL);
-- ----------------------------------------------------------------------------
-- Table Northwind.Order Details
-- ----------------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `Northwind`.`Order Details` (
`OrderID` INT(10) NULL,
`ProductID` INT(10) NULL,
`UnitPrice` DECIMAL(19,4) NULL,
`Quantity` SMALLINT(5) NULL,
`Discount` DOUBLE NULL);
-- ----------------------------------------------------------------------------
-- Table Northwind.Order Subtotals
-- ----------------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `Northwind`.`Order Subtotals` (
`OrderID` INT(10) NULL,
`Subtotal` DECIMAL(19,4) NULL);
-- ----------------------------------------------------------------------------
-- Table Northwind.Products Above Average Price
-- ----------------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `Northwind`.`Products Above Average Price` (
`ProductName` LONGTEXT NULL,
`UnitPrice` DECIMAL(19,4) NULL);
-- ----------------------------------------------------------------------------
-- Table Northwind.Employees
-- ----------------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `Northwind`.`Employees` (
`EmployeeID` INT(10) NULL,
`LastName` VARCHAR(50) NULL,
`FirstName` VARCHAR(50) NULL,
`Title` VARCHAR(10) NULL,
`TitleOfCourtesy` VARCHAR(10) NULL,
`BirthDate` DATETIME NULL,
`HireDate` DATETIME NULL,
`Address` VARCHAR(50) NULL,
`City` VARCHAR(50) NULL,
`Region` VARCHAR(50) NULL,
`PostalCode` VARCHAR(10) NULL,
`Country` VARCHAR(50) NULL,
`HomePhone` VARCHAR(50) NULL,
`Extension` VARCHAR(10) NULL,
`Photo` LONGBLOB NULL,
`Notes` VARCHAR(250) NULL,
`ReportsTo` INT(10) NULL,
`PhotoPath` VARCHAR(80) NULL);
-- ----------------------------------------------------------------------------
-- Table Northwind.Categories
-- ----------------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `Northwind`.`Categories` (
`CategoryID` INT(10) NULL,
`CategoryName` VARCHAR(50) NULL,
`Description` VARCHAR(50) NULL,
`Picture` LONGBLOB NULL);
-- ----------------------------------------------------------------------------
-- Table Northwind.Products by Category
-- ----------------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `Northwind`.`Products by Category` (
`CategoryName` LONGTEXT NULL,
`ProductName` LONGTEXT NULL,
`QuantityPerUnit` LONGTEXT NULL,
`UnitsInStock` SMALLINT(5) NULL,
`Discontinued` SMALLINT(5) NULL);
-- ----------------------------------------------------------------------------
-- Table Northwind.Quarterly Orders
-- ----------------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `Northwind`.`Quarterly Orders` (
`CustomerID` VARCHAR(5) NULL,
`CompanyName` VARCHAR(50) NULL,
`City` VARCHAR(50) NULL,
`Country` VARCHAR(50) NULL);
-- ----------------------------------------------------------------------------
-- Table Northwind.CustomerCustomerDemo
-- ----------------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `Northwind`.`CustomerCustomerDemo` (
`CustomerID` VARCHAR(5) NULL,
`CustomerTypeID` VARCHAR(10) NULL);
-- ----------------------------------------------------------------------------
-- Table Northwind.Region
-- ----------------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `Northwind`.`Region` (
`RegionID` INT(10) NULL,
`RegionDescription` VARCHAR(50) NULL);
-- ----------------------------------------------------------------------------
-- Table Northwind.Orders Qry
-- ----------------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `Northwind`.`Orders Qry` (
`OrderID` INT(10) NULL,
`CustomerID` VARCHAR(5) NULL,
`EmployeeID` INT(10) NULL,
`OrderDate` DATETIME NULL,
`RequiredDate` DATETIME NULL,
`ShippedDate` DATETIME NULL,
`ShipVia` INT(10) NULL,
`Freight` DECIMAL(19,4) NULL,
`ShipName` LONGTEXT NULL,
`ShipAddress` LONGTEXT NULL,
`ShipCity` LONGTEXT NULL,
`ShipRegion` LONGTEXT NULL,
`ShipPostalCode` LONGTEXT NULL,
`ShipCountry` LONGTEXT NULL,
`CompanyName` LONGTEXT NULL,
`Address` LONGTEXT NULL,
`City` LONGTEXT NULL,
`Region` LONGTEXT NULL,
`PostalCode` LONGTEXT NULL,
`Country` LONGTEXT NULL);
-- ----------------------------------------------------------------------------
-- Table Northwind.Customer and Suppliers by City
-- ----------------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `Northwind`.`Customer and Suppliers by City` (
`City` LONGTEXT NULL,
`CompanyName` LONGTEXT NULL,
`ContactName` LONGTEXT NULL,
`Relationship` LONGTEXT NULL);
-- ----------------------------------------------------------------------------
-- Table Northwind.Products
-- ----------------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `Northwind`.`Products` (
`ProductID` INT(10) NULL,
`ProductName` VARCHAR(50) NULL,
`SupplierID` INT(10) NULL,
`CategoryID` INT(10) NULL,
`QuantityPerUnit` VARCHAR(50) NULL,
`UnitPrice` DECIMAL(19,4) NULL,
`UnitsInStock` SMALLINT(5) NULL,
`UnitsOnOrder` SMALLINT(5) NULL,
`ReorderLevel` SMALLINT(5) NULL,
`Discontinued` SMALLINT(5) NULL);
-- ----------------------------------------------------------------------------
-- Table Northwind.EmployeeTerritories
-- ----------------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `Northwind`.`EmployeeTerritories` (
`EmployeeID` INT(10) NULL,
`TerritoryID` VARCHAR(50) NULL);
-- ----------------------------------------------------------------------------
-- Table Northwind.Invoices
-- ----------------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `Northwind`.`Invoices` (
`ShipName` VARCHAR(50) NULL,
`ShipAddress` VARCHAR(50) NULL,
`ShipCity` VARCHAR(50) NULL,
`ShipRegion` VARCHAR(50) NULL,
`ShipPostalCode` VARCHAR(50) NULL,
`ShipCountry` VARCHAR(50) NULL,
`CustomerID` VARCHAR(5) NULL,
`CustomerName` VARCHAR(50) NULL,
`Address` VARCHAR(50) NULL,
`City` VARCHAR(50) NULL,
`Region` VARCHAR(50) NULL,
`PostalCode` VARCHAR(50) NULL,
`Country` VARCHAR(50) NULL,
`Salesperson` VARCHAR(50) NULL,
`OrderID` INT(10) NULL,
`OrderDate` DATETIME NULL,
`RequiredDate` DATETIME NULL,
`ShippedDate` DATETIME NULL,
`ShipperName` VARCHAR(50) NULL,
`ProductID` INT(10) NULL,
`ProductName` VARCHAR(50) NULL,
`UnitPrice` DECIMAL(19,4) NULL,
`Quantity` VARCHAR(50) NULL,
`Discount` VARCHAR(50) NULL,
`ExtendedPrice` DECIMAL(19,4) NULL,
`Freight` DECIMAL(19,4) NULL);
-- ----------------------------------------------------------------------------
-- Table Northwind.Order Details Extended
-- ----------------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `Northwind`.`Order Details Extended` (
`OrderID` INT(10) NULL,
`ProductID` INT(10) NULL,
`ProductName` VARCHAR(50) NULL,
`UnitPrice` DECIMAL(19,4) NULL,
`Quantity` SMALLINT(5) NULL,
`Discount` DOUBLE NULL,
`ExtendedPrice` DECIMAL(19,4) NULL);
-- ----------------------------------------------------------------------------
-- Table Northwind.Summary of Sales by Year
-- ----------------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `Northwind`.`Summary of Sales by Year` (
`ShippedDate` DATETIME NULL,
`OrderID` INT(10) NULL,
`Subtotal` DECIMAL(19,4) NULL);
-- ----------------------------------------------------------------------------
-- Table Northwind.Summary of Sales by Quarter
-- ----------------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `Northwind`.`Summary of Sales by Quarter` (
`ShippedDate` DATETIME NULL,
`OrderID` INT(10) NULL,
`Subtotal` DECIMAL(19,4) NULL);
-- ----------------------------------------------------------------------------
-- Table Northwind.Shippers
-- ----------------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `Northwind`.`Shippers` (
`ShipperID` INT(10) NULL,
`CompanyName` VARCHAR(50) NULL,
`Phone` VARCHAR(50) NULL);
-- ----------------------------------------------------------------------------
-- Table Northwind.CustomerDemographics
-- ----------------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `Northwind`.`CustomerDemographics` (
`CustomerTypeID` VARCHAR(10) NULL,
`CustomerDesc` VARCHAR(100) NULL);
-- ----------------------------------------------------------------------------
-- Table Northwind.Orders
-- ----------------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `Northwind`.`Orders` (
`OrderID` INT(10) NULL,
`CustomerID` VARCHAR(5) NULL,
`EmployeeID` INT(10) NULL,
`OrderDate` DATETIME NULL,
`RequiredDate` DATETIME NULL,
`ShippedDate` DATETIME NULL,
`ShipVia` INT(10) NULL,
`Freight` DECIMAL(19,4) NULL,
`ShipName` VARCHAR(50) NULL,
`ShipAddress` VARCHAR(50) NULL,
`ShipCity` VARCHAR(50) NULL,
`ShipRegion` VARCHAR(50) NULL,
`ShipPostalCode` VARCHAR(50) NULL,
`ShipCountry` VARCHAR(50) NULL);
SET FOREIGN_KEY_CHECKS = 1;; | the_stack |
-- 2019-05-03T10:48:14.380
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table SET EntityType='D',Updated=TO_TIMESTAMP('2019-05-03 10:48:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Table_ID=540383
;
-- 2019-05-03T10:48:33.186
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET EntityType='D',Updated=TO_TIMESTAMP('2019-05-03 10:48:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=546954
;
-- 2019-05-03T10:48:36.031
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET EntityType='D',Updated=TO_TIMESTAMP('2019-05-03 10:48:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=546955
;
-- 2019-05-03T10:48:39.136
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET EntityType='D', IsUpdateable='N',Updated=TO_TIMESTAMP('2019-05-03 10:48:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=546961
;
-- 2019-05-03T10:48:41.281
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET EntityType='D',Updated=TO_TIMESTAMP('2019-05-03 10:48:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=546956
;
-- 2019-05-03T10:48:43.317
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET EntityType='D',Updated=TO_TIMESTAMP('2019-05-03 10:48:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=546957
;
-- 2019-05-03T10:48:45.960
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET EntityType='D',Updated=TO_TIMESTAMP('2019-05-03 10:48:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=546958
;
-- 2019-05-03T10:48:48.200
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET EntityType='D',Updated=TO_TIMESTAMP('2019-05-03 10:48:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=546963
;
-- 2019-05-03T10:48:50.319
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET EntityType='D',Updated=TO_TIMESTAMP('2019-05-03 10:48:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=546959
;
-- 2019-05-03T10:48:52.561
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET EntityType='D',Updated=TO_TIMESTAMP('2019-05-03 10:48:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=546960
;
-- 2019-05-03T10:48:54.544
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET EntityType='D',Updated=TO_TIMESTAMP('2019-05-03 10:48:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=546962
;
-- 2019-05-03T10:49:03.705
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table SET EntityType='D',Updated=TO_TIMESTAMP('2019-05-03 10:49:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Table_ID=540384
;
-- 2019-05-03T10:49:12.177
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET EntityType='D',Updated=TO_TIMESTAMP('2019-05-03 10:49:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=546964
;
-- 2019-05-03T10:49:15.170
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET EntityType='D',Updated=TO_TIMESTAMP('2019-05-03 10:49:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=546965
;
-- 2019-05-03T10:49:26.204
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET EntityType='D',Updated=TO_TIMESTAMP('2019-05-03 10:49:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=546973
;
-- 2019-05-03T10:49:29.301
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET EntityType='D', IsUpdateable='N',Updated=TO_TIMESTAMP('2019-05-03 10:49:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=546971
;
-- 2019-05-03T10:49:31.216
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET EntityType='D', IsUpdateable='N',Updated=TO_TIMESTAMP('2019-05-03 10:49:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=546972
;
-- 2019-05-03T10:49:33.438
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET EntityType='D',Updated=TO_TIMESTAMP('2019-05-03 10:49:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=546966
;
-- 2019-05-03T10:49:38.231
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET EntityType='D',Updated=TO_TIMESTAMP('2019-05-03 10:49:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=546967
;
-- 2019-05-03T10:49:40.959
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET EntityType='D',Updated=TO_TIMESTAMP('2019-05-03 10:49:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=546968
;
-- 2019-05-03T10:49:46.611
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET EntityType='D',Updated=TO_TIMESTAMP('2019-05-03 10:49:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=546969
;
-- 2019-05-03T10:49:49.915
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET EntityType='D',Updated=TO_TIMESTAMP('2019-05-03 10:49:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=546970
;
-- 2019-05-03T10:49:53.017
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET EntityType='D',Updated=TO_TIMESTAMP('2019-05-03 10:49:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=546976
;
-- 2019-05-03T10:49:56.102
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET EntityType='D',Updated=TO_TIMESTAMP('2019-05-03 10:49:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=546977
;
-- 2019-05-03T10:50:18.749
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Window SET EntityType='D',Updated=TO_TIMESTAMP('2019-05-03 10:50:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Window_ID=540149
;
-- 2019-05-03T10:50:26.754
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET EntityType='D',Updated=TO_TIMESTAMP('2019-05-03 10:50:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=540411
;
-- 2019-05-03T10:50:28.846
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET EntityType='D',Updated=TO_TIMESTAMP('2019-05-03 10:50:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=540410
;
update AD_Field set EntityType='D' where EntityType<>'D' and ad_tab_id in (540411, 540410);
-- 2019-05-03T10:52:59.293
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu SET EntityType='D',Updated=TO_TIMESTAMP('2019-05-03 10:52:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=540375
;
-- 2019-05-03T10:59:02.228
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table SET EntityType='D',Updated=TO_TIMESTAMP('2019-05-03 10:59:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Table_ID=540280
;
-- 2019-05-03T10:59:21.126
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET EntityType='D',Updated=TO_TIMESTAMP('2019-05-03 10:59:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=545094
;
-- 2019-05-03T10:59:29.459
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET EntityType='D',Updated=TO_TIMESTAMP('2019-05-03 10:59:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=545096
;
-- 2019-05-03T10:59:31.779
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET EntityType='D', IsUpdateable='N',Updated=TO_TIMESTAMP('2019-05-03 10:59:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=545098
;
-- 2019-05-03T10:59:33.833
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET EntityType='D',Updated=TO_TIMESTAMP('2019-05-03 10:59:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=545127
;
-- 2019-05-03T10:59:36.068
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET EntityType='D',Updated=TO_TIMESTAMP('2019-05-03 10:59:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=545126
;
-- 2019-05-03T10:59:38.010
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET EntityType='D',Updated=TO_TIMESTAMP('2019-05-03 10:59:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=545114
;
-- 2019-05-03T10:59:40.050
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET EntityType='D',Updated=TO_TIMESTAMP('2019-05-03 10:59:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=545103
;
-- 2019-05-03T10:59:42.107
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET EntityType='D',Updated=TO_TIMESTAMP('2019-05-03 10:59:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=545102
;
-- 2019-05-03T10:59:44.778
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET EntityType='D',Updated=TO_TIMESTAMP('2019-05-03 10:59:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=545100
;
-- 2019-05-03T10:59:46.418
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET EntityType='D', IsUpdateable='N',Updated=TO_TIMESTAMP('2019-05-03 10:59:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=545128
;
-- 2019-05-03T11:00:02.797
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET EntityType='D',Updated=TO_TIMESTAMP('2019-05-03 11:00:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=540291
;
update AD_Field set EntityType='D' where EntityType<>'D' and ad_tab_id in (540291);
-- 2019-05-03T11:13:46.752
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process SET Classname='de.metas.location.process.C_Location_Postal_Validate',Updated=TO_TIMESTAMP('2019-05-03 11:13:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=540200
;
-- 2019-05-03T11:18:53.497
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process SET Classname='de.metas.location.process.ImportPostalCode',Updated=TO_TIMESTAMP('2019-05-03 11:18:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=541092
; | the_stack |
-- MySQL dump 10.15 Distrib 10.0.38-MariaDB, for debian-linux-gnu (x86_64)
--
-- Host: mysql Database: huskar_api
-- ------------------------------------------------------
-- Server version 5.7.19
/*!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 */;
/*!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 `alembic_version`
--
DROP TABLE IF EXISTS `alembic_version`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `alembic_version` (
`version_num` varchar(32) COLLATE utf8mb4_bin NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `application`
--
DROP TABLE IF EXISTS `application`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `application` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`application_name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
`team_id` int(11) NOT NULL,
`status` tinyint(4) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `application_name` (`application_name`),
KEY `ix_application_team_id` (`team_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `application_auth`
--
DROP TABLE IF EXISTS `application_auth`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `application_auth` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`authority` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
`user_id` int(11) NOT NULL,
`application_id` int(11) NOT NULL,
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `uq_app_auth` (`authority`,`application_id`,`user_id`),
KEY `ix_application_auth_user_id` (`user_id`),
KEY `ix_application_auth_updated_at` (`updated_at`),
KEY `ix_application_auth_created_at` (`created_at`),
KEY `ix_application_auth_application_id` (`application_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `audit_index`
--
DROP TABLE IF EXISTS `audit_index`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `audit_index` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`audit_id` bigint(20) DEFAULT NULL,
`target_id` int(11) NOT NULL,
`target_type` tinyint(4) NOT NULL,
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `ux_audit_index` (`target_id`,`target_type`,`audit_id`),
KEY `ix_audit_index_created_at` (`created_at`),
KEY `ix_audit_index_updated_at` (`updated_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `audit_index_instance`
--
DROP TABLE IF EXISTS `audit_index_instance`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `audit_index_instance` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`audit_id` bigint(20) NOT NULL,
`application_id` int(11) NOT NULL,
`cluster_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
`instance_key` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
`instance_type` tinyint(4) NOT NULL,
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `ux_audit_instance_key` (`application_id`,`instance_key`,`instance_type`,`cluster_name`,`audit_id`),
KEY `ix_audit_index_instance_created_at` (`created_at`),
KEY `ix_audit_index_instance_updated_at` (`updated_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `audit_log`
--
DROP TABLE IF EXISTS `audit_log`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `audit_log` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`remote_addr` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
`action_type` int(11) NOT NULL,
`action_data` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
`rollback_id` bigint(20) DEFAULT NULL,
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `ix_audit_log_user_id` (`user_id`),
KEY `ix_audit_log_rollback_id` (`rollback_id`),
KEY `ix_audit_log_updated_at` (`updated_at`),
KEY `ix_audit_log_created_at` (`created_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `infra_downstream`
--
DROP TABLE IF EXISTS `infra_downstream`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `infra_downstream` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`application_name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
`user_hash_bytes` tinyblob NOT NULL,
`user_application_name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
`user_infra_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
`user_infra_name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
`user_scope_type` tinyint(4) NOT NULL,
`user_scope_name` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
`user_field_name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
`version` bigint(20) NOT NULL,
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `ix_infra_downstream_user_hash_bytes` (`user_hash_bytes`(32)),
KEY `ix_infra_downstream_application_name` (`application_name`),
KEY `ix_infra_downstream_updated_at` (`updated_at`),
KEY `ix_infra_downstream_version` (`version`),
KEY `ix_infra_downstream_created_at` (`created_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `key_comment`
--
DROP TABLE IF EXISTS `key_comment`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `key_comment` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`application` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
`cluster` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
`key_type` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
`key_name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
`key_comment` varchar(2048) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `uq_comment` (`key_type`,`application`,`cluster`,`key_name`),
KEY `ix_key_comment_created_at` (`created_at`),
KEY `ix_key_comment_updated_at` (`updated_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `team`
--
DROP TABLE IF EXISTS `team`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `team` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`team_name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
`team_desc` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
`status` tinyint(4) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `team_name` (`team_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `team_admin`
--
DROP TABLE IF EXISTS `team_admin`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `team_admin` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`team_id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `uq_team_admin` (`user_id`,`team_id`),
KEY `ix_team_admin_team_id` (`team_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `user`
--
DROP TABLE IF EXISTS `user`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
`password` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
`email` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
`last_login` datetime DEFAULT NULL,
`is_active` tinyint(1) NOT NULL,
`huskar_admin` tinyint(1) NOT NULL,
`is_app` tinyint(1) NOT NULL,
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `username` (`username`),
UNIQUE KEY `email` (`email`),
KEY `ix_user_updated_at` (`updated_at`),
KEY `ix_user_created_at` (`created_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `webhook`
--
DROP TABLE IF EXISTS `webhook`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `webhook` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`url` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
`hook_type` tinyint(4) NOT NULL,
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `ix_webhook_created_at` (`created_at`),
KEY `ix_webhook_updated_at` (`updated_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `webhook_subscription`
--
DROP TABLE IF EXISTS `webhook_subscription`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `webhook_subscription` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`action_type` int(11) NOT NULL,
`application_id` int(11) NOT NULL,
`webhook_id` int(11) NOT NULL,
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `ux_webhook_subscription` (`application_id`,`webhook_id`,`action_type`),
KEY `ix_webhook_subscription_app_type` (`application_id`,`action_type`),
KEY `ix_webhook_subscription_created_at` (`created_at`),
KEY `ix_webhook_subscription_hook_type` (`webhook_id`,`action_type`),
KEY `ix_webhook_subscription_updated_at` (`updated_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2019-10-25 3:42:44
-- MySQL dump 10.15 Distrib 10.0.38-MariaDB, for debian-linux-gnu (x86_64)
--
-- Host: mysql Database: huskar_api
-- ------------------------------------------------------
-- Server version 5.7.19
/*!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 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!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 */;
--
-- Dumping data for table `alembic_version`
--
LOCK TABLES `alembic_version` WRITE;
/*!40000 ALTER TABLE `alembic_version` DISABLE KEYS */;
/*!40000 ALTER TABLE `alembic_version` 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 */;
/*!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 2019-10-25 3:42:44 | the_stack |
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for equip
-- ----------------------------
CREATE TABLE `equip` (
`user_no` int(11) unsigned NOT NULL,
`weapon` int(11) NOT NULL DEFAULT '0',
`shield` int(11) NOT NULL DEFAULT '0',
`helmet` int(11) NOT NULL DEFAULT '0',
`armor` int(11) NOT NULL DEFAULT '0',
`cape` int(11) NOT NULL DEFAULT '0',
`shoes` int(11) NOT NULL DEFAULT '0',
`accessory` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`user_no`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for guild
-- ----------------------------
CREATE TABLE `guild` (
`master` int(11) DEFAULT NULL,
`guild_name` char(255) DEFAULT ''
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for guild_member
-- ----------------------------
CREATE TABLE `guild_member` (
`guild_no` int(11) DEFAULT NULL,
`user_no` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for item
-- ----------------------------
CREATE TABLE `item` (
`user_no` int(11) NOT NULL,
`item_no` int(11) NOT NULL,
`amount` int(11) NOT NULL,
`index` int(11) NOT NULL,
`damage` int(11) NOT NULL DEFAULT '0',
`magic_damage` int(11) NOT NULL DEFAULT '0',
`defense` int(11) NOT NULL DEFAULT '0',
`magic_defense` int(11) NOT NULL DEFAULT '0',
`str` int(11) NOT NULL DEFAULT '0',
`dex` int(11) NOT NULL DEFAULT '0',
`agi` int(11) NOT NULL DEFAULT '0',
`hp` int(11) NOT NULL DEFAULT '0',
`mp` int(11) NOT NULL DEFAULT '0',
`critical` int(11) NOT NULL DEFAULT '0',
`avoid` int(11) NOT NULL DEFAULT '0',
`hit` int(11) NOT NULL DEFAULT '0',
`reinforce` int(11) NOT NULL DEFAULT '0',
`trade` int(11) NOT NULL DEFAULT '1',
`equipped` int(11) DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for setting_item
-- ----------------------------
CREATE TABLE `setting_item` (
`no` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` char(255) NOT NULL DEFAULT '',
`description` char(255) NOT NULL DEFAULT '',
`image` char(255) NOT NULL DEFAULT '',
`job` int(11) NOT NULL DEFAULT '0',
`limit_level` int(11) NOT NULL DEFAULT '1',
`type` int(11) NOT NULL DEFAULT '0',
`price` int(11) NOT NULL DEFAULT '0',
`damage` int(11) NOT NULL DEFAULT '0',
`magic_damage` int(11) NOT NULL DEFAULT '0',
`defense` int(11) NOT NULL DEFAULT '0',
`magic_defense` int(11) NOT NULL DEFAULT '0',
`str` int(11) NOT NULL DEFAULT '0',
`dex` int(11) NOT NULL DEFAULT '0',
`agi` int(11) NOT NULL DEFAULT '0',
`hp` int(11) NOT NULL DEFAULT '0',
`mp` int(11) NOT NULL DEFAULT '0',
`critical` int(11) NOT NULL DEFAULT '0',
`avoid` int(11) NOT NULL DEFAULT '0',
`hit` int(11) NOT NULL DEFAULT '0',
`delay` int(11) NOT NULL DEFAULT '0',
`consume` int(11) NOT NULL DEFAULT '1',
`max_load` int(11) NOT NULL DEFAULT '1',
`trade` int(11) NOT NULL DEFAULT '1',
`function` char(255) DEFAULT NULL,
PRIMARY KEY (`no`)
) ENGINE=MyISAM AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for setting_job
-- ----------------------------
CREATE TABLE `setting_job` (
`no` int(11) NOT NULL DEFAULT '0',
`name` char(255) NOT NULL DEFAULT '전사',
`hp` int(11) NOT NULL DEFAULT '0',
`mp` int(11) NOT NULL DEFAULT '0',
`str` int(11) NOT NULL DEFAULT '0',
`dex` int(11) NOT NULL DEFAULT '0',
`agi` int(11) NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for setting_npc
-- ----------------------------
CREATE TABLE `setting_npc` (
`no` int(11) DEFAULT NULL,
`name` char(255) DEFAULT NULL,
`image` char(255) DEFAULT NULL,
`map` int(11) DEFAULT NULL,
`x` int(11) DEFAULT NULL,
`y` int(11) DEFAULT NULL,
`direction` int(11) DEFAULT NULL,
`function` char(255) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for setting_option
-- ----------------------------
CREATE TABLE `setting_option` (
`name` char(64) NOT NULL,
`value` double(6,0) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=euckr;
-- ----------------------------
-- Table structure for setting_portal
-- ----------------------------
CREATE TABLE `setting_portal` (
`map` int(11) DEFAULT NULL,
`x` int(11) DEFAULT NULL,
`y` int(11) DEFAULT NULL,
`next_map` int(11) DEFAULT NULL,
`next_x` int(11) DEFAULT NULL,
`next_y` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for setting_register
-- ----------------------------
CREATE TABLE `setting_register` (
`no` int(11) unsigned NOT NULL AUTO_INCREMENT,
`job` int(11) NOT NULL DEFAULT '1',
`image` char(255) NOT NULL DEFAULT '001-Fighter01',
`map` int(11) NOT NULL DEFAULT '0',
`x` int(11) NOT NULL DEFAULT '0',
`y` int(11) NOT NULL DEFAULT '0',
`level` int(11) NOT NULL DEFAULT '1',
PRIMARY KEY (`no`)
) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for setting_reward
-- ----------------------------
CREATE TABLE `setting_reward` (
`no` int(11) DEFAULT NULL,
`item_no` int(11) DEFAULT NULL,
`num` int(11) DEFAULT '1',
`per` int(11) DEFAULT '100'
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for setting_shop
-- ----------------------------
CREATE TABLE `setting_shop` (
`no` int(11) DEFAULT NULL,
`item_no` int(11) DEFAULT '1'
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for setting_skill
-- ----------------------------
CREATE TABLE `setting_skill` (
`no` int(11) NOT NULL AUTO_INCREMENT,
`name` char(255) DEFAULT NULL,
`description` char(255) DEFAULT NULL,
`type` char(255) DEFAULT NULL,
`job` int(11) DEFAULT NULL,
`delay` int(11) DEFAULT NULL,
`limit_level` int(11) DEFAULT NULL,
`max_rank` int(11) DEFAULT NULL,
`user_animation` int(11) DEFAULT NULL,
`target_animation` int(11) DEFAULT NULL,
`image` char(255) DEFAULT NULL,
`function` char(255) DEFAULT NULL,
PRIMARY KEY (`no`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for setting_troop
-- ----------------------------
CREATE TABLE `setting_troop` (
`no` int(11) NOT NULL AUTO_INCREMENT,
`name` char(255) DEFAULT NULL,
`image` char(255) DEFAULT '001-Fighter01',
`type` int(11) DEFAULT '0',
`team` int(11) DEFAULT '0',
`num` int(11) DEFAULT '1',
`range` int(11) DEFAULT '5',
`hp` int(11) DEFAULT '10',
`mp` int(11) DEFAULT '10',
`animation` int(11) DEFAULT '4',
`damage` int(11) DEFAULT '1',
`magic_damage` int(11) DEFAULT '1',
`defense` int(11) DEFAULT '1',
`magic_defense` int(11) DEFAULT '1',
`critical` int(11) DEFAULT '10',
`avoid` int(11) DEFAULT '50',
`hit` int(11) DEFAULT '50',
`move_speed` int(11) DEFAULT '20',
`attack_speed` int(11) DEFAULT '20',
`map` int(11) DEFAULT '1',
`x` int(11) DEFAULT '0',
`y` int(11) DEFAULT '0',
`direction` int(11) DEFAULT '2',
`regen` int(11) DEFAULT '10',
`level` int(11) DEFAULT '1',
`exp` int(11) DEFAULT '0',
`gold` int(11) DEFAULT '0',
`reward` int(11) DEFAULT NULL,
`skill` char(255) DEFAULT NULL,
`frequency` int(11) DEFAULT '0',
`die` char(255) DEFAULT NULL,
PRIMARY KEY (`no`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for skill
-- ----------------------------
CREATE TABLE `skill` (
`user_no` int(11) DEFAULT NULL,
`skill_no` int(11) DEFAULT NULL,
`rank` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for slot
-- ----------------------------
CREATE TABLE `slot` (
`no` int(11) NOT NULL,
`slot0` int(11) NOT NULL DEFAULT '-1',
`slot1` int(11) NOT NULL DEFAULT '-1',
`slot2` int(11) NOT NULL DEFAULT '-1',
`slot3` int(11) NOT NULL DEFAULT '-1',
`slot4` int(11) NOT NULL DEFAULT '-1',
`slot5` int(11) NOT NULL DEFAULT '-1',
`slot6` int(11) NOT NULL DEFAULT '-1',
`slot7` int(11) NOT NULL DEFAULT '-1',
`slot8` int(11) NOT NULL DEFAULT '-1',
`slot9` int(11) NOT NULL DEFAULT '-1'
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for user
-- ----------------------------
CREATE TABLE `user` (
`no` int(11) NOT NULL AUTO_INCREMENT,
`id` char(255) NOT NULL DEFAULT '',
`pass` char(255) NOT NULL DEFAULT '',
`name` char(255) NOT NULL DEFAULT '',
`title` int(11) NOT NULL DEFAULT '0',
`guild` int(11) DEFAULT '0',
`mail` char(255) NOT NULL DEFAULT '',
`image` char(255) NOT NULL DEFAULT '001-Fighter01',
`job` int(11) NOT NULL DEFAULT '0',
`str` int(11) NOT NULL DEFAULT '0',
`dex` int(11) NOT NULL DEFAULT '0',
`agi` int(11) NOT NULL DEFAULT '0',
`stat_point` int(11) NOT NULL DEFAULT '0',
`skill_point` int(11) NOT NULL DEFAULT '0',
`hp` int(11) NOT NULL DEFAULT '0',
`mp` int(11) NOT NULL DEFAULT '0',
`level` int(11) NOT NULL DEFAULT '1',
`exp` int(11) NOT NULL DEFAULT '0',
`gold` int(11) NOT NULL DEFAULT '0',
`map` int(11) NOT NULL DEFAULT '0',
`seed` int(11) NOT NULL DEFAULT '0',
`x` int(11) NOT NULL DEFAULT '0',
`y` int(11) NOT NULL DEFAULT '0',
`direction` int(11) NOT NULL DEFAULT '2',
`speed` int(11) NOT NULL DEFAULT '4',
`admin` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`no`)
) ENGINE=MyISAM AUTO_INCREMENT=23 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records
-- ----------------------------
INSERT INTO `equip` VALUES ('1', '6', '0', '0', '0', '0', '0', '0');
INSERT INTO `equip` VALUES ('2', '0', '0', '0', '0', '0', '0', '0');
INSERT INTO `item` VALUES ('1', '1', '1', '7', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '0');
INSERT INTO `item` VALUES ('1', '1', '1', '6', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '1');
INSERT INTO `item` VALUES ('1', '1', '1', '5', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '0');
INSERT INTO `item` VALUES ('1', '1', '1', '4', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '0');
INSERT INTO `item` VALUES ('1', '1', '1', '3', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '0');
INSERT INTO `item` VALUES ('1', '8', '5', '2', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '0');
INSERT INTO `item` VALUES ('1', '1', '1', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '0');
INSERT INTO `item` VALUES ('1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '0');
INSERT INTO `item` VALUES ('2', '1', '1', '6', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '0');
INSERT INTO `item` VALUES ('2', '1', '1', '5', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '0');
INSERT INTO `item` VALUES ('2', '1', '1', '4', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '0');
INSERT INTO `item` VALUES ('2', '1', '1', '3', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '0');
INSERT INTO `item` VALUES ('2', '8', '8', '2', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '0');
INSERT INTO `item` VALUES ('2', '1', '1', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '0');
INSERT INTO `setting_item` VALUES ('1', '목도', '나무로 만든 검', '001-Weapon01', '0', '1', '0', '100', '10', '10', '10', '10', '5', '4', '3', '2', '1', '10', '5', '5', '2', '0', '1', '1', null);
INSERT INTO `setting_item` VALUES ('2', '냄비 뚜껑', '방패가 없으니 이거라도 쓰자', '009-Shield01', '0', '1', '1', '10', '0', '0', '5', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '1', null);
INSERT INTO `setting_item` VALUES ('3', '밀짚모자', '난 해적왕이 될 사나이!', '010-Head01', '0', '1', '2', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '1', '1', null);
INSERT INTO `setting_item` VALUES ('4', '쫄쫄이 잠옷', '입을 옷이 없다', '014-Body02', '0', '1', '3', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '1', null);
INSERT INTO `setting_item` VALUES ('5', '누더기 망토', '누가 쓰던걸까', '019-Accessory04', '0', '1', '4', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '1', null);
INSERT INTO `setting_item` VALUES ('6', '등산화', '아빠 등산화를 훔쳤다', '020-Accessory05', '0', '1', '5', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '1', null);
INSERT INTO `setting_item` VALUES ('7', '금반지', '돌잔치때 받은 금반지', '016-Accessory01', '0', '1', '6', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '1', null);
INSERT INTO `setting_item` VALUES ('8', '포션', '뭐지 이 아이템은', '021-Potion01', '0', '1', '7', '100', '0', '0', '0', '0', '0', '0', '0', '10000', '0', '0', '0', '0', '0', '1', '10', '1', 'potion');
INSERT INTO `setting_job` VALUES ('1', '전사', '1000', '5', '1', '0', '0');
INSERT INTO `setting_job` VALUES ('2', '마법사', '5', '10', '0', '0', '1');
INSERT INTO `setting_job` VALUES ('3', '도적', '7', '7', '0', '1', '0');
INSERT INTO `setting_npc` VALUES ('1', '테스트', '003-Fighter03', '1', '10', '4', '2', 'testNpc');
INSERT INTO `setting_option` VALUES ('chatting_balloon_delay', '5000');
INSERT INTO `setting_portal` VALUES ('1', '19', '8', '2', '0', '14');
INSERT INTO `setting_portal` VALUES ('2', '0', '14', '1', '19', '8');
INSERT INTO `setting_register` VALUES ('1', '1', '001-Fighter01', '1', '0', '0', '1');
INSERT INTO `setting_register` VALUES ('2', '1', '002-Fighter02', '1', '0', '0', '1');
INSERT INTO `setting_register` VALUES ('3', '2', '004-Fighter04', '1', '0', '0', '1');
INSERT INTO `setting_reward` VALUES ('1', '1', '1', '10000');
INSERT INTO `setting_reward` VALUES ('1', '8', '1', '10000');
INSERT INTO `setting_shop` VALUES ('1', '8');
INSERT INTO `setting_skill` VALUES ('1', '크로스 컷', '전사의 기본적인 기술. 적을 두차례 벤다.', '근접 공격', '1', '20', '1', '10', '0', '67', '050-Skill07', 'crossCut');
INSERT INTO `setting_troop` VALUES ('1', '다람쥐', '168-Small10', '4', '0', '10', '10', '10', '10', '4', '1', '1', '1', '1', '10', '50', '50', '5', '5', '2', '5', '5', '2', '30', '1', '10', '100', '1', 'chipmunkSkill', '50', null);
INSERT INTO `skill` VALUES ('1', '1', '1');
INSERT INTO `slot` VALUES ('1', '-1', '-1', '-1', '-1', '-1', '-1', '-1', '-1', '-1', '-1');
INSERT INTO `slot` VALUES ('1', '-1', '-1', '-1', '-1', '-1', '-1', '-1', '-1', '-1', '-1');
INSERT INTO `user` VALUES ('1', '1', 'PPAkXhcIYGcDVjdCgY/hHg==', 'foo', '0', '0', '1', '016-Thief01', '1', '0', '0', '0', '0', '0', '999', '0', '1', '0', '0', '1', '0', '10', '6', '4', '4', '0');
INSERT INTO `user` VALUES ('2', '2', 'gKBvNUyp+H1+LZJgpXESyA==', 'bar', '0', '0', '2', '053-Undead03', '1', '0', '0', '0', '0', '0', '1000', '0', '1', '0', '0', '1', '0', '8', '5', '8', '4', '0'); | 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*/`adnc_usr_dev` /*!40100 DEFAULT CHARACTER SET utf8mb4 */;
USE `adnc_usr_dev`;
/*Table structure for table `SysDept` */
DROP TABLE IF EXISTS `SysDept`;
CREATE TABLE `SysDept` (
`Id` bigint(20) NOT NULL,
`CreateBy` bigint(20) NOT NULL,
`CreateTime` datetime(6) NOT NULL,
`ModifyBy` bigint(20) DEFAULT NULL COMMENT '最后更新人',
`ModifyTime` datetime(6) DEFAULT NULL,
`FullName` varchar(32) CHARACTER SET utf8mb4 NOT NULL,
`Pid` bigint(20) DEFAULT NULL,
`Pids` varchar(80) CHARACTER SET utf8mb4 DEFAULT NULL,
`SimpleName` varchar(16) CHARACTER SET utf8mb4 NOT NULL,
`Tips` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
`Version` int(11) DEFAULT NULL,
`Ordinal` int(11) NOT NULL DEFAULT 0,
PRIMARY KEY (`Id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='部门';
/*Data for the table `SysDept` */
insert into `SysDept`(`Id`,`CreateBy`,`CreateTime`,`ModifyBy`,`ModifyTime`,`FullName`,`Pid`,`Pids`,`SimpleName`,`Tips`,`Version`,`Ordinal`) values
(1600000001000,1600000000000,'2020-11-24 01:22:27.000000',1600000000000,'2020-11-25 18:30:11.883723','总公司',0,'[0],','总公司',NULL,NULL,0),
(1606155294001,1600000000000,'2020-11-24 02:14:54.675010',1600000000000,'2021-02-08 22:51:06.109324','财务部',1600000001000,'[0],[1600000001000],','财务部',NULL,NULL,2),
(1606155335002,1600000000000,'2020-11-24 02:15:35.476720',1600000000000,'2021-02-08 22:46:38.866773','研发部',1600000001000,'[0],[1600000001000],','研发部',NULL,NULL,1),
(1606155393003,1600000000000,'2020-11-24 02:16:33.336059',1600000000000,'2021-02-08 23:40:42.477252','csharp组',1606155335002,'[0],[1600000001000],[1606155335002],','csharp组',NULL,NULL,6),
(1606155436004,1600000000000,'2021-02-02 12:45:35.079665',1600000000000,'2021-02-08 23:19:00.342879','go组',1606155335002,'[0],[1600000001000],[1606155335002],','go组',NULL,NULL,3),
(1612796969001,1600000000000,'2021-02-08 23:09:29.757253',1600000000000,'2021-02-08 23:17:57.831845','测试部',1600000001000,'[0],[1600000001000],','测试部',NULL,NULL,1),
(1612797557001,1600000000000,'2021-02-08 23:19:17.938562',NULL,NULL,'java组',1606155335002,'[0],[1600000001000],[1606155335002],','java组',NULL,NULL,1),
(1616044463001,1600000000000,'2021-03-18 13:14:23.793179',NULL,NULL,'云南知轮汽车科技有限公司',1600000001000,'[0],[1600000001000],','知轮科技',NULL,NULL,1);
/*Table structure for table `SysMenu` */
DROP TABLE IF EXISTS `SysMenu`;
CREATE TABLE `SysMenu` (
`Id` bigint(20) NOT NULL,
`CreateBy` bigint(20) NOT NULL,
`CreateTime` datetime(6) NOT NULL,
`ModifyBy` bigint(20) DEFAULT NULL COMMENT '最后更新人',
`ModifyTime` datetime(6) DEFAULT NULL,
`Code` varchar(16) CHARACTER SET utf8mb4 NOT NULL,
`Component` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
`Hidden` bit(1) DEFAULT NULL COMMENT '是否隐藏',
`Icon` varchar(16) CHARACTER SET utf8mb4 DEFAULT NULL,
`IsMenu` bit(1) NOT NULL COMMENT '是否是菜单1:菜单,0:按钮',
`IsOpen` bit(1) DEFAULT NULL COMMENT '是否默认打开1:是,0:否',
`Levels` int(11) NOT NULL COMMENT '级别',
`Name` varchar(16) CHARACTER SET utf8mb4 NOT NULL,
`PCode` varchar(16) CHARACTER SET utf8mb4 NOT NULL,
`PCodes` varchar(128) CHARACTER SET utf8mb4 NOT NULL,
`Status` bit(1) NOT NULL COMMENT '状态1:启用,0:禁用',
`Tips` varchar(32) DEFAULT NULL COMMENT '鼠标悬停提示信息',
`Url` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
`Ordinal` int(11) NOT NULL DEFAULT 0,
PRIMARY KEY (`Id`) USING BTREE,
UNIQUE KEY `UK_s37unj3gh67ujhk83lqva8i1t` (`Code`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='菜单';
/*Data for the table `SysMenu` */
insert into `SysMenu`(`Id`,`CreateBy`,`CreateTime`,`ModifyBy`,`ModifyTime`,`Code`,`Component`,`Hidden`,`Icon`,`IsMenu`,`IsOpen`,`Levels`,`Name`,`PCode`,`PCodes`,`Status`,`Tips`,`Url`,`Ordinal`) values
(1600000000001,1600000000000,'2020-08-08 08:08:08.888888',1600000000000,'2021-02-08 23:40:04.403976','usr','layout','\0','peoples','',NULL,1,'用户中心','0','[0],','',NULL,'/usr',0),
(1600000000003,1600000000000,'2020-08-08 08:08:08.888888',1600000000000,'2021-02-08 23:39:40.812082','maintain','layout','\0','operation','',NULL,1,'运维中心','0','[0],','',NULL,'/maintain',1),
(1600000000004,1600000000000,'2020-08-08 08:08:08.888888',1600000000000,'2020-11-25 00:21:11.459114','user','views/usr/user/index','\0','user','',NULL,2,'用户管理','usr','[0],[usr]','',NULL,'/user',0),
(1600000000005,1600000000000,'2020-08-08 08:08:08.888888',1600000000000,'2020-11-25 00:21:23.738379','userAdd',NULL,'\0','','\0',NULL,3,'添加用户','user','[0],[usr][user]','',NULL,'/user/add',0),
(1600000000006,1600000000000,'2020-08-08 08:08:08.888888',1600000000000,'2020-11-25 00:21:44.038549','userEdit',NULL,'\0','','\0',NULL,3,'修改用户','user','[0],[usr][user]','',NULL,'/user/edit',0),
(1600000000007,1600000000000,'2020-08-08 08:08:08.888888',1600000000000,'2020-08-08 08:08:08.888888','userDelete',NULL,'\0',NULL,'\0','\0',3,'删除用户','user','[0],[usr],[user],','',NULL,'/user/delete',0),
(1600000000008,1600000000000,'2020-08-08 08:08:08.888888',1600000000000,'2020-08-08 08:08:08.888888','userReset',NULL,'\0',NULL,'\0','\0',3,'重置密码','user','[0],[usr],[user],','',NULL,'/user/reset',0),
(1600000000009,1600000000000,'2020-08-08 08:08:08.888888',1600000000000,'2020-11-25 00:21:48.244064','userFreeze',NULL,'\0','','\0',NULL,3,'冻结用户','user','[0],[usr][user]','',NULL,'/user/freeze',0),
(1600000000010,1600000000000,'2020-08-08 08:08:08.888888',1600000000000,'2020-08-08 08:08:08.888888','userUnfreeze',NULL,'\0',NULL,'\0','\0',3,'解除冻结用户','user','[0],[usr],[user],','',NULL,'/user/unfreeze',0),
(1600000000011,1600000000000,'2020-08-08 08:08:08.888888',1600000000000,'2020-08-08 08:08:08.888888','userSetRole',NULL,'\0',NULL,'\0','\0',3,'分配角色','user','[0],[usr],[user],','',NULL,'/user/setRole',0),
(1600000000012,1600000000000,'2020-08-08 08:08:08.888888',1600000000000,'2020-08-08 08:08:08.888888','role','views/usr/role/index','\0','people','',NULL,2,'角色管理','usr','[0],[usr]','',NULL,'/role',0),
(1600000000013,1600000000000,'2020-08-08 08:08:08.888888',1600000000000,'2020-08-08 08:08:08.888888','roleAdd',NULL,'\0',NULL,'\0','\0',3,'添加角色','role','[0],[usr],[role],','',NULL,'/role/add',0),
(1600000000014,1600000000000,'2020-08-08 08:08:08.888888',1600000000000,'2020-08-08 08:08:08.888888','roleEdit',NULL,'\0',NULL,'\0','\0',3,'修改角色','role','[0],[usr],[role],','',NULL,'/role/edit',0),
(1600000000015,1600000000000,'2020-08-08 08:08:08.888888',1600000000000,'2020-08-08 08:08:08.888888','roleDelete',NULL,'\0',NULL,'\0',NULL,3,'删除角色','role','[0],[usr],[role]','',NULL,'/role/delete',0),
(1600000000016,1600000000000,'2020-08-08 08:08:08.888888',1600000000000,'2020-08-08 08:08:08.888888','roleSetAuthority',NULL,'\0',NULL,'\0','\0',3,'配置权限','role','[0],[usr],[role],','',NULL,'/role/setAuthority',0),
(1600000000017,1600000000000,'2020-08-08 08:08:08.888888',1600000000000,'2020-08-08 08:08:08.888888','menu','views/usr/menu/index','\0','menu','',NULL,2,'菜单管理','usr','[0],[usr]','',NULL,'/menu',0),
(1600000000018,1600000000000,'2020-08-08 08:08:08.888888',1600000000000,'2020-08-08 08:08:08.888888','menuAdd',NULL,'\0',NULL,'\0','\0',3,'添加菜单','menu','[0],[usr],[menu],','',NULL,'/menu/add',0),
(1600000000019,1600000000000,'2020-08-08 08:08:08.888888',1600000000000,'2020-08-08 08:08:08.888888','menuEdit',NULL,'\0',NULL,'\0','\0',3,'修改菜单','menu','[0],[usr],[menu],','',NULL,'/menu/edit',0),
(1600000000020,1600000000000,'2020-08-08 08:08:08.888888',1600000000000,'2020-08-08 08:08:08.888888','menuDelete',NULL,'\0',NULL,'\0','\0',3,'删除菜单','menu','[0],[usr],[menu],','',NULL,'/menu/remove',0),
(1600000000021,1600000000000,'2020-08-08 08:08:08.888888',1600000000000,'2020-08-08 08:08:08.888888','dept','views/usr/dept/index','\0','dept','',NULL,2,'部门管理','usr','[0],[usr],','',NULL,'/dept',0),
(1600000000022,1600000000000,'2020-08-08 08:08:08.888888',1600000000000,'2020-08-08 08:08:08.888888','dict','views/maintain/dict/index','\0','dict','',NULL,2,'字典管理','maintain','[0],[maintain],','',NULL,'/dict',0),
(1600000000023,1600000000000,'2020-08-08 08:08:08.888888',1600000000000,'2020-08-08 08:08:08.888888','deptEdit',NULL,'\0',NULL,'\0',NULL,3,'修改部门','dept','[0],[usr],[dept],','',NULL,'/dept/update',0),
(1600000000024,1600000000000,'2020-08-08 08:08:08.888888',1600000000000,'2020-08-08 08:08:08.888888','deptDelete',NULL,'\0',NULL,'\0',NULL,3,'删除部门','dept','[0],[usr],[dept],','',NULL,'/dept/delete',0),
(1600000000025,1600000000000,'2020-08-08 08:08:08.888888',1600000000000,'2020-11-24 23:45:06.337465','dictAdd',NULL,'\0','','\0',NULL,3,'添加字典','dict','[0],[maintain],[dict]','',NULL,'/dict/add',0),
(1600000000026,1600000000000,'2020-08-08 08:08:08.888888',1600000000000,'2020-08-08 08:08:08.888888','dictEdit',NULL,'\0',NULL,'\0',NULL,3,'修改字典','dict','[0],[maintain],[dict],','',NULL,'/dict/update',0),
(1600000000027,1600000000000,'2020-08-08 08:08:08.888888',1600000000000,'2020-08-08 08:08:08.888888','dictDelete',NULL,'\0',NULL,'\0',NULL,3,'删除字典','dict','[0],[maintain],[dict],','',NULL,'/dict/delete',0),
(1600000000028,1600000000000,'2020-08-08 08:08:08.888888',1600000000000,'2020-08-08 08:08:08.888888','deptList',NULL,'\0',NULL,'\0',NULL,3,'部门列表','dept','[0],[usr],[dept],','',NULL,'/dept/list',0),
(1600000000030,1600000000000,'2020-08-08 08:08:08.888888',1600000000000,'2020-08-08 08:08:08.888888','dictList',NULL,'\0',NULL,'\0',NULL,3,'字典列表','dict','[0],[maintain],[dict],','',NULL,'/dict/list',0),
(1600000000032,1600000000000,'2020-08-08 08:08:08.888888',1600000000000,'2020-08-08 08:08:08.888888','deptAdd',NULL,'\0',NULL,'\0',NULL,3,'添加部门','dept','[0],[usr],[dept],','',NULL,'/dept/add',0),
(1600000000033,1600000000000,'2020-08-08 08:08:08.888888',1600000000000,'2020-08-08 08:08:08.888888','cfg','views/maintain/cfg/index','\0','cfg','',NULL,2,'参数管理','maintain','[0],[maintain]','',NULL,'/cfg',0),
(1600000000034,1600000000000,'2020-08-08 08:08:08.888888',1600000000000,'2020-08-08 08:08:08.888888','cfgAdd',NULL,'\0',NULL,'\0',NULL,3,'添加系统参数','cfg','[0],[maintain],[cfg],','',NULL,'/cfg/add',0),
(1600000000035,1600000000000,'2020-08-08 08:08:08.888888',1600000000000,'2020-08-08 08:08:08.888888','cfgEdit',NULL,'\0',NULL,'\0',NULL,3,'修改系统参数','cfg','[0],[maintain],[cfg],','',NULL,'/cfg/update',0),
(1600000000036,1600000000000,'2020-08-08 08:08:08.888888',1600000000000,'2020-08-08 08:08:08.888888','cfgDelete',NULL,'\0',NULL,'\0',NULL,3,'删除系统参数','cfg','[0],[maintain],[cfg],','',NULL,'/cfg/delete',0),
(1600000000037,1600000000000,'2020-08-08 08:08:08.888888',1600000000000,'2021-02-02 12:45:20.451193','task','views/maintain/task/index','','task','',NULL,2,'任务管理','maintain','[0],[maintain]','',NULL,'/task',0),
(1600000000038,1600000000000,'2020-08-08 08:08:08.888888',1600000000000,'2020-08-08 08:08:08.888888','taskAdd',NULL,'\0',NULL,'\0',NULL,3,'添加任务','task','[0],[maintain],[task],','',NULL,'/task/add',0),
(1600000000039,1600000000000,'2020-08-08 08:08:08.888888',1600000000000,'2020-08-08 08:08:08.888888','taskEdit',NULL,'\0',NULL,'\0',NULL,3,'修改任务','task','[0],[maintain],[task],','',NULL,'/task/update',0),
(1600000000040,1600000000000,'2020-08-08 08:08:08.888888',1600000000000,'2020-08-08 08:08:08.888888','taskDelete',NULL,'\0',NULL,'\0',NULL,3,'删除任务','task','[0],[maintain],[task],','',NULL,'/task/delete',0),
(1600000000047,1600000000000,'2020-08-08 08:08:08.888888',1600000000000,'2020-08-08 08:08:08.888888','taskLog','views/maintain/task/taskLog','','task','',NULL,3,'任务日志','task','[0],[maintain],[task],','',NULL,'/task/taskLog',0),
(1600000000048,1600000000000,'2020-08-08 08:08:08.888888',1600000000000,'2020-08-08 08:08:08.888888','opsLog','views/maintain/opslog/index','\0','log','',NULL,2,'操作日志','maintain','[0],[maintain]','',NULL,'/opslog',0),
(1600000000049,1600000000000,'2020-08-08 08:08:08.888888',1600000000000,'2020-08-08 08:08:08.888888','loginLog','views/maintain/loginlog/index','\0','logininfor','',NULL,2,'登录日志','maintain','[0],[maintain]','',NULL,'/loginlog',0),
(1600000000054,1600000000000,'2020-08-08 08:08:08.888888',1600000000000,'2021-01-11 00:01:02.425962','druid','layout','\0','link','',NULL,2,'性能检测','maintain','[0],[maintain]','',NULL,'http://193.112.75.77:18886',0),
(1600000000055,1600000000000,'2020-08-08 08:08:08.888888',1600000000000,'2020-11-25 19:30:04.982175','swagger','views/maintain/swagger/index','\0','swagger','',NULL,2,'接口文档','maintain','[0],[maintain]','',NULL,'/swagger',0),
(1600000000071,1600000000000,'2020-08-08 08:08:08.888888',1600000000000,'2020-11-24 23:44:04.045778','nlogLog','views/maintain/nloglog/index','\0','logininfor','',NULL,2,'Nlog日志','maintain','[0],[maintain]','',NULL,'/nloglogs',0),
(1600000000072,1600000000000,'2020-08-08 08:08:08.888888',1600000000000,'2020-08-08 08:08:08.888888','health','layout','\0','monitor','',NULL,2,'健康检测','maintain','[0],[maintain]','',NULL,'http://193.112.75.77:8666/healthchecks-ui',0),
(1600000000073,1600000000000,'2020-08-08 08:08:08.888888',1600000000000,'2020-08-08 08:08:08.888888','menuList',NULL,'\0','','\0',NULL,3,'菜单列表','menu','[0],[usr][menu]','',NULL,'/menu/list',0),
(1600000000074,1600000000000,'2020-08-08 08:08:08.888888',1600000000000,'2021-02-08 23:29:43.628024','roleList',NULL,'\0','','\0',NULL,3,'角色列表','role','[0],[usr][role]','',NULL,'/role/list',1),
(1600000000075,1600000000000,'2020-08-08 08:08:08.888888',1600000000000,'2020-08-08 08:08:08.888888','userList',NULL,'\0','','\0',NULL,3,'用户列表','user','[0],[usr][user]','',NULL,'user/list',0),
(1600000000076,1600000000000,'2020-08-08 08:08:08.888888',1600000000000,'2020-08-08 08:08:08.888888','cfgList',NULL,'\0','','\0',NULL,3,'系统参数列表','cfg','[0],[maintain][cfg]','',NULL,'/cfg/list',0),
(1600000000077,1600000000000,'2020-08-08 08:08:08.888888',1600000000000,'2020-08-08 08:08:08.888888','taskList',NULL,'\0',NULL,'\0',NULL,3,'任务列表','task','[0],[maintain][task]','',NULL,'/task/list',0),
(1600000000078,1600000000000,'2020-08-08 08:08:08.888888',1600000000000,'2020-11-24 23:43:13.041844','eventBus','layout','\0','server','',NULL,2,'EventBus','maintain','[0],[maintain]','',NULL,'http://193.112.75.77:8888/cus/cap/',0);
/*Table structure for table `SysRelation` */
DROP TABLE IF EXISTS `SysRelation`;
CREATE TABLE `SysRelation` (
`Id` bigint(20) NOT NULL,
`MenuId` bigint(20) DEFAULT NULL,
`RoleId` bigint(20) DEFAULT NULL,
PRIMARY KEY (`Id`) USING BTREE,
KEY `IX_SysRelation_RoleId` (`RoleId`) USING BTREE,
KEY `IX_SysRelation_MenuId` (`MenuId`) USING BTREE,
CONSTRAINT `FK_SysRelation_SysMenu_MenuId` FOREIGN KEY (`MenuId`) REFERENCES `SysMenu` (`Id`) ON DELETE CASCADE,
CONSTRAINT `FK_SysRelation_SysRole_RoleId` FOREIGN KEY (`RoleId`) REFERENCES `SysRole` (`Id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='菜单角色关系';
/*Data for the table `SysRelation` */
insert into `SysRelation`(`Id`,`MenuId`,`RoleId`) values
(1606193510001,1600000000001,1600000000010),
(1606193510002,1600000000004,1600000000010),
(1606193510003,1600000000005,1600000000010),
(1606193510004,1600000000006,1600000000010),
(1606193510005,1600000000007,1600000000010),
(1606193510006,1600000000008,1600000000010),
(1606193510007,1600000000009,1600000000010),
(1606193510008,1600000000010,1600000000010),
(1606193510009,1600000000011,1600000000010),
(1606193510010,1600000000075,1600000000010),
(1606193510011,1600000000012,1600000000010),
(1606193510012,1600000000013,1600000000010),
(1606193510013,1600000000014,1600000000010),
(1606193510014,1600000000015,1600000000010),
(1606193510015,1600000000016,1600000000010),
(1606193510016,1600000000074,1600000000010),
(1606193510017,1600000000017,1600000000010),
(1606193510018,1600000000018,1600000000010),
(1606193510019,1600000000019,1600000000010),
(1606193510020,1600000000020,1600000000010),
(1606193510021,1600000000073,1600000000010),
(1606193510022,1600000000021,1600000000010),
(1606193510023,1600000000023,1600000000010),
(1606193510024,1600000000024,1600000000010),
(1606193510025,1600000000028,1600000000010),
(1606193510026,1600000000032,1600000000010),
(1606193510027,1600000000003,1600000000010),
(1606193510028,1600000000022,1600000000010),
(1606193510029,1600000000025,1600000000010),
(1606193510030,1600000000026,1600000000010),
(1606193510031,1600000000027,1600000000010),
(1606193510032,1600000000030,1600000000010),
(1606193510033,1600000000033,1600000000010),
(1606193510034,1600000000034,1600000000010),
(1606193510035,1600000000035,1600000000010),
(1606193510036,1600000000036,1600000000010),
(1606193510037,1600000000076,1600000000010),
(1606193510038,1600000000037,1600000000010),
(1606193510039,1600000000038,1600000000010),
(1606193510040,1600000000039,1600000000010),
(1606193510041,1600000000040,1600000000010),
(1606193510042,1600000000047,1600000000010),
(1606193510043,1600000000077,1600000000010),
(1606193510044,1600000000048,1600000000010),
(1606193510045,1600000000049,1600000000010),
(1606193510046,1600000000054,1600000000010),
(1606193510047,1600000000055,1600000000010),
(1606193510048,1600000000071,1600000000010),
(1606193510049,1600000000072,1600000000010),
(1606193510050,1600000000078,1600000000010),
(1610294626091,1600000000003,1606156061057),
(1610294626092,1600000000022,1606156061057),
(1610294626093,1600000000025,1606156061057),
(1610294626094,1600000000026,1606156061057),
(1610294626095,1600000000027,1606156061057),
(1610294626096,1600000000030,1606156061057),
(1610294626097,1600000000033,1606156061057),
(1610294626098,1600000000034,1606156061057),
(1610294626099,1600000000035,1606156061057),
(1610294626100,1600000000036,1606156061057),
(1610294626101,1600000000076,1606156061057),
(1610294626102,1600000000037,1606156061057),
(1610294626103,1600000000038,1606156061057),
(1610294626104,1600000000039,1606156061057),
(1610294626105,1600000000040,1606156061057),
(1610294626106,1600000000047,1606156061057),
(1610294626107,1600000000077,1606156061057),
(1610294626108,1600000000048,1606156061057),
(1610294626109,1600000000049,1606156061057),
(1610294626110,1600000000054,1606156061057),
(1610294626111,1600000000055,1606156061057),
(1610294626112,1600000000071,1606156061057),
(1610294626113,1600000000072,1606156061057),
(1610294626114,1600000000078,1606156061057);
/*Table structure for table `SysRole` */
DROP TABLE IF EXISTS `SysRole`;
CREATE TABLE `SysRole` (
`Id` bigint(20) NOT NULL,
`CreateBy` bigint(20) NOT NULL,
`CreateTime` datetime(6) NOT NULL,
`ModifyBy` bigint(20) DEFAULT NULL COMMENT '最后更新人',
`ModifyTime` datetime(6) DEFAULT NULL,
`DeptId` bigint(20) DEFAULT NULL,
`Name` varchar(32) CHARACTER SET utf8mb4 NOT NULL,
`Pid` bigint(20) DEFAULT NULL,
`Tips` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
`Version` int(11) DEFAULT NULL,
`Ordinal` int(11) NOT NULL DEFAULT 0,
PRIMARY KEY (`Id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='角色';
/*Data for the table `SysRole` */
insert into `SysRole`(`Id`,`CreateBy`,`CreateTime`,`ModifyBy`,`ModifyTime`,`DeptId`,`Name`,`Pid`,`Tips`,`Version`,`Ordinal`) values
(1600000000010,1600000000000,'2020-08-08 08:08:08.888888',1600000000000,'2021-02-08 23:39:16.907337',NULL,'系统管理员',NULL,'administrator',NULL,0),
(1606156061057,1600000000000,'2020-08-08 08:08:08.888888',1600000000000,'2021-02-08 22:44:29.701775',NULL,'只读用户',NULL,'readonly',NULL,1),
(1615989759001,1600000000000,'2020-08-08 08:08:08.888888',NULL,NULL,NULL,'aaaa',NULL,'bbbb',NULL,1);
/*Table structure for table `SysUser` */
DROP TABLE IF EXISTS `SysUser`;
CREATE TABLE `SysUser` (
`Id` bigint(20) NOT NULL,
`CreateBy` bigint(20) NOT NULL,
`CreateTime` datetime(6) NOT NULL,
`ModifyBy` bigint(20) DEFAULT NULL COMMENT '最后更新人',
`ModifyTime` datetime(6) DEFAULT NULL,
`Account` varchar(16) CHARACTER SET utf8mb4 NOT NULL,
`Avatar` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
`Birthday` datetime(6) DEFAULT NULL,
`DeptId` bigint(20) DEFAULT NULL,
`Email` varchar(32) CHARACTER SET utf8mb4 DEFAULT NULL,
`Name` varchar(16) CHARACTER SET utf8mb4 NOT NULL,
`Password` varchar(32) CHARACTER SET utf8mb4 NOT NULL,
`Phone` varchar(11) CHARACTER SET utf8mb4 DEFAULT NULL,
`Salt` varchar(6) CHARACTER SET utf8mb4 NOT NULL,
`Sex` int(11) DEFAULT NULL,
`Status` int(11) DEFAULT NULL,
`Version` int(11) DEFAULT NULL,
`IsDeleted` tinyint(1) NOT NULL DEFAULT 0,
`RoleIds` varchar(72) CHARACTER SET utf8mb4 DEFAULT NULL,
PRIMARY KEY (`Id`) USING BTREE,
KEY `FK_SysUser_SysDept_DeptId` (`DeptId`) USING BTREE,
CONSTRAINT `FK_SysUser_SysDept_DeptId` FOREIGN KEY (`DeptId`) REFERENCES `SysDept` (`Id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='账号';
/*Data for the table `SysUser` */
insert into `SysUser`(`Id`,`CreateBy`,`CreateTime`,`ModifyBy`,`ModifyTime`,`Account`,`Avatar`,`Birthday`,`DeptId`,`Email`,`Name`,`Password`,`Phone`,`Salt`,`Sex`,`Status`,`Version`,`IsDeleted`,`RoleIds`) values
(1600000000000,1600000000000,'2020-08-08 08:08:08.888888',1600000000000,'2021-02-08 19:36:59.797137','alpha2008',NULL,'2020-11-04 00:00:00.000000',1600000001000,'alpha2008@tom.com','余小猫','C1FE6E4E238DD6812856995AEC16AD9D','18898658888','2mh6e',1,1,NULL,0,'1600000000010,1606156061057'),
(1606291099001,1600000000000,'2020-11-25 15:58:20.255014',1600000000000,'2021-02-08 23:41:01.034853','adncgo2',NULL,'2020-11-25 00:00:00.000000',1606155393003,'beta2009@tom.com','余二猫','A9B7CDA2D9001025FC02C40AF6A80D4E','18987656789','880qx',2,1,NULL,0,'1606156061057'),
(1606293242002,1600000000000,'2020-11-25 16:34:03.074970',1600000000000,'2021-02-08 23:20:03.098985','adncgo3',NULL,'2020-11-25 00:00:00.000000',1606155436004,'beta2009@tom.com','余三猫','B273093C82A8E58C4E6E9673A8062092','18898737334','p110y',1,1,NULL,0,'1600000000010,1606156061057');
/*!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 |
use master
go
set nocount on
go
set dateformat mdy
go
if exists (select * from master.dbo.sysdatabases
where name = "GHTDB")
begin
drop database GHTDB
end
go
print 'Creating the "GHTDB" database'
go
if (@@maxpagesize = 1024 * 2)
create database GHTDB on default = 10
else
create database GHTDB on default = 10
go
exec sp_dboption N'GHTDB', N'trunc log on chkpt', true, 1
print 'print1'
go
exec sp_dboption N'GHTDB', N'trunc. log', N'true', 1
print 'print2'
go
exec sp_dboption N'GHTDB', N'read only', N'false', 1
print 'print3'
go
exec sp_dboption N'GHTDB', N'dbo use', N'false', 1
print 'print4'
go
-- exec sp_dboption N'GHTDB', N'cursor close on commit', N'false', 1
-- exec sp_dboption N'GHTDB', N'abort tran on log full', N'true', 1
print 'print5'
go
use GHTDB
GO
checkpoint
go
SET QUOTED_IDENTIFIER OFF
GO
print '------------------------------'
print 'create tables - start'
print '------------------------------'
go
CREATE TABLE [dbo].[TYPES_SIMPLE] (
-- ID
[ID] char(10) NULL,
[T_BIT] [bit] DEFAULT 0 not null,
-- integer
[T_TINYINT] [tinyint] NULL ,
[T_SMALLINT] [smallint] NULL ,
[T_INT] [int] NULL ,
-- float
[T_DECIMAL] [decimal](18, 0) NULL ,
[T_NUMERIC] [numeric](18, 7) NULL ,
[T_FLOAT] [float] NULL ,
[T_REAL] [real] NULL ,
-- text
[T_CHAR] [char] (10) NULL ,
[T_NCHAR] [nchar] (10) NULL ,
[T_VARCHAR] [varchar] (50) NULL ,
[T_NVARCHAR] [nvarchar] (50) NULL
) ON [default]
GO
CREATE TABLE [dbo].[TYPES_EXTENDED] (
-- ID
[ID] char(10) NULL,
-- Text
[T_TEXT] [text] NULL ,
[T_NTEXT] [nvarchar](1000) NULL ,
-- Binary
[T_BINARY] [binary] (50) NULL ,
[T_VARBINARY] [varbinary] (50) NULL ,
--Time
[T_DATETIME] [datetime] NULL ,
[T_SMALLDATETIME] [smalldatetime] NULL
) ON [default]
CREATE TABLE [dbo].[TYPES_SPECIFIC] (
-- ID
[ID1] char(10) NULL
) ON [default]
GO
CREATE TABLE [dbo].[Categories] (
[CategoryID] numeric(5,0) IDENTITY NOT NULL ,
[CategoryName] [nvarchar] (15) NOT NULL ,
[Description] [nvarchar](1000) NULL ,
[Picture] [image] NULL
) ON [default]
GO
CREATE TABLE [dbo].[CustomerCustomerDemo] (
[CustomerID] [nchar] (5) NOT NULL ,
[CustomerTypeID] [nchar] (10) NOT NULL
) ON [default]
GO
CREATE TABLE [dbo].[CustomerDemographics] (
[CustomerTypeID] [nchar] (10) NOT NULL ,
[CustomerDesc] [nvarchar](1000) NULL
) ON [default]
GO
CREATE TABLE [dbo].[Customers] (
[CustomerID] [nchar] (5) NOT NULL ,
[CompanyName] [nvarchar] (40) NOT NULL ,
[ContactName] [nvarchar] (30) NULL ,
[ContactTitle] [nvarchar] (30) NULL ,
[Address] [nvarchar] (60) NULL ,
[City] [nvarchar] (15) NULL ,
[Region] [nvarchar] (15) NULL ,
[PostalCode] [nvarchar] (10) NULL ,
[Country] [nvarchar] (15) NULL ,
[Phone] [nvarchar] (24) NULL ,
[Fax] [nvarchar] (24) NULL
) ON [default]
GO
CREATE TABLE [dbo].[EmployeeTerritories] (
[EmployeeID] [int] NOT NULL ,
[TerritoryID] [nvarchar] (20) NOT NULL
) ON [default]
GO
CREATE TABLE [dbo].[Employees] (
[EmployeeID] [int] NOT NULL ,
[LastName] [nvarchar] (20) NOT NULL ,
[FirstName] [nvarchar] (10) NOT NULL ,
[Title] [nvarchar] (30) NULL ,
[TitleOfCourtesy] [nvarchar] (25) NULL ,
[BirthDate] [datetime] NULL ,
[HireDate] [datetime] NULL ,
[Address] [nvarchar] (60) NULL ,
[City] [nvarchar] (15) NULL ,
[Region] [nvarchar] (15) NULL ,
[PostalCode] [nvarchar] (10) NULL ,
[Country] [nvarchar] (15) NULL ,
[HomePhone] [nvarchar] (24) NULL ,
[Extension] [nvarchar] (4) NULL ,
[Photo] [image] NULL ,
[Notes] [nvarchar](1000) NULL ,
[ReportsTo] [int] NULL ,
[PhotoPath] [nvarchar] (255) NULL
) ON [default]
GO
CREATE TABLE [dbo].[GH_EMPTYTABLE] (
[Col1] [int] NULL ,
[Col2] [varchar] (50) NULL
) ON [default]
GO
CREATE TABLE [dbo].[Order Details] (
[OrderID] numeric(5,0) NOT NULL ,
[ProductID] numeric(5,0) NOT NULL ,
[UnitPrice] [money] DEFAULT (0) NOT NULL ,
[Quantity] [smallint] DEFAULT (1) NOT NULL ,
[Discount] [real] DEFAULT (0) NOT NULL
) ON [default]
GO
CREATE TABLE [dbo].[Orders] (
[OrderID] numeric(5,0) IDENTITY NOT NULL ,
[CustomerID] [nchar] (5) NULL ,
[EmployeeID] [int] NULL ,
[OrderDate] [datetime] NULL ,
[RequiredDate] [datetime] NULL ,
[ShippedDate] [datetime] NULL ,
[ShipVia] numeric(5,0) NULL ,
[Freight] [money] DEFAULT (0) NULL ,
[ShipName] [nvarchar] (40) NULL ,
[ShipAddress] [nvarchar] (60) NULL ,
[ShipCity] [nvarchar] (15) NULL ,
[ShipRegion] [nvarchar] (15) NULL ,
[ShipPostalCode] [nvarchar] (10) NULL ,
[ShipCountry] [nvarchar] (15) NULL
) ON [default]
GO
CREATE TABLE [dbo].[Products] (
[ProductID] numeric(5,0) IDENTITY NOT NULL ,
[ProductName] [nvarchar] (40) NOT NULL ,
[SupplierID] numeric(5,0) NULL ,
[CategoryID] numeric(5,0) NULL ,
[QuantityPerUnit] [nvarchar] (20) NULL ,
[UnitPrice] [money] DEFAULT (0) NULL ,
[UnitsInStock] [smallint] DEFAULT (0) NULL ,
[UnitsOnOrder] [smallint] DEFAULT (0) NULL ,
[ReorderLevel] [smallint] DEFAULT (0) NULL ,
[Discontinued] [bit] NOT NULL
) ON [default]
GO
CREATE TABLE [dbo].[Region] (
[RegionID] [int] NOT NULL ,
[RegionDescription] [nchar] (50) NOT NULL
) ON [default]
GO
CREATE TABLE [dbo].[Shippers] (
[ShipperID] numeric(5,0) IDENTITY NOT NULL ,
[CompanyName] [nvarchar] (40) NOT NULL ,
[Phone] [nvarchar] (24) NULL
) ON [default]
GO
CREATE TABLE [dbo].[Suppliers] (
[SupplierID] numeric(5,0) IDENTITY NOT NULL ,
[CompanyName] [nvarchar] (40) NOT NULL ,
[ContactName] [nvarchar] (30) NULL ,
[ContactTitle] [nvarchar] (30) NULL ,
[Address] [nvarchar] (60) NULL ,
[City] [nvarchar] (15) NULL ,
[Region] [nvarchar] (15) NULL ,
[PostalCode] [nvarchar] (10) NULL ,
[Country] [nvarchar] (15) NULL ,
[Phone] [nvarchar] (24) NULL ,
[Fax] [nvarchar] (24) NULL ,
[HomePage] [nvarchar](1000) NULL
) ON [default]
GO
CREATE TABLE [dbo].[Territories] (
[TerritoryID] [nvarchar] (20) NOT NULL ,
[TerritoryDescription] [nchar] (50) NOT NULL ,
[RegionID] [int] NOT NULL
) ON [default]
GO
print '------------------------------'
print 'create tables - finish'
print '------------------------------'
go
ALTER TABLE [dbo].[Categories] ADD
CONSTRAINT [PK_Categories] PRIMARY KEY CLUSTERED
(
[CategoryID]
) ON [default]
GO
ALTER TABLE [dbo].[Customers] ADD
CONSTRAINT [PK_Customers] PRIMARY KEY CLUSTERED
(
[CustomerID]
) ON [default]
GO
ALTER TABLE [dbo].[Employees] ADD
CONSTRAINT [PK_Employees] PRIMARY KEY CLUSTERED
(
[EmployeeID]
) ON [default]
GO
ALTER TABLE [dbo].[Order Details] ADD
CONSTRAINT [PK_Order_Details] PRIMARY KEY CLUSTERED
(
[OrderID],
[ProductID]
) ON [default]
GO
ALTER TABLE [dbo].[Orders] ADD
CONSTRAINT [PK_Orders] PRIMARY KEY CLUSTERED
(
[OrderID]
) ON [default]
GO
ALTER TABLE [dbo].[Products] ADD
CONSTRAINT [PK_Products] PRIMARY KEY CLUSTERED
(
[ProductID]
) ON [default]
GO
ALTER TABLE [dbo].[Shippers] ADD
CONSTRAINT [PK_Shippers] PRIMARY KEY CLUSTERED
(
[ShipperID]
) ON [default]
GO
ALTER TABLE [dbo].[Suppliers] ADD
CONSTRAINT [PK_Suppliers] PRIMARY KEY CLUSTERED
(
[SupplierID]
) ON [default]
GO
CREATE INDEX [CategoryName] ON [dbo].[Categories]([CategoryName]) ON [default]
GO
ALTER TABLE [dbo].[CustomerCustomerDemo] ADD
CONSTRAINT [PK_CustomerCustomerDemo] PRIMARY KEY NONCLUSTERED
(
[CustomerID],
[CustomerTypeID]
) ON [default]
GO
ALTER TABLE [dbo].[CustomerDemographics] ADD
CONSTRAINT [PK_CustomerDemographics] PRIMARY KEY NONCLUSTERED
(
[CustomerTypeID]
) ON [default]
GO
CREATE INDEX [City] ON [dbo].[Customers]([City]) ON [default]
GO
CREATE INDEX [CompanyName] ON [dbo].[Customers]([CompanyName]) ON [default]
GO
CREATE INDEX [PostalCode] ON [dbo].[Customers]([PostalCode]) ON [default]
GO
CREATE INDEX [Region] ON [dbo].[Customers]([Region]) ON [default]
GO
ALTER TABLE [dbo].[EmployeeTerritories] ADD
CONSTRAINT [PK_EmployeeTerritories] PRIMARY KEY NONCLUSTERED
(
[EmployeeID],
[TerritoryID]
) ON [default]
GO
ALTER TABLE [dbo].[Employees] ADD
CONSTRAINT [CK_Birthdate] CHECK ([BirthDate] < getdate())
GO
CREATE INDEX [LastName] ON [dbo].[Employees]([LastName]) ON [default]
GO
CREATE INDEX [PostalCode] ON [dbo].[Employees]([PostalCode]) ON [default]
GO
ALTER TABLE [dbo].[Order Details] ADD
CONSTRAINT [CK_Discount] CHECK ([Discount] >= 0 and [Discount] <= 1),
CONSTRAINT [CK_Quantity] CHECK ([Quantity] > 0),
CONSTRAINT [CK_UnitPrice] CHECK ([UnitPrice] >= 0)
GO
print 'got here5'
go
CREATE INDEX [OrderID] ON [dbo].[Order Details]([OrderID]) ON [default]
GO
CREATE INDEX [OrdersOrder_Details] ON [dbo].[Order Details]([OrderID]) ON [default]
GO
CREATE INDEX [ProductID] ON [dbo].[Order Details]([ProductID]) ON [default]
GO
CREATE INDEX [ProductsOrder_Details] ON [dbo].[Order Details]([ProductID]) ON [default]
GO
CREATE INDEX [CustomerID] ON [dbo].[Orders]([CustomerID]) ON [default]
GO
CREATE INDEX [CustomersOrders] ON [dbo].[Orders]([CustomerID]) ON [default]
GO
CREATE INDEX [EmployeeID] ON [dbo].[Orders]([EmployeeID]) ON [default]
GO
CREATE INDEX [EmployeesOrders] ON [dbo].[Orders]([EmployeeID]) ON [default]
GO
CREATE INDEX [OrderDate] ON [dbo].[Orders]([OrderDate]) ON [default]
GO
CREATE INDEX [ShippedDate] ON [dbo].[Orders]([ShippedDate]) ON [default]
GO
CREATE INDEX [ShippersOrders] ON [dbo].[Orders]([ShipVia]) ON [default]
GO
CREATE INDEX [ShipPostalCode] ON [dbo].[Orders]([ShipPostalCode]) ON [default]
GO
print 'got here6'
go
ALTER TABLE [dbo].[Products] ADD
CONSTRAINT [CK_Products_UnitPrice] CHECK ([UnitPrice] >= 0),
CONSTRAINT [CK_ReorderLevel] CHECK ([ReorderLevel] >= 0),
CONSTRAINT [CK_UnitsInStock] CHECK ([UnitsInStock] >= 0),
CONSTRAINT [CK_UnitsOnOrder] CHECK ([UnitsOnOrder] >= 0)
GO
print 'got here7'
go
CREATE INDEX [CategoriesProducts] ON [dbo].[Products]([CategoryID]) ON [default]
GO
CREATE INDEX [CategoryID] ON [dbo].[Products]([CategoryID]) ON [default]
GO
CREATE INDEX [ProductName] ON [dbo].[Products]([ProductName]) ON [default]
GO
CREATE INDEX [SupplierID] ON [dbo].[Products]([SupplierID]) ON [default]
GO
CREATE INDEX [SuppliersProducts] ON [dbo].[Products]([SupplierID]) ON [default]
GO
ALTER TABLE [dbo].[Region] ADD
CONSTRAINT [PK_Region] PRIMARY KEY NONCLUSTERED
(
[RegionID]
) ON [default]
GO
CREATE INDEX [CompanyName] ON [dbo].[Suppliers]([CompanyName]) ON [default]
GO
CREATE INDEX [PostalCode] ON [dbo].[Suppliers]([PostalCode]) ON [default]
GO
ALTER TABLE [dbo].[Territories] ADD
CONSTRAINT [PK_Territories] PRIMARY KEY NONCLUSTERED
(
[TerritoryID]
) ON [default]
GO
ALTER TABLE [dbo].[CustomerCustomerDemo] ADD
CONSTRAINT [FK_CustomerCustomerDemo] FOREIGN KEY
(
[CustomerTypeID]
) REFERENCES [dbo].[CustomerDemographics] (
[CustomerTypeID]
),
CONSTRAINT [FK_CustCustDemo_Customers] FOREIGN KEY
(
[CustomerID]
) REFERENCES [dbo].[Customers] (
[CustomerID]
)
GO
ALTER TABLE [dbo].[EmployeeTerritories] ADD
CONSTRAINT [FK_EmpTer_Employees] FOREIGN KEY
(
[EmployeeID]
) REFERENCES [dbo].[Employees] (
[EmployeeID]
),
CONSTRAINT [FK_EmpTer_Ter] FOREIGN KEY
(
[TerritoryID]
) REFERENCES [dbo].[Territories] (
[TerritoryID]
)
GO
ALTER TABLE [dbo].[Employees] ADD
CONSTRAINT [FK_Employees_Employees] FOREIGN KEY
(
[ReportsTo]
) REFERENCES [dbo].[Employees] (
[EmployeeID]
)
GO
ALTER TABLE [dbo].[Order Details] ADD
CONSTRAINT [FK_Order_Details_Orders] FOREIGN KEY
(
[OrderID]
) REFERENCES [dbo].[Orders] (
[OrderID]
),
CONSTRAINT [FK_Order_Details_Products] FOREIGN KEY
(
[ProductID]
) REFERENCES [dbo].[Products] (
[ProductID]
)
GO
ALTER TABLE [dbo].[Orders] ADD
CONSTRAINT [FK_Orders_Customers] FOREIGN KEY
(
[CustomerID]
) REFERENCES [dbo].[Customers] (
[CustomerID]
),
CONSTRAINT [FK_Orders_Employees] FOREIGN KEY
(
[EmployeeID]
) REFERENCES [dbo].[Employees] (
[EmployeeID]
),
CONSTRAINT [FK_Orders_Shippers] FOREIGN KEY
(
[ShipVia]
) REFERENCES [dbo].[Shippers] (
[ShipperID]
)
GO
ALTER TABLE [dbo].[Products] ADD
CONSTRAINT [FK_Products_Categories] FOREIGN KEY
(
[CategoryID]
) REFERENCES [dbo].[Categories] (
[CategoryID]
),
CONSTRAINT [FK_Products_Suppliers] FOREIGN KEY
(
[SupplierID]
) REFERENCES [dbo].[Suppliers] (
[SupplierID]
)
GO
ALTER TABLE [dbo].[Territories] ADD
CONSTRAINT [FK_Territories_Region] FOREIGN KEY
(
[RegionID]
) REFERENCES [dbo].[Region] (
[RegionID]
)
GO
SET QUOTED_IDENTIFIER ON
GO
print '------------------------------'
print 'create views - start'
print '------------------------------'
go
SET QUOTED_IDENTIFIER ON
GO
create view "Current Product List" AS
SELECT Product_List.ProductID, Product_List.ProductName
FROM Products AS Product_List
WHERE (((Product_List.Discontinued)=0))
--ORDER BY Product_List.ProductName
GO
SET QUOTED_IDENTIFIER OFF
GO
SET QUOTED_IDENTIFIER ON
GO
create view "Orders Qry" AS
SELECT Orders.OrderID, Orders.CustomerID, Orders.EmployeeID, Orders.OrderDate, Orders.RequiredDate,
Orders.ShippedDate, Orders.ShipVia, Orders.Freight, Orders.ShipName, Orders.ShipAddress, Orders.ShipCity,
Orders.ShipRegion, Orders.ShipPostalCode, Orders.ShipCountry,
Customers.CompanyName, Customers.Address, Customers.City, Customers.Region, Customers.PostalCode, Customers.Country
FROM Customers INNER JOIN Orders ON Customers.CustomerID = Orders.CustomerID
GO
SET QUOTED_IDENTIFIER OFF
GO
SET QUOTED_IDENTIFIER ON
GO
create view "Products Above Average Price" AS
SELECT Products.ProductName, Products.UnitPrice
FROM Products
WHERE Products.UnitPrice>(SELECT AVG(UnitPrice) From Products)
--ORDER BY Products.UnitPrice DESC
GO
SET QUOTED_IDENTIFIER OFF
GO
SET QUOTED_IDENTIFIER ON
GO
create view "Products by Category" AS
SELECT Categories.CategoryName, Products.ProductName, Products.QuantityPerUnit, Products.UnitsInStock, Products.Discontinued
FROM Categories INNER JOIN Products ON Categories.CategoryID = Products.CategoryID
WHERE Products.Discontinued <> 1
--ORDER BY Categories.CategoryName, Products.ProductName
GO
SET QUOTED_IDENTIFIER OFF
GO
SET QUOTED_IDENTIFIER ON
GO
create view "Quarterly Orders" AS
SELECT DISTINCT Customers.CustomerID, Customers.CompanyName, Customers.City, Customers.Country
FROM Customers RIGHT JOIN Orders ON Customers.CustomerID = Orders.CustomerID
WHERE Orders.OrderDate BETWEEN '19970101' And '19971231'
GO
SET QUOTED_IDENTIFIER OFF
GO
SET QUOTED_IDENTIFIER ON
GO
create view Invoices AS
SELECT Orders.ShipName, Orders.ShipAddress, Orders.ShipCity, Orders.ShipRegion, Orders.ShipPostalCode,
Orders.ShipCountry, Orders.CustomerID, Customers.CompanyName AS CustomerName, Customers.Address, Customers.City,
Customers.Region, Customers.PostalCode, Customers.Country,
(FirstName + ' ' + LastName) AS Salesperson,
Orders.OrderID, Orders.OrderDate, Orders.RequiredDate, Orders.ShippedDate, Shippers.CompanyName As ShipperName,
"Order Details".ProductID, Products.ProductName, "Order Details".UnitPrice, "Order Details".Quantity,
"Order Details".Discount,
(CONVERT(money,("Order Details".UnitPrice*Quantity*(1-Discount)/100))*100) AS ExtendedPrice, Orders.Freight
FROM Shippers INNER JOIN
(Products INNER JOIN
(
(Employees INNER JOIN
(Customers INNER JOIN Orders ON Customers.CustomerID = Orders.CustomerID)
ON Employees.EmployeeID = Orders.EmployeeID)
INNER JOIN "Order Details" ON Orders.OrderID = "Order Details".OrderID)
ON Products.ProductID = "Order Details".ProductID)
ON Shippers.ShipperID = Orders.ShipVia
GO
SET QUOTED_IDENTIFIER OFF
GO
SET QUOTED_IDENTIFIER ON
GO
create view "Order Details Extended" AS
SELECT "Order Details".OrderID, "Order Details".ProductID, Products.ProductName,
"Order Details".UnitPrice, "Order Details".Quantity, "Order Details".Discount,
(CONVERT(money,("Order Details".UnitPrice*Quantity*(1-Discount)/100))*100) AS ExtendedPrice
FROM Products INNER JOIN "Order Details" ON Products.ProductID = "Order Details".ProductID
--ORDER BY "Order Details".OrderID
GO
SET QUOTED_IDENTIFIER OFF
SET QUOTED_IDENTIFIER ON
GO
create view "Order Subtotals" AS
SELECT "Order Details".OrderID, Sum(CONVERT(money,("Order Details".UnitPrice*Quantity*(1-Discount)/100))*100) AS Subtotal
FROM "Order Details"
GROUP BY "Order Details".OrderID
GO
SET QUOTED_IDENTIFIER OFF
GO
SET QUOTED_IDENTIFIER ON
GO
create view "Product Sales for 1997" AS
SELECT Categories.CategoryName, Products.ProductName,
Sum(CONVERT(money,("Order Details".UnitPrice*Quantity*(1-Discount)/100))*100) AS ProductSales
FROM (Categories INNER JOIN Products ON Categories.CategoryID = Products.CategoryID)
INNER JOIN (Orders
INNER JOIN "Order Details" ON Orders.OrderID = "Order Details".OrderID)
ON Products.ProductID = "Order Details".ProductID
WHERE (((Orders.ShippedDate) Between '19970101' And '19971231'))
GROUP BY Categories.CategoryName, Products.ProductName
GO
SET QUOTED_IDENTIFIER OFF
GO
SET QUOTED_IDENTIFIER ON
GO
create view "Category Sales for 1997" AS
SELECT "Product Sales for 1997".CategoryName, Sum("Product Sales for 1997".ProductSales) AS CategorySales
FROM "Product Sales for 1997"
GROUP BY "Product Sales for 1997".CategoryName
GO
SET QUOTED_IDENTIFIER OFF
GO
SET QUOTED_IDENTIFIER ON
GO
create view "Sales Totals by Amount" AS
SELECT "Order Subtotals".Subtotal AS SaleAmount, Orders.OrderID, Customers.CompanyName, Orders.ShippedDate
FROM Customers INNER JOIN
(Orders INNER JOIN "Order Subtotals" ON Orders.OrderID = "Order Subtotals".OrderID)
ON Customers.CustomerID = Orders.CustomerID
WHERE ("Order Subtotals".Subtotal >2500) AND (Orders.ShippedDate BETWEEN '19970101' And '19971231')
GO
SET QUOTED_IDENTIFIER OFF
GO
SET QUOTED_IDENTIFIER ON
GO
create view "Sales by Category" AS
SELECT Categories.CategoryID, Categories.CategoryName, Products.ProductName,
Sum("Order Details Extended".ExtendedPrice) AS ProductSales
FROM Categories INNER JOIN
(Products INNER JOIN
(Orders INNER JOIN "Order Details Extended" ON Orders.OrderID = "Order Details Extended".OrderID)
ON Products.ProductID = "Order Details Extended".ProductID)
ON Categories.CategoryID = Products.CategoryID
WHERE Orders.OrderDate BETWEEN '19970101' And '19971231'
GROUP BY Categories.CategoryID, Categories.CategoryName, Products.ProductName
--ORDER BY Products.ProductName
GO
SET QUOTED_IDENTIFIER OFF
GO
SET QUOTED_IDENTIFIER ON
GO
create view "Summary of Sales by Quarter" AS
SELECT Orders.ShippedDate, Orders.OrderID, "Order Subtotals".Subtotal
FROM Orders INNER JOIN "Order Subtotals" ON Orders.OrderID = "Order Subtotals".OrderID
WHERE Orders.ShippedDate IS NOT NULL
--ORDER BY Orders.ShippedDate
GO
SET QUOTED_IDENTIFIER OFF
GO
SET QUOTED_IDENTIFIER ON
GO
create view "Summary of Sales by Year" AS
SELECT Orders.ShippedDate, Orders.OrderID, "Order Subtotals".Subtotal
FROM Orders INNER JOIN "Order Subtotals" ON Orders.OrderID = "Order Subtotals".OrderID
WHERE Orders.ShippedDate IS NOT NULL
--ORDER BY Orders.ShippedDate
GO
SET QUOTED_IDENTIFIER OFF
GO
SET QUOTED_IDENTIFIER ON
GO
print '------------------------------'
print 'create views - finish'
print '------------------------------'
go
print '------------------------------'
print 'create procedures - start'
print '------------------------------'
go
CREATE PROCEDURE CustOrderHist @CustomerID nchar(5)
AS
SELECT ProductName, Total=SUM(Quantity)
FROM Products P, [Order Details] OD, Orders O, Customers C
WHERE C.CustomerID = @CustomerID
AND C.CustomerID = O.CustomerID AND O.OrderID = OD.OrderID AND OD.ProductID = P.ProductID
GROUP BY ProductName
GO
SET QUOTED_IDENTIFIER OFF
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE CustOrdersDetail @OrderID int
AS
SELECT ProductName,
UnitPrice=ROUND(Od.UnitPrice, 2),
Quantity,
Discount=CONVERT(int, Discount * 100),
ExtendedPrice=ROUND(CONVERT(money, Quantity * (1 - Discount) * Od.UnitPrice), 2)
FROM Products P, [Order Details] Od
WHERE Od.ProductID = P.ProductID and Od.OrderID = @OrderID
GO
SET QUOTED_IDENTIFIER OFF
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE CustOrdersOrders @CustomerID nchar(5)
AS
SELECT OrderID,
OrderDate,
RequiredDate,
ShippedDate
FROM Orders
WHERE CustomerID = @CustomerID
ORDER BY OrderID
GO
SET QUOTED_IDENTIFIER OFF
GO
SET QUOTED_IDENTIFIER ON
GO
create procedure "Employee Sales by Country"
@Beginning_Date DateTime, @Ending_Date DateTime AS
SELECT Employees.Country, Employees.LastName, Employees.FirstName, Orders.ShippedDate, Orders.OrderID, "Order Subtotals".Subtotal AS SaleAmount
FROM Employees INNER JOIN
(Orders INNER JOIN "Order Subtotals" ON Orders.OrderID = "Order Subtotals".OrderID)
ON Employees.EmployeeID = Orders.EmployeeID
WHERE Orders.ShippedDate Between @Beginning_Date And @Ending_Date
GO
SET QUOTED_IDENTIFIER OFF
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE GH_CREATETABLE
AS
Begin
Create Table #temp_tbl (
Col1 int,
Col2 int
)
--insert values to the table
insert into #temp_tbl values (11,12)
insert into #temp_tbl values (21,22)
insert into #temp_tbl values (31,32)
--execute select on the created table
select Col1 as Value1, Col2 as Value2 from #temp_tbl
end
GO
SET QUOTED_IDENTIFIER OFF
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE GH_MULTIRECORDSETS
as BEGIN
-- Declare cursor
SELECT EmployeeID, LastName FROM Employees where EmployeeID in (1,2) order by EmployeeID asc
SELECT CustomerID, CompanyName,ContactName FROM Customers where CustomerID in ('MORGK','NORTS') order by CustomerID asc
-- return empty result set
SELECT OrderID, ShipAddress,ShipVia, ShipCity FROM Orders where OrderID=-1
END
GO
CREATE procedure GH_INOUT1
@INPARAM varchar(20) ,
@OUTPARAM int output
AS
declare @L_INPARAM varchar(30)
select L_INPARAM = @INPARAM
select @OUTPARAM = 100
GO
CREATE procedure GH_REFCURSOR1
AS
SELECT EmployeeID, LastName FROM Employees
WHERE EmployeeID=1
GO
CREATE procedure GH_REFCURSOR2
@IN_EMPLOYEEID int
AS
SELECT EmployeeID, LastName FROM Employees
where EmployeeID = @IN_EMPLOYEEID
GO
CREATE procedure GH_REFCURSOR3
@IN_LASTNAME varchar(20) AS
SELECT EmployeeID, LastName FROM Employees
where LastName = @IN_LASTNAME
GO
SET QUOTED_IDENTIFIER OFF
GO
SET QUOTED_IDENTIFIER ON
GO
create procedure "Sales by Year"
@Beginning_Date DateTime, @Ending_Date DateTime AS
SELECT Orders.ShippedDate, Orders.OrderID, "Order Subtotals".Subtotal, DATENAME(yy,ShippedDate) AS Year
FROM Orders INNER JOIN "Order Subtotals" ON Orders.OrderID = "Order Subtotals".OrderID
WHERE Orders.ShippedDate Between @Beginning_Date And @Ending_Date
GO
SET QUOTED_IDENTIFIER OFF
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE SalesByCategory
@CategoryName nvarchar(15), @OrdYear nvarchar(4) = '1998'
AS
IF @OrdYear != '1996' AND @OrdYear != '1997' AND @OrdYear != '1998'
BEGIN
SELECT @OrdYear = '1998'
END
SELECT ProductName,
TotalPurchase=ROUND(SUM(CONVERT(decimal(14,2), OD.Quantity * (1-OD.Discount) * OD.UnitPrice)), 0)
FROM [Order Details] OD, Orders O, Products P, Categories C
WHERE OD.OrderID = O.OrderID
AND OD.ProductID = P.ProductID
AND P.CategoryID = C.CategoryID
AND C.CategoryName = @CategoryName
AND SUBSTRING(CONVERT(nvarchar(22), O.OrderDate, 111), 1, 4) = @OrdYear
GROUP BY ProductName
ORDER BY ProductName
GO
SET QUOTED_IDENTIFIER OFF
GO
SET QUOTED_IDENTIFIER ON
GO
create procedure "Ten Most Expensive Products" AS
SET ROWCOUNT 10
SELECT Products.ProductName AS TenMostExpensiveProducts, Products.UnitPrice
FROM Products
ORDER BY Products.UnitPrice DESC
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE GHSP_TYPES_SIMPLE_1
@T_TINYINT tinyint,
@T_SMALLINT smallint ,
@T_INT int,
@T_DECIMAL decimal(18, 0),
@T_NUMERIC numeric(18, 0) ,
@T_FLOAT float ,
@T_REAL real ,
@T_CHAR char (10),
@T_NCHAR nchar (10),
@T_VARCHAR varchar (50) ,
@T_NVARCHAR nvarchar (50)
AS
SELECT @T_TINYINT as 'T_TINYINT', @T_SMALLINT as 'T_SMALLINT' , @T_INT as 'T_INT', @T_DECIMAL as 'T_DECIMAL',
@T_NUMERIC as 'T_NUMERIC' , @T_FLOAT as 'T_FLOAT' , @T_REAL as 'T_REAL' , @T_CHAR as 'T_CHAR', @T_NCHAR as 'T_NCHAR', @T_VARCHAR as 'T_VARCHAR' , @T_NVARCHAR as 'T_NVARCHAR'
GO
SET QUOTED_IDENTIFIER OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE GHSP_TYPES_SIMPLE_2
@T_TINYINT tinyint output,
@T_SMALLINT smallint output,
@T_INT int output,
@T_DECIMAL decimal(18, 0) output,
@T_NUMERIC numeric(18, 0) output,
@T_FLOAT float output,
@T_REAL real output,
@T_CHAR char (10) output,
@T_NCHAR nchar (10) output,
@T_VARCHAR varchar (50) output,
@T_NVARCHAR nvarchar (50) output
AS
SELECT @T_TINYINT = @T_TINYINT*2
SELECT @T_SMALLINT = @T_SMALLINT*2
SELECT @T_INT = @T_INT*2
SELECT @T_DECIMAL = @T_DECIMAL*2
SELECT @T_NUMERIC = @T_NUMERIC*2
SELECT @T_FLOAT = @T_FLOAT*2
SELECT @T_REAL = @T_REAL*2
SELECT @T_CHAR = UPPER(@T_CHAR)
SELECT @T_NCHAR =UPPER(@T_NCHAR)
SELECT @T_VARCHAR = UPPER(@T_VARCHAR)
SELECT @T_NVARCHAR = UPPER(@T_NVARCHAR)
GO
SET QUOTED_IDENTIFIER OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE GHSP_TYPES_SIMPLE_3
@ID char,
@T_TINYINT tinyint output,
@T_SMALLINT smallint output,
@T_INT int output,
@T_DECIMAL decimal(18, 0) output,
@T_NUMERIC numeric(18, 0) output,
@T_FLOAT float output,
@T_REAL real output,
@T_CHAR char (10) output,
@T_NCHAR nchar (10) output,
@T_VARCHAR varchar (50) output,
@T_NVARCHAR nvarchar (50) output
AS
SELECT @T_TINYINT = T_TINYINT, @T_SMALLINT = T_SMALLINT , @T_INT = T_INT, @T_DECIMAL = T_DECIMAL ,
@T_NUMERIC = T_NUMERIC , @T_FLOAT = T_FLOAT , @T_REAL = T_REAL , @T_CHAR = T_CHAR, @T_NCHAR = T_NCHAR,
@T_VARCHAR = T_VARCHAR, @T_NVARCHAR = T_NVARCHAR FROM TYPES_SIMPLE WHERE ID = @ID
GO
SET QUOTED_IDENTIFIER OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE GHSP_TYPES_SIMPLE_4
@ID char
AS
/*Insert*/
insert into TYPES_SIMPLE(ID,T_INT) values (@ID,50)
SELECT * FROM TYPES_SIMPLE WHERE ID = @ID
/*Update*/
update TYPES_SIMPLE set T_INT=60 where ID = @ID
SELECT * FROM TYPES_SIMPLE WHERE ID = @ID
/*Delete*/
delete from TYPES_SIMPLE WHERE ID = @ID
SELECT * FROM TYPES_SIMPLE WHERE ID = @ID
GO
SET QUOTED_IDENTIFIER OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE GHSP_TYPES_SIMPLE_5
AS
DECLARE @T_TINYINT tinyint
DECLARE @T_SMALLINT smallint
DECLARE @T_INT int
DECLARE @T_DECIMAL decimal(18,0)
DECLARE @T_NUMERIC numeric(18,0)
DECLARE @T_FLOAT float
DECLARE @T_REAL real
DECLARE @T_CHAR char(10)
DECLARE @T_NCHAR nchar(10)
DECLARE @T_VARCHAR varchar(50)
DECLARE @T_NVARCHAR nvarchar(50)
SELECT @T_TINYINT = 25
SELECT @T_SMALLINT = 77
SELECT @T_INT = 2525
SELECT @T_DECIMAL = 10
SELECT @T_NUMERIC = 123123
SELECT @T_FLOAT = 17.1414257
SELECT @T_REAL = 0.71425
SELECT @T_CHAR = 'abcdefghij'
SELECT @T_NCHAR = N'klmnopqrst'
SELECT @T_VARCHAR = 'qwertasdfg'
SELECT @T_NVARCHAR = N'qwertasdfg'
SELECT @T_TINYINT as 'T_TINYINT', @T_SMALLINT as 'T_SMALLINT' , @T_INT as 'T_INT', @T_DECIMAL as 'T_DECIMAL', @T_NUMERIC as 'T_NUMERIC' , @T_FLOAT as 'T_FLOAT' , @T_REAL as 'T_REAL' , @T_CHAR as 'T_CHAR', @T_NCHAR as 'T_NCHAR', @T_VARCHAR as 'T_VARCHAR' , @T_NVARCHAR as 'T_NVARCHAR'
GO
SET QUOTED_IDENTIFIER OFF
GO
if not exists (select * from master.dbo.syslogins where name = N'mainsoft')
BEGIN
declare @logindb nvarchar(132), @loginlang nvarchar(132) select @logindb = N'GHTDB', @loginlang = N'us_english'
if @logindb is null or not exists (select * from master.dbo.sysdatabases where name = @logindb)
select @logindb = N'master'
if @loginlang is null or (not exists (select * from master.dbo.syslanguages where name = @loginlang) and @loginlang <> N'us_english')
select @loginlang = @@language
exec sp_addlogin N'mainsoft', 'mainsoft', @logindb, @loginlang
END
GO
--exec sp_addsrvrolemember N'mainsoft', sysadmin
exec sp_adduser mainsoft
GO
if not exists (select * from dbo.sysusers where name = N'mainsoft' and uid < 16382)
EXEC sp_grantdbaccess N'mainsoft', N'mainsoft', 1
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [mainsoft].[CategoriesNew] (
[CategoryID] numeric(5,0) IDENTITY NOT NULL ,
[CategoryName] [nvarchar] (15) NOT NULL ,
[Description] [nvarchar](1000) NULL ,
[Picture] [image] NULL
) ON [default]
GO
CREATE TABLE [mainsoft].[Categories] (
[CategoryID] [nvarchar] (15) NOT NULL ,
[CategoryName] [nvarchar] (15) NOT NULL ,
[Description] [nvarchar](1000) NULL ,
[Picture] [int] NULL
) ON [default]
GO
CREATE procedure [mainsoft].[GH_DUMMY]
@EmployeeIdPrm char (10)
AS
SELECT * FROM Employees where EmployeeID > CONVERT(int,@EmployeeIdPrm)
GO
SET QUOTED_IDENTIFIER OFF
GO
------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------
use master
go
IF EXISTS (SELECT name FROM master.dbo.sysdatabases WHERE name = N'GHTDB_EX')
DROP DATABASE [GHTDB_EX]
GO
if (@@maxpagesize = 1024 * 2)
create database GHTDB_EX on default = 10
else
create database GHTDB_EX on default = 10
go
exec sp_dboption N'GHTDB_EX', N'trunc log on chkpt', true, 1
exec sp_dboption N'GHTDB_EX', N'trunc. log', N'true', 1
exec sp_dboption N'GHTDB_EX', N'read only', N'false', 1
exec sp_dboption N'GHTDB_EX', N'dbo use', N'false', 1
go
use [GHTDB_EX]
GO
CREATE TABLE [dbo].[Customers] (
[CustomerID] [char] (10) NOT NULL ,
[CompanyName] [nvarchar] (40) NULL ,
[ContactName] [nvarchar] (30) NULL ,
[ContactTitle] [nvarchar] (30) NULL ,
[Address] [nvarchar] (60) NULL ,
[City] [nvarchar] (15) NULL ,
[Region] [nvarchar] (15) NULL ,
[PostalCode] [nvarchar] (10) NULL ,
[Country] [nvarchar] (15) NULL ,
[Phone] [nvarchar] (24) NULL ,
[Fax] [nvarchar] (24) NULL
) ON [default]
GO
SET QUOTED_IDENTIFIER OFF
GO
print '------------------------------'
print 'create another GH_DUMMY which select from a different table'
print 'customers instead of employees'
print '------------------------------'
go
CREATE procedure GH_DUMMY
@CustomerIdPrm char (10)
AS
SELECT * FROM Customers where CustomerID=CONVERT(char,@CustomerIdPrm)
GO
SET QUOTED_IDENTIFIER OFF
GO | the_stack |
-- original: pager1.test
-- credit: http://www.sqlite.org/src/tree?ci=trunk&name=test
SELECT count(*) FROM ab
;PRAGMA page_size = 1024
;CREATE TABLE tsub_ii(a, b)
;PRAGMA page_size = 4096;
PRAGMA synchronous = OFF;
CREATE TABLE t1(a, b);
CREATE TABLE t2(a, b)
;PRAGMA page_size = 4096;
CREATE TABLE t1(a, b);
CREATE TABLE t2(a, b)
;PRAGMA journal_mode = PERSIST;
PRAGMA page_size = 1024;
BEGIN;
CREATE TABLE t1(a, b);
CREATE TABLE t2(a, b);
CREATE TABLE t3(a, b);
COMMIT
;INSERT INTO t3 VALUES(a_string(300), a_string(300));
INSERT INTO t3 SELECT * FROM t3; /* 2 */
INSERT INTO t3 SELECT * FROM t3; /* 4 */
INSERT INTO t3 SELECT * FROM t3; /* 8 */
INSERT INTO t3 SELECT * FROM t3; /* 16 */
INSERT INTO t3 SELECT * FROM t3; /* 32 */
;PRAGMA cache_size = 10;
BEGIN
;INSERT INTO t2 VALUES(1, 2)
;COMMIT;
SELECT * FROM t2
;CREATE TABLE t6(a, b);
CREATE TABLE t7(a, b);
CREATE TABLE t5(a, b);
DROP TABLE t6;
DROP TABLE t7
;BEGIN;
CREATE TABLE t6(a, b)
;INSERT INTO t5 VALUES(1, 2)
;COMMIT;
SELECT * FROM t5
;PRAGMA auto_vacuum = none;
PRAGMA page_size = 1024;
CREATE TABLE t1(x)
;INSERT INTO t1 VALUES(zeroblob(900))
;CREATE TABLE t2(x);
DROP TABLE t2
;BEGIN;
CREATE TABLE t2(x)
;CREATE TABLE t3(x);
COMMIT
;PRAGMA journal_mode = DELETE;
PRAGMA cache_size = 10;
BEGIN;
CREATE TABLE zz(top PRIMARY KEY);
INSERT INTO zz VALUES(a_string(222));
INSERT INTO zz SELECT a_string((SELECT 222+max(rowid) FROM zz)) FROM zz;
INSERT INTO zz SELECT a_string((SELECT 222+max(rowid) FROM zz)) FROM zz;
INSERT INTO zz SELECT a_string((SELECT 222+max(rowid) FROM zz)) FROM zz;
INSERT INTO zz SELECT a_string((SELECT 222+max(rowid) FROM zz)) FROM zz;
INSERT INTO zz SELECT a_string((SELECT 222+max(rowid) FROM zz)) FROM zz;
COMMIT;
BEGIN;
UPDATE zz SET top = a_string(345)
;PRAGMA journal_mode = TRUNCATE;
PRAGMA integrity_check
;SELECT count(*) FROM zz
;SELECT count(*) FROM v;
PRAGMA main.page_size
;SELECT count(*) FROM v;
PRAGMA main.page_size
;PRAGMA page_size = 1024;
PRAGMA journal_mode = PERSIST;
PRAGMA cache_size = 10;
BEGIN;
CREATE TABLE t1(a INTEGER PRIMARY KEY, b BLOB);
INSERT INTO t1 VALUES(NULL, a_string(400));
INSERT INTO t1 SELECT NULL, a_string(400) FROM t1; /* 2 */
INSERT INTO t1 SELECT NULL, a_string(400) FROM t1; /* 4 */
INSERT INTO t1 SELECT NULL, a_string(400) FROM t1; /* 8 */
INSERT INTO t1 SELECT NULL, a_string(400) FROM t1; /* 16 */
INSERT INTO t1 SELECT NULL, a_string(400) FROM t1; /* 32 */
INSERT INTO t1 SELECT NULL, a_string(400) FROM t1; /* 64 */
INSERT INTO t1 SELECT NULL, a_string(400) FROM t1; /* 128 */
COMMIT;
UPDATE t1 SET b = a_string(400)
;SELECT sum(length(b)) FROM t1
;PRAGMA integrity_check
;CREATE INDEX i1 ON t1(b);
UPDATE t1 SET b = a_string(400)
;SELECT sum(length(b)) FROM t1
;PRAGMA integrity_check
;PRAGMA journal_mode = OFF;
CREATE TABLE t1(a, b);
BEGIN;
INSERT INTO t1 VALUES(1, 2);
COMMIT;
SELECT * FROM t1
;SELECT * FROM t1
;COMMIT;
SELECT * FROM t1
;CREATE TABLE tx(y, z);
INSERT INTO tx VALUES('Ayutthaya', 'Beijing');
INSERT INTO tx VALUES('London', 'Tokyo')
;PRAGMA page_size = 1024;
CREATE TABLE t1(a, b);
INSERT INTO t1 VALUES(a_string(500), a_string(200));
INSERT INTO t1 SELECT a_string(500), a_string(200) FROM t1;
INSERT INTO t1 SELECT a_string(500), a_string(200) FROM t1;
INSERT INTO t1 SELECT a_string(500), a_string(200) FROM t1;
INSERT INTO t1 SELECT a_string(500), a_string(200) FROM t1;
INSERT INTO t1 SELECT a_string(500), a_string(200) FROM t1;
INSERT INTO t1 SELECT a_string(500), a_string(200) FROM t1;
INSERT INTO t1 SELECT a_string(500), a_string(200) FROM t1
;PRAGMA writable_schema = 1;
UPDATE sqlite_master SET rootpage = sub_lockingpage
;CREATE TABLE t2(x);
INSERT INTO t2 VALUES(a_string(5000))
;DELETE FROM t2;
INSERT INTO t2 VALUES(randomblob(5000))
;CREATE TABLE t1(a, b);
CREATE TABLE t2(a, b);
PRAGMA writable_schema = 1;
UPDATE sqlite_master SET rootpage=5 WHERE tbl_name = 't1';
PRAGMA writable_schema = 0;
ALTER TABLE t1 RENAME TO x1
;PRAGMA page_size = 1024;
CREATE TABLE t1(x);
INSERT INTO t1 VALUES(a_string(800));
INSERT INTO t1 VALUES(a_string(800))
;PRAGMA page_size = 512;
PRAGMA auto_vacuum = 1;
CREATE TABLE t1(aa, ab, ac, ad, ae, af, ag, ah, ai, aj, ak, al, am, an,
ba, bb, bc, bd, be, bf, bg, bh, bi, bj, bk, bl, bm, bn,
ca, cb, cc, cd, ce, cf, cg, ch, ci, cj, ck, cl, cm, cn,
da, db, dc, dd, de, df, dg, dh, di, dj, dk, dl, dm, dn,
ea, eb, ec, ed, ee, ef, eg, eh, ei, ej, ek, el, em, en,
fa, fb, fc, fd, fe, ff, fg, fh, fi, fj, fk, fl, fm, fn,
ga, gb, gc, gd, ge, gf, gg, gh, gi, gj, gk, gl, gm, gn,
ha, hb, hc, hd, he, hf, hg, hh, hi, hj, hk, hl, hm, hn,
ia, ib, ic, id, ie, if, ig, ih, ii, ij, ik, il, im, ix,
ja, jb, jc, jd, je, jf, jg, jh, ji, jj, jk, jl, jm, jn,
ka, kb, kc, kd, ke, kf, kg, kh, ki, kj, kk, kl, km, kn,
la, lb, lc, ld, le, lf, lg, lh, li, lj, lk, ll, lm, ln,
ma, mb, mc, md, me, mf, mg, mh, mi, mj, mk, ml, mm, mn
);
CREATE TABLE t2(aa, ab, ac, ad, ae, af, ag, ah, ai, aj, ak, al, am, an,
ba, bb, bc, bd, be, bf, bg, bh, bi, bj, bk, bl, bm, bn,
ca, cb, cc, cd, ce, cf, cg, ch, ci, cj, ck, cl, cm, cn,
da, db, dc, dd, de, df, dg, dh, di, dj, dk, dl, dm, dn,
ea, eb, ec, ed, ee, ef, eg, eh, ei, ej, ek, el, em, en,
fa, fb, fc, fd, fe, ff, fg, fh, fi, fj, fk, fl, fm, fn,
ga, gb, gc, gd, ge, gf, gg, gh, gi, gj, gk, gl, gm, gn,
ha, hb, hc, hd, he, hf, hg, hh, hi, hj, hk, hl, hm, hn,
ia, ib, ic, id, ie, if, ig, ih, ii, ij, ik, il, im, ix,
ja, jb, jc, jd, je, jf, jg, jh, ji, jj, jk, jl, jm, jn,
ka, kb, kc, kd, ke, kf, kg, kh, ki, kj, kk, kl, km, kn,
la, lb, lc, ld, le, lf, lg, lh, li, lj, lk, ll, lm, ln,
ma, mb, mc, md, me, mf, mg, mh, mi, mj, mk, ml, mm, mn
);
INSERT INTO t1(aa) VALUES( a_string(100000) );
INSERT INTO t2(aa) VALUES( a_string(100000) );
VACUUM
;CREATE TABLE one(two, three);
INSERT INTO one VALUES('a', 'b')
;BEGIN EXCLUSIVE;
COMMIT
;PRAGMA locking_mode = exclusive;
PRAGMA journal_mode = persist;
CREATE TABLE one(two, three);
INSERT INTO one VALUES('a', 'b')
;BEGIN EXCLUSIVE;
COMMIT
;PRAGMA cache_size = 10;
PRAGMA journal_mode = wal;
BEGIN;
CREATE TABLE t1(x);
CREATE TABLE t2(y);
INSERT INTO t1 VALUES(a_string(800));
INSERT INTO t1 SELECT a_string(800) FROM t1; /* 2 */
INSERT INTO t1 SELECT a_string(800) FROM t1; /* 4 */
INSERT INTO t1 SELECT a_string(800) FROM t1; /* 8 */
INSERT INTO t1 SELECT a_string(800) FROM t1; /* 16 */
INSERT INTO t1 SELECT a_string(800) FROM t1; /* 32 */
COMMIT
;BEGIN;
INSERT INTO t2 VALUES('xxxx')
;PRAGMA journal_mode = WAL;
CREATE TABLE ko(c DEFAULT 'abc', b DEFAULT 'def');
INSERT INTO ko DEFAULT VALUES
;CREATE TABLE ko(c DEFAULT 'abc', b DEFAULT 'def');
INSERT INTO ko DEFAULT VALUES
;PRAGMA wal_checkpoint
;PRAGMA synchronous = off;
PRAGMA journal_mode = WAL;
INSERT INTO ko DEFAULT VALUES
;PRAGMA wal_checkpoint
;PRAGMA journal_mode = PERSIST;
CREATE TABLE t1(a, b)
;PRAGMA journal_mode = DELETE
;PRAGMA journal_mode = PERSIST;
INSERT INTO t1 VALUES('Canberra', 'ACT')
;SELECT * FROM t1
;PRAGMA journal_mode = DELETE
;PRAGMA journal_mode
;PRAGMA journal_mode = PERSIST;
INSERT INTO t1 VALUES('Darwin', 'NT');
BEGIN IMMEDIATE
;PRAGMA journal_mode = DELETE
;PRAGMA journal_mode
;PRAGMA journal_mode = PERSIST;
INSERT INTO t1 VALUES('Adelaide', 'SA');
BEGIN EXCLUSIVE
;PRAGMA journal_mode = DELETE
;PRAGMA journal_mode
;PRAGMA journal_mode = off
;PRAGMA journal_mode = sub_mode
;PRAGMA journal_mode = memory
;PRAGMA journal_mode = sub_mode
;PRAGMA locking_mode = normal
;PRAGMA locking_mode = exclusive
;PRAGMA locking_mode
;PRAGMA main.locking_mode
;PRAGMA cache_size = 10;
PRAGMA auto_vacuum = FULL;
CREATE TABLE x1(x, y, z, PRIMARY KEY(y, z));
CREATE TABLE x2(x, y, z, PRIMARY KEY(y, z));
INSERT INTO x2 VALUES(a_string(400), a_string(500), a_string(600));
INSERT INTO x2 SELECT a_string(600), a_string(400), a_string(500) FROM x2;
INSERT INTO x2 SELECT a_string(500), a_string(600), a_string(400) FROM x2;
INSERT INTO x2 SELECT a_string(400), a_string(500), a_string(600) FROM x2;
INSERT INTO x2 SELECT a_string(600), a_string(400), a_string(500) FROM x2;
INSERT INTO x2 SELECT a_string(500), a_string(600), a_string(400) FROM x2;
INSERT INTO x2 SELECT a_string(400), a_string(500), a_string(600) FROM x2;
INSERT INTO x1 SELECT * FROM x2
;BEGIN;
DELETE FROM x1 WHERE rowid<32
;UPDATE x1 SET z = a_string(300) WHERE rowid>40;
COMMIT;
PRAGMA integrity_check;
SELECT count(*) FROM x1
;DELETE FROM x1;
INSERT INTO x1 SELECT * FROM x2;
BEGIN;
DELETE FROM x1 WHERE rowid<32;
UPDATE x1 SET z = a_string(299) WHERE rowid>40
;PRAGMA integrity_check;
SELECT count(*) FROM x1
;DELETE FROM x1;
INSERT INTO x1 SELECT * FROM x2
;CREATE TABLE x3(x, y, z)
;SELECT * FROM x3
;BEGIN;
SAVEPOINT abc;
CREATE TABLE t1(a, b);
ROLLBACK TO abc;
COMMIT
;SAVEPOINT abc;
CREATE TABLE t1(a, b);
ROLLBACK TO abc;
COMMIT
;PRAGMA page_size = 512;
CREATE TABLE tbl(a PRIMARY KEY, b UNIQUE);
BEGIN;
INSERT INTO tbl VALUES(a_string(25), a_string(600));
INSERT INTO tbl SELECT a_string(25), a_string(600) FROM tbl;
INSERT INTO tbl SELECT a_string(25), a_string(600) FROM tbl;
INSERT INTO tbl SELECT a_string(25), a_string(600) FROM tbl;
INSERT INTO tbl SELECT a_string(25), a_string(600) FROM tbl;
INSERT INTO tbl SELECT a_string(25), a_string(600) FROM tbl;
INSERT INTO tbl SELECT a_string(25), a_string(600) FROM tbl;
INSERT INTO tbl SELECT a_string(25), a_string(600) FROM tbl;
COMMIT
;UPDATE tbl SET b = a_string(550)
;BEGIN;
CREATE TABLE t1(a, b)
;PRAGMA journal_mode = WAL;
CREATE TABLE t1(a, b);
INSERT INTO t1 VALUES('a', 'b')
;SELECT * FROM t1
;PRAGMA locking_mode=exclusive
;INSERT INTO t1 VALUES('c', 'd'); COMMIT
;PRAGMA journal_mode = PERSIST;
CREATE TABLE t1(a, b);
INSERT INTO t1 VALUES('a', 'b')
;PRAGMA journal_mode = DELETE
;PRAGMA journal_mode = PERSIST;
INSERT INTO t1 VALUES('c', 'd')
;BEGIN; INSERT INTO t1 VALUES('e', 'f')
;PRAGMA journal_mode = DELETE
;PRAGMA journal_mode = PERSIST;
INSERT INTO t1 VALUES('g', 'h')
;BEGIN; INSERT INTO t1 VALUES('e', 'f')
;PRAGMA journal_mode = DELETE
;COMMIT
;PRAGMA page_size = 1024;
PRAGMA auto_vacuum = full;
PRAGMA locking_mode=exclusive;
CREATE TABLE t1(a, b);
INSERT INTO t1 VALUES(1, 2)
;PRAGMA page_size = 4096;
VACUUM; | the_stack |
CREATE DATABASE /*!32312 IF NOT EXISTS*/`mssystemoa` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `mssystemoa`;
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for oa_chat
-- ----------------------------
DROP TABLE IF EXISTS `oa_chat`;
CREATE TABLE `oa_chat` (
`Id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`Sender` bigint(20) NOT NULL COMMENT '发送方',
`Message` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '消息',
`Receiver` bigint(20) NOT NULL COMMENT '接收方',
`CreateTime` bigint(20) NOT NULL COMMENT '创建时间',
PRIMARY KEY (`Id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of oa_chat
-- ----------------------------
INSERT INTO `oa_chat` VALUES (1, 5, '你好', 1, 1560898931);
INSERT INTO `oa_chat` VALUES (2, 1, '你好', 5, 1560898950);
-- ----------------------------
-- Table structure for oa_leave
-- ----------------------------
DROP TABLE IF EXISTS `oa_leave`;
CREATE TABLE `oa_leave` (
`Id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`LeaveCode` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '请假编号',
`Title` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '标题',
`UserId` int(11) NOT NULL COMMENT '请假人',
`AgentId` int(11) NOT NULL COMMENT '工作代理人',
`LeaveType` tinyint(4) NOT NULL COMMENT '请假类型',
`Reason` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '请假原因',
`Days` int(11) NOT NULL COMMENT '请假天数',
`StartTime` bigint(20) NOT NULL COMMENT '开始时间',
`EndTime` bigint(20) NOT NULL COMMENT '结束时间',
`CreateUserId` int(11) NOT NULL COMMENT '创建人',
`CreateTime` bigint(20) NOT NULL COMMENT '创建时间',
`FlowStatus` int(11) NULL DEFAULT -1 COMMENT '流程状态',
`FlowTime` bigint(20) NULL DEFAULT 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 oa_leave
-- ----------------------------
INSERT INTO `oa_leave` VALUES (1, '15604170854388', '想看看外面的世界', 0, 0, 0, '想看看外面的世界', 7, 1560441600, 1560960000, 1, 1560417085, 1, 1560417476);
INSERT INTO `oa_leave` VALUES (2, '15604180604164', '测试2', 0, 0, 0, '测试', 2, 1560441600, 1560528000, 1, 1560418060, 1, 1560419404);
-- ----------------------------
-- Table structure for oa_mail
-- ----------------------------
DROP TABLE IF EXISTS `oa_mail`;
CREATE TABLE `oa_mail` (
`Id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`Title` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`Content` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`SendStatus` tinyint(4) NOT NULL COMMENT '发送状态',
`Sender` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '发送人',
`SendMail` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '发送地址',
PRIMARY KEY (`Id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for oa_mail_config
-- ----------------------------
DROP TABLE IF EXISTS `oa_mail_config`;
CREATE TABLE `oa_mail_config` (
`Id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`Host` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '邮件服务地址',
`Port` int(11) NOT NULL COMMENT '端口',
`SecureSocketOptions` tinyint(4) NOT NULL DEFAULT 1 COMMENT 'Secure socket options.',
`UserName` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '账号',
`Password` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '密码',
PRIMARY KEY (`Id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '邮件服务配置' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of oa_mail_config
-- ----------------------------
INSERT INTO `oa_mail_config` VALUES (1, ' smtp.qq.com', 587, 1, '2636256005@qq.com', 'snewsyiqgyagecdd');
-- ----------------------------
-- Table structure for oa_message
-- ----------------------------
DROP TABLE IF EXISTS `oa_message`;
CREATE TABLE `oa_message` (
`Id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`MsgType` int(11) NOT NULL COMMENT '消息类型',
`FaceUserType` tinyint(4) NOT NULL COMMENT '面向人员类型',
`Title` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '标题',
`IsLocal` tinyint(4) NOT NULL COMMENT '是否是本地消息',
`TargetType` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '跳转方式',
`Link` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '链接地址',
`Content` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '消息内容',
`IsEnable` tinyint(4) NOT NULL COMMENT '是否立即生效',
`StartTime` bigint(20) NULL DEFAULT NULL COMMENT '开始时间',
`EndTime` bigint(20) NULL DEFAULT NULL COMMENT '结束时间',
`IsExecuted` tinyint(4) NOT NULL COMMENT '是否执行过',
`IsDel` tinyint(4) NOT NULL COMMENT '是否删除',
`MakerUserId` bigint(20) NULL DEFAULT NULL COMMENT '编制人ID',
`CreateUserId` bigint(20) NOT NULL COMMENT '创建人Id',
`CreateTime` bigint(20) 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 oa_message
-- ----------------------------
INSERT INTO `oa_message` VALUES (1, 1, 0, '测试', 1, 'tab', NULL, '测试', 1, 0, 0, 1, 0, 0, 1, 1555213291);
INSERT INTO `oa_message` VALUES (2, 0, 0, '测试2', 1, 'blank', NULL, NULL, 1, 0, 0, 1, 0, 0, 1, 1555315893);
-- ----------------------------
-- Table structure for oa_message_user
-- ----------------------------
DROP TABLE IF EXISTS `oa_message_user`;
CREATE TABLE `oa_message_user` (
`Id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`MessageId` bigint(20) NOT NULL COMMENT '消息ID',
`UserId` bigint(20) NOT NULL COMMENT '用户ID',
`IsRead` tinyint(4) UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否已读',
PRIMARY KEY (`Id`) USING BTREE,
INDEX `MessageId`(`MessageId`) USING BTREE,
CONSTRAINT `oa_message_user_ibfk_1` FOREIGN KEY (`MessageId`) REFERENCES `oa_message` (`Id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '消息用户关系表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for oa_work
-- ----------------------------
DROP TABLE IF EXISTS `oa_work`;
CREATE TABLE `oa_work` (
`WorkId` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`WorkType` tinyint(4) NOT NULL COMMENT '类型:1日报,2周报,3月报',
`Content` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '已完成工作',
`PlanContent` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '计划完成工作',
`NeedHelpContent` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '需要协助的工作',
`Memo` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
`IsDel` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否删除',
`ReportDate` bigint(20) NOT NULL COMMENT '汇报日期',
`CreateUserId` int(11) NOT NULL COMMENT '创建人ID',
`CreateTime` bigint(20) NOT NULL COMMENT '创建时间',
PRIMARY KEY (`WorkId`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '我的工作' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of oa_work
-- ----------------------------
INSERT INTO `oa_work` VALUES (1, 0, '123', '123', '123', NULL, 0, 0, 1, 0);
INSERT INTO `oa_work` VALUES (2, 0, NULL, NULL, NULL, NULL, 0, 0, 1, 0);
-- ----------------------------
-- Table structure for oa_work_reporter
-- ----------------------------
DROP TABLE IF EXISTS `oa_work_reporter`;
CREATE TABLE `oa_work_reporter` (
`ReportId` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`WorkId` int(11) NOT NULL COMMENT '工作id',
`Reporter` int(11) NOT NULL COMMENT '汇报人',
`ReadDate` bigint(20) NULL DEFAULT NULL COMMENT '阅读时间',
`Memo` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
PRIMARY KEY (`ReportId`) USING BTREE,
INDEX `WorkId`(`WorkId`) USING BTREE,
CONSTRAINT `oa_work_reporter_ibfk_1` FOREIGN KEY (`WorkId`) REFERENCES `oa_work` (`WorkId`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '汇总人列表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for oa_workflowsql
-- ----------------------------
DROP TABLE IF EXISTS `oa_workflowsql`;
CREATE TABLE `oa_workflowsql` (
`Name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '流程sql名称,必须是以oa_为开头,用于判断属于哪个系统,方便调用接口',
`FlowSQL` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '流程SQL,执行结果必须是一行一列',
`Param` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '参数名。以英文 , 分割',
`SQLType` tinyint(4) NOT NULL DEFAULT 0 COMMENT '类型,0:选人节点,必须返回的是用户ID,1:连线条件,条件通过返回的是一行一列的数据,不通过没有任何返回结果',
`Status` int(11) NOT NULL DEFAULT 1 COMMENT '状态',
`Remark` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
`CreateTime` bigint(20) NOT NULL COMMENT '创建时间',
`CreateUserId` bigint(20) NOT NULL COMMENT '创建人ID',
PRIMARY KEY (`Name`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用于工作流获取权限系统数据' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of oa_workflowsql
-- ----------------------------
INSERT INTO `oa_workflowsql` VALUES ('oa_leaveLessThenThreeDays', 'SELECT ol.`Id` FROM `oa_leave` ol WHERE ol.`Days`<=3 AND ol.`CreateUserId`=@userid AND ol.`Id`=@formid', 'userid,formid', 1, 1, '请假时间小于等于三天判断', 1, 1);
INSERT INTO `oa_workflowsql` VALUES ('oa_leaveMoreThenThreeDays', 'SELECT ol.`Id` FROM `oa_leave` ol WHERE ol.`Days` > 3 AND ol.`CreateUserId`=@userid AND ol.`Id`=@formid', 'userid,formid', 1, 1, '请假时间大于三天判断', 1, 1);
-- ----------------------------
-- Table structure for sys_user
-- ----------------------------
DROP TABLE IF EXISTS `sys_user`;
CREATE TABLE `sys_user` (
`UserId` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`Account` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '登录账号',
`UserName` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '用户名',
`JobNumber` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工号',
`Password` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '密码',
`HeadImg` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '头像地址',
`IsDel` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否删除 1:是,0:否',
`CreateUserId` bigint(20) NOT NULL COMMENT '创建人ID',
`CreateTime` bigint(20) NOT NULL COMMENT '创建时间',
`UpdateUserId` bigint(20) NULL DEFAULT NULL COMMENT '更新人',
`UpdateTime` bigint(20) NULL DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`UserId`) USING BTREE,
INDEX `Account`(`Account`) USING BTREE,
INDEX `JobNumber`(`JobNumber`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 22 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户表(作用于全部系统)' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of sys_user
-- ----------------------------
INSERT INTO `sys_user` VALUES (1, 'wms', 'wms', '20180101', '40BD001563085FC35165329EA1FF5C5ECBDBBEEF', '/uploadfile/342bd59b-edf4-48cf-aa27-d13e5a0b70df.jpeg', 0, 1, 12, 1, 1542809506);
INSERT INTO `sys_user` VALUES (4, 'wangwu', '王五123', '20180102', '40BD001563085FC35165329EA1FF5C5ECBDBBEEF', '/uploadfile/342bd59b-edf4-48cf-aa27-d13e5a0b70df.jpeg', 0, 0, 1498571322, 1, 1560497334);
INSERT INTO `sys_user` VALUES (5, 'zhangsan', '张三', '20180103', '40BD001563085FC35165329EA1FF5C5ECBDBBEEF', '/uploadfile/1ca449c6-24ed-4b78-a032-6005990ff707.jpeg', 0, 0, 1499750510, 1, 1538660578);
INSERT INTO `sys_user` VALUES (6, 'lisi', '李四aa', '20180104', '40BD001563085FC35165329EA1FF5C5ECBDBBEEF', '/uploadfile/342bd59b-edf4-48cf-aa27-d13e5a0b70df.jpeg', 0, 0, 1499750523, NULL, NULL);
INSERT INTO `sys_user` VALUES (7, '123', '123', '20180105', '40BD001563085FC35165329EA1FF5C5ECBDBBEEF', '/uploadfile/342bd59b-edf4-48cf-aa27-d13e5a0b70df.jpeg', 0, 0, 1499750534, 1, 1557909906);
INSERT INTO `sys_user` VALUES (8, '321', '321', '20180106', '40BD001563085FC35165329EA1FF5C5ECBDBBEEF', '/uploadfile/342bd59b-edf4-48cf-aa27-d13e5a0b70df.jpeg', 1, 0, 1499750544, NULL, NULL);
INSERT INTO `sys_user` VALUES (9, '1234', '1234', '20180107', '40BD001563085FC35165329EA1FF5C5ECBDBBEEF', '/uploadfile/342bd59b-edf4-48cf-aa27-d13e5a0b70df.jpeg', 1, 0, 1499750555, NULL, NULL);
INSERT INTO `sys_user` VALUES (10, '1234', '1234', '20180108', '40BD001563085FC35165329EA1FF5C5ECBDBBEEF', '/uploadfile/342bd59b-edf4-48cf-aa27-d13e5a0b70df.jpeg', 1, 0, 1499750555, NULL, NULL);
INSERT INTO `sys_user` VALUES (11, 'asd', 'asd', '20180109', '40BD001563085FC35165329EA1FF5C5ECBDBBEEF', '/uploadfile/342bd59b-edf4-48cf-aa27-d13e5a0b70df.jpeg', 1, 0, 1499750583, NULL, NULL);
INSERT INTO `sys_user` VALUES (12, 'asd', 'asd', '20180110', '40BD001563085FC35165329EA1FF5C5ECBDBBEEF', '/uploadfile/342bd59b-edf4-48cf-aa27-d13e5a0b70df.jpeg', 1, 0, 1499750584, NULL, NULL);
INSERT INTO `sys_user` VALUES (13, 'aaa', 'aaa', '20180111', '40BD001563085FC35165329EA1FF5C5ECBDBBEEF', '/uploadfile/342bd59b-edf4-48cf-aa27-d13e5a0b70df.jpeg', 1, 0, 1499750592, NULL, NULL);
INSERT INTO `sys_user` VALUES (14, 'aaa', 'aaa', '20180112', '40BD001563085FC35165329EA1FF5C5ECBDBBEEF', '/uploadfile/342bd59b-edf4-48cf-aa27-d13e5a0b70df.jpeg', 1, 0, 1499750592, NULL, NULL);
INSERT INTO `sys_user` VALUES (15, 'bbb', 'bbb', '20180113', '40BD001563085FC35165329EA1FF5C5ECBDBBEEF', '/uploadfile/342bd59b-edf4-48cf-aa27-d13e5a0b70df.jpeg', 1, 0, 1501310757, NULL, NULL);
INSERT INTO `sys_user` VALUES (16, 'ccc', 'ccc', '20180114', '40BD001563085FC35165329EA1FF5C5ECBDBBEEF', '/uploadfile/342bd59b-edf4-48cf-aa27-d13e5a0b70df.jpeg', 1, 0, 1501310765, NULL, NULL);
INSERT INTO `sys_user` VALUES (17, 'ddd', 'ddd', '20180115', '40BD001563085FC35165329EA1FF5C5ECBDBBEEF', '/uploadfile/342bd59b-edf4-48cf-aa27-d13e5a0b70df.jpeg', 1, 0, 1501310778, NULL, NULL);
INSERT INTO `sys_user` VALUES (18, 'eee', 'eee', '20180116', '40BD001563085FC35165329EA1FF5C5ECBDBBEEF', '/uploadfile/342bd59b-edf4-48cf-aa27-d13e5a0b70df.jpeg', 1, 0, 1501310789, NULL, NULL);
INSERT INTO `sys_user` VALUES (19, 'asd', 'asd', '20180117', '40BD001563085FC35165329EA1FF5C5ECBDBBEEF', '/uploadfile/342bd59b-edf4-48cf-aa27-d13e5a0b70df.jpeg', 1, 0, 1509869141, NULL, NULL);
INSERT INTO `sys_user` VALUES (20, '123', '123', '2018102098', 'A93C168323147D1135503939396CAC628DC194C5', '/uploadfile/342bd59b-edf4-48cf-aa27-d13e5a0b70df.jpeg', 1, 0, 1539993966, NULL, NULL);
INSERT INTO `sys_user` VALUES (21, 'cs', 'cs', '2019041302', '40BD001563085FC35165329EA1FF5C5ECBDBBEEF', '/uploadfile/342bd59b-edf4-48cf-aa27-d13e5a0b70df.jpeg', 1, 0, 1555123202, NULL, NULL);
SET FOREIGN_KEY_CHECKS = 1; | the_stack |
-- Copyright (c) Microsoft Corporation. All rights reserved.
USE [master]
GO
IF EXISTS (SELECT name FROM sys.databases WHERE name = N'InstanceStore')
DROP DATABASE [InstanceStore]
GO
CREATE DATABASE [InstanceStore]
GO
GO
IF EXISTS (SELECT name FROM sys.databases WHERE name = N'ContosoHR2')
DROP DATABASE [ContosoHR]
GO
CREATE DATABASE [ContosoHR]
GO
USE [ContosoHR]
GO
/****** Object: StoredProcedure [dbo].[InsertInEmployeeInbox] Script Date: 11/12/2009 16:17:39 ******/
DROP PROCEDURE [dbo].[InsertInEmployeeInbox]
GO
/****** Object: StoredProcedure [dbo].[InsertJobPostingResumee] Script Date: 11/12/2009 16:17:39 ******/
DROP PROCEDURE [dbo].[InsertJobPostingResumee]
GO
/****** Object: StoredProcedure [dbo].[InsertResumee] Script Date: 11/12/2009 16:17:39 ******/
DROP PROCEDURE [dbo].[InsertResumee]
GO
/****** Object: StoredProcedure [dbo].[ArchiveInboxRequest] Script Date: 11/12/2009 16:17:39 ******/
DROP PROCEDURE [dbo].[ArchiveInboxRequest]
GO
/****** Object: StoredProcedure [dbo].[CleanData] Script Date: 11/12/2009 16:17:39 ******/
DROP PROCEDURE [dbo].[CleanData]
GO
/****** Object: StoredProcedure [dbo].[SaveHiringRequest] Script Date: 11/12/2009 16:17:39 ******/
DROP PROCEDURE [dbo].[SaveHiringRequest]
GO
/****** Object: StoredProcedure [dbo].[SaveJobPosting] Script Date: 11/12/2009 16:17:39 ******/
DROP PROCEDURE [dbo].[SaveJobPosting]
GO
/****** Object: StoredProcedure [dbo].[SaveRequestHistory] Script Date: 11/12/2009 16:17:39 ******/
DROP PROCEDURE [dbo].[SaveRequestHistory]
GO
/****** Object: StoredProcedure [dbo].[SelectActiveJobPostings] Script Date: 11/12/2009 16:17:39 ******/
DROP PROCEDURE [dbo].[SelectActiveJobPostings]
GO
/****** Object: StoredProcedure [dbo].[SelectArchivedRequestsStartedBy] Script Date: 11/12/2009 16:17:39 ******/
DROP PROCEDURE [dbo].[SelectArchivedRequestsStartedBy]
GO
/****** Object: StoredProcedure [dbo].[SelectClosedJobPostings] Script Date: 11/12/2009 16:17:39 ******/
DROP PROCEDURE [dbo].[SelectClosedJobPostings]
GO
/****** Object: StoredProcedure [dbo].[SelectHiringRequest] Script Date: 11/12/2009 16:17:39 ******/
DROP PROCEDURE [dbo].[SelectHiringRequest]
GO
/****** Object: StoredProcedure [dbo].[SelectHiringRequestHistory] Script Date: 11/12/2009 16:17:39 ******/
DROP PROCEDURE [dbo].[SelectHiringRequestHistory]
GO
/****** Object: StoredProcedure [dbo].[SelectJobPosting] Script Date: 11/12/2009 16:17:39 ******/
DROP PROCEDURE [dbo].[SelectJobPosting]
GO
/****** Object: StoredProcedure [dbo].[SelectJobPostingResumees] Script Date: 11/12/2009 16:17:39 ******/
DROP PROCEDURE [dbo].[SelectJobPostingResumees]
GO
/****** Object: StoredProcedure [dbo].[SelectNotStartedJobPostings] Script Date: 11/12/2009 16:17:39 ******/
DROP PROCEDURE [dbo].[SelectNotStartedJobPostings]
GO
/****** Object: StoredProcedure [dbo].[SelectRequestsFor] Script Date: 11/12/2009 16:17:39 ******/
DROP PROCEDURE [dbo].[SelectRequestsFor]
GO
/****** Object: StoredProcedure [dbo].[SelectRequestsStartedBy] Script Date: 11/12/2009 16:17:39 ******/
DROP PROCEDURE [dbo].[SelectRequestsStartedBy]
GO
/****** Object: StoredProcedure [dbo].[UpdateResumeesCountInJobPosting] Script Date: 11/12/2009 16:17:39 ******/
DROP PROCEDURE [dbo].[UpdateResumeesCountInJobPosting]
GO
/****** Object: StoredProcedure [dbo].[RemoveFromEmployeeInbox] Script Date: 11/12/2009 16:17:39 ******/
DROP PROCEDURE [dbo].[RemoveFromEmployeeInbox]
GO
/****** Object: StoredProcedure [dbo].[RemoveFromInbox] Script Date: 11/12/2009 16:17:39 ******/
DROP PROCEDURE [dbo].[RemoveFromInbox]
GO
/****** Object: Table [dbo].[RequestHistory] Script Date: 11/12/2009 16:17:42 ******/
DROP TABLE [dbo].[RequestHistory]
GO
/****** Object: Table [dbo].[Departments] Script Date: 11/12/2009 16:17:41 ******/
DROP TABLE [dbo].[Departments]
GO
/****** Object: Table [dbo].[Employees] Script Date: 11/12/2009 16:17:42 ******/
DROP TABLE [dbo].[Employees]
GO
/****** Object: Table [dbo].[HiringRequests] Script Date: 11/12/2009 16:17:42 ******/
ALTER TABLE [dbo].[HiringRequests] DROP CONSTRAINT [DF_HiringRequests_IsCompleted]
GO
ALTER TABLE [dbo].[HiringRequests] DROP CONSTRAINT [DF_HiringRequests_IsSuccess]
GO
ALTER TABLE [dbo].[HiringRequests] DROP CONSTRAINT [DF_HiringRequests_IsCancelled]
GO
DROP TABLE [dbo].[HiringRequests]
GO
/****** Object: Table [dbo].[InboxItems] Script Date: 11/12/2009 16:17:42 ******/
DROP TABLE [dbo].[InboxItems]
GO
/****** Object: Table [dbo].[InboxItemsArchive] Script Date: 11/12/2009 16:17:42 ******/
DROP TABLE [dbo].[InboxItemsArchive]
GO
/****** Object: Table [dbo].[InboxItemsByEmployee] Script Date: 11/12/2009 16:17:42 ******/
DROP TABLE [dbo].[InboxItemsByEmployee]
GO
/****** Object: Table [dbo].[JobPostingResumees] Script Date: 11/12/2009 16:17:42 ******/
DROP TABLE [dbo].[JobPostingResumees]
GO
/****** Object: Table [dbo].[JobPostings] Script Date: 11/12/2009 16:17:42 ******/
ALTER TABLE [dbo].[JobPostings] DROP CONSTRAINT [DF_JobPosting_CreationDate]
GO
DROP TABLE [dbo].[JobPostings]
GO
/****** Object: Table [dbo].[Positions] Script Date: 11/12/2009 16:17:42 ******/
DROP TABLE [dbo].[Positions]
GO
/****** Object: Table [dbo].[PositionTypes] Script Date: 11/12/2009 16:17:42 ******/
DROP TABLE [dbo].[PositionTypes]
GO
/****** Object: Table [dbo].[PositionTypes] Script Date: 11/12/2009 16:17:42 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[PositionTypes](
[Id] [char](8) NOT NULL,
[Name] [varchar](128) NOT NULL,
CONSTRAINT [PK_PositionTypes] PRIMARY KEY CLUSTERED
(
[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
INSERT [dbo].[PositionTypes] ([Id], [Name]) VALUES (N'CEO', N'CEO')
INSERT [dbo].[PositionTypes] ([Id], [Name]) VALUES (N'DIR', N'Director')
INSERT [dbo].[PositionTypes] ([Id], [Name]) VALUES (N'IC', N'Individual Contributor')
INSERT [dbo].[PositionTypes] ([Id], [Name]) VALUES (N'MGR', N'Manager')
/****** Object: Table [dbo].[Positions] Script Date: 11/12/2009 16:17:42 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Positions](
[Id] [char](8) NOT NULL,
[Name] [nvarchar](128) NOT NULL,
[PositionType] [char](8) NOT NULL,
CONSTRAINT [PK_Positions] PRIMARY KEY CLUSTERED
(
[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
INSERT [dbo].[Positions] ([Id], [Name], [PositionType]) VALUES (N'AN', N'System Analyst', N'IC')
INSERT [dbo].[Positions] ([Id], [Name], [PositionType]) VALUES (N'ASSIST', N'Assistant', N'IC')
INSERT [dbo].[Positions] ([Id], [Name], [PositionType]) VALUES (N'CEO', N'CEO', N'CEO')
INSERT [dbo].[Positions] ([Id], [Name], [PositionType]) VALUES (N'DEVMGR', N'Development Manager', N'MGR')
INSERT [dbo].[Positions] ([Id], [Name], [PositionType]) VALUES (N'HRAN', N'HR Analyst', N'IC')
INSERT [dbo].[Positions] ([Id], [Name], [PositionType]) VALUES (N'HRDIR', N'HR Director', N'DIR')
INSERT [dbo].[Positions] ([Id], [Name], [PositionType]) VALUES (N'HRMGR', N'HR Manager', N'MGR')
INSERT [dbo].[Positions] ([Id], [Name], [PositionType]) VALUES (N'HRT', N'HR Technician', N'IC')
INSERT [dbo].[Positions] ([Id], [Name], [PositionType]) VALUES (N'ITDIR', N'Director', N'DIR')
INSERT [dbo].[Positions] ([Id], [Name], [PositionType]) VALUES (N'MKTAN', N'Marketing Analyst', N'IC')
INSERT [dbo].[Positions] ([Id], [Name], [PositionType]) VALUES (N'MKTDIR', N'Marketing Director', N'DIR')
INSERT [dbo].[Positions] ([Id], [Name], [PositionType]) VALUES (N'MKTECH', N'Marketing Technician', N'IC')
INSERT [dbo].[Positions] ([Id], [Name], [PositionType]) VALUES (N'MKTMGR', N'Marketing Manager', N'MGR')
INSERT [dbo].[Positions] ([Id], [Name], [PositionType]) VALUES (N'REC', N'Recruiter', N'IC')
INSERT [dbo].[Positions] ([Id], [Name], [PositionType]) VALUES (N'RECMGR', N'Recruiting Manager', N'MGR')
INSERT [dbo].[Positions] ([Id], [Name], [PositionType]) VALUES (N'SDE', N'Software Engineer', N'IC')
INSERT [dbo].[Positions] ([Id], [Name], [PositionType]) VALUES (N'SDET', N'Software Engineer in Test', N'IC')
INSERT [dbo].[Positions] ([Id], [Name], [PositionType]) VALUES (N'SDIR', N'Sales Director', N'DIR')
INSERT [dbo].[Positions] ([Id], [Name], [PositionType]) VALUES (N'SL', N'Salesman', N'IC')
INSERT [dbo].[Positions] ([Id], [Name], [PositionType]) VALUES (N'SMGR', N'Sales Manager', N'MGR')
INSERT [dbo].[Positions] ([Id], [Name], [PositionType]) VALUES (N'SRSL', N'Senior Salesman', N'IC')
/****** Object: Table [dbo].[JobPostings] Script Date: 11/12/2009 16:17:42 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[JobPostings](
[Id] [uniqueidentifier] NOT NULL,
[HiringRequestId] [uniqueidentifier] NULL,
[Title] [varchar](1024) NULL,
[Description] [text] NULL,
[ResumeesReceived] [int] NULL,
[Status] [varchar](64) NULL,
[CreationDate] [datetime] NULL CONSTRAINT [DF_JobPosting_CreationDate] DEFAULT (getdate()),
[LastUpdate] [datetime] NULL,
[LastResumeeDate] [datetime] NULL,
CONSTRAINT [PK_JobPosting] PRIMARY KEY CLUSTERED
(
[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object: Table [dbo].[JobPostingResumees] Script Date: 11/12/2009 16:17:42 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[JobPostingResumees](
[JobPostingId] [uniqueidentifier] NOT NULL,
[CandidateMail] [varchar](512) NOT NULL,
[CandidateName] [varchar](512) NULL,
[Resumee] [text] NULL,
[ReceivedDate] [datetime] NULL,
CONSTRAINT [PK_JobPostingResumees] PRIMARY KEY CLUSTERED
(
[JobPostingId] ASC,
[CandidateMail] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object: Table [dbo].[InboxItemsByEmployee] Script Date: 11/12/2009 16:17:42 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[InboxItemsByEmployee](
[RequestId] [uniqueidentifier] NOT NULL,
[EmployeeId] [int] NOT NULL
) ON [PRIMARY]
GO
/****** Object: Table [dbo].[InboxItemsArchive] Script Date: 11/12/2009 16:17:42 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[InboxItemsArchive](
[RequestId] [uniqueidentifier] NOT NULL,
[StartedBy] [int] NOT NULL,
[Title] [varchar](1024) NOT NULL,
[State] [varchar](512) NOT NULL,
[InboxEntryDate] [datetime] NOT NULL,
[ArchivalDate] [datetime] NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object: Table [dbo].[InboxItems] Script Date: 11/12/2009 16:17:42 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[InboxItems](
[RequestId] [uniqueidentifier] NOT NULL,
[StartedBy] [int] NOT NULL,
[Title] [varchar](1024) NOT NULL,
[State] [varchar](512) NOT NULL,
[InboxEntryDate] [date] NOT NULL,
CONSTRAINT [PK_InboxItems] PRIMARY KEY CLUSTERED
(
[RequestId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object: Table [dbo].[HiringRequests] Script Date: 11/12/2009 16:17:42 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[HiringRequests](
[Id] [uniqueidentifier] NOT NULL,
[RequesterId] [varchar](16) NOT NULL,
[CreationDate] [date] NOT NULL,
[PositionId] [varchar](16) NOT NULL,
[DepartmentId] [varchar](16) NOT NULL,
[Description] [varchar](1024) NULL,
[Title] [varchar](1024) NOT NULL,
[WorkflowInstanceId] [uniqueidentifier] NULL,
[IsCompleted] [bit] NULL CONSTRAINT [DF_HiringRequests_IsCompleted] DEFAULT ((0)),
[IsSuccess] [bit] NULL CONSTRAINT [DF_HiringRequests_IsSuccess] DEFAULT ((0)),
[IsCancelled] [bit] NULL CONSTRAINT [DF_HiringRequests_IsCancelled] DEFAULT ((0)),
CONSTRAINT [PK_HiringRequests] PRIMARY KEY CLUSTERED
(
[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object: Table [dbo].[Employees] Script Date: 11/12/2009 16:17:42 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Employees](
[Id] [int] NOT NULL,
[Name] [nvarchar](512) NOT NULL,
[Position] [char](8) NOT NULL,
[Department] [char](8) NOT NULL,
[ManagerId] [int] NULL,
CONSTRAINT [PK_Employees] PRIMARY KEY CLUSTERED
(
[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
INSERT [dbo].[Employees] ([Id], [Name], [Position], [Department], [ManagerId]) VALUES (1, N'Alexander, Michael', N'SDE', N'ENG', 6)
INSERT [dbo].[Employees] ([Id], [Name], [Position], [Department], [ManagerId]) VALUES (2, N'Harui, Roger', N'SDE', N'ENG', 6)
INSERT [dbo].[Employees] ([Id], [Name], [Position], [Department], [ManagerId]) VALUES (3, N'Petculescu, Cristian', N'SDET', N'ENG', 6)
INSERT [dbo].[Employees] ([Id], [Name], [Position], [Department], [ManagerId]) VALUES (4, N'Jacobs, Andy', N'SDET', N'ENG', 6)
INSERT [dbo].[Employees] ([Id], [Name], [Position], [Department], [ManagerId]) VALUES (5, N'Potra, Cristina', N'AN', N'ENG', 6)
INSERT [dbo].[Employees] ([Id], [Name], [Position], [Department], [ManagerId]) VALUES (6, N'Brehm, Peter', N'DEVMGR', N'ENG', 7)
INSERT [dbo].[Employees] ([Id], [Name], [Position], [Department], [ManagerId]) VALUES (7, N'Reiter, Tsvi', N'ITDIR', N'ENG', 25)
INSERT [dbo].[Employees] ([Id], [Name], [Position], [Department], [ManagerId]) VALUES (8, N'Poe, Toni', N'SRSL', N'SALES', 9)
INSERT [dbo].[Employees] ([Id], [Name], [Position], [Department], [ManagerId]) VALUES (9, N'Pfeiffer, Michael', N'SMGR', N'SALES', 11)
INSERT [dbo].[Employees] ([Id], [Name], [Position], [Department], [ManagerId]) VALUES (10, N'Harp, Walter', N'SMGR', N'SALES', 11)
INSERT [dbo].[Employees] ([Id], [Name], [Position], [Department], [ManagerId]) VALUES (11, N'Alverca, Luis', N'SDIR', N'SALES', 25)
INSERT [dbo].[Employees] ([Id], [Name], [Position], [Department], [ManagerId]) VALUES (12, N'Abercrombie, Kim', N'MKTAN', N'MKT', 13)
INSERT [dbo].[Employees] ([Id], [Name], [Position], [Department], [ManagerId]) VALUES (13, N'Xie, Ming-Yang', N'MKTMGR', N'MKT', 15)
INSERT [dbo].[Employees] ([Id], [Name], [Position], [Department], [ManagerId]) VALUES (14, N'Yalovsky, David', N'MKTMGR', N'MKT', 15)
INSERT [dbo].[Employees] ([Id], [Name], [Position], [Department], [ManagerId]) VALUES (15, N'Allen, Michael', N'MKTDIR', N'MKT', 25)
INSERT [dbo].[Employees] ([Id], [Name], [Position], [Department], [ManagerId]) VALUES (16, N'Gonzalez, Howard', N'REC', N'HR', 19)
INSERT [dbo].[Employees] ([Id], [Name], [Position], [Department], [ManagerId]) VALUES (17, N'Neves, Paulo', N'REC', N'HR', 19)
INSERT [dbo].[Employees] ([Id], [Name], [Position], [Department], [ManagerId]) VALUES (18, N'Williams, Jeff', N'REC', N'HR', 19)
INSERT [dbo].[Employees] ([Id], [Name], [Position], [Department], [ManagerId]) VALUES (19, N'Forde, Viggo', N'RECMGR', N'HR', 24)
INSERT [dbo].[Employees] ([Id], [Name], [Position], [Department], [ManagerId]) VALUES (20, N'Larsson, Katarina', N'HRT', N'HR', 23)
INSERT [dbo].[Employees] ([Id], [Name], [Position], [Department], [ManagerId]) VALUES (21, N'Turner, Olinda', N'HRAN', N'HR', 23)
INSERT [dbo].[Employees] ([Id], [Name], [Position], [Department], [ManagerId]) VALUES (22, N'Norred, Chris', N'HRAN', N'HR', 23)
INSERT [dbo].[Employees] ([Id], [Name], [Position], [Department], [ManagerId]) VALUES (23, N'Miller, Lisa', N'HRMGR', N'HR', 24)
INSERT [dbo].[Employees] ([Id], [Name], [Position], [Department], [ManagerId]) VALUES (24, N'Gonzalez, Nuria', N'HRDIR', N'HR', 25)
INSERT [dbo].[Employees] ([Id], [Name], [Position], [Department], [ManagerId]) VALUES (25, N'Goldstein, Brian Richard', N'CEO', N'PRES', NULL)
INSERT [dbo].[Employees] ([Id], [Name], [Position], [Department], [ManagerId]) VALUES (26, N'White, Cindy', N'ASSIST', N'PRES', 25)
INSERT [dbo].[Employees] ([Id], [Name], [Position], [Department], [ManagerId]) VALUES (27, N'Miller, Ben', N'ASSIST', N'HR', 24)
INSERT [dbo].[Employees] ([Id], [Name], [Position], [Department], [ManagerId]) VALUES (28, N'Truffat, Marcelo', N'ASSIST', N'MKT', 15)
/****** Object: Table [dbo].[Departments] Script Date: 11/12/2009 16:17:41 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Departments](
[Id] [char](8) NOT NULL,
[Name] [nvarchar](256) NOT NULL,
[Owner] [int] NOT NULL,
CONSTRAINT [PK_Departments] PRIMARY KEY CLUSTERED
(
[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
INSERT [dbo].[Departments] ([Id], [Name], [Owner]) VALUES (N'ENG', N'Engineering', 7)
INSERT [dbo].[Departments] ([Id], [Name], [Owner]) VALUES (N'HR', N'Human Resources', 25)
INSERT [dbo].[Departments] ([Id], [Name], [Owner]) VALUES (N'MKT', N'Marketing', 15)
INSERT [dbo].[Departments] ([Id], [Name], [Owner]) VALUES (N'PRES', N'Presidency', 25)
INSERT [dbo].[Departments] ([Id], [Name], [Owner]) VALUES (N'SALES', N'Sales', 11)
/****** Object: Table [dbo].[RequestHistory] Script Date: 11/12/2009 16:17:42 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[RequestHistory](
[RequestId] [uniqueidentifier] NOT NULL,
[RecordNumber] [int] NULL,
[SourceState] [varchar](256) NULL,
[Action] [varchar](256) NULL,
[Comment] [varchar](256) NULL,
[EmployeeId] [varchar](16) NULL,
[EmployeeName] [varchar](512) NULL,
[Date] [datetime] NOT NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object: StoredProcedure [dbo].[RemoveFromInbox] Script Date: 11/12/2009 16:17:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[RemoveFromInbox]
(
@requestId uniqueidentifier
)
AS
BEGIN
DELETE FROM InboxItems
WHERE RequestId = @requestId
DELETE FROM InboxItemsByEmployee
WHERE RequestId = @requestId
END
GO
/****** Object: StoredProcedure [dbo].[RemoveFromEmployeeInbox] Script Date: 11/12/2009 16:17:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[RemoveFromEmployeeInbox]
(
@requestId uniqueidentifier,
@employeeId int
)
AS
BEGIN
DELETE FROM InboxItemsByEmployee
WHERE RequestId = @requestId
AND EmployeeId = @employeeId
END
GO
/****** Object: StoredProcedure [dbo].[UpdateResumeesCountInJobPosting] Script Date: 11/12/2009 16:17:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[UpdateResumeesCountInJobPosting]
-- Add the parameters for the stored procedure here
(
@id uniqueidentifier
)
AS
BEGIN
/* SET NOCOUNT ON */
/* UPDATE IT */
UPDATE JobPostings SET
ResumeesReceived = ResumeesReceived + 1,
LastResumeeDate = GetDate()
WHERE id = @id
END
GO
/****** Object: StoredProcedure [dbo].[SelectRequestsStartedBy] Script Date: 11/12/2009 16:17:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[SelectRequestsStartedBy]
(
@employeeId int
)
AS
BEGIN
SELECT *
FROM InboxItems
WHERE StartedBy = @employeeId
ORDER BY InboxEntryDate
END
GO
/****** Object: StoredProcedure [dbo].[SelectRequestsFor] Script Date: 11/12/2009 16:17:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[SelectRequestsFor]
(
@employeeId int
)
AS
BEGIN
SELECT i.*
FROM InboxItems i, InboxItemsByEmployee ie
WHERE i.RequestId = ie.RequestId
AND ie.EmployeeId = @employeeId
ORDER BY i.InboxEntryDate
END
GO
/****** Object: StoredProcedure [dbo].[SelectNotStartedJobPostings] Script Date: 11/12/2009 16:17:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[SelectNotStartedJobPostings]
AS
BEGIN
/* SET NOCOUNT ON */
SELECT *
FROM JobPostings
WHERE Status = 'WaitingData'
ORDER BY CreationDate
END
GO
/****** Object: StoredProcedure [dbo].[SelectJobPostingResumees] Script Date: 11/12/2009 16:17:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[SelectJobPostingResumees]
(
@id uniqueidentifier
)
AS
BEGIN
/* SET NOCOUNT ON */
SELECT *
FROM JobPostings, JobPostingResumees
WHERE JobPostings.id = @id
AND JobPostings.Id = JobPostingResumees.JobPostingId
END
GO
/****** Object: StoredProcedure [dbo].[SelectJobPosting] Script Date: 11/12/2009 16:17:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[SelectJobPosting]
(
@id uniqueidentifier
)
AS
BEGIN
/* SET NOCOUNT ON */
SELECT *
FROM JobPostings
WHERE id = @id
END
GO
/****** Object: StoredProcedure [dbo].[SelectHiringRequestHistory] Script Date: 11/12/2009 16:17:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[SelectHiringRequestHistory]
(
@id uniqueidentifier
)
AS
BEGIN
/* SET NOCOUNT ON */
SELECT *
FROM RequestHistory
WHERE RequestId = @id
ORDER BY [Date]
END
GO
/****** Object: StoredProcedure [dbo].[SelectHiringRequest] Script Date: 11/12/2009 16:17:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[SelectHiringRequest]
(
@id uniqueidentifier
)
AS
BEGIN
/* SET NOCOUNT ON */
SELECT *
FROM HiringRequests
WHERE id = @id
END
GO
/****** Object: StoredProcedure [dbo].[SelectClosedJobPostings] Script Date: 11/12/2009 16:17:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[SelectClosedJobPostings]
AS
SELECT *
FROM JobPostings
WHERE Status = 'Closed'
GO
/****** Object: StoredProcedure [dbo].[SelectArchivedRequestsStartedBy] Script Date: 11/12/2009 16:17:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[SelectArchivedRequestsStartedBy]
(
@employeeId int
)
AS
BEGIN
SELECT *
FROM InboxItemsArchive
WHERE StartedBy = @employeeId
ORDER BY InboxEntryDate
END
GO
/****** Object: StoredProcedure [dbo].[SelectActiveJobPostings] Script Date: 11/12/2009 16:17:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[SelectActiveJobPostings]
AS
BEGIN
/* SET NOCOUNT ON */
SELECT *
FROM JobPostings
WHERE Status = 'Receiving Resumes'
END
GO
/****** Object: StoredProcedure [dbo].[SaveRequestHistory] Script Date: 11/12/2009 16:17:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[SaveRequestHistory]
(
@requestId uniqueidentifier,
@sourceState varchar(256),
@actionName varchar(256),
@comment varchar(256),
@employeeId varchar(16),
@employeeName varchar(512)
)
AS
BEGIN
/* SET NOCOUNT ON */
INSERT INTO RequestHistory (RequestId, SourceState, [action], comment, employeeId, employeeName, [date])
VALUES (@requestId, @sourceState, @actionName, @comment, @employeeId, @employeeName, GETDATE())
END
GO
/****** Object: StoredProcedure [dbo].[SaveJobPosting] Script Date: 11/12/2009 16:17:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[SaveJobPosting]
(
@id uniqueidentifier,
@hiringRequestId uniqueidentifier,
@title varchar(1024),
@description text,
@status varchar(64)
)
AS
BEGIN
/* SET NOCOUNT ON */
/* if the HiringRequest exists... */
IF exists(SELECT *
FROM JobPostings
WHERE id = @id)
/* UPDATE IT */
UPDATE JobPostings SET
Title = @title,
Description = @description,
Status = @status,
LastUpdate = GetDate()
WHERE id = @id
ELSE /* if it does not exist, insert it */
INSERT INTO JobPostings (Id, HiringRequestId, Title, Description, CreationDate, LastUpdate, ResumeesReceived, Status)
VALUES (@id, @hiringRequestId, @title, @description, GetDate(), GetDate(), 0, @status)
END
GO
/****** Object: StoredProcedure [dbo].[SaveHiringRequest] Script Date: 11/12/2009 16:17:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[SaveHiringRequest]
(
@id uniqueidentifier,
@requesterId int,
@creationDate datetime,
@positionId varchar(16),
@departmentId varchar(16),
@description varchar(1024),
@title varchar(1024),
@workflowInstanceId uniqueidentifier,
@isCompleted bit,
@isSuccess bit,
@isCancelled bit
)
AS
BEGIN
/* SET NOCOUNT ON */
/* if the HiringRequest exists... */
IF exists(SELECT *
FROM HiringRequests
WHERE id = @id)
/* UPDATE IT */
UPDATE HiringRequests SET
PositionId = @positionId,
DepartmentId = @departmentId,
Description = @description,
Title = @title,
WorkflowInstanceId = @workflowInstanceId,
IsCompleted = @isCompleted,
IsSuccess = @isSuccess,
IsCancelled = @isCancelled
WHERE id = @id
ELSE /* if it does not exist, insert it */
INSERT INTO HiringRequests (Id, RequesterId, CreationDate, PositionId, DepartmentId, Description, Title, WorkflowInstanceId, IsCompleted, IsSuccess, IsCancelled)
VALUES (@id, @requesterId, @creationDate, @positionId, @departmentId, @description, @title, @workflowInstanceId, @isCompleted, @isSuccess, @isCancelled)
END
GO
/****** Object: StoredProcedure [dbo].[CleanData] Script Date: 11/12/2009 16:17:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[CleanData]
AS
BEGIN
DELETE FROM InboxItemsByEmployee
DELETE FROM InboxItemsArchive
DELETE FROM InboxItems
DELETE FROM RequestHistory
DELETE FROM HiringRequests
END
GO
/****** Object: StoredProcedure [dbo].[ArchiveInboxRequest] Script Date: 11/12/2009 16:17:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ArchiveInboxRequest]
(
@requestId uniqueidentifier,
@state varchar(512)
)
AS
BEGIN
INSERT INTO InboxItemsArchive (RequestId, StartedBy, Title, State, InboxEntryDate, ArchivalDate)
SELECT i.RequestId, i.StartedBy, i.Title, @state, i.InboxEntryDate, GETDATE()
FROM InboxItems i
WHERE i.RequestId = @requestId
DELETE FROM InboxItems
WHERE RequestId = @requestId
DELETE FROM InboxItemsByEmployee
WHERE RequestId = @requestId
END
GO
/****** Object: StoredProcedure [dbo].[InsertResumee] Script Date: 11/12/2009 16:17:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[InsertResumee]
(
@id uniqueidentifier,
@candidateMail varchar(512),
@candidateName varchar(512),
@resumee text
)
AS
BEGIN
/* SET NOCOUNT ON */
INSERT INTO JobPostingResumees (JobPostingId, CandidateMail, CandidateName, Resumee, ReceivedDate)
VALUES (@id, @candidateMail, @candidateName, @resumee, GetDate())
END
GO
/****** Object: StoredProcedure [dbo].[InsertJobPostingResumee] Script Date: 11/12/2009 16:17:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[InsertJobPostingResumee]
(
@jobPostingId uniqueidentifier,
@candidateMail varchar(512),
@candidateName varchar(512),
@resumee text
)
AS
BEGIN
INSERT INTO JobPostingResumees (JobPostingId, CandidateMail, CandidateName, ReceivedDate, Resumee)
VALUES (@jobPostingId, @candidateMail, @candidateName, GETDATE(), @resumee)
END
GO
/****** Object: StoredProcedure [dbo].[InsertInEmployeeInbox] Script Date: 11/12/2009 16:17:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[InsertInEmployeeInbox]
(
@requestId uniqueidentifier,
@startedBy int,
@title varchar(1024),
@state varchar(512),
@employeeId int
)
AS
BEGIN
IF NOT exists(SELECT *
FROM InboxItems
WHERE RequestId = @requestId
AND State = @state)
BEGIN
EXEC RemoveFromInbox @requestId
INSERT INTO InboxItems (RequestId, StartedBy, Title, State, InboxEntryDate)
VALUES (@requestId, @startedBy, @title, @state, GETDATE())
END
INSERT INTO InboxItemsByEmployee (RequestId, EmployeeId)
VALUES (@requestId, @employeeId)
END
GO | the_stack |
-- 2017-11-22T16:05:26.690
-- 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,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,543480,0,'Name3',TO_TIMESTAMP('2017-11-22 16:05:26','YYYY-MM-DD HH24:MI:SS'),100,'Zusätzliche Bezeichnung','D','Y','Name3','Zusätzlicher Name',TO_TIMESTAMP('2017-11-22 16:05:26','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-11-22T16:05:26.727
-- 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=543480 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)
;
-- 2017-11-22T16:05:46.145
-- 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,Description,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,SelectionColumnSeqNo,Updated,UpdatedBy,Version) VALUES (0,557877,543480,0,10,291,'N','Name3',TO_TIMESTAMP('2017-11-22 16:05:45','YYYY-MM-DD HH24:MI:SS'),100,'N','Zusätzliche Bezeichnung','D',60,'Y','N','Y','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','Y','N','Y','N','Name3',0,TO_TIMESTAMP('2017-11-22 16:05:45','YYYY-MM-DD HH24:MI:SS'),100,1)
;
-- 2017-11-22T16:05:46.148
-- 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=557877 AND NOT EXISTS (SELECT 1 FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 2017-11-22T16:06:30.409
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ SELECT public.db_alter_table('C_BPartner','ALTER TABLE public.C_BPartner ADD COLUMN Name3 VARCHAR(60)')
;
-- 2017-11-22T16:08:34.195
-- 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,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,543482,0,'isSEPASigned',TO_TIMESTAMP('2017-11-22 16:08:34','YYYY-MM-DD HH24:MI:SS'),100,'','D','Y','SEPA Signed','Sepa Unterzeichnung ',TO_TIMESTAMP('2017-11-22 16:08:34','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-11-22T16:08:34.199
-- 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=543482 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)
;
-- 2017-11-22T16:08:50.961
-- 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,Description,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,SelectionColumnSeqNo,Updated,UpdatedBy,Version) VALUES (0,557879,543482,0,20,291,'N','isSEPASigned',TO_TIMESTAMP('2017-11-22 16:08:50','YYYY-MM-DD HH24:MI:SS'),100,'N','N','','D',1,'Y','N','Y','N','N','N','N','N','N','N','N','N','N','N','Y','N','N','N','Y','N','Y','N','SEPA Signed',0,TO_TIMESTAMP('2017-11-22 16:08:50','YYYY-MM-DD HH24:MI:SS'),100,1)
;
-- 2017-11-22T16:08:50.964
-- 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=557879 AND NOT EXISTS (SELECT 1 FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 2017-11-22T16:08:52.983
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ SELECT public.db_alter_table('C_BPartner','ALTER TABLE public.C_BPartner ADD COLUMN isSEPASigned CHAR(1) DEFAULT ''N'' CHECK (isSEPASigned IN (''Y'',''N'')) NOT NULL')
;
-- 2017-11-22T16:10:09.294
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element SET ColumnName='IsSEPASigned',Updated=TO_TIMESTAMP('2017-11-22 16:10:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=543482
;
-- 2017-11-22T16:10:09.295
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName='IsSEPASigned', Name='SEPA Signed', Description='', Help=NULL WHERE AD_Element_ID=543482
;
-- 2017-11-22T16:10:09.306
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='IsSEPASigned', Name='SEPA Signed', Description='', Help=NULL, AD_Element_ID=543482 WHERE UPPER(ColumnName)='ISSEPASIGNED' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2017-11-22T16:10:09.308
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='IsSEPASigned', Name='SEPA Signed', Description='', Help=NULL WHERE AD_Element_ID=543482 AND IsCentrallyMaintained='Y'
;
-- 2017-11-22T16:10:22.713
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO t_alter_column values('c_bpartner','IsSEPASigned','CHAR(1)',null,'N')
;
-- 2017-11-22T16:10:23.834
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE C_BPartner SET IsSEPASigned='N' WHERE IsSEPASigned IS NULL
;
-- 2017-11-22T16:20:55.237
-- 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,IsCentrallyMaintained,IsDisplayed,IsDisplayedGrid,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SeqNoGrid,SortNo,SpanX,SpanY,Updated,UpdatedBy) VALUES (0,557877,560559,0,220,0,TO_TIMESTAMP('2017-11-22 16:20:55','YYYY-MM-DD HH24:MI:SS'),100,'Zusätzliche Bezeichnung',0,'D',0,'Y','Y','Y','Y','N','N','N','N','N','Name3',260,290,0,1,1,TO_TIMESTAMP('2017-11-22 16:20:55','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-11-22T16:20:55.239
-- 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=560559 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)
;
-- 2017-11-22T16:21:22.625
-- 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,IsCentrallyMaintained,IsDisplayed,IsDisplayedGrid,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SeqNoGrid,SortNo,SpanX,SpanY,Updated,UpdatedBy) VALUES (0,557879,560561,0,220,0,TO_TIMESTAMP('2017-11-22 16:21:22','YYYY-MM-DD HH24:MI:SS'),100,'',0,'D',0,'Y','Y','Y','Y','N','N','N','N','N','SEPA Signed',280,310,0,1,1,TO_TIMESTAMP('2017-11-22 16:21:22','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-11-22T16:21:22.628
-- 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=560561 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)
;
-- 2017-11-22T16:33:32.094
-- 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_Element_ID,AD_UI_ElementGroup_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayed_SideList,IsDisplayedGrid,Name,SeqNo,SeqNo_SideList,SeqNoGrid,Updated,UpdatedBy) VALUES (0,560559,0,220,549287,540671,'F',TO_TIMESTAMP('2017-11-22 16:33:31','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Name3',50,0,0,TO_TIMESTAMP('2017-11-22 16:33:31','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-11-22T16:35:26.541
-- 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_Element_ID,AD_UI_ElementGroup_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayed_SideList,IsDisplayedGrid,Name,SeqNo,SeqNo_SideList,SeqNoGrid,Updated,UpdatedBy) VALUES (0,560561,0,220,549290,540671,'F',TO_TIMESTAMP('2017-11-22 16:35:26','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Sepa Unterzeichnung ',80,0,0,TO_TIMESTAMP('2017-11-22 16:35:26','YYYY-MM-DD HH24:MI:SS'),100)
; | the_stack |
set enable_default_ustore_table = on;
create schema test_unione_insert_select_single_col;
set current_schema='test_unione_insert_select_single_col';
-- create type
create type composite_type as (c1 int, c2 boolean);
create type composite_type_complex as (col_int integer, col_decimal decimal, col_bool boolean, col_money money, col_text text, col_date date, col_geo point, col_net cidr, col_circle circle);
-- create tables
create table name (c1 name) with (storage_type=USTORE);
create table blob (c1 blob) with (storage_type=USTORE);
create table macaddr (c1 macaddr) with (storage_type=USTORE);
create table uuid (c1 uuid) with (storage_type=USTORE);
create table box (c1 box) with (storage_type=USTORE);
create table raw_table (c1 raw) with (storage_type=USTORE);
create table point (c1 point) with (storage_type=USTORE);
create table lseg (c1 lseg) with (storage_type=USTORE);
create table polygon (c1 polygon) with (storage_type=USTORE);
create table path (c1 path) with (storage_type=USTORE);
create table circle (c1 circle) with (storage_type=USTORE);
create table tsvector (c1 tsvector) with (storage_type=USTORE);
create table tsquery (c1 tsquery) with (storage_type=USTORE);
create table intvector (c1 int[][]) with (storage_type=USTORE);
create table intarray (c1 int[]) with (storage_type=USTORE);
create table composite (c1 composite_type) with (storage_type=USTORE);
create table composite_complex (c1 composite_type_complex) with (storage_type=USTORE);
create table i_name (c1 name) with (storage_type=USTORE);
create table i_blob (c1 blob) with (storage_type=USTORE);
create table i_macaddr (c1 macaddr) with (storage_type=USTORE);
create table i_uuid (c1 uuid) with (storage_type=USTORE);
create table i_box (c1 box) with (storage_type=USTORE);
create table i_raw_table (c1 raw) with (storage_type=USTORE);
create table i_point (c1 point) with (storage_type=USTORE);
create table i_lseg (c1 lseg) with (storage_type=USTORE);
create table i_polygon (c1 polygon) with (storage_type=USTORE);
create table i_path (c1 path) with (storage_type=USTORE);
create table i_circle (c1 circle) with (storage_type=USTORE);
create table i_tsvector (c1 tsvector) with (storage_type=USTORE);
create table i_tsquery (c1 tsquery) with (storage_type=USTORE);
create table i_intvector (c1 int[][]) with (storage_type=USTORE);
create table i_intarray (c1 int[]) with (storage_type=USTORE);
create table i_composite (c1 composite_type) with (storage_type=USTORE);
create table i_composite_complex (c1 composite_type_complex) with (storage_type=USTORE);
-- create tables for data verification
create table v_name (c1 name) with (orientation=row);
create table v_blob (c1 blob) with (orientation=row);
create table v_macaddr (c1 macaddr) with (orientation=row);
create table v_uuid (c1 uuid) with (orientation=row);
create table v_box (c1 box) with (orientation=row);
create table v_raw (c1 raw) with (orientation=row);
create table v_point (c1 point) with (orientation=row);
create table v_lseg (c1 lseg) with (orientation=row);
create table v_polygon (c1 polygon) with (orientation=row);
create table v_path (c1 path) with (orientation=row);
create table v_circle (c1 circle) with (orientation=row);
create table v_tsvector (c1 tsvector) with (orientation=row);
create table v_tsquery (c1 tsquery) with (orientation=row);
create table v_intvector (c1 int[][]) with (orientation=row);
create table v_intarray (c1 int[]) with (orientation=row);
create table v_composite (c1 composite_type) with (orientation=row);
create table v_composite_complex (c1 composite_type_complex) with (orientation=row);
create table i_v_name (c1 name) with (orientation=row);
create table i_v_blob (c1 blob) with (orientation=row);
create table i_v_macaddr (c1 macaddr) with (orientation=row);
create table i_v_uuid (c1 uuid) with (orientation=row);
create table i_v_box (c1 box) with (orientation=row);
create table i_v_raw (c1 raw) with (orientation=row);
create table i_v_point (c1 point) with (orientation=row);
create table i_v_lseg (c1 lseg) with (orientation=row);
create table i_v_polygon (c1 polygon) with (orientation=row);
create table i_v_path (c1 path) with (orientation=row);
create table i_v_circle (c1 circle) with (orientation=row);
create table i_v_tsvector (c1 tsvector) with (orientation=row);
create table i_v_tsquery (c1 tsquery) with (orientation=row);
create table i_v_intvector (c1 int[][]) with (orientation=row);
create table i_v_intarray (c1 int[]) with (orientation=row);
create table i_v_composite (c1 composite_type) with (orientation=row);
create table i_v_composite_complex (c1 composite_type_complex) with (orientation=row);
-- insert into table
insert into name values ('AAAAAA');
insert into name values ('BBBBBB');
insert into v_name values ('AAAAAA');
insert into v_name values ('BBBBBB');
insert into blob values ('aaaaaaaaaaa');
insert into blob values ('bbbbbbbbbbb');
insert into v_blob values ('aaaaaaaaaaa');
insert into v_blob values ('bbbbbbbbbbb');
insert into macaddr values ('08:00:2b:01:02:03');
insert into macaddr values ('08:00:2a:01:02:03');
insert into v_macaddr values ('08:00:2b:01:02:03');
insert into v_macaddr values ('08:00:2a:01:02:03');
insert into uuid values ('A0EEBC99-9C0B-4EF8-BB6D-6BB9BD380A11');
insert into v_uuid values ('A0EEBC99-9C0B-4EF8-BB6D-6BB9BD380A11');
insert into box values ('(0,0,100,100)');
insert into box values ('(5,5,100,100)');
insert into v_box values ('(0,0,100,100)');
insert into v_box values ('(5,5,100,100)');
insert into raw_table values ('DEADBEEF');
insert into raw_table values ('BEEFBEEF');
insert into v_raw values ('DEADBEEF');
insert into v_raw values ('BEEFBEEF');
insert into point values ('(0.0000009,0.0000009)');
insert into point values ('(0.0000018,0.0000018)');
insert into v_point values ('(0.0000009,0.0000009)');
insert into v_point values ('(0.0000018,0.0000018)');
insert into lseg values ('((0.0000009,0.0000009),(0.0000018,0.0000018))');
insert into lseg values ('((0.0000018,0.0000018),(0.0000027,0.0000027))');
insert into v_lseg values ('((0.0000009,0.0000009),(0.0000018,0.0000018))');
insert into v_lseg values ('((0.0000018,0.0000018),(0.0000027,0.0000027))');
insert into polygon values ('(2.0,0.0),(2.0,4.0),(0.0,0.0)');
insert into polygon values ('(1.0,0.0),(1.0,4.0),(0.5,0.5)');
insert into v_polygon values ('(2.0,0.0),(2.0,4.0),(0.0,0.0)');
insert into v_polygon values ('(1.0,0.0),(1.0,4.0),(0.5,0.5)');
insert into path values ('((1,1),(2,2),(3,3))');
insert into path values ('((1,1),(2,2),(3,3))');
insert into path values ('[(0,2),(-1,0),(-10,1)]');
insert into path values ('[(0,2),(-1,0),(-10,1)]');
insert into v_path values ('((1,1),(2,2),(3,3))');
insert into v_path values ('((1,1),(2,2),(3,3))');
insert into v_path values ('[(0,2),(-1,0),(-10,1)]');
insert into v_path values ('[(0,2),(-1,0),(-10,1)]');
insert into circle values ('<(250,250),250>');
insert into circle values ('<(500,500),500>');
insert into v_circle values ('<(250,250),250>');
insert into v_circle values ('<(500,500),500>');
insert into tsvector values (' a:1 s:2 d g');
insert into tsvector values (' a:2 s:2 d g');
insert into v_tsvector values (' a:1 s:2 d g');
insert into v_tsvector values (' a:2 s:2 d g');
insert into tsquery values ('1|2|4|5|6');
insert into tsquery values ('1|2|4|5|7');
insert into v_tsquery values ('1|2|4|5|6');
insert into v_tsquery values ('1|2|4|5|7');
insert into intvector values ('{{1},{2}}');
insert into intvector values ('{{1},{3}}');
insert into v_intvector values ('{{1},{2}}');
insert into v_intvector values ('{{1},{3}}');
insert into intarray values ('{1,2,3}');
insert into intarray values ('{2,3,4}');
insert into v_intarray values ('{1,2,3}');
insert into v_intarray values ('{2,3,4}');
insert into composite values(row(1,true));
insert into composite values(row(2,false));
insert into v_composite values(row(1,true));
insert into v_composite values(row(2,false));
insert into composite_complex values (row(214748,12345.122,false,2000,'hello','2020-09-04','(0.0000009,0.0000009)','192.168.1','<(250,250),250>'));
insert into composite_complex values (row(21478,135.2468,true,2000,'helloo','2020-09-04','(0.0000039,0.0000039)','192.168.1','<(500,500),500>'));
insert into v_composite_complex values (row(214748,12345.122,false,2000,'hello','2020-09-04','(0.0000009,0.0000009)','192.168.1','<(250,250),250>'));
insert into v_composite_complex values (row(21478,135.2468,true,2000,'helloo','2020-09-04','(0.0000039,0.0000039)','192.168.1','<(500,500),500>'));
-- insert select
insert into i_name select * from name;
insert into i_blob select * from blob;
insert into i_macaddr select * from macaddr;
insert into i_uuid select * from uuid;
insert into i_raw_table select * from raw_table;
insert into i_tsvector select * from tsvector;
insert into i_tsquery select * from tsquery;
insert into i_intvector select * from intvector;
insert into i_intarray select * from intarray;
insert into i_composite select * from composite;
insert into i_composite_complex select * from composite_complex;
insert into i_v_name select * from v_name;
insert into i_v_blob select * from v_blob;
insert into i_v_macaddr select * from v_macaddr;
insert into i_v_uuid select * from v_uuid;
insert into i_v_raw select * from v_raw;
insert into i_v_tsvector select * from v_tsvector;
insert into i_v_tsquery select * from v_tsquery;
insert into i_v_intvector select * from v_intvector;
insert into i_v_intarray select * from v_intarray;
insert into i_v_composite select * from v_composite;
insert into i_v_composite_complex select * from v_composite_complex;
-- data verification
create view view_name as (
select * from i_name except select * from i_v_name);
create view view_blob as (
select * from i_blob except select * from i_v_blob);
create view view_macaddr as (
select * from i_macaddr except select * from i_v_macaddr);
create view view_uuid as (
select * from i_uuid except select * from i_v_uuid);
create view view_raw as (
select * from i_raw_table except select * from i_v_raw);
create view view_tsvector as (
select * from i_tsvector except select * from i_v_tsvector);
create view view_tsquery as (
select * from i_tsquery except select * from i_v_tsquery);
create view view_intvector as (
select * from i_intvector except select * from i_v_intvector);
create view view_intarray as (
select * from i_intarray except select * from i_v_intarray);
create view view_composite as (
select * from i_composite except select * from i_v_composite);
select * from i_box;
select * from i_v_box;
select * from i_point;
select * from i_v_point;
select * from i_lseg;
select * from i_v_lseg;
select * from i_circle;
select * from i_v_circle;
select * from i_path;
select * from i_v_path;
select * from i_polygon;
select * from i_v_polygon;
select * from i_composite_complex;
select * from i_v_composite_complex;
select * from view_name;
select * from view_blob;
select * from view_macaddr;
select * from view_uuid;
select * from view_raw;
select * from view_tsvector;
select * from view_tsquery;
select * from view_intvector;
select * from view_intarray;
select * from view_composite;
-- drop table and views
drop view view_name;
drop view view_blob;
drop view view_macaddr;
drop view view_uuid;
drop view view_raw;
drop view view_tsvector;
drop view view_tsquery;
drop view view_intvector;
drop view view_intarray;
drop view view_composite;
drop table name;
drop table blob;
drop table macaddr;
drop table uuid;
drop table box;
drop table raw_table;
drop table point;
drop table lseg;
drop table polygon;
drop table circle;
drop table path;
drop table tsvector;
drop table tsquery;
drop table intvector;
drop table intarray;
drop table composite;
drop table composite_complex;
drop table i_name;
drop table i_blob;
drop table i_macaddr;
drop table i_uuid;
drop table i_box;
drop table i_raw_table;
drop table i_point;
drop table i_lseg;
drop table i_polygon;
drop table i_circle;
drop table i_path;
drop table i_tsvector;
drop table i_tsquery;
drop table i_intvector;
drop table i_intarray;
drop table i_composite;
drop table i_composite_complex;
drop table v_name;
drop table v_blob;
drop table v_macaddr;
drop table v_uuid;
drop table v_box;
drop table v_raw;
drop table v_point;
drop table v_lseg;
drop table v_polygon;
drop table v_path;
drop table v_circle;
drop table v_tsvector;
drop table v_tsquery;
drop table v_intvector;
drop table v_intarray;
drop table v_composite;
drop table v_composite_complex;
drop table i_v_name;
drop table i_v_blob;
drop table i_v_macaddr;
drop table i_v_uuid;
drop table i_v_box;
drop table i_v_raw;
drop table i_v_point;
drop table i_v_lseg;
drop table i_v_polygon;
drop table i_v_path;
drop table i_v_circle;
drop table i_v_tsvector;
drop table i_v_tsquery;
drop table i_v_intvector;
drop table i_v_intarray;
drop table i_v_composite;
drop table i_v_composite_complex;
drop type composite_type;
drop type composite_type_complex; | the_stack |
-- phpMyAdmin SQL Dump
-- version 4.0.4
-- http://www.phpmyadmin.net
--
-- 主机: localhost
-- 生成日期: 2015 年 05 月 15 日 06:30
-- 服务器版本: 5.6.12-log
-- PHP 版本: 5.4.12
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 */;
--
-- 数据库: `yincart-home-new`
--
CREATE DATABASE IF NOT EXISTS `yincart-home-new` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
USE `yincart-home-new`;
-- --------------------------------------------------------
--
-- 表的结构 `auth_assignment`
--
CREATE TABLE IF NOT EXISTS `auth_assignment` (
`item_name` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
`user_id` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
`created_at` int(11) DEFAULT NULL,
PRIMARY KEY (`item_name`,`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
INSERT INTO `auth_assignment` VALUES ('Administrator', '1', 1432554123);
--
-- 表的结构 `auth_item`
--
CREATE TABLE IF NOT EXISTS `auth_item` (
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`type` int(11) NOT NULL,
`description` text COLLATE utf8_unicode_ci,
`rule_name` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`data` text COLLATE utf8_unicode_ci,
`created_at` int(11) DEFAULT NULL,
`updated_at` int(11) DEFAULT NULL,
PRIMARY KEY (`name`),
KEY `rule_name` (`rule_name`),
KEY `idx-auth_item-type` (`type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
INSERT INTO `auth_item` VALUES ('Administrator', 1, '', NULL, NULL, 1432554006, 1432554059);
INSERT INTO `auth_item` VALUES ('Customer', 1, NULL, NULL, NULL, 1432639084, 1432639084);
INSERT INTO `auth_item` VALUES ('home\\modules\\core\\controllers\\DefaultController_Index', 2, NULL, NULL, NULL, 1432883781, 1432883781);
INSERT INTO `auth_item` VALUES ('home\\modules\\member\\controllers\\DefaultController_Index', 2, NULL, NULL, NULL, 1432883387, 1432883387);
INSERT INTO `auth_item` VALUES ('home\\modules\\member\\controllers\\WishlistController_AddWishlist', 2, NULL, NULL, NULL, 1432883678, 1432883678);
INSERT INTO `auth_item` VALUES ('home\\modules\\member\\controllers\\WishlistController_DeleteWishlist', 2, NULL, NULL, NULL, 1432883735, 1432883735);
INSERT INTO `auth_item` VALUES ('home\\modules\\member\\controllers\\WishlistController_GetWishlist', 2, NULL, NULL, NULL, 1432883678, 1432883678);
INSERT INTO `auth_item` VALUES ('Merchant', 1, '', NULL, NULL, 1432554082, 1432554082);
INSERT INTO `auth_item` VALUES ('star\\auth\\controllers\\AuthController_Create', 2, NULL, NULL, NULL, 1432884200, 1432884200);
INSERT INTO `auth_item` VALUES ('star\\auth\\controllers\\AuthController_ListRole', 2, NULL, NULL, NULL, 1432884200, 1432884200);
INSERT INTO `auth_item` VALUES ('star\\auth\\controllers\\AuthController_Update', 2, NULL, NULL, NULL, 1432884200, 1432884200);
INSERT INTO `auth_item` VALUES ('star\\catalog\\controllers\\core\\DefaultController_Index', 2, NULL, NULL, NULL, 1432884014, 1432884014);
INSERT INTO `auth_item` VALUES ('star\\catalog\\controllers\\core\\ItemController_AjaxSkus', 2, NULL, NULL, NULL, 1432883981, 1432883981);
INSERT INTO `auth_item` VALUES ('star\\catalog\\controllers\\core\\ItemController_Bulk', 2, NULL, NULL, NULL, 1432883981, 1432883981);
INSERT INTO `auth_item` VALUES ('star\\catalog\\controllers\\core\\ItemController_Create', 2, NULL, NULL, NULL, 1432883981, 1432883981);
INSERT INTO `auth_item` VALUES ('star\\catalog\\controllers\\core\\ItemController_Delete', 2, NULL, NULL, NULL, 1432883981, 1432883981);
INSERT INTO `auth_item` VALUES ('star\\catalog\\controllers\\core\\ItemController_Index', 2, NULL, NULL, NULL, 1432883981, 1432883981);
INSERT INTO `auth_item` VALUES ('star\\catalog\\controllers\\core\\ItemController_ItemProps', 2, NULL, NULL, NULL, 1432883981, 1432883981);
INSERT INTO `auth_item` VALUES ('star\\catalog\\controllers\\core\\ItemController_Update', 2, NULL, NULL, NULL, 1432883981, 1432883981);
INSERT INTO `auth_item` VALUES ('star\\catalog\\controllers\\core\\ItemController_View', 2, NULL, NULL, NULL, 1432883981, 1432883981);
INSERT INTO `auth_item` VALUES ('star\\catalog\\controllers\\core\\ItemImgController_Create', 2, NULL, NULL, NULL, 1432883991, 1432883991);
INSERT INTO `auth_item` VALUES ('star\\catalog\\controllers\\core\\ItemImgController_Delete', 2, NULL, NULL, NULL, 1432883991, 1432883991);
INSERT INTO `auth_item` VALUES ('star\\catalog\\controllers\\core\\ItemImgController_Index', 2, NULL, NULL, NULL, 1432883991, 1432883991);
INSERT INTO `auth_item` VALUES ('star\\catalog\\controllers\\core\\ItemPropController_Create', 2, NULL, NULL, NULL, 1432884003, 1432884003);
INSERT INTO `auth_item` VALUES ('star\\catalog\\controllers\\core\\ItemPropController_Delete', 2, NULL, NULL, NULL, 1432884003, 1432884003);
INSERT INTO `auth_item` VALUES ('star\\catalog\\controllers\\core\\ItemPropController_Index', 2, NULL, NULL, NULL, 1432884003, 1432884003);
INSERT INTO `auth_item` VALUES ('star\\catalog\\controllers\\core\\ItemPropController_Update', 2, NULL, NULL, NULL, 1432884003, 1432884003);
INSERT INTO `auth_item` VALUES ('star\\catalog\\controllers\\core\\ItemPropController_View', 2, NULL, NULL, NULL, 1432884003, 1432884003);
--
-- 表的结构 `auth_item_child`
--
CREATE TABLE IF NOT EXISTS `auth_item_child` (
`parent` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
`child` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`parent`,`child`),
KEY `child` (`child`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
INSERT INTO `auth_item_child` VALUES ('Merchant', 'home\\modules\\core\\controllers\\DefaultController_Index');
INSERT INTO `auth_item_child` VALUES ('Customer', 'home\\modules\\member\\controllers\\DefaultController_Index');
INSERT INTO `auth_item_child` VALUES ('Customer', 'home\\modules\\member\\controllers\\WishlistController_AddWishlist');
INSERT INTO `auth_item_child` VALUES ('Customer', 'home\\modules\\member\\controllers\\WishlistController_DeleteWishlist');
INSERT INTO `auth_item_child` VALUES ('Customer', 'home\\modules\\member\\controllers\\WishlistController_GetWishlist');
INSERT INTO `auth_item_child` VALUES ('Administrator', 'star\\auth\\controllers\\AuthController_Create');
INSERT INTO `auth_item_child` VALUES ('Administrator', 'star\\auth\\controllers\\AuthController_ListRole');
INSERT INTO `auth_item_child` VALUES ('Administrator', 'star\\auth\\controllers\\AuthController_Update');
INSERT INTO `auth_item_child` VALUES ('Administrator', 'star\\catalog\\controllers\\core\\DefaultController_Index');
INSERT INTO `auth_item_child` VALUES ('Merchant', 'star\\catalog\\controllers\\core\\DefaultController_Index');
INSERT INTO `auth_item_child` VALUES ('Administrator', 'star\\catalog\\controllers\\core\\ItemController_AjaxSkus');
INSERT INTO `auth_item_child` VALUES ('Merchant', 'star\\catalog\\controllers\\core\\ItemController_AjaxSkus');
INSERT INTO `auth_item_child` VALUES ('Administrator', 'star\\catalog\\controllers\\core\\ItemController_Bulk');
INSERT INTO `auth_item_child` VALUES ('Merchant', 'star\\catalog\\controllers\\core\\ItemController_Bulk');
INSERT INTO `auth_item_child` VALUES ('Administrator', 'star\\catalog\\controllers\\core\\ItemController_Create');
INSERT INTO `auth_item_child` VALUES ('Merchant', 'star\\catalog\\controllers\\core\\ItemController_Create');
INSERT INTO `auth_item_child` VALUES ('Administrator', 'star\\catalog\\controllers\\core\\ItemController_Delete');
INSERT INTO `auth_item_child` VALUES ('Merchant', 'star\\catalog\\controllers\\core\\ItemController_Delete');
INSERT INTO `auth_item_child` VALUES ('Administrator', 'star\\catalog\\controllers\\core\\ItemController_Index');
INSERT INTO `auth_item_child` VALUES ('Merchant', 'star\\catalog\\controllers\\core\\ItemController_Index');
INSERT INTO `auth_item_child` VALUES ('Administrator', 'star\\catalog\\controllers\\core\\ItemController_ItemProps');
INSERT INTO `auth_item_child` VALUES ('Merchant', 'star\\catalog\\controllers\\core\\ItemController_ItemProps');
INSERT INTO `auth_item_child` VALUES ('Administrator', 'star\\catalog\\controllers\\core\\ItemController_Update');
INSERT INTO `auth_item_child` VALUES ('Merchant', 'star\\catalog\\controllers\\core\\ItemController_Update');
INSERT INTO `auth_item_child` VALUES ('Administrator', 'star\\catalog\\controllers\\core\\ItemController_View');
INSERT INTO `auth_item_child` VALUES ('Merchant', 'star\\catalog\\controllers\\core\\ItemController_View');
INSERT INTO `auth_item_child` VALUES ('Administrator', 'star\\catalog\\controllers\\core\\ItemImgController_Create');
INSERT INTO `auth_item_child` VALUES ('Merchant', 'star\\catalog\\controllers\\core\\ItemImgController_Create');
INSERT INTO `auth_item_child` VALUES ('Administrator', 'star\\catalog\\controllers\\core\\ItemImgController_Delete');
INSERT INTO `auth_item_child` VALUES ('Merchant', 'star\\catalog\\controllers\\core\\ItemImgController_Delete');
INSERT INTO `auth_item_child` VALUES ('Administrator', 'star\\catalog\\controllers\\core\\ItemImgController_Index');
INSERT INTO `auth_item_child` VALUES ('Merchant', 'star\\catalog\\controllers\\core\\ItemImgController_Index');
INSERT INTO `auth_item_child` VALUES ('Administrator', 'star\\catalog\\controllers\\core\\ItemPropController_Create');
INSERT INTO `auth_item_child` VALUES ('Administrator', 'star\\catalog\\controllers\\core\\ItemPropController_Delete');
INSERT INTO `auth_item_child` VALUES ('Administrator', 'star\\catalog\\controllers\\core\\ItemPropController_Index');
INSERT INTO `auth_item_child` VALUES ('Administrator', 'star\\catalog\\controllers\\core\\ItemPropController_Update');
INSERT INTO `auth_item_child` VALUES ('Administrator', 'star\\catalog\\controllers\\core\\ItemPropController_View');
--
-- 表的结构 `auth_rule`
--
CREATE TABLE IF NOT EXISTS `auth_rule` (
`name` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
`data` text COLLATE utf8_unicode_ci,
`created_at` int(11) DEFAULT NULL,
`updated_at` int(11) DEFAULT NULL,
PRIMARY KEY (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- 表的结构 `comment`
--
CREATE TABLE IF NOT EXISTS `comment` (
`id` int(12) NOT NULL AUTO_INCREMENT,
`parent_id` int(12) DEFAULT NULL,
`post_id` int(12) NOT NULL,
`user_id` int(12) NOT NULL DEFAULT '0',
`text` text,
`create_time` int(11) DEFAULT NULL,
`update_time` int(11) DEFAULT NULL,
`status` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `owner_name` (`post_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=12 ;
-- --------------------------------------------------------
--
-- 表的结构 `friend_link`
--
CREATE TABLE IF NOT EXISTS `friend_link` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`category_id` int(11) DEFAULT NULL,
`title` varchar(100) NOT NULL,
`pic` varchar(255) NOT NULL,
`url` varchar(200) NOT NULL,
`memo` text NOT NULL,
`sort_order` int(11) NOT NULL DEFAULT '255',
`language` varchar(45) NOT NULL,
`create_time` int(11) NOT NULL,
`update_time` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=66 ;
-- --------------------------------------------------------
--
-- 表的结构 `item`
--
CREATE TABLE IF NOT EXISTS `item` (
`item_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Item ID',
`category_id` int(10) unsigned NOT NULL COMMENT 'Category ID',
`outer_id` varchar(45) DEFAULT NULL,
`title` varchar(255) NOT NULL COMMENT '名称',
`stock` int(10) unsigned NOT NULL COMMENT '库存',
`min_number` int(10) unsigned NOT NULL DEFAULT '1' COMMENT '最少订货量',
`price` decimal(10,2) unsigned NOT NULL COMMENT '价格',
`currency` varchar(20) NOT NULL COMMENT '币种',
`props` longtext NOT NULL COMMENT '商品属性 格式:pid:vid;pid:vid',
`props_name` longtext NOT NULL COMMENT '商品属性名称。标识着props内容里面的pid和vid所对应的名称。格式为:pid1:vid1:pid_name1:vid_name1;pid2:vid2:pid_name2:vid_name2……(注:属性名称中的冒号":"被转换为:"#cln#"; 分号";"被转换为:"#scln#" )',
`desc` longtext NOT NULL COMMENT '描述',
`shipping_fee` decimal(10,2) NULL DEFAULT '0.00' COMMENT '运费',
`is_show` tinyint(1) NULL DEFAULT '0' COMMENT '是否显示',
`is_promote` tinyint(1) NULL DEFAULT '0' COMMENT '是否促销',
`is_new` tinyint(1) NULL DEFAULT '0' COMMENT '是否新品',
`is_hot` tinyint(1) NULL DEFAULT '0' COMMENT '是否热销',
`is_best` tinyint(1) NULL DEFAULT '0' COMMENT '是否精品',
`click_count` int(10) NULL DEFAULT '0' COMMENT '点击量',
`wish_count` int(10) NULL DEFAULT '0' COMMENT '收藏数',
`review_count` int(10) NULL DEFAULT '0',
`deal_count` int(10) NULL DEFAULT '0',
`create_time` int(10) unsigned NOT NULL COMMENT '创建时间',
`update_time` int(10) unsigned NOT NULL COMMENT '更新时间',
`language` varchar(45) NOT NULL,
`country` int(10) unsigned NULL,
`state` int(10) unsigned NULL,
`city` int(10) unsigned NULL,
PRIMARY KEY (`item_id`),
KEY `fk_item_category1_idx` (`category_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=60 ;
-- --------------------------------------------------------
--
-- 表的结构 `item_img`
--
CREATE TABLE IF NOT EXISTS `item_img` (
`img_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Item Img ID',
`item_id` int(10) unsigned NOT NULL COMMENT 'Item ID',
`pic` varchar(255) NOT NULL COMMENT '图片url',
`title` varchar(255) NOT NULL COMMENT '图片title',
`position` tinyint(3) unsigned NOT NULL COMMENT '图片位置',
`create_time` int(10) unsigned NOT NULL COMMENT '创建时间',
PRIMARY KEY (`img_id`),
KEY `fk_item_img_item1_idx` (`item_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=32 ;
-- --------------------------------------------------------
--
-- 表的结构 `item_prop`
--
CREATE TABLE IF NOT EXISTS `item_prop` (
`prop_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '属性 ID 例:品牌的PID=20000',
`category_id` int(10) unsigned NOT NULL,
`parent_prop_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '上级属性ID',
`parent_value_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '上级属性值ID',
`prop_name` varchar(100) NOT NULL COMMENT '属性名称',
`prop_alias` varchar(100) DEFAULT NULL COMMENT '属性别名',
`type` tinyint(1) unsigned NOT NULL COMMENT '属性值类型。可选值:input(输入)、optional(枚举)multiCheck (多选)',
`is_key_prop` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否关键属性。可选值:1(是),0(否),搜索属性',
`is_sale_prop` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否销售属性。可选值:1(是),0(否)',
`is_color_prop` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否颜色属性。可选值:1(是),0(否)',
`must` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '发布产品或商品时是否为必选属性。可选值:1(是),0(否)',
`multi` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '发布产品或商品时是否可以多选。可选值:1(是),0(否)',
`status` tinyint(1) unsigned DEFAULT '0' COMMENT '状态。可选值:0(正常),1(删除)',
`sort_order` tinyint(3) unsigned DEFAULT '255' COMMENT '排序',
PRIMARY KEY (`prop_id`),
KEY `fk_item_prop_category1_idx` (`category_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=26 ;
-- --------------------------------------------------------
--
-- 表的结构 `lookup`
--
CREATE TABLE IF NOT EXISTS `lookup` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(128) NOT NULL,
`code` int(11) NOT NULL,
`type` varchar(128) NOT NULL,
`position` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ;
-- --------------------------------------------------------
--
-- 表的结构 `menu`
--
CREATE TABLE IF NOT EXISTS `menu` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(128) NOT NULL,
`parent` int(11) DEFAULT NULL,
`route` varchar(256) DEFAULT NULL,
`order` int(11) DEFAULT NULL,
`data` text,
PRIMARY KEY (`id`),
KEY `parent` (`parent`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- 表的结构 `migration`
--
CREATE TABLE IF NOT EXISTS `migration` (
`version` varchar(180) CHARACTER SET utf8 NOT NULL,
`apply_time` int(11) DEFAULT NULL,
PRIMARY KEY (`version`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- 表的结构 `post`
--
CREATE TABLE IF NOT EXISTS `post` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`category_id` int(11) NOT NULL DEFAULT '0',
`user_id` int(11) DEFAULT '0',
`language_id` int(11) DEFAULT '0',
`star_id` int(11) DEFAULT '0',
`cluster_id` int(11) DEFAULT '0',
`station_id` int(11) DEFAULT '0',
`title` varchar(200) NOT NULL,
`url` varchar(100) DEFAULT NULL,
`source` varchar(50) DEFAULT NULL,
`summary` text,
`content` text NOT NULL,
`tags` text,
`status` int(11) DEFAULT NULL,
`views` int(11) NOT NULL DEFAULT '0',
`allow_comment` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0:allow;1:forbid',
`create_time` int(11) NOT NULL,
`update_time` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `FK_post_author` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=184 ;
-- --------------------------------------------------------
--
-- 表的结构 `product`
--
CREATE TABLE IF NOT EXISTS `product` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`title` varchar(200) NOT NULL,
`detail` text NOT NULL,
`create_time` int(11) NOT NULL,
`update_time` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- 表的结构 `product_model`
--
CREATE TABLE IF NOT EXISTS `product_model` (
`id` int(11) NOT NULL,
`model` varchar(200) NOT NULL,
`price` decimal(10,2) NOT NULL,
`stock` int(11) NOT NULL,
`create_time` int(11) NOT NULL,
`update_time` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- 表的结构 `profile`
--
CREATE TABLE IF NOT EXISTS `profile` (
`user_id` int(11) NOT NULL,
`name` varchar(255) DEFAULT NULL,
`public_email` varchar(255) DEFAULT NULL,
`gravatar_email` varchar(255) DEFAULT NULL,
`gravatar_id` varchar(32) DEFAULT NULL,
`location` varchar(255) DEFAULT NULL,
`website` varchar(255) DEFAULT NULL,
`bio` text,
PRIMARY KEY (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- 表的结构 `prop_img`
--
CREATE TABLE IF NOT EXISTS `prop_img` (
`prop_img_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Prop Img ID',
`item_id` int(10) unsigned NOT NULL COMMENT 'Item ID',
`item_prop_value` varchar(255) NOT NULL COMMENT '图片所对应的属性组合的字符串',
`pic` varchar(255) NOT NULL COMMENT '图片url',
`create_time` int(10) unsigned NOT NULL COMMENT '创建时间',
PRIMARY KEY (`prop_img_id`),
KEY `fk_prop_img_item1_idx` (`item_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- 表的结构 `prop_value`
--
CREATE TABLE IF NOT EXISTS `prop_value` (
`value_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '属性值ID',
`prop_id` int(10) unsigned NOT NULL,
`value_name` varchar(45) NOT NULL COMMENT '属性值',
`value_alias` varchar(45) NOT NULL COMMENT '属性值别名',
`status` tinyint(1) unsigned NOT NULL COMMENT '状态。可选值:normal(正常),deleted(删除)',
`sort_order` tinyint(3) unsigned NOT NULL DEFAULT '255' COMMENT '排列序号。取值范围:大于零的整数',
PRIMARY KEY (`value_id`),
KEY `fk_prop_value_item_prop1_idx` (`prop_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=60 ;
-- --------------------------------------------------------
--
-- 表的结构 `sku`
--
CREATE TABLE IF NOT EXISTS `sku` (
`sku_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'SKU ID',
`item_id` int(10) unsigned NOT NULL COMMENT 'Item ID',
`tag` varchar(45) NULL,
`props` longtext NOT NULL COMMENT 'sku的销售属性组合字符串(颜色,大小,等等,可通过类目API获取某类目下的销售属性),格式是p1:v1;p2:v2',
`props_name` longtext NOT NULL COMMENT 'sku所对应的销售属性的中文名字串,格式如:pid1:vid1:pid_name1:vid_name1;pid2:vid2:pid_name2:vid_name2……',
`quantity` int(10) unsigned NOT NULL COMMENT 'sku商品库存',
`price` decimal(10,2) unsigned NOT NULL COMMENT 'sku的商品价格',
`outer_id` varchar(45) NOT NULL COMMENT '商家设置的外部id',
`status` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT 'sku状态。 normal:正常 ;delete:删除',
PRIMARY KEY (`sku_id`),
KEY `fk_sku_item1_idx` (`item_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=81 ;
-- --------------------------------------------------------
--
-- 表的结构 `social_account`
--
CREATE TABLE IF NOT EXISTS `social_account` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) DEFAULT NULL,
`provider` varchar(255) NOT NULL,
`client_id` varchar(255) NOT NULL,
`data` text,
PRIMARY KEY (`id`),
UNIQUE KEY `account_unique` (`provider`,`client_id`),
KEY `fk_user_account` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- 表的结构 `star`
--
CREATE TABLE IF NOT EXISTS `star` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`skin_id` int(11) DEFAULT NULL,
`cluster_id` int(11) DEFAULT NULL,
`station_id` int(11) DEFAULT NULL,
`name` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL,
`name_alias` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
`domain` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
`type` tinyint(1) DEFAULT NULL,
`detail` text COLLATE utf8_unicode_ci,
`start_date` int(11) DEFAULT NULL,
`end_date` int(11) DEFAULT NULL,
`create_time` int(11) DEFAULT NULL,
`update_time` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- 表的结构 `station`
--
CREATE TABLE IF NOT EXISTS `station` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
`detail` text COLLATE utf8_unicode_ci,
`enabled` tinyint(1) NOT NULL DEFAULT '0',
`start_date` int(11) DEFAULT NULL,
`end_date` int(11) DEFAULT NULL,
`create_time` int(11) NOT NULL,
`update_time` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=5 ;
-- --------------------------------------------------------
--
-- 表的结构 `tag`
--
CREATE TABLE IF NOT EXISTS `tag` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(128) NOT NULL,
`frequency` int(11) DEFAULT '1',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=40 ;
-- --------------------------------------------------------
--
-- 表的结构 `token`
--
CREATE TABLE IF NOT EXISTS `token` (
`user_id` int(11) NOT NULL,
`code` varchar(32) NOT NULL,
`created_at` int(11) NOT NULL,
`type` smallint(6) NOT NULL,
UNIQUE KEY `token_unique` (`user_id`,`code`,`type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- 表的结构 `tree`
--
CREATE TABLE IF NOT EXISTS `tree` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`root` int(10) unsigned DEFAULT NULL,
`lft` int(10) unsigned NOT NULL,
`rgt` int(10) unsigned NOT NULL,
`level` smallint(5) unsigned NOT NULL,
`type` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
`name` varchar(128) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`),
KEY `root` (`root`),
KEY `lft` (`lft`),
KEY `rgt` (`rgt`),
KEY `level` (`level`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=38 ;
INSERT INTO `tree` VALUES (1, 1, 1, 4, 1, '1', 'root');
INSERT INTO `tree` VALUES (2, 1, 2, 3, 2, 'default', '商品分类');
-- --------------------------------------------------------
--
-- 表的结构 `user`
--
CREATE TABLE IF NOT EXISTS `user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(25) NOT NULL,
`email` varchar(255) NOT NULL,
`password_hash` varchar(60) NOT NULL,
`auth_key` varchar(32) NOT NULL,
`confirmed_at` int(11) DEFAULT NULL,
`unconfirmed_email` varchar(255) DEFAULT NULL,
`blocked_at` int(11) DEFAULT NULL,
`registration_ip` varchar(45) DEFAULT NULL,
`created_at` int(11) NOT NULL,
`updated_at` int(11) NOT NULL,
`flags` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `user_unique_username` (`username`),
UNIQUE KEY `user_unique_email` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=157 ;
INSERT INTO `user` VALUES (1, 'admin', 'admin@a.com', '$2y$10$LoiYdggKnoIZBsrlefUpJOFANhJe15RBzjKW4zj6/GhQhAyJOjNG.', 'WdTQviiBj8pOOAWpBMa6gnib3xTUdyg7', 1432541159, NULL, NULL, '127.0.0.1', 1432541160, 1432541160, 0);
CREATE TABLE `currency` (
`currency_id` int(11) NOT NULL AUTO_INCREMENT,
`code` varchar(8) DEFAULT NULL,
`name` varchar(20) DEFAULT NULL,
`sign` varchar(5) DEFAULT NULL,
`rate` decimal(10,4) DEFAULT NULL,
`is_default` tinyint(1) DEFAULT '0',
`enabled` tinyint(1) DEFAULT '0',
PRIMARY KEY (`currency_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of currency
-- ----------------------------
INSERT INTO `currency` VALUES ('1', 'CNY', '人民币', '¥', '0.0000', '1', '1');
INSERT INTO `currency` VALUES ('2', 'USD', '美元', '$', '0.0000', '0', '1');
INSERT INTO `currency` VALUES ('3', 'EUR', '欧元', '€', '0.0000', '0', '1');
CREATE TABLE `language` (
`language_id` int(11) NOT NULL AUTO_INCREMENT,
`code` varchar(10) DEFAULT NULL,
`name` varchar(20) DEFAULT NULL,
PRIMARY KEY (`language_id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of language
-- ----------------------------
INSERT INTO `language` VALUES ('1', 'zh-cn', 'Chinese');
INSERT INTO `language` VALUES ('2', 'en', 'English');
INSERT INTO `language` VALUES ('3', 'de', 'German');
INSERT INTO `language` VALUES ('4', 'ru', 'Russian');
INSERT INTO `language` VALUES ('5', 'it', 'Italian');
-- --------------------------------------------------------
--
-- 表的结构 `wishlist`
--
CREATE TABLE IF NOT EXISTS `wishlist` (
`wishlist_id` int(10) NOT NULL AUTO_INCREMENT,
`user_id` int(10) DEFAULT NULL,
`item_id` int(10) DEFAULT NULL,
`desc` text,
`created_at` int(11) DEFAULT NULL,
PRIMARY KEY (`wishlist_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `cart` (
`cart_id` int(10) unsigned NOT NULL AUTO_INCREMENT ,
`user_id` int(10) unsigned NOT NULL ,
`sku_id` int(10) unsigned NOT NULL COMMENT 'SKU Id',
`qty` int(10) unsigned NOT NULL COMMENT '库存',
`data` varchar(255) DEFAULT NULL COMMENT 'json格式存取,额外的字段',
`create_time` int(10) unsigned NOT NULL COMMENT '创建时间',
PRIMARY KEY (`cart_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;
--
-- 限制导出的表
--
--
-- 限制表 `auth_assignment`
--
ALTER TABLE `auth_assignment`
ADD CONSTRAINT `auth_assignment_ibfk_1` FOREIGN KEY (`item_name`) REFERENCES `auth_item` (`name`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- 限制表 `auth_item`
--
ALTER TABLE `auth_item`
ADD CONSTRAINT `auth_item_ibfk_1` FOREIGN KEY (`rule_name`) REFERENCES `auth_rule` (`name`) ON DELETE SET NULL ON UPDATE CASCADE;
--
-- 限制表 `auth_item_child`
--
ALTER TABLE `auth_item_child`
ADD CONSTRAINT `auth_item_child_ibfk_1` FOREIGN KEY (`parent`) REFERENCES `auth_item` (`name`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `auth_item_child_ibfk_2` FOREIGN KEY (`child`) REFERENCES `auth_item` (`name`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- 限制表 `item_img`
--
ALTER TABLE `item_img`
ADD CONSTRAINT `fk_item_img_item1` FOREIGN KEY (`item_id`) REFERENCES `item` (`item_id`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- 限制表 `menu`
--
ALTER TABLE `menu`
ADD CONSTRAINT `menu_ibfk_1` FOREIGN KEY (`parent`) REFERENCES `menu` (`id`) ON DELETE SET NULL ON UPDATE CASCADE;
--
-- 限制表 `profile`
--
ALTER TABLE `profile`
ADD CONSTRAINT `fk_user_profile` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE;
--
-- 限制表 `prop_img`
--
ALTER TABLE `prop_img`
ADD CONSTRAINT `fk_prop_img_item1` FOREIGN KEY (`item_id`) REFERENCES `item` (`item_id`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- 限制表 `prop_value`
--
ALTER TABLE `prop_value`
ADD CONSTRAINT `fk_prop_value_item_prop1` FOREIGN KEY (`prop_id`) REFERENCES `item_prop` (`prop_id`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- 限制表 `sku`
--
ALTER TABLE `sku`
ADD CONSTRAINT `fk_sku_item1` FOREIGN KEY (`item_id`) REFERENCES `item` (`item_id`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- 限制表 `social_account`
--
ALTER TABLE `social_account`
ADD CONSTRAINT `fk_user_account` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE;
--
-- 限制表 `token`
--
ALTER TABLE `token`
ADD CONSTRAINT `fk_user_token` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE;
/*!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 |
-- 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.
--;
-- Schema upgrade from 4.12.0.0 to 4.13.0.0
--;
-- Add XenServer 7.1.2, 7.6 and 8.0 hypervisor capabilities
INSERT IGNORE INTO `cloud`.`hypervisor_capabilities`(uuid, hypervisor_type, hypervisor_version, max_guests_limit, max_data_volumes_limit, max_hosts_per_cluster, storage_motion_supported) values (UUID(), 'XenServer', '7.6.0', 1000, 253, 64, 1);
INSERT IGNORE INTO `cloud`.`hypervisor_capabilities`(uuid, hypervisor_type, hypervisor_version, max_guests_limit, max_data_volumes_limit, max_hosts_per_cluster, storage_motion_supported) values (UUID(), 'XenServer', '8.0.0', 1000, 253, 64, 1);
INSERT IGNORE INTO `cloud`.`hypervisor_capabilities`(uuid, hypervisor_type, hypervisor_version, max_guests_limit, max_data_volumes_limit, max_hosts_per_cluster, storage_motion_supported) values (UUID(), 'XenServer', '7.1.1', 1000, 253, 64, 1);
INSERT IGNORE INTO `cloud`.`hypervisor_capabilities`(uuid, hypervisor_type, hypervisor_version, max_guests_limit, max_data_volumes_limit, max_hosts_per_cluster, storage_motion_supported) values (UUID(), 'XenServer', '7.1.2', 1000, 253, 64, 1);
-- Add VMware 6.7 hypervisor capabilities
INSERT IGNORE INTO `cloud`.`hypervisor_capabilities`(uuid,hypervisor_type, hypervisor_version, max_guests_limit, security_group_enabled, max_data_volumes_limit, max_hosts_per_cluster, storage_motion_supported, vm_snapshot_enabled) VALUES (UUID(), 'VMware', '6.7', '1024', '0', '59', '64', '1', '1');
INSERT IGNORE INTO `cloud`.`hypervisor_capabilities`(uuid,hypervisor_type, hypervisor_version, max_guests_limit, security_group_enabled, max_data_volumes_limit, max_hosts_per_cluster, storage_motion_supported, vm_snapshot_enabled) VALUES (UUID(), 'VMware', '6.7.1', '1024', '0', '59', '64', '1', '1');
INSERT IGNORE INTO `cloud`.`hypervisor_capabilities`(uuid,hypervisor_type, hypervisor_version, max_guests_limit, security_group_enabled, max_data_volumes_limit, max_hosts_per_cluster, storage_motion_supported, vm_snapshot_enabled) VALUES (UUID(), 'VMware', '6.7.2', '1024', '0', '59', '64', '1', '1');
INSERT IGNORE INTO `cloud`.`hypervisor_capabilities`(uuid,hypervisor_type, hypervisor_version, max_guests_limit, security_group_enabled, max_data_volumes_limit, max_hosts_per_cluster, storage_motion_supported, vm_snapshot_enabled) VALUES (UUID(), 'VMware', '6.7.3', '1024', '0', '59', '64', '1', '1');
-- Update VMware 6.x hypervisor capabilities
UPDATE `cloud`.`hypervisor_capabilities` SET max_guests_limit='1024', max_data_volumes_limit='59', max_hosts_per_cluster='64' WHERE (hypervisor_type='VMware' AND hypervisor_version='6.0' );
UPDATE `cloud`.`hypervisor_capabilities` SET max_guests_limit='1024', max_data_volumes_limit='59', max_hosts_per_cluster='64' WHERE (hypervisor_type='VMware' AND hypervisor_version='6.5' );
-- Add new OS versions
INSERT INTO cloud.guest_os (id, uuid, category_id, display_name, created, is_user_defined) VALUES ('277', UUID(), '1', 'Ubuntu 17.04', now(), '0');
INSERT INTO cloud.guest_os (id, uuid, category_id, display_name, created, is_user_defined) VALUES ('278', UUID(), '1', 'Ubuntu 17.10', now(), '0');
INSERT INTO cloud.guest_os (id, uuid, category_id, display_name, created, is_user_defined) VALUES ('279', UUID(), '1', 'Ubuntu 18.04 LTS', now(), '0');
INSERT INTO cloud.guest_os (id, uuid, category_id, display_name, created, is_user_defined) VALUES ('280', UUID(), '1', 'Ubuntu 18.10', now(), '0');
INSERT INTO cloud.guest_os (id, uuid, category_id, display_name, created, is_user_defined) VALUES ('281', UUID(), '1', 'Ubuntu 19.04', now(), '0');
INSERT INTO cloud.guest_os (id, uuid, category_id, display_name, created, is_user_defined) VALUES ('282', UUID(), '1', 'Red Hat Enterprise Linux 7.3', now(), '0');
INSERT INTO cloud.guest_os (id, uuid, category_id, display_name, created, is_user_defined) VALUES ('283', UUID(), '1', 'Red Hat Enterprise Linux 7.4', now(), '0');
INSERT INTO cloud.guest_os (id, uuid, category_id, display_name, created, is_user_defined) VALUES ('284', UUID(), '1', 'Red Hat Enterprise Linux 7.5', now(), '0');
INSERT INTO cloud.guest_os (id, uuid, category_id, display_name, created, is_user_defined) VALUES ('285', UUID(), '1', 'Red Hat Enterprise Linux 7.6', now(), '0');
INSERT INTO cloud.guest_os (id, uuid, category_id, display_name, created, is_user_defined) VALUES ('286', UUID(), '1', 'Red Hat Enterprise Linux 8.0', now(), '0');
INSERT INTO cloud.guest_os (id, uuid, category_id, display_name, created, is_user_defined) VALUES ('289', UUID(), '2', 'Debian GNU/Linux 9 (32-bit)', now(), '0');
INSERT INTO cloud.guest_os (id, uuid, category_id, display_name, created, is_user_defined) VALUES ('290', UUID(), '2', 'Debian GNU/Linux 9 (64-bit)', now(), '0');
INSERT INTO cloud.guest_os (id, uuid, category_id, display_name, created, is_user_defined) VALUES ('291', UUID(), '5', 'SUSE Linux Enterprise Server 15 (64-bit)', now(), '0');
INSERT INTO cloud.guest_os (id, uuid, category_id, display_name, created, is_user_defined) VALUES ('292', UUID(), '2', 'Debian GNU/Linux 10 (32-bit)', now(), '0');
INSERT INTO cloud.guest_os (id, uuid, category_id, display_name, created, is_user_defined) VALUES ('293', UUID(), '2', 'Debian GNU/Linux 10 (64-bit)', now(), '0');
INSERT INTO cloud.guest_os (id, uuid, category_id, display_name, created, is_user_defined) VALUES ('294', UUID(), '2', 'Linux 4.x Kernel (32-bit)', now(), '0');
INSERT INTO cloud.guest_os (id, uuid, category_id, display_name, created, is_user_defined) VALUES ('295', UUID(), '2', 'Linux 4.x Kernel (64-bit)', now(), '0');
INSERT INTO cloud.guest_os (id, uuid, category_id, display_name, created, is_user_defined) VALUES ('296', UUID(), '3', 'Oracle Linux 8', now(), '0');
INSERT INTO cloud.guest_os (id, uuid, category_id, display_name, created, is_user_defined) VALUES ('297', UUID(), '1', 'CentOS 8', now(), '0');
INSERT INTO cloud.guest_os (id, uuid, category_id, display_name, created, is_user_defined) VALUES ('298', UUID(), '9', 'FreeBSD 11 (32-bit)', now(), '0');
INSERT INTO cloud.guest_os (id, uuid, category_id, display_name, created, is_user_defined) VALUES ('299', UUID(), '9', 'FreeBSD 11 (64-bit)', now(), '0');
INSERT INTO cloud.guest_os (id, uuid, category_id, display_name, created, is_user_defined) VALUES ('300', UUID(), '9', 'FreeBSD 12 (32-bit)', now(), '0');
INSERT INTO cloud.guest_os (id, uuid, category_id, display_name, created, is_user_defined) VALUES ('301', UUID(), '9', 'FreeBSD 12 (64-bit)', now(), '0');
INSERT INTO cloud.guest_os (id, uuid, category_id, display_name, created, is_user_defined) VALUES ('302', UUID(), '1', 'CentOS 6.8', now(), '0');
INSERT INTO cloud.guest_os (id, uuid, category_id, display_name, created, is_user_defined) VALUES ('303', UUID(), '1', 'CentOS 6.9', now(), '0');
INSERT INTO cloud.guest_os (id, uuid, category_id, display_name, created, is_user_defined) VALUES ('304', UUID(), '1', 'CentOS 6.10', now(), '0');
-- Add New and missing VMware 6.5 Guest OSes
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'VMware', '6.5', 'oracleLinux6Guest', 235, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'VMware', '6.5', 'oracleLinux6_64Guest', 236, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'VMware', '6.5', 'oracleLinux6Guest', 147, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'VMware', '6.5', 'oracleLinux6_64Guest', 148, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'VMware', '6.5', 'oracleLinux6Guest', 213, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'VMware', '6.5', 'oracleLinux6_64Guest', 214, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'VMware', '6.5', 'oracleLinux6Guest', 215, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'VMware', '6.5', 'oracleLinux6_64Guest', 216, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'VMware', '6.5', 'oracleLinux6Guest', 217, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'VMware', '6.5', 'oracleLinux6_64Guest', 218, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'VMware', '6.5', 'oracleLinux6Guest', 219, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'VMware', '6.5', 'oracleLinux6_64Guest', 220, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'VMware', '6.5', 'oracleLinux6Guest', 250, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'VMware', '6.5', 'oracleLinux6_64Guest', 251, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'VMware', '6.5', 'oracleLinux7_64Guest', 247, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'VMware', '6.5', 'ubuntuGuest', 255, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'VMware', '6.5', 'ubuntu64Guest', 256, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'VMware', '6.5', 'ubuntu64Guest', 277, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'VMware', '6.5', 'ubuntu64Guest', 278, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'VMware', '6.5', 'ubuntu64Guest', 279, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'VMware', '6.5', 'ubuntu64Guest', 280, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'VMware', '6.5', 'rhel7_64Guest', 282, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'VMware', '6.5', 'rhel7_64Guest', 283, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'VMware', '6.5', 'rhel7_64Guest', 284, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'VMware', '6.5', 'rhel7_64Guest', 285, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'VMware', '6.5', 'windows9Server64Guest', 276, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'VMware', '6.5', 'debian9Guest', 289, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'VMware', '6.5', 'debian9_64Guest', 290, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'VMware', '6.5', 'debian10Guest', 282, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'VMware', '6.5', 'debian10_64Guest', 293, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'VMware', '6.5', 'sles15_64Guest', 291, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'VMware', '6.5', 'centos6_64Guest', 302, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'VMware', '6.5', 'centos6_64Guest', 303, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'VMware', '6.5', 'centos6_64Guest', 304, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'VMware', '6.5', 'rhel8_64Guest', 286, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'VMware', '6.5', 'ubuntu64Guest', 281, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'VMware', '6.5', 'other4xLinuxGuest', 294, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'VMware', '6.5', 'other4xLinux64Guest', 295, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'VMware', '6.5', 'oracleLinux8_64Guest', 296, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'VMware', '6.5', 'centos8_64Guest', 297, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'VMware', '6.5', 'freebsd11Guest', 298, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'VMware', '6.5', 'freebsd11_64Guest', 299, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'VMware', '6.5', 'freebsd12Guest', 300, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'VMware', '6.5', 'freebsd12_64Guest', 301, now(), 0);
-- Copy VMware 6.5 Guest OSes to VMware 6.7
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) SELECT UUID(),'VMware', '6.7', guest_os_name, guest_os_id, utc_timestamp(), 0 FROM `cloud`.`guest_os_hypervisor` WHERE hypervisor_type='VMware' AND hypervisor_version='6.5';
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) SELECT UUID(),'VMware', '6.7.1', guest_os_name, guest_os_id, utc_timestamp(), 0 FROM `cloud`.`guest_os_hypervisor` WHERE hypervisor_type='VMware' AND hypervisor_version='6.7';
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) SELECT UUID(),'VMware', '6.7.2', guest_os_name, guest_os_id, utc_timestamp(), 0 FROM `cloud`.`guest_os_hypervisor` WHERE hypervisor_type='VMware' AND hypervisor_version='6.7.1';
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) SELECT UUID(),'VMware', '6.7.3', guest_os_name, guest_os_id, utc_timestamp(), 0 FROM `cloud`.`guest_os_hypervisor` WHERE hypervisor_type='VMware' AND hypervisor_version='6.7.2';
-- Copy XenServer 7.1.0 to XenServer 7.1.1
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) SELECT UUID(),'Xenserver', '7.1.1', guest_os_name, guest_os_id, utc_timestamp(), 0 FROM `cloud`.`guest_os_hypervisor` WHERE hypervisor_type='Xenserver' AND hypervisor_version='7.1.0';
-- Copy XenServer 7.1.1 to XenServer 7.1.2
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) SELECT UUID(),'Xenserver', '7.1.2', guest_os_name, guest_os_id, utc_timestamp(), 0 FROM `cloud`.`guest_os_hypervisor` WHERE hypervisor_type='Xenserver' AND hypervisor_version='7.1.1';
-- Add New XenServer 7.1.2 Guest OSes
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'Xenserver', '7.1.2', 'Debian Stretch 9.0', 289, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'Xenserver', '7.1.2', 'Debian Stretch 9.0', 290, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'Xenserver', '7.1.2', 'Ubuntu Bionic Beaver 18.04', 279, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'Xenserver', '7.1.2', 'Windows Server 2019 (64-bit)', 276, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'Xenserver', '7.1.2', 'CentOS 6 (64-bit', 303, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'Xenserver', '7.1.2', 'CentOS 7', 283, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'Xenserver', '7.1.2', 'CentOS 7', 284, now(), 0);
-- Copy XenServer 7.5 hypervisor guest OS mappings to XenServer 7.6
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) SELECT UUID(),'Xenserver', '7.6.0', guest_os_name, guest_os_id, utc_timestamp(), 0 FROM `cloud`.`guest_os_hypervisor` WHERE hypervisor_type='Xenserver' AND hypervisor_version='7.5.0';
-- Add New XenServer 7.6 Guest OSes
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'Xenserver', '7.6.0', 'Debian Jessie 8.0', 269, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'Xenserver', '7.6.0', 'Debian Jessie 8.0', 270, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'Xenserver', '7.6.0', 'Debian Stretch 9.0', 289, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'Xenserver', '7.6.0', 'Debian Stretch 9.0', 290, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'Xenserver', '7.6.0', 'Ubuntu Xenial Xerus 16.04', 255, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'Xenserver', '7.6.0', 'Ubuntu Xenial Xerus 16.04', 256, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'Xenserver', '7.6.0', 'Ubuntu Bionic Beaver 18.04', 279, now(), 0);
-- Copy XenServer 7.6 hypervisor guest OS mappings to XenServer8.0
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) SELECT UUID(),'Xenserver', '8.0.0', guest_os_name, guest_os_id, utc_timestamp(), 0 FROM `cloud`.`guest_os_hypervisor` WHERE hypervisor_type='Xenserver' AND hypervisor_version='7.6.0';
-- Add New XenServer 8.0 Guest OSes
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'Xenserver', '8.0.0', 'Windows Server 2019 (64-bit)', 276, now(), 0);
-- Add Missing KVM Guest OSes
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'KVM', 'default', 'CentOS 6.6', 262, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'KVM', 'default', 'CentOS 6.7', 263, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'KVM', 'default', 'CentOS 6.7', 264, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'KVM', 'default', 'CentOS 6.8', 302, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'KVM', 'default', 'CentOS 6.9', 303, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'KVM', 'default', 'CentOS 6.10', 304, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'KVM', 'default', 'Red Hat Enterprise Linux 7.2', 269, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'KVM', 'default', 'Red Hat Enterprise Linux 7.3', 282, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'KVM', 'default', 'Red Hat Enterprise Linux 7.4', 283, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'KVM', 'default', 'Red Hat Enterprise Linux 7.5', 284, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'KVM', 'default', 'Red Hat Enterprise Linux 7.6', 285, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'KVM', 'default', 'Red Hat Enterprise Linux 8', 286, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'KVM', 'default', 'Ubuntu 17.04', 277, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'KVM', 'default', 'Ubuntu 17.10', 278, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'KVM', 'default', 'Ubuntu 18.04 LTS', 279, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'KVM', 'default', 'Ubuntu 18.10', 280, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'KVM', 'default', 'Ubuntu 19.04', 281, now(), 0);
-- DPDK client and server mode support
ALTER TABLE `cloud`.`service_offering_details` CHANGE COLUMN `value` `value` TEXT NOT NULL;
ALTER TABLE `cloud`.`vpc_offerings` ADD COLUMN `sort_key` int(32) NOT NULL default 0 COMMENT 'sort key used for customising sort method';
-- Add `sort_key` column to data_center
ALTER TABLE `cloud`.`data_center` ADD COLUMN `sort_key` INT(32) NOT NULL DEFAULT 0;
-- Move domain_id to disk offering details and drop the domain_id column
INSERT INTO `cloud`.`disk_offering_details` (offering_id, name, value, display) SELECT id, 'domainid', domain_id, 0 FROM `cloud`.`disk_offering` WHERE domain_id IS NOT NULL AND type='Disk';
INSERT INTO `cloud`.`service_offering_details` (service_offering_id, name, value, display) SELECT id, 'domainid', domain_id, 0 FROM `cloud`.`disk_offering` WHERE domain_id IS NOT NULL AND type='Service';
ALTER TABLE `cloud`.`disk_offering` DROP COLUMN `domain_id`;
ALTER TABLE `cloud`.`service_offering_details` DROP FOREIGN KEY `fk_service_offering_details__service_offering_id`, DROP KEY `uk_service_offering_id_name`;
ALTER TABLE `cloud`.`service_offering_details` ADD CONSTRAINT `fk_service_offering_details__service_offering_id` FOREIGN KEY (`service_offering_id`) REFERENCES `service_offering`(`id`) ON DELETE CASCADE;
-- Disk offering with multi-domains and multi-zones
DROP VIEW IF EXISTS `cloud`.`disk_offering_view`;
CREATE VIEW `cloud`.`disk_offering_view` AS
SELECT
`disk_offering`.`id` AS `id`,
`disk_offering`.`uuid` AS `uuid`,
`disk_offering`.`name` AS `name`,
`disk_offering`.`display_text` AS `display_text`,
`disk_offering`.`provisioning_type` AS `provisioning_type`,
`disk_offering`.`disk_size` AS `disk_size`,
`disk_offering`.`min_iops` AS `min_iops`,
`disk_offering`.`max_iops` AS `max_iops`,
`disk_offering`.`created` AS `created`,
`disk_offering`.`tags` AS `tags`,
`disk_offering`.`customized` AS `customized`,
`disk_offering`.`customized_iops` AS `customized_iops`,
`disk_offering`.`removed` AS `removed`,
`disk_offering`.`use_local_storage` AS `use_local_storage`,
`disk_offering`.`system_use` AS `system_use`,
`disk_offering`.`hv_ss_reserve` AS `hv_ss_reserve`,
`disk_offering`.`bytes_read_rate` AS `bytes_read_rate`,
`disk_offering`.`bytes_read_rate_max` AS `bytes_read_rate_max`,
`disk_offering`.`bytes_read_rate_max_length` AS `bytes_read_rate_max_length`,
`disk_offering`.`bytes_write_rate` AS `bytes_write_rate`,
`disk_offering`.`bytes_write_rate_max` AS `bytes_write_rate_max`,
`disk_offering`.`bytes_write_rate_max_length` AS `bytes_write_rate_max_length`,
`disk_offering`.`iops_read_rate` AS `iops_read_rate`,
`disk_offering`.`iops_read_rate_max` AS `iops_read_rate_max`,
`disk_offering`.`iops_read_rate_max_length` AS `iops_read_rate_max_length`,
`disk_offering`.`iops_write_rate` AS `iops_write_rate`,
`disk_offering`.`iops_write_rate_max` AS `iops_write_rate_max`,
`disk_offering`.`iops_write_rate_max_length` AS `iops_write_rate_max_length`,
`disk_offering`.`cache_mode` AS `cache_mode`,
`disk_offering`.`sort_key` AS `sort_key`,
`disk_offering`.`type` AS `type`,
`disk_offering`.`display_offering` AS `display_offering`,
`disk_offering`.`state` AS `state`,
GROUP_CONCAT(DISTINCT(domain.id)) AS domain_id,
GROUP_CONCAT(DISTINCT(domain.uuid)) AS domain_uuid,
GROUP_CONCAT(DISTINCT(domain.name)) AS domain_name,
GROUP_CONCAT(DISTINCT(domain.path)) AS domain_path,
GROUP_CONCAT(DISTINCT(zone.id)) AS zone_id,
GROUP_CONCAT(DISTINCT(zone.uuid)) AS zone_uuid,
GROUP_CONCAT(DISTINCT(zone.name)) AS zone_name
FROM
`cloud`.`disk_offering`
LEFT JOIN
`cloud`.`disk_offering_details` AS `domain_details` ON `domain_details`.`offering_id` = `disk_offering`.`id` AND `domain_details`.`name`='domainid'
LEFT JOIN
`cloud`.`domain` AS `domain` ON FIND_IN_SET(`domain`.`id`, `domain_details`.`value`)
LEFT JOIN
`cloud`.`disk_offering_details` AS `zone_details` ON `zone_details`.`offering_id` = `disk_offering`.`id` AND `zone_details`.`name`='zoneid'
LEFT JOIN
`cloud`.`data_center` AS `zone` ON FIND_IN_SET(`zone`.`id`, `zone_details`.`value`)
WHERE
`disk_offering`.`state`='Active'
GROUP BY
`disk_offering`.`id`;
-- Service offering with multi-domains and multi-zones
DROP VIEW IF EXISTS `cloud`.`service_offering_view`;
CREATE VIEW `cloud`.`service_offering_view` AS
SELECT
`service_offering`.`id` AS `id`,
`disk_offering`.`uuid` AS `uuid`,
`disk_offering`.`name` AS `name`,
`disk_offering`.`display_text` AS `display_text`,
`disk_offering`.`provisioning_type` AS `provisioning_type`,
`disk_offering`.`created` AS `created`,
`disk_offering`.`tags` AS `tags`,
`disk_offering`.`removed` AS `removed`,
`disk_offering`.`use_local_storage` AS `use_local_storage`,
`disk_offering`.`system_use` AS `system_use`,
`disk_offering`.`customized_iops` AS `customized_iops`,
`disk_offering`.`min_iops` AS `min_iops`,
`disk_offering`.`max_iops` AS `max_iops`,
`disk_offering`.`hv_ss_reserve` AS `hv_ss_reserve`,
`disk_offering`.`bytes_read_rate` AS `bytes_read_rate`,
`disk_offering`.`bytes_read_rate_max` AS `bytes_read_rate_max`,
`disk_offering`.`bytes_read_rate_max_length` AS `bytes_read_rate_max_length`,
`disk_offering`.`bytes_write_rate` AS `bytes_write_rate`,
`disk_offering`.`bytes_write_rate_max` AS `bytes_write_rate_max`,
`disk_offering`.`bytes_write_rate_max_length` AS `bytes_write_rate_max_length`,
`disk_offering`.`iops_read_rate` AS `iops_read_rate`,
`disk_offering`.`iops_read_rate_max` AS `iops_read_rate_max`,
`disk_offering`.`iops_read_rate_max_length` AS `iops_read_rate_max_length`,
`disk_offering`.`iops_write_rate` AS `iops_write_rate`,
`disk_offering`.`iops_write_rate_max` AS `iops_write_rate_max`,
`disk_offering`.`iops_write_rate_max_length` AS `iops_write_rate_max_length`,
`disk_offering`.`cache_mode` AS `cache_mode`,
`service_offering`.`cpu` AS `cpu`,
`service_offering`.`speed` AS `speed`,
`service_offering`.`ram_size` AS `ram_size`,
`service_offering`.`nw_rate` AS `nw_rate`,
`service_offering`.`mc_rate` AS `mc_rate`,
`service_offering`.`ha_enabled` AS `ha_enabled`,
`service_offering`.`limit_cpu_use` AS `limit_cpu_use`,
`service_offering`.`host_tag` AS `host_tag`,
`service_offering`.`default_use` AS `default_use`,
`service_offering`.`vm_type` AS `vm_type`,
`service_offering`.`sort_key` AS `sort_key`,
`service_offering`.`is_volatile` AS `is_volatile`,
`service_offering`.`deployment_planner` AS `deployment_planner`,
GROUP_CONCAT(DISTINCT(domain.id)) AS domain_id,
GROUP_CONCAT(DISTINCT(domain.uuid)) AS domain_uuid,
GROUP_CONCAT(DISTINCT(domain.name)) AS domain_name,
GROUP_CONCAT(DISTINCT(domain.path)) AS domain_path,
GROUP_CONCAT(DISTINCT(zone.id)) AS zone_id,
GROUP_CONCAT(DISTINCT(zone.uuid)) AS zone_uuid,
GROUP_CONCAT(DISTINCT(zone.name)) AS zone_name
FROM
`cloud`.`service_offering`
INNER JOIN
`cloud`.`disk_offering_view` AS `disk_offering` ON service_offering.id = disk_offering.id
LEFT JOIN
`cloud`.`service_offering_details` AS `domain_details` ON `domain_details`.`service_offering_id` = `disk_offering`.`id` AND `domain_details`.`name`='domainid'
LEFT JOIN
`cloud`.`domain` AS `domain` ON FIND_IN_SET(`domain`.`id`, `domain_details`.`value`)
LEFT JOIN
`cloud`.`service_offering_details` AS `zone_details` ON `zone_details`.`service_offering_id` = `disk_offering`.`id` AND `zone_details`.`name`='zoneid'
LEFT JOIN
`cloud`.`data_center` AS `zone` ON FIND_IN_SET(`zone`.`id`, `zone_details`.`value`)
WHERE
`disk_offering`.`state`='Active'
GROUP BY
`service_offering`.`id`;
-- Add display column for network offering details table
ALTER TABLE `cloud`.`network_offering_details` ADD COLUMN `display` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'True if the detail can be displayed to the end user';
-- Network offering with multi-domains and multi-zones
DROP VIEW IF EXISTS `cloud`.`network_offering_view`;
CREATE VIEW `cloud`.`network_offering_view` AS
SELECT
`network_offerings`.`id` AS `id`,
`network_offerings`.`uuid` AS `uuid`,
`network_offerings`.`name` AS `name`,
`network_offerings`.`unique_name` AS `unique_name`,
`network_offerings`.`display_text` AS `display_text`,
`network_offerings`.`nw_rate` AS `nw_rate`,
`network_offerings`.`mc_rate` AS `mc_rate`,
`network_offerings`.`traffic_type` AS `traffic_type`,
`network_offerings`.`tags` AS `tags`,
`network_offerings`.`system_only` AS `system_only`,
`network_offerings`.`specify_vlan` AS `specify_vlan`,
`network_offerings`.`service_offering_id` AS `service_offering_id`,
`network_offerings`.`conserve_mode` AS `conserve_mode`,
`network_offerings`.`created` AS `created`,
`network_offerings`.`removed` AS `removed`,
`network_offerings`.`default` AS `default`,
`network_offerings`.`availability` AS `availability`,
`network_offerings`.`dedicated_lb_service` AS `dedicated_lb_service`,
`network_offerings`.`shared_source_nat_service` AS `shared_source_nat_service`,
`network_offerings`.`sort_key` AS `sort_key`,
`network_offerings`.`redundant_router_service` AS `redundant_router_service`,
`network_offerings`.`state` AS `state`,
`network_offerings`.`guest_type` AS `guest_type`,
`network_offerings`.`elastic_ip_service` AS `elastic_ip_service`,
`network_offerings`.`eip_associate_public_ip` AS `eip_associate_public_ip`,
`network_offerings`.`elastic_lb_service` AS `elastic_lb_service`,
`network_offerings`.`specify_ip_ranges` AS `specify_ip_ranges`,
`network_offerings`.`inline` AS `inline`,
`network_offerings`.`is_persistent` AS `is_persistent`,
`network_offerings`.`internal_lb` AS `internal_lb`,
`network_offerings`.`public_lb` AS `public_lb`,
`network_offerings`.`egress_default_policy` AS `egress_default_policy`,
`network_offerings`.`concurrent_connections` AS `concurrent_connections`,
`network_offerings`.`keep_alive_enabled` AS `keep_alive_enabled`,
`network_offerings`.`supports_streched_l2` AS `supports_streched_l2`,
`network_offerings`.`supports_public_access` AS `supports_public_access`,
`network_offerings`.`for_vpc` AS `for_vpc`,
`network_offerings`.`service_package_id` AS `service_package_id`,
GROUP_CONCAT(DISTINCT(domain.id)) AS domain_id,
GROUP_CONCAT(DISTINCT(domain.uuid)) AS domain_uuid,
GROUP_CONCAT(DISTINCT(domain.name)) AS domain_name,
GROUP_CONCAT(DISTINCT(domain.path)) AS domain_path,
GROUP_CONCAT(DISTINCT(zone.id)) AS zone_id,
GROUP_CONCAT(DISTINCT(zone.uuid)) AS zone_uuid,
GROUP_CONCAT(DISTINCT(zone.name)) AS zone_name
FROM
`cloud`.`network_offerings`
LEFT JOIN
`cloud`.`network_offering_details` AS `domain_details` ON `domain_details`.`network_offering_id` = `network_offerings`.`id` AND `domain_details`.`name`='domainid'
LEFT JOIN
`cloud`.`domain` AS `domain` ON FIND_IN_SET(`domain`.`id`, `domain_details`.`value`)
LEFT JOIN
`cloud`.`network_offering_details` AS `zone_details` ON `zone_details`.`network_offering_id` = `network_offerings`.`id` AND `zone_details`.`name`='zoneid'
LEFT JOIN
`cloud`.`data_center` AS `zone` ON FIND_IN_SET(`zone`.`id`, `zone_details`.`value`)
GROUP BY
`network_offerings`.`id`;
-- Create VPC offering details table
CREATE TABLE `vpc_offering_details` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`offering_id` bigint(20) unsigned NOT NULL COMMENT 'vpc offering id',
`name` varchar(255) NOT NULL,
`value` varchar(1024) NOT NULL,
`display` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'True if the detail can be displayed to the end user',
PRIMARY KEY (`id`),
KEY `fk_vpc_offering_details__vpc_offering_id` (`offering_id`),
CONSTRAINT `fk_vpc_offering_details__vpc_offering_id` FOREIGN KEY (`offering_id`) REFERENCES `vpc_offerings` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- VPC offering with multi-domains and multi-zones
DROP VIEW IF EXISTS `cloud`.`vpc_offering_view`;
CREATE VIEW `cloud`.`vpc_offering_view` AS
SELECT
`vpc_offerings`.`id` AS `id`,
`vpc_offerings`.`uuid` AS `uuid`,
`vpc_offerings`.`name` AS `name`,
`vpc_offerings`.`unique_name` AS `unique_name`,
`vpc_offerings`.`display_text` AS `display_text`,
`vpc_offerings`.`state` AS `state`,
`vpc_offerings`.`default` AS `default`,
`vpc_offerings`.`created` AS `created`,
`vpc_offerings`.`removed` AS `removed`,
`vpc_offerings`.`service_offering_id` AS `service_offering_id`,
`vpc_offerings`.`supports_distributed_router` AS `supports_distributed_router`,
`vpc_offerings`.`supports_region_level_vpc` AS `supports_region_level_vpc`,
`vpc_offerings`.`redundant_router_service` AS `redundant_router_service`,
`vpc_offerings`.`sort_key` AS `sort_key`,
GROUP_CONCAT(DISTINCT(domain.id)) AS domain_id,
GROUP_CONCAT(DISTINCT(domain.uuid)) AS domain_uuid,
GROUP_CONCAT(DISTINCT(domain.name)) AS domain_name,
GROUP_CONCAT(DISTINCT(domain.path)) AS domain_path,
GROUP_CONCAT(DISTINCT(zone.id)) AS zone_id,
GROUP_CONCAT(DISTINCT(zone.uuid)) AS zone_uuid,
GROUP_CONCAT(DISTINCT(zone.name)) AS zone_name
FROM
`cloud`.`vpc_offerings`
LEFT JOIN
`cloud`.`vpc_offering_details` AS `domain_details` ON `domain_details`.`offering_id` = `vpc_offerings`.`id` AND `domain_details`.`name`='domainid'
LEFT JOIN
`cloud`.`domain` AS `domain` ON FIND_IN_SET(`domain`.`id`, `domain_details`.`value`)
LEFT JOIN
`cloud`.`vpc_offering_details` AS `zone_details` ON `zone_details`.`offering_id` = `vpc_offerings`.`id` AND `zone_details`.`name`='zoneid'
LEFT JOIN
`cloud`.`data_center` AS `zone` ON FIND_IN_SET(`zone`.`id`, `zone_details`.`value`)
GROUP BY
`vpc_offerings`.`id`;
-- Recreate data_center_view
DROP VIEW IF EXISTS `cloud`.`data_center_view`;
CREATE VIEW `cloud`.`data_center_view` AS
select
data_center.id,
data_center.uuid,
data_center.name,
data_center.is_security_group_enabled,
data_center.is_local_storage_enabled,
data_center.description,
data_center.dns1,
data_center.dns2,
data_center.ip6_dns1,
data_center.ip6_dns2,
data_center.internal_dns1,
data_center.internal_dns2,
data_center.guest_network_cidr,
data_center.domain,
data_center.networktype,
data_center.allocation_state,
data_center.zone_token,
data_center.dhcp_provider,
data_center.removed,
data_center.sort_key,
domain.id domain_id,
domain.uuid domain_uuid,
domain.name domain_name,
domain.path domain_path,
dedicated_resources.affinity_group_id,
dedicated_resources.account_id,
affinity_group.uuid affinity_group_uuid
from
`cloud`.`data_center`
left join
`cloud`.`domain` ON data_center.domain_id = domain.id
left join
`cloud`.`dedicated_resources` ON data_center.id = dedicated_resources.data_center_id
left join
`cloud`.`affinity_group` ON dedicated_resources.affinity_group_id = affinity_group.id;
-- Remove key/value tags from project_view
DROP VIEW IF EXISTS `cloud`.`project_view`;
CREATE VIEW `cloud`.`project_view` AS
select
projects.id,
projects.uuid,
projects.name,
projects.display_text,
projects.state,
projects.removed,
projects.created,
projects.project_account_id,
account.account_name owner,
pacct.account_id,
domain.id domain_id,
domain.uuid domain_uuid,
domain.name domain_name,
domain.path domain_path
from
`cloud`.`projects`
inner join
`cloud`.`domain` ON projects.domain_id = domain.id
inner join
`cloud`.`project_account` ON projects.id = project_account.project_id
and project_account.account_role = 'Admin'
inner join
`cloud`.`account` ON account.id = project_account.account_id
left join
`cloud`.`project_account` pacct ON projects.id = pacct.project_id;
-- KVM: Add background task to upload certificates for direct download
CREATE TABLE `cloud`.`direct_download_certificate` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`uuid` varchar(40) NOT NULL,
`alias` varchar(255) NOT NULL,
`certificate` text NOT NULL,
`hypervisor_type` varchar(45) NOT NULL,
`zone_id` bigint(20) unsigned NOT NULL,
PRIMARY KEY (`id`),
KEY `i_direct_download_certificate_alias` (`alias`),
KEY `fk_direct_download_certificate__zone_id` (`zone_id`),
CONSTRAINT `fk_direct_download_certificate__zone_id` FOREIGN KEY (`zone_id`) REFERENCES `data_center` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `cloud`.`direct_download_certificate_host_map` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`certificate_id` bigint(20) unsigned NOT NULL,
`host_id` bigint(20) unsigned NOT NULL,
`revoked` int(1) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
KEY `fk_direct_download_certificate_host_map__host_id` (`host_id`),
KEY `fk_direct_download_certificate_host_map__certificate_id` (`certificate_id`),
CONSTRAINT `fk_direct_download_certificate_host_map__host_id` FOREIGN KEY (`host_id`) REFERENCES `host` (`id`) ON DELETE CASCADE,
CONSTRAINT `fk_direct_download_certificate_host_map__certificate_id` FOREIGN KEY (`certificate_id`) REFERENCES `direct_download_certificate` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- [Vmware] Allow configuring appliances on the VM instance wizard when OVF properties are available
CREATE TABLE `cloud`.`template_ovf_properties` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`template_id` bigint(20) unsigned NOT NULL,
`key` VARCHAR(100) NOT NULL,
`type` VARCHAR(45) DEFAULT NULL,
`value` VARCHAR(100) DEFAULT NULL,
`password` TINYINT(1) NOT NULL DEFAULT '0',
`qualifiers` TEXT DEFAULT NULL,
`user_configurable` TINYINT(1) NOT NULL DEFAULT '0',
`label` TEXT DEFAULT NULL,
`description` TEXT DEFAULT NULL,
PRIMARY KEY (`id`),
CONSTRAINT `fk_template_ovf_properties__template_id` FOREIGN KEY (`template_id`) REFERENCES `vm_template`(`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Add VM snapshot ID on usage helper tables
ALTER TABLE `cloud_usage`.`usage_vmsnapshot` ADD COLUMN `vm_snapshot_id` BIGINT(20) NULL DEFAULT NULL AFTER `processed`;
ALTER TABLE `cloud_usage`.`usage_snapshot_on_primary` ADD COLUMN `vm_snapshot_id` BIGINT(20) NULL DEFAULT NULL AFTER `deleted`; | the_stack |
--
-- Open MPI Test Results Tables
--
-- Usage: $ psql -d dbname -U dbusername < this_filename
--
-- Roles:
-- GRANT mtt to iu;
--
-- PARTITION/FK PROBLEM:
-- A foreign key reference is only valid for the specific table in which
-- the data is contained. Currently (as of 8.2) this does not work for
-- partition tables. The following error is likely to appear if a
-- table contains a foreign reference to a partition table:
-- ERROR: insert or update on table "test_build_y2006_m11_wk4" violates foreign key constraint "test_build_y2006_m11_wk4_mpi_install_id_fkey"
-- DETAIL: Key (mpi_install_id)=(1) is not present in table "mpi_install".
-- Even though ID '1' is in mpi_install, but in one of the child
-- partitions.
-- The work around is not to have foreign key conditions between the tables
-- which could slow down operations if we ever have to join any of the
-- 3 partition tables, which is unlikey.
--
--
-- Serial number used for individual MTT runs
--
DROP SEQUENCE IF EXISTS client_serial;
CREATE SEQUENCE client_serial;
--
-- Cluster Table
--
DROP TABLE IF EXISTS compute_cluster CASCADE;
CREATE TABLE compute_cluster (
compute_cluster_id serial,
-- Current Max: 42 chars
platform_name varchar(128) NOT NULL DEFAULT 'bogus',
-- Current Max: 6 chars
platform_hardware varchar(128) NOT NULL DEFAULT 'bogus',
-- Current Max: 54 chars
platform_type varchar(128) NOT NULL DEFAULT 'bogus',
-- Current Max: 5 chars
os_name varchar(128) NOT NULL DEFAULT 'bogus',
-- Current Max: 43 chars
os_version varchar(128) NOT NULL DEFAULT 'bogus',
UNIQUE (
os_name,
os_version,
platform_hardware,
platform_type,
platform_name
),
PRIMARY KEY (compute_cluster_id)
);
-- An invlid row in case we need it
INSERT INTO compute_cluster VALUES ('0', 'undef', 'undef', 'undef', 'undef', 'undef');
--
-- Submit Table
--
DROP TABLE IF EXISTS submit CASCADE;
CREATE TABLE submit (
submit_id serial,
-- Current Max: 95 chars
hostname varchar(128) NOT NULL DEFAULT 'bogus',
-- Current Max: 8 chars
local_username varchar(16) NOT NULL DEFAULT 'bogus',
-- Current Max: 8 chars
http_username varchar(16) NOT NULL DEFAULT 'bogus',
-- Current Max: 8 chars
mtt_client_version varchar(16) NOT NULL DEFAULT '',
PRIMARY KEY (submit_id)
);
-- An invlid row in case we need it
INSERT INTO submit VALUES ('0', 'undef', 'undef', 'undef', 'undef');
--
-- Compiler Table
--
DROP TABLE IF EXISTS compiler CASCADE;
CREATE TABLE compiler (
compiler_id serial,
-- Current Max: 9 chars
compiler_name varchar(64) NOT NULL DEFAULT 'bogus',
-- Current Max: 35 chars
compiler_version varchar(64) NOT NULL DEFAULT 'bogus',
UNIQUE (
compiler_name,
compiler_version
),
PRIMARY KEY (compiler_id)
);
-- An invlid row in case we need it
INSERT INTO compiler VALUES ('0', 'undef', 'undef');
--
-- MPI Get Table
--
DROP TABLE IF EXISTS mpi_get CASCADE;
CREATE TABLE mpi_get (
mpi_get_id serial,
-- Current Max: 21 chars
mpi_name varchar(64) NOT NULL DEFAULT 'bogus',
-- Current Max: 24 chars
mpi_version varchar(128) NOT NULL DEFAULT 'bogus',
UNIQUE (
mpi_name,
mpi_version
),
PRIMARY KEY (mpi_get_id)
);
-- An invlid row in case we need it
INSERT INTO mpi_get VALUES ('0', 'undef', 'undef');
--
-- Results: Description Normalization table
--
DROP TABLE IF EXISTS description CASCADE;
CREATE TABLE description (
description_id serial,
description text DEFAULT 'bogus',
PRIMARY KEY (description_id)
);
--
-- Add empty row to the description table
--
INSERT INTO description VALUES(0, '');
--
-- Results: Result Message Normalization table
--
DROP TABLE IF EXISTS result_message CASCADE;
CREATE TABLE result_message (
result_message_id serial,
result_message text DEFAULT 'bogus',
PRIMARY KEY (result_message_id)
);
-- Insert an invalid tuple in case we need it.
INSERT INTO result_message VALUES('0', 'undef');
--
-- Results: Environment Normalization table
--
DROP TABLE IF EXISTS environment CASCADE;
CREATE TABLE environment (
environment_id serial,
environment text DEFAULT 'bogus',
PRIMARY KEY (environment_id)
);
--
-- Add empty row to the environment table
--
INSERT INTO environment VALUES(0, '');
--
-- MPI Install Configure Argument Normalization table
--
DROP TABLE IF EXISTS mpi_install_configure_args CASCADE;
CREATE TABLE mpi_install_configure_args (
mpi_install_configure_id serial,
-- http://www.postgresql.org/docs/8.2/interactive/datatype-bit.html
-- 00 = none
-- 01 = relative
-- 10 = absolute
vpath_mode bit(2) NOT NULL DEFAULT B'00',
-- 000000 = unknown
-- 000001 = 8
-- 000010 = 16
-- 000100 = 32
-- 001000 = 64
-- 010000 = 128
bitness bit(6) NOT NULL DEFAULT B'000000',
-- 00 = unknown
-- 01 = little
-- 10 = big
-- 11 = both (Mac OS X Universal Binaries)
endian bit(2) NOT NULL DEFAULT B'00',
-- Current Max: 1319 chars
configure_arguments text NOT NULL DEFAULT '',
UNIQUE (
vpath_mode,
bitness,
endian,
configure_arguments
),
PRIMARY KEY (mpi_install_configure_id)
);
-- An invlid row in case we need it
INSERT INTO mpi_install_configure_args VALUES ('0', DEFAULT, DEFAULT, DEFAULT, 'undef');
--
-- Collect 'results' data into a table for easy updating
-- Note: Never select on this table, it give missleading results.
-- It will count all the tuples of its children even though it
-- doesn't contain any tuples. I guess this is a quick way to
-- get the total number of results in the database across the
-- three partiion tables.
--
DROP TABLE IF EXISTS results_fields CASCADE;
CREATE TABLE results_fields (
description_id integer NOT NULL,
start_timestamp timestamp without time zone NOT NULL DEFAULT now() - interval '24 hours',
-- result value: 0=fail, 1=pass, 2=skipped, 3=timed out
test_result smallint NOT NULL DEFAULT '-38',
-- flag data submitted by experimental MTT runs
trial boolean DEFAULT 'f',
submit_timestamp timestamp without time zone NOT NULL DEFAULT now(),
duration interval NOT NULL DEFAULT '-38 seconds',
environment_id integer NOT NULL,
result_stdout text NOT NULL DEFAULT '',
result_stderr text NOT NULL DEFAULT '',
result_message_id integer NOT NULL,
merge_stdout_stderr boolean NOT NULL DEFAULT 't',
-- set if process exited
exit_value integer NOT NULL DEFAULT '-38',
-- set if process was signaled
exit_signal integer NOT NULL DEFAULT '-38',
-- keep track of individual MTT runs
client_serial integer NOT NULL DEFAULT '-38'
);
--
-- MPI Install Table
--
DROP TABLE IF EXISTS mpi_install CASCADE;
CREATE TABLE mpi_install (
mpi_install_id serial,
submit_id integer NOT NULL DEFAULT '-38',
compute_cluster_id integer NOT NULL DEFAULT '-38',
mpi_install_compiler_id integer NOT NULL DEFAULT '-38',
mpi_get_id integer NOT NULL DEFAULT '-38',
mpi_install_configure_id integer NOT NULL DEFAULT '-38',
-- ********** --
PRIMARY KEY (mpi_install_id),
FOREIGN KEY (submit_id) REFERENCES submit(submit_id),
FOREIGN KEY (compute_cluster_id) REFERENCES compute_cluster(compute_cluster_id),
FOREIGN KEY (mpi_install_compiler_id) REFERENCES compiler(compiler_id),
FOREIGN KEY (mpi_get_id) REFERENCES mpi_get(mpi_get_id),
FOREIGN KEY (mpi_install_configure_id) REFERENCES mpi_install_configure_args(mpi_install_configure_id),
FOREIGN KEY (description_id) REFERENCES description(description_id),
FOREIGN KEY (environment_id) REFERENCES environment(environment_id),
FOREIGN KEY (result_message_id) REFERENCES result_message(result_message_id)
) INHERITS(results_fields);
-- An invlid row in case we need it
INSERT INTO mpi_install
(description_id,
start_timestamp,
test_result,
trial,
submit_timestamp,
duration,
environment_id,
result_stdout,
result_stderr,
result_message_id,
merge_stdout_stderr,
exit_value,
exit_signal,
client_serial,
submit_id,
compute_cluster_id,
mpi_install_compiler_id,
mpi_get_id,
mpi_install_configure_id,
mpi_install_id
) VALUES (
'0',
TIMESTAMP '2006-11-01',
'1',
DEFAULT,
TIMESTAMP '2006-11-01',
INTERVAL '1',
'0',
'undef',
'undef',
'0',
DEFAULT,
'0',
DEFAULT,
DEFAULT,
'0',
'0',
'0',
'0',
'0',
'0'
);
--
-- Test Suite Table
--
DROP TABLE IF EXISTS test_suites CASCADE;
CREATE TABLE test_suites (
test_suite_id serial,
-- Current Max: 15 chars
suite_name varchar(32) NOT NULL DEFAULT 'bogus',
test_suite_description text DEFAULT '',
UNIQUE (
suite_name
),
PRIMARY KEY (test_suite_id)
);
-- An invalid tuple if we need it
INSERT INTO test_suites VALUES ('0', 'undef', 'undef');
--
-- Ind. Test Name Table
-- NOTE: Test names are assumed to be unique in a test suite
--
DROP TABLE IF EXISTS test_names CASCADE;
CREATE TABLE test_names (
test_name_id serial,
test_suite_id integer NOT NULL,
-- Current Max: 39 chars
test_name varchar(64) NOT NULL DEFAULT 'bogus',
test_name_description text DEFAULT '',
UNIQUE (
test_suite_id,
test_name
),
PRIMARY KEY (test_name_id),
FOREIGN KEY (test_suite_id) REFERENCES test_suites(test_suite_id)
);
-- An invalid tuple if we need it
INSERT INTO test_names VALUES('0', '0', 'undef', 'undef');
--
-- Test Build Table
--
DROP TABLE IF EXISTS test_build CASCADE;
CREATE TABLE test_build (
test_build_id serial,
submit_id integer NOT NULL DEFAULT '-38',
compute_cluster_id integer NOT NULL DEFAULT '-38',
mpi_install_compiler_id integer NOT NULL DEFAULT '-38',
mpi_get_id integer NOT NULL DEFAULT '-38',
mpi_install_configure_id integer NOT NULL DEFAULT '-38',
mpi_install_id integer NOT NULL DEFAULT '-38',
test_suite_id integer NOT NULL DEFAULT '-38',
test_build_compiler_id integer NOT NULL DEFAULT '-38',
-- ********** --
PRIMARY KEY (test_build_id),
FOREIGN KEY (submit_id) REFERENCES submit(submit_id),
FOREIGN KEY (compute_cluster_id) REFERENCES compute_cluster(compute_cluster_id),
FOREIGN KEY (mpi_install_compiler_id) REFERENCES compiler(compiler_id),
FOREIGN KEY (mpi_get_id) REFERENCES mpi_get(mpi_get_id),
FOREIGN KEY (mpi_install_configure_id) REFERENCES mpi_install_configure_args(mpi_install_configure_id),
-- PARTITION/FK PROBLEM: FOREIGN KEY (mpi_install_id) REFERENCES mpi_install(mpi_install_id),
FOREIGN KEY (test_suite_id) REFERENCES test_suites(test_suite_id),
FOREIGN KEY (test_build_compiler_id) REFERENCES compiler(compiler_id),
FOREIGN KEY (description_id) REFERENCES description(description_id),
FOREIGN KEY (environment_id) REFERENCES environment(environment_id),
FOREIGN KEY (result_message_id) REFERENCES result_message(result_message_id)
) INHERITS(results_fields);
-- An invlid row in case we need it
INSERT INTO test_build
(description_id,
start_timestamp,
test_result,
trial,
submit_timestamp,
duration,
environment_id,
result_stdout,
result_stderr,
result_message_id,
merge_stdout_stderr,
exit_value,
exit_signal,
client_serial,
submit_id,
compute_cluster_id,
mpi_install_compiler_id,
mpi_get_id,
mpi_install_configure_id,
mpi_install_id,
test_suite_id,
test_build_compiler_id,
test_build_id
) VALUES (
'0',
TIMESTAMP '2006-11-01',
'1',
DEFAULT,
TIMESTAMP '2006-11-01',
INTERVAL '1',
'0',
'undef',
'undef',
'0',
DEFAULT,
'0',
DEFAULT,
DEFAULT,
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0'
);
--
-- BIOS Table
--
-- DROP TABLE IF EXISTS bios CASCADE;
-- CREATE TABLE bios (
-- bios_id serial,
-- -- file with the bios switches; not an MTT .ini file.
-- bios_nodelist text NOT NULL DEFAULT '',
-- bios_params text NOT NULL DEFAULT '',
-- bios_values text NOT NULL DEFAULT '',
-- PRIMARY KEY (bios_id)
-- );
-- An invalid row in case we need it
-- INSERT INTO bios VALUES ('0', '');
--
-- Firmware Table
--
-- DROP TABLE IF EXISTS firmware CASCADE;
-- CREATE TABLE firmware (
-- firmware_id serial,
-- flashupdt_cfg text NOT NULL DEFAULT '',
-- firmware_nodelist text NOT NULL DEFAULT '',
-- PRIMARY KEY (firmware_id)
-- );
-- An invalid row in case we need it
-- INSERT INTO firmware VALUES ('0', '');
--
-- Provision Table
--
-- TODO: Is this table too specific to ipmi and warewulf? How to abstract?
--
-- DROP TABLE IF EXISTS provision CASCADE;
-- CREATE TABLE provision (
-- provision_id serial,
-- targets text NOT NULL DEFAULT '',
-- image varchar(64),
-- controllers text NOT NULL DEFAULT '',
-- bootstrap varchar(64),
-- PRIMARY KEY (provision_id)
-- );
-- INSERT INTO provision VALUES ('0', '', '', '', '');
-- TODO: Create a Harasser table
-- DROP TABLE IF EXISTS harasser CASCADE;
-- CREATE TABLE harasser (
-- harasser_id serial,
-- harasser_seed integer,
-- inject_script text NOT NULL DEFAULT '',
-- cleanup_script text NOT NULL DEFAULT '',
-- check_script text NOT NULL DEFAULT '',
-- PRIMARY KEY (harasser_id)
-- );
-- INSERT INTO harasser VALUES ('0', '0', '', '', '');
--
-- Latency/Bandwidth Table
--
DROP TABLE IF EXISTS latency_bandwidth CASCADE;
CREATE TABLE latency_bandwidth (
latency_bandwidth_id serial,
message_size integer[] DEFAULT '{}',
bandwidth_min double precision[] DEFAULT '{}',
bandwidth_max double precision[] DEFAULT '{}',
bandwidth_avg double precision[] DEFAULT '{}',
latency_min double precision[] DEFAULT '{}',
latency_max double precision[] DEFAULT '{}',
latency_avg double precision[] DEFAULT '{}',
PRIMARY KEY (latency_bandwidth_id)
);
--
-- Performance Table
--
DROP TABLE IF EXISTS performance CASCADE;
CREATE TABLE performance (
performance_id serial,
latency_bandwidth_id integer,
PRIMARY KEY (performance_id),
FOREIGN KEY (latency_bandwidth_id) REFERENCES latency_bandwidth(latency_bandwidth_id)
);
--
-- Cluster Checker Table
--
-- DROP TABLE IF EXISTS cluster_checker CASCADE;
-- CREATE TABLE cluster_checker (
-- clck_id serial,
-- clck_results_file text NOT NULL DEFAULT '',
-- PRIMARY KEY (clck_id)
-- );
-- An invalid row in case we need it
-- INSERT INTO cluster_checker VALUES ('0', 'undef');
--
-- Interconnect Normalization table
--
DROP TABLE IF EXISTS interconnects CASCADE;
CREATE TABLE interconnects (
interconnect_id serial,
interconnect_name varchar(32),
PRIMARY KEY (interconnect_id)
);
--
-- Test Run Command Network Normalization Table
--
DROP SEQUENCE IF EXISTS test_run_network_id;
CREATE SEQUENCE test_run_network_id;
DROP TABLE IF EXISTS test_run_networks CASCADE;
CREATE TABLE test_run_networks (
-- This value should never be referenced!
network_id serial,
test_run_network_id int,
interconnect_id int,
PRIMARY KEY (network_id),
FOREIGN KEY (interconnect_id) REFERENCES interconnects(interconnect_id)
);
--
-- Test Run Command Normalization Table
--
DROP TABLE IF EXISTS test_run_command CASCADE;
CREATE TABLE test_run_command (
test_run_command_id serial,
-- mpirun, mpiexec, yod, ... 128 chars to handle script names
launcher varchar(128) DEFAULT '',
-- Resource Manager [RSH, SLURM, PBS, ...]
resource_mgr varchar(32) DEFAULT '',
-- Runtime Parameters [MCA, SSI, ...]
parameters text DEFAULT '',
-- Network
network varchar(32) DEFAULT '',
test_run_network_id int DEFAULT 0,
PRIMARY KEY (test_run_command_id)
);
--
-- Test Run Table
-- NOTE:
-- This is the parent partition table which defines the fields and basic constraints.
-- It will never contain any information, but serve as a point of reference.
-- Use the create-partitions.pl script to generate the child table SQL commands
-- Needed to link with this table.
--
DROP TABLE IF EXISTS test_run CASCADE;
CREATE TABLE test_run (
test_run_id serial,
submit_id integer NOT NULL DEFAULT '-38',
compute_cluster_id integer NOT NULL DEFAULT '-38',
mpi_install_compiler_id integer NOT NULL DEFAULT '-38',
mpi_get_id integer NOT NULL DEFAULT '-38',
mpi_install_configure_id integer NOT NULL DEFAULT '-38',
mpi_install_id integer NOT NULL DEFAULT '-38',
test_suite_id integer NOT NULL DEFAULT '-38',
test_build_compiler_id integer NOT NULL DEFAULT '-38',
test_build_id integer NOT NULL DEFAULT '-38',
test_name_id integer NOT NULL DEFAULT '-38',
performance_id integer DEFAULT '-38',
-- clck_id integer DEFAULT '-38',
test_run_command_id integer NOT NULL DEFAULT '-38',
-- bios_id integer DEFAULT '0',
-- firmware_id integer DEFAULT '0',
-- provision_id integer DEFAULT '0',
-- harasser_id integer DEFAULT '0',
np smallint NOT NULL DEFAULT '-38',
full_command text NOT NULL DEFAULT 'bogus',
-- ********** --
PRIMARY KEY (test_run_id),
FOREIGN KEY (submit_id) REFERENCES submit(submit_id),
FOREIGN KEY (compute_cluster_id) REFERENCES compute_cluster(compute_cluster_id),
FOREIGN KEY (mpi_install_compiler_id) REFERENCES compiler(compiler_id),
FOREIGN KEY (mpi_get_id) REFERENCES mpi_get(mpi_get_id),
FOREIGN KEY (mpi_install_configure_id) REFERENCES mpi_install_configure_args(mpi_install_configure_id),
-- PARTITION/FK PROBLEM: FOREIGN KEY (mpi_install_id) REFERENCES mpi_install(mpi_install_id),
FOREIGN KEY (test_suite_id) REFERENCES test_suites(test_suite_id),
FOREIGN KEY (test_build_compiler_id) REFERENCES compiler(compiler_id),
-- PARTITION/FK PROBLEM: FOREIGN KEY (test_build_id) REFERENCES test_build(test_build_id),
FOREIGN KEY (test_name_id) REFERENCES test_names(test_name_id),
FOREIGN KEY (performance_id) REFERENCES performance(performance_id),
-- FOREIGN KEY (clck_id) REFERENCES cluster_checker(clck_id),
FOREIGN KEY (test_run_command_id) REFERENCES test_run_command(test_run_command_id),
FOREIGN KEY (description_id) REFERENCES description(description_id),
FOREIGN KEY (environment_id) REFERENCES environment(environment_id),
FOREIGN KEY (result_message_id) REFERENCES result_message(result_message_id)
) INHERITS(results_fields);
-- ****************************************** --
-- Temporary Conversion tables
-- ****************************************** --
--
-- Cluster Table
--
DROP TABLE IF EXISTS temp_conv_compute_cluster CASCADE;
CREATE TABLE temp_conv_compute_cluster (
new_compute_cluster_id integer NOT NULL,
old_compute_cluster_id integer NOT NULL
);
CREATE INDEX temp_conv_compute_cluster_idx ON temp_conv_compute_cluster (old_compute_cluster_id);
--
-- Submit Table
--
DROP TABLE IF EXISTS temp_conv_submit CASCADE;
CREATE TABLE temp_conv_submit (
new_submit_id integer NOT NULL,
old_submit_id integer NOT NULL
);
CREATE INDEX temp_conv_submit_idx ON temp_conv_submit (old_submit_id);
--
-- Compiler Table
--
DROP TABLE IF EXISTS temp_conv_compiler CASCADE;
CREATE TABLE temp_conv_compiler (
new_compiler_id integer NOT NULL,
old_compiler_id integer NOT NULL
);
CREATE INDEX temp_conv_compiler_idx ON temp_conv_compiler (old_compiler_id);
--
-- Mpi_Get Table
--
DROP TABLE IF EXISTS temp_conv_mpi_get CASCADE;
CREATE TABLE temp_conv_mpi_get (
new_mpi_get_id integer NOT NULL,
old_mpi_get_id integer NOT NULL
);
CREATE INDEX temp_conv_mpi_get_idx ON temp_conv_mpi_get (old_mpi_get_id);
--
-- Latency_Bandwidth Table
--
DROP TABLE IF EXISTS temp_conv_latency_bandwidth CASCADE;
CREATE TABLE temp_conv_latency_bandwidth (
new_latency_bandwidth_id integer NOT NULL,
old_latency_bandwidth_id integer NOT NULL
);
CREATE INDEX temp_conv_latency_bandwidth_idx ON temp_conv_latency_bandwidth (old_latency_bandwidth_id);
--
-- MPI Install
--
DROP TABLE IF EXISTS temp_conv_mpi_install CASCADE;
CREATE TABLE temp_conv_mpi_install (
new_mpi_install_id integer NOT NULL,
old_mpi_install_id integer NOT NULL,
old_results_id integer NOT NULL
);
CREATE INDEX temp_conv_mpi_install_idx ON temp_conv_mpi_install (old_results_id);
--
-- Test Build
--
DROP TABLE IF EXISTS temp_conv_test_build CASCADE;
CREATE TABLE temp_conv_test_build (
new_test_build_id integer NOT NULL,
old_test_build_id integer NOT NULL,
old_results_id integer NOT NULL
);
CREATE INDEX temp_conv_test_build_idx ON temp_conv_test_build (old_results_id);
--
-- Test Run
--
DROP TABLE IF EXISTS temp_conv_test_run CASCADE;
CREATE TABLE temp_conv_test_run (
new_test_run_id integer NOT NULL,
old_test_run_id integer NOT NULL,
old_results_id integer NOT NULL
);
CREATE INDEX temp_conv_test_run_idx ON temp_conv_test_run (old_results_id);
--
-- Add a 'none' value to the latency-bandwidth table
-- This allows the foreign key constraint to work on all test_run entries,
-- even those that don't have latency/bandwidth data.
--
INSERT INTO latency_bandwidth VALUES(0);
INSERT INTO performance VALUES(0,0);
--
-- Add empty row to test_run_command as a placeholder
--
INSERT INTO test_run_command VALUES(0, '', '', '', '');
--
-- Add empty row to test_run_networks and interconnects
--
INSERT INTO interconnects VALUES(0, '');
INSERT INTO test_run_networks VALUES(0, 0, 0);
--
-- Add the partition tables
--
--\i 2006-mpi-install.sql
--\i 2006-test-build.sql
--\i 2006-test-run.sql
--\i 2007-mpi-install.sql
--\i 2007-test-build.sql
--\i 2007-test-run.sql
--
-- Add the partition table indexes
--
--\i 2006-indexes.sql
--\i 2007-indexes.sql | the_stack |
.mode csv
DROP TABLE IF EXISTS FLOAT4_TBL;
DROP TABLE IF EXISTS FLOAT4_TMP;
DROP TABLE IF EXISTS FLOAT8_TBL;
DROP TABLE IF EXISTS FLOAT8_TMP;
DROP TABLE IF EXISTS INT4_TBL;
DROP TABLE IF EXISTS INT4_TMP;
DROP TABLE IF EXISTS INT8_TBL;
DROP TABLE IF EXISTS test_having;
DROP TABLE IF EXISTS onek;
DROP TABLE IF EXISTS tenk1;
CREATE TABLE FLOAT4_TBL (f1 REAL);
CREATE TABLE FLOAT4_TMP (f1 REAL, id integer primary key autoincrement);
CREATE TABLE FLOAT8_TBL(f1 DOUBLE PRECISION);
CREATE TABLE FLOAT8_TMP (f1 DOUBLE PRECISION, f2 DOUBLE PRECISION, id integer primary key autoincrement);
CREATE TABLE INT4_TBL(f1 int4);
CREATE TABLE INT4_TMP (f1 int4, f2 int, id integer primary key autoincrement);
CREATE TABLE INT8_TBL(
q1 int8,
q2 int8,
CONSTRAINT t1_pkey PRIMARY KEY (q1, q2)
);
CREATE TABLE INT8_TMP(
q1 int8,
q2 int8,
q3 int4,
q4 int2,
q5 text,
id integer primary key autoincrement
);
CREATE TABLE INT2_TBL(f1 int2);
--Testcase 1:
INSERT INTO INT2_TBL(f1) VALUES ('0 ');
--Testcase 2:
INSERT INTO INT2_TBL(f1) VALUES (' 1234 ');
--Testcase 3:
INSERT INTO INT2_TBL(f1) VALUES (' -1234');
--Testcase 4:
INSERT INTO INT2_TBL(f1) VALUES ('34.5');
-- largest and smallest values
--Testcase 5:
INSERT INTO INT2_TBL(f1) VALUES ('32767');
--Testcase 6:
INSERT INTO INT2_TBL(f1) VALUES ('-32767');
CREATE TABLE test_having (a int, b int, c char(8), d char);
CREATE TABLE onek (
unique1 int4,
unique2 int4,
two int4,
four int4,
ten int4,
twenty int4,
hundred int4,
thousand int4,
twothousand int4,
fivethous int4,
tenthous int4,
odd int4,
even int4,
stringu1 name,
stringu2 name,
string4 name
);
CREATE TABLE onek2 (
unique1 int4,
unique2 int4,
two int4,
four int4,
ten int4,
twenty int4,
hundred int4,
thousand int4,
twothousand int4,
fivethous int4,
tenthous int4,
odd int4,
even int4,
stringu1 name,
stringu2 name,
string4 name
);
CREATE TABLE tenk1 (
unique1 int4,
unique2 int4,
two int4,
four int4,
ten int4,
twenty int4,
hundred int4,
thousand int4,
twothousand int4,
fivethous int4,
tenthous int4,
odd int4,
even int4,
stringu1 name,
stringu2 name,
string4 name
);
CREATE TABLE tenk2 (
unique1 int4,
unique2 int4,
two int4,
four int4,
ten int4,
twenty int4,
hundred int4,
thousand int4,
twothousand int4,
fivethous int4,
tenthous int4,
odd int4,
even int4,
stringu1 name,
stringu2 name,
string4 name
);
CREATE TABLE aggtest (
a int2,
b float4
);
CREATE TABLE student (
name text,
age int4,
location point,
gpa float8
);
CREATE TABLE person (
name text,
age int4,
location point
);
-- FOR prepare.sql
CREATE TABLE road (
name text,
thepath path
);
create table road_tmp (a int, b int, id integer primary key autoincrement);
CREATE TABLE dates (
name TEXT,
date_as_text TEXT,
date_as_number FLOAT8
);
.separator "\t"
.import /tmp/onek.data onek
.import /tmp/onek.data onek2
.import /tmp/tenk.data tenk1
.import /tmp/agg.data aggtest
.import /tmp/student.data student
.import /tmp/person.data person
.import /tmp/streets.data road
.import /tmp/datetimes.data dates
--Testcase 7:
INSERT INTO tenk2 SELECT * FROM tenk1;
CREATE TABLE bitwise_test(
i2 INT2,
i4 INT4,
i8 INT8,
i INTEGER,
x INT2
);
CREATE TABLE bool_test(
b1 BOOL,
b2 BOOL,
b3 BOOL,
b4 BOOL);
CREATE TABLE bool_test_tmp(
b1 BOOL,
b2 BOOL, primary key (b1, b2));
-- FOR AGGREGATEQ.SQL
create table minmaxtest(f1 int);
create table agg_t1 (a int, b int, c int, d int, primary key (a, b));
create table agg_t2 (x int, y int, z int, primary key (x, y));
create table agg_t3 (a float8, b float8, id integer primary key autoincrement);
create table agg_t4 (a float4, b float4, id integer primary key autoincrement);
create table agg_t5 (a numeric, b numeric, id integer primary key autoincrement);
create table agg_t6 (a float8, id integer primary key autoincrement);
create table agg_t7 (a float8, b float8, c float8, d float8, id integer primary key autoincrement);
create table agg_t8 (a text, b text, primary key (a));
CREATE TABLE regr_test (x float8, y float8, id integer primary key autoincrement);
create table agg_t9 (a int, b int, c int, primary key (a, b));
create table agg_t10(one int, id integer primary key autoincrement);
create table agg_t11(one int, two int, id integer primary key autoincrement);
create table agg_t12(a int, id integer primary key autoincrement);
create table agg_t13(x int, id integer primary key autoincrement);
create table agg_t14(x int, y int, id integer primary key autoincrement);
create table agg_data_2k(g int , id integer primary key autoincrement);
create table agg_data_20k(g int , id integer primary key autoincrement);
create table t1(f1 int4, f2 int8);
create table t2(f1 int8, f22 int8);
create table agg_t15(a text, b int, c int, id integer primary key autoincrement);
create table agg_t16(a text, b text, id integer primary key autoincrement);
create table agg_t17(foo text, bar text);
create table agg_t18 (inner_c int);
create table agg_t19 (outer_c int);
create table agg_t20 (x text);
create table agg_t21 (x int);
-- multi-arg aggs
create table multi_arg_agg (a int, b int, c text);
create table agg_group_1 (c1 int, c2 numeric, c3 int);
create table agg_group_2 (a int , c1 numeric, c2 text, c3 int);
create table agg_group_3 (c1 numeric, c2 int, c3 int);
create table agg_group_4 (c1 numeric, c2 text, c3 int);
create table agg_hash_1 (c1 int, c2 numeric, c3 int);
create table agg_hash_2 (a int , c1 numeric, c2 text, c3 int);
create table agg_hash_3 (c1 numeric, c2 int, c3 int);
create table agg_hash_4 (c1 numeric, c2 text, c3 int);
-- FOR float4.sql
create table testdata(bits text, id integer primary key autoincrement);
-- FOR int4.sql
create table numeric_tmp(f1 numeric, f2 numeric , id integer primary key autoincrement);
CREATE TABLE VARCHAR_TBL(f1 varchar(4));
--Testcase 8:
INSERT INTO VARCHAR_TBL (f1) VALUES ('a');
--Testcase 9:
INSERT INTO VARCHAR_TBL (f1) VALUES ('ab');
--Testcase 10:
INSERT INTO VARCHAR_TBL (f1) VALUES ('abcd');
create table bytea_test_table(v bytea);
-- FOR numeric.sql
CREATE TABLE num_data (id int4, val numeric, primary key (id));
CREATE TABLE num_exp_add (id1 int4, id2 int4, expected numeric, primary key (id1, id2));
CREATE TABLE num_exp_sub (id1 int4, id2 int4, expected numeric, primary key (id1, id2));
CREATE TABLE num_exp_div (id1 int4, id2 int4, expected numeric, primary key (id1, id2));
CREATE TABLE num_exp_mul (id1 int4, id2 int4, expected numeric, primary key (id1, id2));
CREATE TABLE num_exp_sqrt (id int4, expected numeric, primary key (id));
CREATE TABLE num_exp_ln (id int4, expected numeric, primary key (id));
CREATE TABLE num_exp_log10 (id int4, expected numeric, primary key (id));
CREATE TABLE num_exp_power_10_ln (id int4, expected numeric, primary key (id));
CREATE TABLE num_result (id1 int4, id2 int4, result numeric, primary key (id1, id2));
CREATE TABLE fract_only (id int, val numeric(4,4));
CREATE TABLE ceil_floor_round (a numeric primary key);
CREATE TABLE width_bucket_tbl (id1 numeric, id2 numeric, id3 numeric, id4 int, id integer primary key autoincrement);
CREATE TABLE width_bucket_test (operand_num numeric, operand_f8 float8);
CREATE TABLE num_input_test (n1 numeric);
CREATE TABLE num_tmp (n1 numeric, n2 numeric, id integer primary key autoincrement);
CREATE TABLE to_number_tbl(a text, id integer primary key autoincrement);
-- FOR join.sql
create table q1 (i int);
create table q2 (i int);
CREATE TABLE foo (f1 int);
CREATE TABLE J1_TBL (
i integer,
j integer,
t text
);
CREATE TABLE J2_TBL (
i integer,
k integer
);
create table sub_tbl (key1 int, key3 int, key5 int, key6 int, value1 int, id integer primary key autoincrement);
CREATE TABLE t11 (name TEXT, n INTEGER);
CREATE TABLE t21 (name TEXT, n INTEGER);
CREATE TABLE t31 (name TEXT, n INTEGER);
create table x (x1 int, x2 int);
create table y (y1 int, y2 int);
CREATE TABLE t12 (a int, b int);
CREATE TABLE t22 (a int, b int);
CREATE TABLE t32 (x int, y int);
CREATE TABLE tt1 ( tt1_id int4, joincol int4 );
CREATE TABLE tt2 ( tt2_id int4, joincol int4 );
create table tt3(f1 int, f2 text);
create table tt4(f1 int);
create table tt4x(c1 int, c2 int, c3 int);
create table tt5(f1 int, f2 int);
create table tt6(f1 int, f2 int);
create table xx (pkxx int);
create table yy (pkyy int, pkxx int);
create table zt1 (f1 int primary key);
create table zt2 (f2 int primary key);
create table zt3 (f3 int primary key);
create table a1 (i integer);
create table b1 (x integer, y integer);
create table a2 (
code char not null,
primary key (code)
);
create table b2 (
a char not null,
num integer not null,
primary key (a, num)
);
create table c2 (
name char not null,
a char,
primary key (name)
);
create table nt1 (
id int primary key,
a1 boolean,
a2 boolean
);
create table nt2 (
id int primary key,
nt1_id int,
b1 boolean,
b2 boolean,
foreign key (nt1_id) references nt1(id)
);
create table nt3 (
id int primary key,
nt2_id int,
c1 boolean,
foreign key (nt2_id) references nt2(id)
);
CREATE TABLE TEXT_TBL (f1 text);
--Testcase 11:
INSERT INTO TEXT_TBL VALUES ('doh!');
--Testcase 12:
INSERT INTO TEXT_TBL VALUES ('hi de ho neighbor');
CREATE TABLE a3 (id int PRIMARY KEY, b_id int);
CREATE TABLE b3 (id int PRIMARY KEY, c_id int);
CREATE TABLE c3 (id int PRIMARY KEY);
CREATE TABLE d3 (a int, b int);
create table parent (k int primary key, pd int);
create table child (k int unique, cd int);
CREATE TABLE a4 (id int PRIMARY KEY);
CREATE TABLE b4 (id int PRIMARY KEY, a_id int);
create table innertab (id int8 primary key, dat1 int8);
create table uniquetbl (f1 text unique);
create table join_pt1 (a int, b int, c varchar);
create table fkest (a int, b int, c int unique, primary key(a,b));
create table fkest1 (a int, b int, primary key(a,b) foreign key (a,b) references fkest);
create table j11 (id int primary key);
create table j21 (id int primary key);
create table j31 (id int);
create table j12 (id1 int, id2 int, primary key(id1,id2));
create table j22 (id1 int, id2 int, primary key(id1,id2));
create table j32 (id1 int, id2 int, primary key(id1,id2));
create table inserttest01 (col1 int4, col2 int4 NOT NULL, col3 text default 'testing');
CREATE TABLE update_test (
i INT PRIMARY KEY,
a INT DEFAULT 10,
b INT,
c TEXT
);
create table upsert_test (a int primary key, b text); | the_stack |
--
-- PostgreSQL database dump
--
-- Dumped from database version 9.6.1
-- Dumped by pg_dump version 9.6.3
-- Started on 2018-07-27 10:47:55
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET row_security = off;
CREATE DATABASE "IDP" WITH TEMPLATE = template0;
ALTER DATABASE "IDP" OWNER TO postgres;
--connect "IDP"
--
-- TOC entry 6 (class 2615 OID 16680)
-- Name: idpoauth; Type: SCHEMA; Schema: -; Owner: postgres
--
CREATE SCHEMA idpoauth;
ALTER SCHEMA idpoauth OWNER TO postgres;
--
-- TOC entry 1 (class 3079 OID 12393)
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner:
--
CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
--
-- TOC entry 2460 (class 0 OID 0)
-- Dependencies: 1
-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner:
--
COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
SET search_path = idpoauth, pg_catalog;
SET default_tablespace = '';
SET default_with_oids = false;
--
-- TOC entry 186 (class 1259 OID 16681)
-- Name: tuser_info; Type: TABLE; Schema: idpoauth; Owner: postgres
--
CREATE TABLE tuser_info (
user_id character varying NOT NULL,
created_at timestamp without time zone DEFAULT now(),
email_id character varying(100),
base_role_id bigint,
enabled boolean,
org_name text
);
ALTER TABLE tuser_info OWNER TO postgres;
SET search_path = public, pg_catalog;
--
-- TOC entry 187 (class 1259 OID 16688)
-- Name: dashboard_info; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE dashboard_info (
id integer NOT NULL,
application_name text NOT NULL,
pipeline_name text NOT NULL,
stage text NOT NULL,
status text NOT NULL,
pipeline_id text NOT NULL
);
ALTER TABLE dashboard_info OWNER TO postgres;
--
-- TOC entry 188 (class 1259 OID 16694)
-- Name: dashboard_info_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE dashboard_info_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE dashboard_info_id_seq OWNER TO postgres;
--
-- TOC entry 2461 (class 0 OID 0)
-- Dependencies: 188
-- Name: dashboard_info_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE dashboard_info_id_seq OWNED BY dashboard_info.id;
--
-- TOC entry 227 (class 1259 OID 444615)
-- Name: filenet_export; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE filenet_export (
object_id character varying,
object_name character varying,
object_type character varying,
triggerid integer NOT NULL,
env character varying,
object_store character varying,
object_json character varying
);
ALTER TABLE filenet_export OWNER TO postgres;
--
-- TOC entry 228 (class 1259 OID 444621)
-- Name: filenet_import; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE filenet_import (
triggerid integer NOT NULL,
env_source character varying,
env_destination character varying
);
ALTER TABLE filenet_import OWNER TO postgres;
--
-- TOC entry 215 (class 1259 OID 131615)
-- Name: tadditional_job_param_details; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE tadditional_job_param_details (
application_id bigint,
pipeline_id bigint,
param_name character varying(500),
param_value character varying(500),
param_id integer NOT NULL,
param_type character varying(10),
static boolean
);
ALTER TABLE tadditional_job_param_details OWNER TO postgres;
--
-- TOC entry 214 (class 1259 OID 131613)
-- Name: tadditional_job_param_details_param_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE tadditional_job_param_details_param_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE tadditional_job_param_details_param_id_seq OWNER TO postgres;
--
-- TOC entry 2462 (class 0 OID 0)
-- Dependencies: 214
-- Name: tadditional_job_param_details_param_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE tadditional_job_param_details_param_id_seq OWNED BY tadditional_job_param_details.param_id;
--
-- TOC entry 189 (class 1259 OID 16696)
-- Name: tapplication_info; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE tapplication_info (
application_id integer NOT NULL,
application_name character varying(100),
entity_info json,
platform integer
);
ALTER TABLE tapplication_info OWNER TO postgres;
--
-- TOC entry 190 (class 1259 OID 16702)
-- Name: tapplication_info_application_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE tapplication_info_application_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE tapplication_info_application_id_seq OWNER TO postgres;
--
-- TOC entry 2463 (class 0 OID 0)
-- Dependencies: 190
-- Name: tapplication_info_application_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE tapplication_info_application_id_seq OWNED BY tapplication_info.application_id;
--
-- TOC entry 191 (class 1259 OID 16704)
-- Name: tapplication_roles; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE tapplication_roles (
application_id bigint NOT NULL,
role_id bigint NOT NULL,
user_id character varying(50) NOT NULL
);
ALTER TABLE tapplication_roles OWNER TO postgres;
--
-- TOC entry 209 (class 1259 OID 131479)
-- Name: tartifact_approval_artifact_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE tartifact_approval_artifact_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE tartifact_approval_artifact_id_seq OWNER TO postgres;
--
-- TOC entry 213 (class 1259 OID 131526)
-- Name: tartifact_approval; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE tartifact_approval (
artifact_id bigint DEFAULT nextval('tartifact_approval_artifact_id_seq'::regclass) NOT NULL,
artifact_name character varying(200),
release_id integer,
env_id integer,
status character varying(100),
package_content json
);
ALTER TABLE tartifact_approval OWNER TO postgres;
--
-- TOC entry 221 (class 1259 OID 344280)
-- Name: tartifact_history; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE tartifact_history (
seq_id bigint NOT NULL,
artifact_id bigint,
status character varying(100),
remark character varying(500),
environment character varying(100),
env_owner character varying,
action_time timestamp without time zone
);
ALTER TABLE tartifact_history OWNER TO postgres;
--
-- TOC entry 222 (class 1259 OID 344286)
-- Name: tartifact_history_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE tartifact_history_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE tartifact_history_id_seq OWNER TO postgres;
--
-- TOC entry 2464 (class 0 OID 0)
-- Dependencies: 222
-- Name: tartifact_history_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE tartifact_history_id_seq OWNED BY tartifact_history.seq_id;
--
-- TOC entry 217 (class 1259 OID 139556)
-- Name: tdbdeploy_operation; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE tdbdeploy_operation (
sub_application_details_id integer NOT NULL,
application_id bigint,
sub_application character varying(50),
operations character varying(500)
);
ALTER TABLE tdbdeploy_operation OWNER TO postgres;
--
-- TOC entry 216 (class 1259 OID 139554)
-- Name: tdbdeploy_operation_sub_application_details_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE tdbdeploy_operation_sub_application_details_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE tdbdeploy_operation_sub_application_details_id_seq OWNER TO postgres;
--
-- TOC entry 2465 (class 0 OID 0)
-- Dependencies: 216
-- Name: tdbdeploy_operation_sub_application_details_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE tdbdeploy_operation_sub_application_details_id_seq OWNED BY tdbdeploy_operation.sub_application_details_id;
--
-- TOC entry 206 (class 1259 OID 131473)
-- Name: tenvironment_master_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE tenvironment_master_id_seq
START WITH 0
INCREMENT BY 1
MINVALUE 0
NO MAXVALUE
CACHE 1;
ALTER TABLE tenvironment_master_id_seq OWNER TO postgres;
--
-- TOC entry 210 (class 1259 OID 131481)
-- Name: tenvironment_master; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE tenvironment_master (
env_id integer DEFAULT nextval('tenvironment_master_id_seq'::regclass) NOT NULL,
environment_name character varying(1000),
application_id integer
);
ALTER TABLE tenvironment_master OWNER TO postgres;
--
-- TOC entry 207 (class 1259 OID 131475)
-- Name: tenvironment_owner_env_owner_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE tenvironment_owner_env_owner_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE tenvironment_owner_env_owner_id_seq OWNER TO postgres;
--
-- TOC entry 211 (class 1259 OID 131494)
-- Name: tenvironment_owner; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE tenvironment_owner (
env_owner_id integer DEFAULT nextval('tenvironment_owner_env_owner_id_seq'::regclass) NOT NULL,
env_id integer,
owner_name character varying(100),
owner_type character varying(100)
);
ALTER TABLE tenvironment_owner OWNER TO postgres;
--
-- TOC entry 232 (class 1259 OID 469021)
-- Name: tenvironment_planning; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE tenvironment_planning (
release_no character varying(100) NOT NULL,
application_name text NOT NULL,
environment character varying(100) NOT NULL,
start_time text,
end_time text,
type_plan character varying(100) NOT NULL,
on_plan character varying(500)
);
ALTER TABLE tenvironment_planning OWNER TO postgres;
--
-- TOC entry 192 (class 1259 OID 16707)
-- Name: tjob_create_status; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE tjob_create_status (
session_id bigint NOT NULL,
pipeline_id bigint,
job_name character varying(50),
last_modified date,
create_status character varying(50)
);
ALTER TABLE tjob_create_status OWNER TO postgres;
--
-- TOC entry 193 (class 1259 OID 16710)
-- Name: tjob_run_status; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE tjob_run_status (
session_id bigint NOT NULL,
pipeline_id bigint,
build_id character varying(50),
job_name character varying(100),
last_modified date,
job_run_status character varying(50)
);
ALTER TABLE tjob_run_status OWNER TO postgres;
--
-- TOC entry 223 (class 1259 OID 444588)
-- Name: torg_info_org_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE torg_info_org_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE torg_info_org_id_seq OWNER TO postgres;
--
-- TOC entry 224 (class 1259 OID 444590)
-- Name: torg_info; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE torg_info (
org_id integer DEFAULT nextval('torg_info_org_id_seq'::regclass) NOT NULL,
org_name character varying,
org_domain character varying
);
ALTER TABLE torg_info OWNER TO postgres;
--
-- TOC entry 194 (class 1259 OID 16713)
-- Name: tpersistent_logins; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE tpersistent_logins (
username character varying(64) NOT NULL,
series character varying(64) NOT NULL,
token character varying(64) NOT NULL,
last_used timestamp without time zone NOT NULL
);
ALTER TABLE tpersistent_logins OWNER TO postgres;
--
-- TOC entry 195 (class 1259 OID 16716)
-- Name: tpipeline_history; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE tpipeline_history (
pipeline_id bigint,
session_id character varying(50) NOT NULL,
user_id character varying(50),
last_modified date
);
ALTER TABLE tpipeline_history OWNER TO postgres;
--
-- TOC entry 196 (class 1259 OID 16719)
-- Name: tpipeline_info; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE tpipeline_info (
pipeline_name character varying(100),
pipeline_id integer NOT NULL,
application_id bigint,
creation_date timestamp without time zone DEFAULT now(),
active boolean DEFAULT true,
entity_info bytea,
technology character varying(100),
build_tool character varying(100)
);
ALTER TABLE tpipeline_info OWNER TO postgres;
--
-- TOC entry 197 (class 1259 OID 16727)
-- Name: tpipeline_info_pipeline_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE tpipeline_info_pipeline_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE tpipeline_info_pipeline_id_seq OWNER TO postgres;
--
-- TOC entry 2466 (class 0 OID 0)
-- Dependencies: 197
-- Name: tpipeline_info_pipeline_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE tpipeline_info_pipeline_id_seq OWNED BY tpipeline_info.pipeline_id;
--
-- TOC entry 220 (class 1259 OID 287020)
-- Name: tpipeline_roles; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE tpipeline_roles (
pipeline_id bigint NOT NULL,
role_id integer NOT NULL,
user_id character varying(500),
app_id bigint
);
ALTER TABLE tpipeline_roles OWNER TO postgres;
--
-- TOC entry 204 (class 1259 OID 57559)
-- Name: trelease_info_release_if_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE trelease_info_release_if_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE trelease_info_release_if_seq OWNER TO postgres;
--
-- TOC entry 205 (class 1259 OID 57561)
-- Name: trelease_info; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE trelease_info (
release_number character varying,
vsts_release_number character varying,
expected_start_date timestamp without time zone,
expected_end_date timestamp without time zone,
actaul_start_date timestamp without time zone,
actual_end_date timestamp without time zone,
remarks character varying,
branch_list character varying,
pipeline_id bigint,
application_id bigint,
release_id integer DEFAULT nextval('trelease_info_release_if_seq'::regclass) NOT NULL,
status character varying,
email character varying
);
ALTER TABLE trelease_info OWNER TO postgres;
--
-- TOC entry 208 (class 1259 OID 131477)
-- Name: trelease_path_config_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE trelease_path_config_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE trelease_path_config_id_seq OWNER TO postgres;
--
-- TOC entry 212 (class 1259 OID 131505)
-- Name: trelease_path_config; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE trelease_path_config (
id bigint DEFAULT nextval('trelease_path_config_id_seq'::regclass) NOT NULL,
env_id integer,
parent_env_id integer,
path_id character varying(100),
release_id integer
);
ALTER TABLE trelease_path_config OWNER TO postgres;
--
-- TOC entry 198 (class 1259 OID 16729)
-- Name: trole_permissions; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE trole_permissions (
role_id bigint NOT NULL,
permission_key character varying(50) NOT NULL
);
ALTER TABLE trole_permissions OWNER TO postgres;
--
-- TOC entry 199 (class 1259 OID 16732)
-- Name: troles; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE troles (
role_id integer NOT NULL,
role_name character varying(50)
);
ALTER TABLE troles OWNER TO postgres;
--
-- TOC entry 200 (class 1259 OID 16735)
-- Name: troles_role_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE troles_role_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE troles_role_id_seq OWNER TO postgres;
--
-- TOC entry 2467 (class 0 OID 0)
-- Dependencies: 200
-- Name: troles_role_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE troles_role_id_seq OWNED BY troles.role_id;
--
-- TOC entry 233 (class 1259 OID 518235)
-- Name: tsap_cr_info; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE tsap_cr_info (
trigger_id integer NOT NULL,
title character varying(50),
"desc" character varying(100),
status character varying(50),
impact character varying(50),
priority character varying(50),
"unitTesting" character varying(100),
cr_id character varying(100)
);
ALTER TABLE tsap_cr_info OWNER TO postgres;
--
-- TOC entry 229 (class 1259 OID 468994)
-- Name: tsap_deploy_details; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE tsap_deploy_details (
trigger_id integer NOT NULL,
transport_request character varying(50),
object_name character varying(50) NOT NULL,
deploy_operation character varying(10) NOT NULL,
landscape character varying(50),
object_type character varying(50) NOT NULL,
username character varying(50),
task_associated character varying(50),
object_timestamp timestamp without time zone
);
ALTER TABLE tsap_deploy_details OWNER TO postgres;
--
-- TOC entry 231 (class 1259 OID 469009)
-- Name: tsap_rebase_transport_requests; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE tsap_rebase_transport_requests (
dummytr character varying,
sprinttr character varying,
bugtr character varying,
tr_id integer NOT NULL,
object_name character varying(50),
object_type character varying(50)
);
ALTER TABLE tsap_rebase_transport_requests OWNER TO postgres;
--
-- TOC entry 230 (class 1259 OID 469007)
-- Name: tsap_rebase_transport_requests_tr_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE tsap_rebase_transport_requests_tr_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE tsap_rebase_transport_requests_tr_id_seq OWNER TO postgres;
--
-- TOC entry 2468 (class 0 OID 0)
-- Dependencies: 230
-- Name: tsap_rebase_transport_requests_tr_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE tsap_rebase_transport_requests_tr_id_seq OWNED BY tsap_rebase_transport_requests.tr_id;
--
-- TOC entry 219 (class 1259 OID 139584)
-- Name: tslave_detials; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE tslave_detials (
slave_id integer NOT NULL,
application_id bigint,
slave_name character varying(100),
"slaveOS" character varying(50),
usage character varying(50),
build character varying(5),
deploy character varying(5),
test character varying(5),
labels character varying(200)
);
ALTER TABLE tslave_detials OWNER TO postgres;
--
-- TOC entry 218 (class 1259 OID 139582)
-- Name: tslave_detials_slave_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE tslave_detials_slave_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE tslave_detials_slave_id_seq OWNER TO postgres;
--
-- TOC entry 2469 (class 0 OID 0)
-- Dependencies: 218
-- Name: tslave_detials_slave_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE tslave_detials_slave_id_seq OWNED BY tslave_detials.slave_id;
--
-- TOC entry 226 (class 1259 OID 444607)
-- Name: tsubscription_info; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE tsubscription_info (
subscription_type character varying NOT NULL,
expiry_date date,
org_name text NOT NULL
);
ALTER TABLE tsubscription_info OWNER TO postgres;
--
-- TOC entry 225 (class 1259 OID 444599)
-- Name: tsubscription_master; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE tsubscription_master (
subscription_type character varying NOT NULL,
permission character varying NOT NULL
);
ALTER TABLE tsubscription_master OWNER TO postgres;
--
-- TOC entry 201 (class 1259 OID 16742)
-- Name: ttrigger_history; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE ttrigger_history (
trigger_id integer NOT NULL,
pipeline_id bigint,
trigger_entity json,
release_number character varying(20),
trigger_time timestamp with time zone DEFAULT now(),
version character varying,
jiraprojectkey character varying(20),
userstorystring character varying(50),
tfs_workitem character varying(20),
build_status character varying(10),
execution_no_link character varying(500),
scm_branch character varying(80),
environment character varying(50),
deploy_status character varying(10),
test_status character varying(10),
artifact_link character varying(500),
build_triggered character varying(10),
deploy_triggered character varying(10),
test_triggered character varying(10),
artifact_name character varying(200)
);
ALTER TABLE ttrigger_history OWNER TO postgres;
--
-- TOC entry 202 (class 1259 OID 16749)
-- Name: ttrigger_history_trigger_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE ttrigger_history_trigger_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE ttrigger_history_trigger_id_seq OWNER TO postgres;
--
-- TOC entry 2470 (class 0 OID 0)
-- Dependencies: 202
-- Name: ttrigger_history_trigger_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE ttrigger_history_trigger_id_seq OWNED BY ttrigger_history.trigger_id;
--
-- TOC entry 203 (class 1259 OID 16751)
-- Name: tuser_info; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE tuser_info (
user_id character varying(50) NOT NULL,
email_id character varying(100),
base_role_id bigint,
enabled boolean,
org_id bigint DEFAULT 1
);
ALTER TABLE tuser_info OWNER TO postgres;
CREATE TABLE tnotification_info
(
"id" SERIAL,
"status" character varying,
username character varying,
pipeline_name character varying ,
creation_date timestamp DEFAULT now(),
CONSTRAINT tnotification_info_pkey PRIMARY KEY ("id")
);
ALTER TABLE tnotification_info OWNER TO postgres;
--
-- TOC entry 2181 (class 2604 OID 16754)
-- Name: dashboard_info id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY dashboard_info ALTER COLUMN id SET DEFAULT nextval('dashboard_info_id_seq'::regclass);
--
-- TOC entry 2195 (class 2604 OID 131618)
-- Name: tadditional_job_param_details param_id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY tadditional_job_param_details ALTER COLUMN param_id SET DEFAULT nextval('tadditional_job_param_details_param_id_seq'::regclass);
--
-- TOC entry 2182 (class 2604 OID 16755)
-- Name: tapplication_info application_id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY tapplication_info ALTER COLUMN application_id SET DEFAULT nextval('tapplication_info_application_id_seq'::regclass);
--
-- TOC entry 2198 (class 2604 OID 344288)
-- Name: tartifact_history seq_id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY tartifact_history ALTER COLUMN seq_id SET DEFAULT nextval('tartifact_history_id_seq'::regclass);
--
-- TOC entry 2196 (class 2604 OID 139559)
-- Name: tdbdeploy_operation sub_application_details_id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY tdbdeploy_operation ALTER COLUMN sub_application_details_id SET DEFAULT nextval('tdbdeploy_operation_sub_application_details_id_seq'::regclass);
--
-- TOC entry 2185 (class 2604 OID 16756)
-- Name: tpipeline_info pipeline_id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY tpipeline_info ALTER COLUMN pipeline_id SET DEFAULT nextval('tpipeline_info_pipeline_id_seq'::regclass);
--
-- TOC entry 2186 (class 2604 OID 16757)
-- Name: troles role_id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY troles ALTER COLUMN role_id SET DEFAULT nextval('troles_role_id_seq'::regclass);
--
-- TOC entry 2200 (class 2604 OID 469012)
-- Name: tsap_rebase_transport_requests tr_id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY tsap_rebase_transport_requests ALTER COLUMN tr_id SET DEFAULT nextval('tsap_rebase_transport_requests_tr_id_seq'::regclass);
--
-- TOC entry 2197 (class 2604 OID 139587)
-- Name: tslave_detials slave_id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY tslave_detials ALTER COLUMN slave_id SET DEFAULT nextval('tslave_detials_slave_id_seq'::regclass);
--
-- TOC entry 2188 (class 2604 OID 16759)
-- Name: ttrigger_history trigger_id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY ttrigger_history ALTER COLUMN trigger_id SET DEFAULT nextval('ttrigger_history_trigger_id_seq'::regclass);
SET search_path = idpoauth, pg_catalog;
--
-- TOC entry 2202 (class 2606 OID 444579)
-- Name: tuser_info user_id_pkey; Type: CONSTRAINT; Schema: idpoauth; Owner: postgres
--
ALTER TABLE ONLY tuser_info
ADD CONSTRAINT user_id_pkey PRIMARY KEY (user_id);
SET search_path = public, pg_catalog;
--
-- TOC entry 2248 (class 2606 OID 131623)
-- Name: tadditional_job_param_details additional_job_param_details_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY tadditional_job_param_details
ADD CONSTRAINT additional_job_param_details_pkey PRIMARY KEY (param_id);
--
-- TOC entry 2218 (class 2606 OID 17634)
-- Name: tpipeline_history application_history_pk; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY tpipeline_history
ADD CONSTRAINT application_history_pk PRIMARY KEY (session_id);
--
-- TOC entry 2206 (class 2606 OID 17636)
-- Name: tapplication_info application_info_pk; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY tapplication_info
ADD CONSTRAINT application_info_pk PRIMARY KEY (application_id);
--
-- TOC entry 2232 (class 2606 OID 57571)
-- Name: trelease_info application_pipeline_release; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY trelease_info
ADD CONSTRAINT application_pipeline_release UNIQUE (application_id, release_number, pipeline_id);
--
-- TOC entry 2210 (class 2606 OID 17638)
-- Name: tapplication_roles application_roles_pk; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY tapplication_roles
ADD CONSTRAINT application_roles_pk PRIMARY KEY (application_id, role_id, user_id);
--
-- TOC entry 2208 (class 2606 OID 17640)
-- Name: tapplication_info application_unique; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY tapplication_info
ADD CONSTRAINT application_unique UNIQUE (application_name);
--
-- TOC entry 2244 (class 2606 OID 131531)
-- Name: tartifact_approval artifact_id; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY tartifact_approval
ADD CONSTRAINT artifact_id PRIMARY KEY (artifact_id);
--
-- TOC entry 2246 (class 2606 OID 131533)
-- Name: tartifact_approval artifact_unique; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY tartifact_approval
ADD CONSTRAINT artifact_unique UNIQUE (release_id, artifact_name, env_id);
--
-- TOC entry 2204 (class 2606 OID 17642)
-- Name: dashboard_info dashboard_info_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY dashboard_info
ADD CONSTRAINT dashboard_info_pkey PRIMARY KEY (id);
--
-- TOC entry 2252 (class 2606 OID 139564)
-- Name: tdbdeploy_operation dbdeploy_operation_pk; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY tdbdeploy_operation
ADD CONSTRAINT dbdeploy_operation_pk PRIMARY KEY (sub_application_details_id);
--
-- TOC entry 2236 (class 2606 OID 131588)
-- Name: tenvironment_master env_app_id; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY tenvironment_master
ADD CONSTRAINT env_app_id UNIQUE (application_id, environment_name);
--
-- TOC entry 2238 (class 2606 OID 131486)
-- Name: tenvironment_master env_id; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY tenvironment_master
ADD CONSTRAINT env_id PRIMARY KEY (env_id);
--
-- TOC entry 2240 (class 2606 OID 131499)
-- Name: tenvironment_owner env_owner_id; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY tenvironment_owner
ADD CONSTRAINT env_owner_id PRIMARY KEY (env_owner_id);
--
-- TOC entry 2242 (class 2606 OID 131510)
-- Name: trelease_path_config id; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY trelease_path_config
ADD CONSTRAINT id PRIMARY KEY (id);
--
-- TOC entry 2212 (class 2606 OID 17644)
-- Name: tjob_create_status job_create_status_pk; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY tjob_create_status
ADD CONSTRAINT job_create_status_pk PRIMARY KEY (session_id);
--
-- TOC entry 2214 (class 2606 OID 17646)
-- Name: tjob_run_status job_run_status_pk; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY tjob_run_status
ADD CONSTRAINT job_run_status_pk PRIMARY KEY (session_id);
--
-- TOC entry 2216 (class 2606 OID 17648)
-- Name: tpersistent_logins persistent_logins_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY tpersistent_logins
ADD CONSTRAINT persistent_logins_pkey PRIMARY KEY (series);
--
-- TOC entry 2220 (class 2606 OID 17650)
-- Name: tpipeline_info pipeline_info_pk; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY tpipeline_info
ADD CONSTRAINT pipeline_info_pk PRIMARY KEY (pipeline_id);
--
-- TOC entry 2222 (class 2606 OID 17652)
-- Name: tpipeline_info pipeline_unique; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY tpipeline_info
ADD CONSTRAINT pipeline_unique UNIQUE (pipeline_name, application_id);
--
-- TOC entry 2266 (class 2606 OID 469017)
-- Name: tsap_rebase_transport_requests pk_tr_id; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY tsap_rebase_transport_requests
ADD CONSTRAINT pk_tr_id PRIMARY KEY (tr_id);
--
-- TOC entry 2234 (class 2606 OID 57569)
-- Name: trelease_info release_info_FK; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY trelease_info
ADD CONSTRAINT "release_info_FK" PRIMARY KEY (release_id);
--
-- TOC entry 2224 (class 2606 OID 17654)
-- Name: trole_permissions role_permissions_pk; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY trole_permissions
ADD CONSTRAINT role_permissions_pk PRIMARY KEY (role_id, permission_key);
--
-- TOC entry 2226 (class 2606 OID 17657)
-- Name: troles roles_pk; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY troles
ADD CONSTRAINT roles_pk PRIMARY KEY (role_id);
--
-- TOC entry 2254 (class 2606 OID 139589)
-- Name: tslave_detials slave_detials_pk; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY tslave_detials
ADD CONSTRAINT slave_detials_pk PRIMARY KEY (slave_id);
--
-- TOC entry 2256 (class 2606 OID 139591)
-- Name: tslave_detials slave_detials_unique_constraint; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY tslave_detials
ADD CONSTRAINT slave_detials_unique_constraint UNIQUE (application_id, slave_name);
--
-- TOC entry 2250 (class 2606 OID 131625)
-- Name: tadditional_job_param_details tadditional_job_param_details_pipeline_id_param_name_key; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY tadditional_job_param_details
ADD CONSTRAINT tadditional_job_param_details_pipeline_id_param_name_key UNIQUE (pipeline_id, param_name);
--
-- TOC entry 2258 (class 2606 OID 444598)
-- Name: torg_info torg_info_PK; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY torg_info
ADD CONSTRAINT "torg_info_PK" PRIMARY KEY (org_id);
--
-- TOC entry 2228 (class 2606 OID 17661)
-- Name: ttrigger_history trigger_history_pk; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY ttrigger_history
ADD CONSTRAINT trigger_history_pk PRIMARY KEY (trigger_id);
--
-- TOC entry 2264 (class 2606 OID 468998)
-- Name: tsap_deploy_details tsap_deploy_details_pk; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY tsap_deploy_details
ADD CONSTRAINT tsap_deploy_details_pk PRIMARY KEY (trigger_id, object_name, object_type, deploy_operation);
--
-- TOC entry 2262 (class 2606 OID 501762)
-- Name: tsubscription_info tsubscription_info_PK; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY tsubscription_info
ADD CONSTRAINT "tsubscription_info_PK" PRIMARY KEY (subscription_type, org_name);
--
-- TOC entry 2260 (class 2606 OID 444606)
-- Name: tsubscription_master tsubscription_master_PK; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY tsubscription_master
ADD CONSTRAINT "tsubscription_master_PK" PRIMARY KEY (subscription_type, permission);
--
-- TOC entry 2230 (class 2606 OID 17664)
-- Name: tuser_info user_info_pk; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY tuser_info
ADD CONSTRAINT user_info_pk PRIMARY KEY (user_id);
--
-- TOC entry 2270 (class 2606 OID 17665)
-- Name: tpipeline_history application_history_user_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY tpipeline_history
ADD CONSTRAINT application_history_user_id_fk FOREIGN KEY (user_id) REFERENCES tuser_info(user_id);
--
-- TOC entry 2275 (class 2606 OID 131489)
-- Name: tenvironment_master application_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY tenvironment_master
ADD CONSTRAINT application_id FOREIGN KEY (application_id) REFERENCES tapplication_info(application_id);
--
-- TOC entry 2267 (class 2606 OID 17670)
-- Name: tapplication_roles application_roles_application_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY tapplication_roles
ADD CONSTRAINT application_roles_application_id_fk FOREIGN KEY (application_id) REFERENCES tapplication_info(application_id);
--
-- TOC entry 2268 (class 2606 OID 17675)
-- Name: tapplication_roles application_roles_role_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY tapplication_roles
ADD CONSTRAINT application_roles_role_id_fk FOREIGN KEY (role_id) REFERENCES troles(role_id);
--
-- TOC entry 2269 (class 2606 OID 17680)
-- Name: tapplication_roles application_roles_user_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY tapplication_roles
ADD CONSTRAINT application_roles_user_id FOREIGN KEY (user_id) REFERENCES tuser_info(user_id);
--
-- TOC entry 2276 (class 2606 OID 131500)
-- Name: tenvironment_owner env_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY tenvironment_owner
ADD CONSTRAINT env_id FOREIGN KEY (env_id) REFERENCES tenvironment_master(env_id);
--
-- TOC entry 2277 (class 2606 OID 131511)
-- Name: trelease_path_config env_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY trelease_path_config
ADD CONSTRAINT env_id FOREIGN KEY (env_id) REFERENCES tenvironment_master(env_id);
--
-- TOC entry 2280 (class 2606 OID 131534)
-- Name: tartifact_approval env_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY tartifact_approval
ADD CONSTRAINT env_id FOREIGN KEY (env_id) REFERENCES tenvironment_master(env_id);
--
-- TOC entry 2278 (class 2606 OID 131516)
-- Name: trelease_path_config parent_env_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY trelease_path_config
ADD CONSTRAINT parent_env_id FOREIGN KEY (parent_env_id) REFERENCES tenvironment_master(env_id);
--
-- TOC entry 2279 (class 2606 OID 131521)
-- Name: trelease_path_config release_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY trelease_path_config
ADD CONSTRAINT release_id FOREIGN KEY (release_id) REFERENCES trelease_info(release_id);
--
-- TOC entry 2281 (class 2606 OID 131539)
-- Name: tartifact_approval release_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY tartifact_approval
ADD CONSTRAINT release_id FOREIGN KEY (release_id) REFERENCES trelease_info(release_id);
--
-- TOC entry 2273 (class 2606 OID 57572)
-- Name: trelease_info release_info_appliaction_FK; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY trelease_info
ADD CONSTRAINT "release_info_appliaction_FK" FOREIGN KEY (application_id) REFERENCES tapplication_info(application_id);
--
-- TOC entry 2274 (class 2606 OID 57577)
-- Name: trelease_info release_info_pipeline_FK; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY trelease_info
ADD CONSTRAINT "release_info_pipeline_FK" FOREIGN KEY (pipeline_id) REFERENCES tpipeline_info(pipeline_id);
--
-- TOC entry 2271 (class 2606 OID 17685)
-- Name: trole_permissions role_permissions_role_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY trole_permissions
ADD CONSTRAINT role_permissions_role_id_fk FOREIGN KEY (role_id) REFERENCES troles(role_id);
--
-- TOC entry 2283 (class 2606 OID 139592)
-- Name: tslave_detials slave_detials_app_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY tslave_detials
ADD CONSTRAINT slave_detials_app_fk FOREIGN KEY (application_id) REFERENCES tapplication_info(application_id);
--
-- TOC entry 2282 (class 2606 OID 139565)
-- Name: tdbdeploy_operation tdbdeploy_operation_tapplication_info_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY tdbdeploy_operation
ADD CONSTRAINT tdbdeploy_operation_tapplication_info_fk FOREIGN KEY (application_id) REFERENCES tapplication_info(application_id);
--
-- TOC entry 2284 (class 2606 OID 287026)
-- Name: tpipeline_roles tpipeline_roles_app_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY tpipeline_roles
ADD CONSTRAINT tpipeline_roles_app_id_fk FOREIGN KEY (app_id) REFERENCES tapplication_info(application_id);
--
-- TOC entry 2285 (class 2606 OID 287031)
-- Name: tpipeline_roles tpipeline_roles_pipeline_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY tpipeline_roles
ADD CONSTRAINT tpipeline_roles_pipeline_id_fk FOREIGN KEY (pipeline_id) REFERENCES tpipeline_info(pipeline_id);
--
-- TOC entry 2286 (class 2606 OID 287036)
-- Name: tpipeline_roles tpipeline_roles_role_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY tpipeline_roles
ADD CONSTRAINT tpipeline_roles_role_id_fk FOREIGN KEY (role_id) REFERENCES troles(role_id);
--
-- TOC entry 2287 (class 2606 OID 287041)
-- Name: tpipeline_roles tpipeline_roles_user_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY tpipeline_roles
ADD CONSTRAINT tpipeline_roles_user_id FOREIGN KEY (user_id) REFERENCES tuser_info(user_id);
--
-- TOC entry 2272 (class 2606 OID 17695)
-- Name: ttrigger_history trigger_history_pipeline_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY ttrigger_history
ADD CONSTRAINT trigger_history_pipeline_fk FOREIGN KEY (pipeline_id) REFERENCES tpipeline_info(pipeline_id);
--
-- TOC entry 2288 (class 2606 OID 468999)
-- Name: tsap_deploy_details tsap_deploy__trigger_details_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY tsap_deploy_details
ADD CONSTRAINT tsap_deploy__trigger_details_fk FOREIGN KEY (trigger_id) REFERENCES ttrigger_history(trigger_id);
INSERT INTO torg_info (org_name,org_domain) VALUES ('Infosys', 'infosys.com');
INSERT INTO tuser_info VALUES ('idpadmin', 'dummyuser@xyz.com', 5, true, 1);
INSERT INTO troles VALUES (1, 'PIPELINE_ADMIN');
INSERT INTO troles VALUES (2, 'DEVELOPER');
INSERT INTO troles VALUES (3, 'RELEASE_MANAGER');
INSERT INTO troles VALUES (4, 'ENVIRONMENT_OWNER');
INSERT INTO troles VALUES (5, 'IDP_ADMIN');
INSERT INTO troles VALUES (6, 'QA');
INSERT INTO troles VALUES (7, 'DB_OWNER');
INSERT INTO troles VALUES (8, 'BASIC_INFO_ADMIN');
INSERT INTO troles VALUES (9, 'CODE_INFO_ADMIN');
INSERT INTO troles VALUES (10, 'BUILD_INFO_ADMIN');
INSERT INTO troles VALUES (11, 'DEPLOY_INFO_ADMIN');
INSERT INTO troles VALUES (12, 'TEST_INFO_ADMIN');
INSERT INTO troles VALUES (13, 'IDP_MASTER_ADMIN');
INSERT INTO troles VALUES (14, 'TEST_ADMIN');
INSERT INTO troles VALUES (15, 'TESTER');
INSERT INTO trole_permissions VALUES (1, 'CREATE_PIPELINE');
INSERT INTO trole_permissions VALUES (1, 'COPY_PIPELINE');
INSERT INTO trole_permissions VALUES (1, 'EDIT_PIPELINE');
INSERT INTO trole_permissions VALUES (1, 'VIEW_PIPELINE');
INSERT INTO trole_permissions VALUES (1, 'DELETE_PIPELINE');
INSERT INTO trole_permissions VALUES (1, 'BUILD');
INSERT INTO trole_permissions VALUES (2, 'BUILD');
INSERT INTO trole_permissions VALUES (2, 'VIEW_PIPELINE');
INSERT INTO trole_permissions VALUES (3, 'BUILD');
INSERT INTO trole_permissions VALUES (3, 'RELEASE');
INSERT INTO trole_permissions VALUES (3, 'VIEW_PIPELINE');
INSERT INTO trole_permissions VALUES (4, 'BUILD');
INSERT INTO trole_permissions VALUES (4, 'DEPLOY');
INSERT INTO trole_permissions VALUES (4, 'TEST');
INSERT INTO trole_permissions VALUES (4, 'VIEW_PIPELINE');
INSERT INTO trole_permissions VALUES (5, 'CREATE_APPLICATION');
INSERT INTO trole_permissions VALUES (5, 'EDIT_APPLICATION');
INSERT INTO trole_permissions VALUES (5, 'CREATE_LICENSE');
INSERT INTO trole_permissions VALUES (6, 'VIEW_PIPELINE');
INSERT INTO trole_permissions VALUES (6, 'DATABASE_BUILD');
INSERT INTO trole_permissions VALUES (6, 'DATABASE_DEPLOY');
INSERT INTO trole_permissions VALUES (6, 'DATABASE_TEST');
INSERT INTO trole_permissions VALUES (6, 'BUILD');
INSERT INTO trole_permissions VALUES (6, 'DEPLOY');
INSERT INTO trole_permissions VALUES (6, 'TEST');
INSERT INTO trole_permissions VALUES (8, 'VIEW_BASIC_INFO');
INSERT INTO trole_permissions VALUES (8, 'EDIT_BASIC_INFO');
INSERT INTO trole_permissions VALUES (9, 'EDIT_CODE_INFO');
INSERT INTO trole_permissions VALUES (9, 'VIEW_CODE_INFO');
INSERT INTO trole_permissions VALUES (10, 'EDIT_BUILD_INFO');
INSERT INTO trole_permissions VALUES (10, 'VIEW_BUILD_INFO');
INSERT INTO trole_permissions VALUES (11, 'VIEW_TEST_INFO');
INSERT INTO trole_permissions VALUES (11, 'VIEW_DEPLOY_INFO');
INSERT INTO trole_permissions VALUES (11, 'EDIT_DEPLOY_INFO');
INSERT INTO trole_permissions VALUES (12, 'EDIT_TEST_INFO');
INSERT INTO trole_permissions VALUES (13, 'CREATE_ORGANIZATION');
INSERT INTO trole_permissions VALUES (14, 'CREATE_PIPELINE');
INSERT INTO trole_permissions VALUES (14, 'COPY_PIPELINE');
INSERT INTO trole_permissions VALUES (14, 'EDIT_PIPELINE');
INSERT INTO trole_permissions VALUES (14, 'VIEW_PIPELINE');
INSERT INTO trole_permissions VALUES (14, 'DELETE_PIPELINE');
INSERT INTO trole_permissions VALUES (14, 'BUILD');
INSERT INTO trole_permissions VALUES (15, 'VIEW_PIPELINE');
INSERT INTO trole_permissions VALUES (15, 'BUILD');
INSERT INTO idpoauth.tuser_info (user_id,org_name) VALUES ('idpadmin','INFOSYS');
INSERT INTO tsubscription_master(subscription_type, permission) VALUES('CI','CREATE_BUILD_SUBSCRIBED');
INSERT INTO tsubscription_master(subscription_type, permission) VALUES('CD','CREATE_DEPLOY_SUBSCRIBED');
INSERT INTO tsubscription_master(subscription_type, permission) VALUES('CT','CREATE_TEST_SUBSCRIBED');
INSERT INTO tsubscription_info(subscription_type, expiry_date, org_name) VALUES('CI','2020-07-22','INFOSYS');
INSERT INTO tsubscription_info(subscription_type, expiry_date, org_name) VALUES('CD','2020-07-22','INFOSYS');
INSERT INTO tsubscription_info(subscription_type, expiry_date, org_name) VALUES('CT','2020-07-22','INFOSYS');
-- Completed on 2018-07-27 10:47:59
--
-- PostgreSQL database dump complete
-- | the_stack |
SET search_path = disclosure, pg_catalog;
--
-- Name: idx_committee_summary_pk; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE UNIQUE INDEX idx_committee_summary_pk ON committee_summary USING btree (cmte_id, cand_id, fec_election_yr);
--
-- Name: idx_sched_a_2015_2016_clean_contbr_id; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX idx_sched_a_2015_2016_clean_contbr_id ON fec_fitem_sched_a_2015_2016 USING btree (clean_contbr_id);
--
-- Name: idx_sched_a_2015_2016_cmte_id; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX idx_sched_a_2015_2016_cmte_id ON fec_fitem_sched_a_2015_2016 USING btree (cmte_id);
--
-- Name: idx_sched_a_2015_2016_contb_receipt_amt; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX idx_sched_a_2015_2016_contb_receipt_amt ON fec_fitem_sched_a_2015_2016 USING btree (contb_receipt_amt);
--
-- Name: idx_sched_a_2015_2016_contb_receipt_dt; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX idx_sched_a_2015_2016_contb_receipt_dt ON fec_fitem_sched_a_2015_2016 USING btree (contb_receipt_dt);
--
-- Name: idx_sched_a_2015_2016_contbr_city; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX idx_sched_a_2015_2016_contbr_city ON fec_fitem_sched_a_2015_2016 USING btree (contbr_city);
--
-- Name: idx_sched_a_2015_2016_contbr_st; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX idx_sched_a_2015_2016_contbr_st ON fec_fitem_sched_a_2015_2016 USING btree (contbr_st);
--
-- Name: idx_sched_a_2015_2016_contributor_employer_text; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX idx_sched_a_2015_2016_contributor_employer_text ON fec_fitem_sched_a_2015_2016 USING gin (contributor_employer_text);
--
-- Name: idx_sched_a_2015_2016_contributor_name_text; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX idx_sched_a_2015_2016_contributor_name_text ON fec_fitem_sched_a_2015_2016 USING gin (contributor_name_text);
--
-- Name: idx_sched_a_2015_2016_contributor_occupation_text; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX idx_sched_a_2015_2016_contributor_occupation_text ON fec_fitem_sched_a_2015_2016 USING gin (contributor_occupation_text);
--
-- Name: idx_sched_a_2015_2016_entity_tp; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX idx_sched_a_2015_2016_entity_tp ON fec_fitem_sched_a_2015_2016 USING btree (entity_tp);
--
-- Name: idx_sched_a_2015_2016_image_num; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX idx_sched_a_2015_2016_image_num ON fec_fitem_sched_a_2015_2016 USING btree (image_num);
--
-- Name: idx_sched_a_2015_2016_is_individual; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX idx_sched_a_2015_2016_is_individual ON fec_fitem_sched_a_2015_2016 USING btree (is_individual);
--
-- Name: idx_sched_a_2015_2016_rpt_yr; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX idx_sched_a_2015_2016_rpt_yr ON fec_fitem_sched_a_2015_2016 USING btree (rpt_yr);
--
-- Name: idx_sched_b_2015_2016_clean_recipient_cmte_id; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX idx_sched_b_2015_2016_clean_recipient_cmte_id ON fec_fitem_sched_b_2015_2016 USING btree (clean_recipient_cmte_id);
--
-- Name: idx_sched_b_2015_2016_clean_recipient_recipient_st; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX idx_sched_b_2015_2016_clean_recipient_recipient_st ON fec_fitem_sched_b_2015_2016 USING btree (recipient_st);
--
-- Name: idx_sched_b_2015_2016_cmte_id; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX idx_sched_b_2015_2016_cmte_id ON fec_fitem_sched_b_2015_2016 USING btree (cmte_id);
--
-- Name: idx_sched_b_2015_2016_disb_amt; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX idx_sched_b_2015_2016_disb_amt ON fec_fitem_sched_b_2015_2016 USING btree (disb_amt);
--
-- Name: idx_sched_b_2015_2016_disb_dt; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX idx_sched_b_2015_2016_disb_dt ON fec_fitem_sched_b_2015_2016 USING btree (disb_dt);
--
-- Name: idx_sched_b_2015_2016_disbursement_description_text; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX idx_sched_b_2015_2016_disbursement_description_text ON fec_fitem_sched_b_2015_2016 USING gin (disbursement_description_text);
--
-- Name: idx_sched_b_2015_2016_image_num; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX idx_sched_b_2015_2016_image_num ON fec_fitem_sched_b_2015_2016 USING btree (image_num);
--
-- Name: idx_sched_b_2015_2016_recipient_city; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX idx_sched_b_2015_2016_recipient_city ON fec_fitem_sched_b_2015_2016 USING btree (recipient_city);
--
-- Name: idx_sched_b_2015_2016_recipient_name_text; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX idx_sched_b_2015_2016_recipient_name_text ON fec_fitem_sched_b_2015_2016 USING gin (recipient_name_text);
--
-- Name: idx_sched_b_2015_2016_rpt_yr; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX idx_sched_b_2015_2016_rpt_yr ON fec_fitem_sched_b_2015_2016 USING btree (rpt_yr);
--
-- Name: nml_sched_b_link_id_idx; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX nml_sched_b_link_id_idx ON nml_sched_b USING btree (link_id);
--
-- Name: ofec_sched_a_aggregate_employer_cmte_id; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_employer_cmte_id ON dsc_sched_a_aggregate_employer USING btree (cmte_id);
--
-- Name: ofec_sched_a_aggregate_employer_count; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_employer_count ON dsc_sched_a_aggregate_employer USING btree (count);
--
-- Name: ofec_sched_a_aggregate_employer_cycle; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_employer_cycle ON dsc_sched_a_aggregate_employer USING btree (cycle);
--
-- Name: ofec_sched_a_aggregate_employer_cycle_cmte_id; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_employer_cycle_cmte_id ON dsc_sched_a_aggregate_employer USING btree (cycle, cmte_id);
--
-- Name: ofec_sched_a_aggregate_employer_employer; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_employer_employer ON dsc_sched_a_aggregate_employer USING btree (employer);
--
-- Name: ofec_sched_a_aggregate_employer_total; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_employer_total ON dsc_sched_a_aggregate_employer USING btree (total);
--
-- Name: ofec_sched_a_aggregate_occupation_cmte_id; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_occupation_cmte_id ON dsc_sched_a_aggregate_occupation USING btree (cmte_id);
--
-- Name: ofec_sched_a_aggregate_occupation_count; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_occupation_count ON dsc_sched_a_aggregate_occupation USING btree (count);
--
-- Name: ofec_sched_a_aggregate_occupation_cycle; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_occupation_cycle ON dsc_sched_a_aggregate_occupation USING btree (cycle);
--
-- Name: ofec_sched_a_aggregate_occupation_cycle_cmte_id; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_occupation_cycle_cmte_id ON dsc_sched_a_aggregate_occupation USING btree (cycle, cmte_id);
--
-- Name: ofec_sched_a_aggregate_occupation_occupation; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_occupation_occupation ON dsc_sched_a_aggregate_occupation USING btree (occupation);
--
-- Name: ofec_sched_a_aggregate_occupation_total; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_occupation_total ON dsc_sched_a_aggregate_occupation USING btree (total);
--
-- Name: ofec_sched_a_aggregate_size_cmte_id; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_size_cmte_id ON dsc_sched_a_aggregate_size USING btree (cmte_id);
--
-- Name: ofec_sched_a_aggregate_size_cmte_id_cycle; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_size_cmte_id_cycle ON dsc_sched_a_aggregate_size USING btree (cmte_id, cycle);
--
-- Name: ofec_sched_a_aggregate_size_count; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_size_count ON dsc_sched_a_aggregate_size USING btree (count);
--
-- Name: ofec_sched_a_aggregate_size_cycle; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_size_cycle ON dsc_sched_a_aggregate_size USING btree (cycle);
--
-- Name: ofec_sched_a_aggregate_size_size; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_size_size ON dsc_sched_a_aggregate_size USING btree (size);
--
-- Name: ofec_sched_a_aggregate_size_total; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_size_total ON dsc_sched_a_aggregate_size USING btree (total);
--
-- Name: ofec_sched_a_aggregate_state_cmte_id; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_state_cmte_id ON dsc_sched_a_aggregate_state USING btree (cmte_id);
--
-- Name: ofec_sched_a_aggregate_state_count; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_state_count ON dsc_sched_a_aggregate_state USING btree (count);
--
-- Name: ofec_sched_a_aggregate_state_cycle; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_state_cycle ON dsc_sched_a_aggregate_state USING btree (cycle);
--
-- Name: ofec_sched_a_aggregate_state_cycle_cmte_id; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_state_cycle_cmte_id ON dsc_sched_a_aggregate_state USING btree (cycle, cmte_id);
--
-- Name: ofec_sched_a_aggregate_state_state; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_state_state ON dsc_sched_a_aggregate_state USING btree (state);
--
-- Name: ofec_sched_a_aggregate_state_state_full; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_state_state_full ON dsc_sched_a_aggregate_state USING btree (state_full);
--
-- Name: ofec_sched_a_aggregate_state_total; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_state_total ON dsc_sched_a_aggregate_state USING btree (total);
--
-- Name: ofec_sched_a_aggregate_zip_cmte_id; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_zip_cmte_id ON dsc_sched_a_aggregate_zip USING btree (cmte_id);
--
-- Name: ofec_sched_a_aggregate_zip_count; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_zip_count ON dsc_sched_a_aggregate_zip USING btree (count);
--
-- Name: ofec_sched_a_aggregate_zip_cycle; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_zip_cycle ON dsc_sched_a_aggregate_zip USING btree (cycle);
--
-- Name: ofec_sched_a_aggregate_zip_state; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_zip_state ON dsc_sched_a_aggregate_zip USING btree (state);
--
-- Name: ofec_sched_a_aggregate_zip_state_full; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_zip_state_full ON dsc_sched_a_aggregate_zip USING btree (state_full);
--
-- Name: ofec_sched_a_aggregate_zip_total; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_zip_total ON dsc_sched_a_aggregate_zip USING btree (total);
--
-- Name: ofec_sched_a_aggregate_zip_zip; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_zip_zip ON dsc_sched_a_aggregate_zip USING btree (zip);
--
-- Name: ofec_sched_b_aggregate_purpose_cmte_id; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX ofec_sched_b_aggregate_purpose_cmte_id ON dsc_sched_b_aggregate_purpose USING btree (cmte_id);
--
-- Name: ofec_sched_b_aggregate_purpose_count; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX ofec_sched_b_aggregate_purpose_count ON dsc_sched_b_aggregate_purpose USING btree (count);
--
-- Name: ofec_sched_b_aggregate_purpose_cycle; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX ofec_sched_b_aggregate_purpose_cycle ON dsc_sched_b_aggregate_purpose USING btree (cycle);
--
-- Name: ofec_sched_b_aggregate_purpose_cycle_cmte_id; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX ofec_sched_b_aggregate_purpose_cycle_cmte_id ON dsc_sched_b_aggregate_purpose USING btree (cycle, cmte_id);
--
-- Name: ofec_sched_b_aggregate_purpose_purpose; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX ofec_sched_b_aggregate_purpose_purpose ON dsc_sched_b_aggregate_purpose USING btree (purpose);
--
-- Name: ofec_sched_b_aggregate_purpose_total; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX ofec_sched_b_aggregate_purpose_total ON dsc_sched_b_aggregate_purpose USING btree (total);
--
-- Name: ofec_sched_b_aggregate_recipient_cmte_id; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX ofec_sched_b_aggregate_recipient_cmte_id ON dsc_sched_b_aggregate_recipient USING btree (cmte_id);
--
-- Name: ofec_sched_b_aggregate_recipient_count; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX ofec_sched_b_aggregate_recipient_count ON dsc_sched_b_aggregate_recipient USING btree (count);
--
-- Name: ofec_sched_b_aggregate_recipient_cycle; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX ofec_sched_b_aggregate_recipient_cycle ON dsc_sched_b_aggregate_recipient USING btree (cycle);
--
-- Name: ofec_sched_b_aggregate_recipient_cycle_cmte_id; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX ofec_sched_b_aggregate_recipient_cycle_cmte_id ON dsc_sched_b_aggregate_recipient USING btree (cycle, cmte_id);
--
-- Name: ofec_sched_b_aggregate_recipient_id_cmte_id; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX ofec_sched_b_aggregate_recipient_id_cmte_id ON dsc_sched_b_aggregate_recipient_id USING btree (cmte_id);
--
-- Name: ofec_sched_b_aggregate_recipient_id_cmte_id_cycle; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX ofec_sched_b_aggregate_recipient_id_cmte_id_cycle ON dsc_sched_b_aggregate_recipient_id USING btree (cmte_id, cycle);
--
-- Name: ofec_sched_b_aggregate_recipient_id_count; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX ofec_sched_b_aggregate_recipient_id_count ON dsc_sched_b_aggregate_recipient_id USING btree (count);
--
-- Name: ofec_sched_b_aggregate_recipient_id_cycle; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX ofec_sched_b_aggregate_recipient_id_cycle ON dsc_sched_b_aggregate_recipient_id USING btree (cycle);
--
-- Name: ofec_sched_b_aggregate_recipient_id_recipient_cmte_id; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX ofec_sched_b_aggregate_recipient_id_recipient_cmte_id ON dsc_sched_b_aggregate_recipient_id USING btree (recipient_cmte_id);
--
-- Name: ofec_sched_b_aggregate_recipient_id_total; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX ofec_sched_b_aggregate_recipient_id_total ON dsc_sched_b_aggregate_recipient_id USING btree (total);
--
-- Name: ofec_sched_b_aggregate_recipient_recipient_nm; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX ofec_sched_b_aggregate_recipient_recipient_nm ON dsc_sched_b_aggregate_recipient USING btree (recipient_nm);
--
-- Name: ofec_sched_b_aggregate_recipient_total; Type: INDEX; Schema: disclosure; Owner: fec
--
CREATE INDEX ofec_sched_b_aggregate_recipient_total ON dsc_sched_b_aggregate_recipient USING btree (total);
SET search_path = fecapp, pg_catalog;
--
-- Name: trc_election_dates_election_date_idx; Type: INDEX; Schema: fecapp; Owner: fec
--
CREATE INDEX trc_election_dates_election_date_idx ON trc_election_dates USING btree (election_date);
--
-- Name: trc_election_election_date_idx; Type: INDEX; Schema: fecapp; Owner: fec
--
CREATE INDEX trc_election_election_date_idx ON trc_election USING btree (election_date);
--
-- Name: trc_election_election_district_idx; Type: INDEX; Schema: fecapp; Owner: fec
--
CREATE INDEX trc_election_election_district_idx ON trc_election USING btree (election_district);
--
-- Name: trc_election_election_state_idx; Type: INDEX; Schema: fecapp; Owner: fec
--
CREATE INDEX trc_election_election_state_idx ON trc_election USING btree (election_state);
--
-- Name: trc_election_election_yr_idx; Type: INDEX; Schema: fecapp; Owner: fec
--
CREATE INDEX trc_election_election_yr_idx ON trc_election USING btree (election_yr);
--
-- Name: trc_election_office_sought_idx; Type: INDEX; Schema: fecapp; Owner: fec
--
CREATE INDEX trc_election_office_sought_idx ON trc_election USING btree (office_sought);
--
-- Name: trc_election_update_date_idx; Type: INDEX; Schema: fecapp; Owner: fec
--
CREATE INDEX trc_election_update_date_idx ON trc_election USING btree (update_date);
--
-- Name: trc_report_due_date_create_date_idx; Type: INDEX; Schema: fecapp; Owner: fec
--
CREATE INDEX trc_report_due_date_create_date_idx ON trc_report_due_date USING btree (create_date);
--
-- Name: trc_report_due_date_due_date_idx; Type: INDEX; Schema: fecapp; Owner: fec
--
CREATE INDEX trc_report_due_date_due_date_idx ON trc_report_due_date USING btree (due_date);
--
-- Name: trc_report_due_date_report_type_idx; Type: INDEX; Schema: fecapp; Owner: fec
--
CREATE INDEX trc_report_due_date_report_type_idx ON trc_report_due_date USING btree (report_type);
--
-- Name: trc_report_due_date_report_year_idx; Type: INDEX; Schema: fecapp; Owner: fec
--
CREATE INDEX trc_report_due_date_report_year_idx ON trc_report_due_date USING btree (report_year);
--
-- Name: trc_report_due_date_update_date_idx; Type: INDEX; Schema: fecapp; Owner: fec
--
CREATE INDEX trc_report_due_date_update_date_idx ON trc_report_due_date USING btree (update_date);
SET search_path = public, pg_catalog;
--
-- Name: entity_disbursements_chart_cycle_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX entity_disbursements_chart_cycle_idx ON entity_disbursements_chart USING btree (cycle);
--
-- Name: entity_disbursements_chart_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE UNIQUE INDEX entity_disbursements_chart_idx_idx ON entity_disbursements_chart USING btree (idx);
--
-- Name: entity_receipts_chart_cycle_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX entity_receipts_chart_cycle_idx ON entity_receipts_chart USING btree (cycle);
--
-- Name: entity_receipts_chart_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE UNIQUE INDEX entity_receipts_chart_idx_idx ON entity_receipts_chart USING btree (idx);
--
-- Name: idx_ofec_sched_a_1977_1978_clean_contbr_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1977_1978_clean_contbr_id_amt ON ofec_sched_a_1977_1978 USING btree (clean_contbr_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1977_1978_clean_contbr_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1977_1978_clean_contbr_id_dt ON ofec_sched_a_1977_1978 USING btree (clean_contbr_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1977_1978_contbr_city_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1977_1978_contbr_city_amt ON ofec_sched_a_1977_1978 USING btree (contbr_city, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1977_1978_contbr_city_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1977_1978_contbr_city_dt ON ofec_sched_a_1977_1978 USING btree (contbr_city, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1977_1978_contbr_st_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1977_1978_contbr_st_amt ON ofec_sched_a_1977_1978 USING btree (contbr_st, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1977_1978_contbr_st_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1977_1978_contbr_st_dt ON ofec_sched_a_1977_1978 USING btree (contbr_st, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1977_1978_contbr_zip_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1977_1978_contbr_zip_amt ON ofec_sched_a_1977_1978 USING btree (contbr_zip, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1977_1978_contbr_zip_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1977_1978_contbr_zip_dt ON ofec_sched_a_1977_1978 USING btree (contbr_zip, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1977_1978_contrib_emp_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1977_1978_contrib_emp_text_amt ON ofec_sched_a_1977_1978 USING gin (contributor_employer_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1977_1978_contrib_emp_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1977_1978_contrib_emp_text_dt ON ofec_sched_a_1977_1978 USING gin (contributor_employer_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1977_1978_contrib_name_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1977_1978_contrib_name_text_amt ON ofec_sched_a_1977_1978 USING gin (contributor_name_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1977_1978_contrib_name_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1977_1978_contrib_name_text_dt ON ofec_sched_a_1977_1978 USING gin (contributor_name_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1977_1978_contrib_occ_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1977_1978_contrib_occ_text_amt ON ofec_sched_a_1977_1978 USING gin (contributor_occupation_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1977_1978_contrib_occ_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1977_1978_contrib_occ_text_dt ON ofec_sched_a_1977_1978 USING gin (contributor_occupation_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1977_1978_entity_tp; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1977_1978_entity_tp ON ofec_sched_a_1977_1978 USING btree (entity_tp);
--
-- Name: idx_ofec_sched_a_1977_1978_image_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1977_1978_image_num_amt ON ofec_sched_a_1977_1978 USING btree (image_num, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1977_1978_image_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1977_1978_image_num_dt ON ofec_sched_a_1977_1978 USING btree (image_num, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1977_1978_is_individual_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1977_1978_is_individual_amt ON ofec_sched_a_1977_1978 USING btree (is_individual, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1977_1978_is_individual_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1977_1978_is_individual_dt ON ofec_sched_a_1977_1978 USING btree (is_individual, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1977_1978_pg_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1977_1978_pg_date ON ofec_sched_a_1977_1978 USING btree (pg_date);
--
-- Name: idx_ofec_sched_a_1977_1978_rpt_yr; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1977_1978_rpt_yr ON ofec_sched_a_1977_1978 USING btree (rpt_yr);
--
-- Name: idx_ofec_sched_a_1977_1978_sub_id_amount; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1977_1978_sub_id_amount ON ofec_sched_a_1977_1978 USING btree (contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1977_1978_sub_id_amount_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1977_1978_sub_id_amount_dt ON ofec_sched_a_1977_1978 USING btree (contb_receipt_amt, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1977_1978_sub_id_cmte_id_amount; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1977_1978_sub_id_cmte_id_amount ON ofec_sched_a_1977_1978 USING btree (cmte_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1977_1978_sub_id_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1977_1978_sub_id_cmte_id_amt ON ofec_sched_a_1977_1978 USING btree (cmte_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1977_1978_sub_id_cmte_id_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1977_1978_sub_id_cmte_id_date ON ofec_sched_a_1977_1978 USING btree (cmte_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1977_1978_sub_id_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1977_1978_sub_id_cmte_id_dt ON ofec_sched_a_1977_1978 USING btree (cmte_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1977_1978_sub_id_date_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1977_1978_sub_id_date_amt ON ofec_sched_a_1977_1978 USING btree (contb_receipt_dt, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1977_1978_sub_id_line_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1977_1978_sub_id_line_num_amt ON ofec_sched_a_1977_1978 USING btree (line_num, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1977_1978_sub_id_line_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1977_1978_sub_id_line_num_dt ON ofec_sched_a_1977_1978 USING btree (line_num, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1977_1978_two_year_transaction_period_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1977_1978_two_year_transaction_period_amt ON ofec_sched_a_1977_1978 USING btree (two_year_transaction_period, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1977_1978_two_year_transaction_period_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1977_1978_two_year_transaction_period_dt ON ofec_sched_a_1977_1978 USING btree (two_year_transaction_period, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1979_1980_clean_contbr_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1979_1980_clean_contbr_id_amt ON ofec_sched_a_1979_1980 USING btree (clean_contbr_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1979_1980_clean_contbr_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1979_1980_clean_contbr_id_dt ON ofec_sched_a_1979_1980 USING btree (clean_contbr_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1979_1980_contbr_city_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1979_1980_contbr_city_amt ON ofec_sched_a_1979_1980 USING btree (contbr_city, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1979_1980_contbr_city_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1979_1980_contbr_city_dt ON ofec_sched_a_1979_1980 USING btree (contbr_city, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1979_1980_contbr_st_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1979_1980_contbr_st_amt ON ofec_sched_a_1979_1980 USING btree (contbr_st, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1979_1980_contbr_st_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1979_1980_contbr_st_dt ON ofec_sched_a_1979_1980 USING btree (contbr_st, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1979_1980_contbr_zip_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1979_1980_contbr_zip_amt ON ofec_sched_a_1979_1980 USING btree (contbr_zip, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1979_1980_contbr_zip_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1979_1980_contbr_zip_dt ON ofec_sched_a_1979_1980 USING btree (contbr_zip, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1979_1980_contrib_emp_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1979_1980_contrib_emp_text_amt ON ofec_sched_a_1979_1980 USING gin (contributor_employer_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1979_1980_contrib_emp_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1979_1980_contrib_emp_text_dt ON ofec_sched_a_1979_1980 USING gin (contributor_employer_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1979_1980_contrib_name_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1979_1980_contrib_name_text_amt ON ofec_sched_a_1979_1980 USING gin (contributor_name_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1979_1980_contrib_name_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1979_1980_contrib_name_text_dt ON ofec_sched_a_1979_1980 USING gin (contributor_name_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1979_1980_contrib_occ_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1979_1980_contrib_occ_text_amt ON ofec_sched_a_1979_1980 USING gin (contributor_occupation_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1979_1980_contrib_occ_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1979_1980_contrib_occ_text_dt ON ofec_sched_a_1979_1980 USING gin (contributor_occupation_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1979_1980_entity_tp; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1979_1980_entity_tp ON ofec_sched_a_1979_1980 USING btree (entity_tp);
--
-- Name: idx_ofec_sched_a_1979_1980_image_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1979_1980_image_num_amt ON ofec_sched_a_1979_1980 USING btree (image_num, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1979_1980_image_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1979_1980_image_num_dt ON ofec_sched_a_1979_1980 USING btree (image_num, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1979_1980_is_individual_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1979_1980_is_individual_amt ON ofec_sched_a_1979_1980 USING btree (is_individual, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1979_1980_is_individual_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1979_1980_is_individual_dt ON ofec_sched_a_1979_1980 USING btree (is_individual, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1979_1980_pg_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1979_1980_pg_date ON ofec_sched_a_1979_1980 USING btree (pg_date);
--
-- Name: idx_ofec_sched_a_1979_1980_rpt_yr; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1979_1980_rpt_yr ON ofec_sched_a_1979_1980 USING btree (rpt_yr);
--
-- Name: idx_ofec_sched_a_1979_1980_sub_id_amount; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1979_1980_sub_id_amount ON ofec_sched_a_1979_1980 USING btree (contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1979_1980_sub_id_amount_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1979_1980_sub_id_amount_dt ON ofec_sched_a_1979_1980 USING btree (contb_receipt_amt, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1979_1980_sub_id_cmte_id_amount; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1979_1980_sub_id_cmte_id_amount ON ofec_sched_a_1979_1980 USING btree (cmte_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1979_1980_sub_id_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1979_1980_sub_id_cmte_id_amt ON ofec_sched_a_1979_1980 USING btree (cmte_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1979_1980_sub_id_cmte_id_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1979_1980_sub_id_cmte_id_date ON ofec_sched_a_1979_1980 USING btree (cmte_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1979_1980_sub_id_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1979_1980_sub_id_cmte_id_dt ON ofec_sched_a_1979_1980 USING btree (cmte_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1979_1980_sub_id_date_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1979_1980_sub_id_date_amt ON ofec_sched_a_1979_1980 USING btree (contb_receipt_dt, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1979_1980_sub_id_line_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1979_1980_sub_id_line_num_amt ON ofec_sched_a_1979_1980 USING btree (line_num, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1979_1980_sub_id_line_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1979_1980_sub_id_line_num_dt ON ofec_sched_a_1979_1980 USING btree (line_num, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1979_1980_two_year_transaction_period_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1979_1980_two_year_transaction_period_amt ON ofec_sched_a_1979_1980 USING btree (two_year_transaction_period, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1979_1980_two_year_transaction_period_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1979_1980_two_year_transaction_period_dt ON ofec_sched_a_1979_1980 USING btree (two_year_transaction_period, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1981_1982_clean_contbr_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1981_1982_clean_contbr_id_amt ON ofec_sched_a_1981_1982 USING btree (clean_contbr_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1981_1982_clean_contbr_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1981_1982_clean_contbr_id_dt ON ofec_sched_a_1981_1982 USING btree (clean_contbr_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1981_1982_contbr_city_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1981_1982_contbr_city_amt ON ofec_sched_a_1981_1982 USING btree (contbr_city, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1981_1982_contbr_city_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1981_1982_contbr_city_dt ON ofec_sched_a_1981_1982 USING btree (contbr_city, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1981_1982_contbr_st_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1981_1982_contbr_st_amt ON ofec_sched_a_1981_1982 USING btree (contbr_st, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1981_1982_contbr_st_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1981_1982_contbr_st_dt ON ofec_sched_a_1981_1982 USING btree (contbr_st, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1981_1982_contbr_zip_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1981_1982_contbr_zip_amt ON ofec_sched_a_1981_1982 USING btree (contbr_zip, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1981_1982_contbr_zip_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1981_1982_contbr_zip_dt ON ofec_sched_a_1981_1982 USING btree (contbr_zip, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1981_1982_contrib_emp_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1981_1982_contrib_emp_text_amt ON ofec_sched_a_1981_1982 USING gin (contributor_employer_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1981_1982_contrib_emp_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1981_1982_contrib_emp_text_dt ON ofec_sched_a_1981_1982 USING gin (contributor_employer_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1981_1982_contrib_name_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1981_1982_contrib_name_text_amt ON ofec_sched_a_1981_1982 USING gin (contributor_name_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1981_1982_contrib_name_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1981_1982_contrib_name_text_dt ON ofec_sched_a_1981_1982 USING gin (contributor_name_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1981_1982_contrib_occ_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1981_1982_contrib_occ_text_amt ON ofec_sched_a_1981_1982 USING gin (contributor_occupation_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1981_1982_contrib_occ_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1981_1982_contrib_occ_text_dt ON ofec_sched_a_1981_1982 USING gin (contributor_occupation_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1981_1982_entity_tp; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1981_1982_entity_tp ON ofec_sched_a_1981_1982 USING btree (entity_tp);
--
-- Name: idx_ofec_sched_a_1981_1982_image_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1981_1982_image_num_amt ON ofec_sched_a_1981_1982 USING btree (image_num, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1981_1982_image_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1981_1982_image_num_dt ON ofec_sched_a_1981_1982 USING btree (image_num, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1981_1982_is_individual_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1981_1982_is_individual_amt ON ofec_sched_a_1981_1982 USING btree (is_individual, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1981_1982_is_individual_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1981_1982_is_individual_dt ON ofec_sched_a_1981_1982 USING btree (is_individual, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1981_1982_pg_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1981_1982_pg_date ON ofec_sched_a_1981_1982 USING btree (pg_date);
--
-- Name: idx_ofec_sched_a_1981_1982_rpt_yr; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1981_1982_rpt_yr ON ofec_sched_a_1981_1982 USING btree (rpt_yr);
--
-- Name: idx_ofec_sched_a_1981_1982_sub_id_amount; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1981_1982_sub_id_amount ON ofec_sched_a_1981_1982 USING btree (contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1981_1982_sub_id_amount_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1981_1982_sub_id_amount_dt ON ofec_sched_a_1981_1982 USING btree (contb_receipt_amt, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1981_1982_sub_id_cmte_id_amount; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1981_1982_sub_id_cmte_id_amount ON ofec_sched_a_1981_1982 USING btree (cmte_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1981_1982_sub_id_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1981_1982_sub_id_cmte_id_amt ON ofec_sched_a_1981_1982 USING btree (cmte_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1981_1982_sub_id_cmte_id_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1981_1982_sub_id_cmte_id_date ON ofec_sched_a_1981_1982 USING btree (cmte_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1981_1982_sub_id_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1981_1982_sub_id_cmte_id_dt ON ofec_sched_a_1981_1982 USING btree (cmte_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1981_1982_sub_id_date_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1981_1982_sub_id_date_amt ON ofec_sched_a_1981_1982 USING btree (contb_receipt_dt, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1981_1982_sub_id_line_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1981_1982_sub_id_line_num_amt ON ofec_sched_a_1981_1982 USING btree (line_num, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1981_1982_sub_id_line_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1981_1982_sub_id_line_num_dt ON ofec_sched_a_1981_1982 USING btree (line_num, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1981_1982_two_year_transaction_period_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1981_1982_two_year_transaction_period_amt ON ofec_sched_a_1981_1982 USING btree (two_year_transaction_period, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1981_1982_two_year_transaction_period_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1981_1982_two_year_transaction_period_dt ON ofec_sched_a_1981_1982 USING btree (two_year_transaction_period, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1983_1984_clean_contbr_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1983_1984_clean_contbr_id_amt ON ofec_sched_a_1983_1984 USING btree (clean_contbr_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1983_1984_clean_contbr_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1983_1984_clean_contbr_id_dt ON ofec_sched_a_1983_1984 USING btree (clean_contbr_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1983_1984_contbr_city_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1983_1984_contbr_city_amt ON ofec_sched_a_1983_1984 USING btree (contbr_city, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1983_1984_contbr_city_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1983_1984_contbr_city_dt ON ofec_sched_a_1983_1984 USING btree (contbr_city, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1983_1984_contbr_st_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1983_1984_contbr_st_amt ON ofec_sched_a_1983_1984 USING btree (contbr_st, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1983_1984_contbr_st_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1983_1984_contbr_st_dt ON ofec_sched_a_1983_1984 USING btree (contbr_st, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1983_1984_contbr_zip_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1983_1984_contbr_zip_amt ON ofec_sched_a_1983_1984 USING btree (contbr_zip, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1983_1984_contbr_zip_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1983_1984_contbr_zip_dt ON ofec_sched_a_1983_1984 USING btree (contbr_zip, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1983_1984_contrib_emp_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1983_1984_contrib_emp_text_amt ON ofec_sched_a_1983_1984 USING gin (contributor_employer_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1983_1984_contrib_emp_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1983_1984_contrib_emp_text_dt ON ofec_sched_a_1983_1984 USING gin (contributor_employer_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1983_1984_contrib_name_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1983_1984_contrib_name_text_amt ON ofec_sched_a_1983_1984 USING gin (contributor_name_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1983_1984_contrib_name_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1983_1984_contrib_name_text_dt ON ofec_sched_a_1983_1984 USING gin (contributor_name_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1983_1984_contrib_occ_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1983_1984_contrib_occ_text_amt ON ofec_sched_a_1983_1984 USING gin (contributor_occupation_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1983_1984_contrib_occ_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1983_1984_contrib_occ_text_dt ON ofec_sched_a_1983_1984 USING gin (contributor_occupation_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1983_1984_entity_tp; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1983_1984_entity_tp ON ofec_sched_a_1983_1984 USING btree (entity_tp);
--
-- Name: idx_ofec_sched_a_1983_1984_image_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1983_1984_image_num_amt ON ofec_sched_a_1983_1984 USING btree (image_num, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1983_1984_image_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1983_1984_image_num_dt ON ofec_sched_a_1983_1984 USING btree (image_num, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1983_1984_is_individual_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1983_1984_is_individual_amt ON ofec_sched_a_1983_1984 USING btree (is_individual, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1983_1984_is_individual_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1983_1984_is_individual_dt ON ofec_sched_a_1983_1984 USING btree (is_individual, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1983_1984_pg_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1983_1984_pg_date ON ofec_sched_a_1983_1984 USING btree (pg_date);
--
-- Name: idx_ofec_sched_a_1983_1984_rpt_yr; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1983_1984_rpt_yr ON ofec_sched_a_1983_1984 USING btree (rpt_yr);
--
-- Name: idx_ofec_sched_a_1983_1984_sub_id_amount; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1983_1984_sub_id_amount ON ofec_sched_a_1983_1984 USING btree (contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1983_1984_sub_id_amount_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1983_1984_sub_id_amount_dt ON ofec_sched_a_1983_1984 USING btree (contb_receipt_amt, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1983_1984_sub_id_cmte_id_amount; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1983_1984_sub_id_cmte_id_amount ON ofec_sched_a_1983_1984 USING btree (cmte_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1983_1984_sub_id_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1983_1984_sub_id_cmte_id_amt ON ofec_sched_a_1983_1984 USING btree (cmte_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1983_1984_sub_id_cmte_id_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1983_1984_sub_id_cmte_id_date ON ofec_sched_a_1983_1984 USING btree (cmte_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1983_1984_sub_id_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1983_1984_sub_id_cmte_id_dt ON ofec_sched_a_1983_1984 USING btree (cmte_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1983_1984_sub_id_date_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1983_1984_sub_id_date_amt ON ofec_sched_a_1983_1984 USING btree (contb_receipt_dt, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1983_1984_sub_id_line_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1983_1984_sub_id_line_num_amt ON ofec_sched_a_1983_1984 USING btree (line_num, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1983_1984_sub_id_line_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1983_1984_sub_id_line_num_dt ON ofec_sched_a_1983_1984 USING btree (line_num, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1983_1984_two_year_transaction_period_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1983_1984_two_year_transaction_period_amt ON ofec_sched_a_1983_1984 USING btree (two_year_transaction_period, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1983_1984_two_year_transaction_period_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1983_1984_two_year_transaction_period_dt ON ofec_sched_a_1983_1984 USING btree (two_year_transaction_period, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1985_1986_clean_contbr_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1985_1986_clean_contbr_id_amt ON ofec_sched_a_1985_1986 USING btree (clean_contbr_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1985_1986_clean_contbr_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1985_1986_clean_contbr_id_dt ON ofec_sched_a_1985_1986 USING btree (clean_contbr_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1985_1986_contbr_city_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1985_1986_contbr_city_amt ON ofec_sched_a_1985_1986 USING btree (contbr_city, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1985_1986_contbr_city_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1985_1986_contbr_city_dt ON ofec_sched_a_1985_1986 USING btree (contbr_city, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1985_1986_contbr_st_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1985_1986_contbr_st_amt ON ofec_sched_a_1985_1986 USING btree (contbr_st, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1985_1986_contbr_st_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1985_1986_contbr_st_dt ON ofec_sched_a_1985_1986 USING btree (contbr_st, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1985_1986_contbr_zip_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1985_1986_contbr_zip_amt ON ofec_sched_a_1985_1986 USING btree (contbr_zip, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1985_1986_contbr_zip_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1985_1986_contbr_zip_dt ON ofec_sched_a_1985_1986 USING btree (contbr_zip, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1985_1986_contrib_emp_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1985_1986_contrib_emp_text_amt ON ofec_sched_a_1985_1986 USING gin (contributor_employer_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1985_1986_contrib_emp_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1985_1986_contrib_emp_text_dt ON ofec_sched_a_1985_1986 USING gin (contributor_employer_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1985_1986_contrib_name_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1985_1986_contrib_name_text_amt ON ofec_sched_a_1985_1986 USING gin (contributor_name_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1985_1986_contrib_name_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1985_1986_contrib_name_text_dt ON ofec_sched_a_1985_1986 USING gin (contributor_name_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1985_1986_contrib_occ_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1985_1986_contrib_occ_text_amt ON ofec_sched_a_1985_1986 USING gin (contributor_occupation_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1985_1986_contrib_occ_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1985_1986_contrib_occ_text_dt ON ofec_sched_a_1985_1986 USING gin (contributor_occupation_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1985_1986_entity_tp; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1985_1986_entity_tp ON ofec_sched_a_1985_1986 USING btree (entity_tp);
--
-- Name: idx_ofec_sched_a_1985_1986_image_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1985_1986_image_num_amt ON ofec_sched_a_1985_1986 USING btree (image_num, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1985_1986_image_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1985_1986_image_num_dt ON ofec_sched_a_1985_1986 USING btree (image_num, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1985_1986_is_individual_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1985_1986_is_individual_amt ON ofec_sched_a_1985_1986 USING btree (is_individual, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1985_1986_is_individual_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1985_1986_is_individual_dt ON ofec_sched_a_1985_1986 USING btree (is_individual, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1985_1986_pg_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1985_1986_pg_date ON ofec_sched_a_1985_1986 USING btree (pg_date);
--
-- Name: idx_ofec_sched_a_1985_1986_rpt_yr; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1985_1986_rpt_yr ON ofec_sched_a_1985_1986 USING btree (rpt_yr);
--
-- Name: idx_ofec_sched_a_1985_1986_sub_id_amount; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1985_1986_sub_id_amount ON ofec_sched_a_1985_1986 USING btree (contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1985_1986_sub_id_amount_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1985_1986_sub_id_amount_dt ON ofec_sched_a_1985_1986 USING btree (contb_receipt_amt, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1985_1986_sub_id_cmte_id_amount; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1985_1986_sub_id_cmte_id_amount ON ofec_sched_a_1985_1986 USING btree (cmte_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1985_1986_sub_id_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1985_1986_sub_id_cmte_id_amt ON ofec_sched_a_1985_1986 USING btree (cmte_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1985_1986_sub_id_cmte_id_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1985_1986_sub_id_cmte_id_date ON ofec_sched_a_1985_1986 USING btree (cmte_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1985_1986_sub_id_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1985_1986_sub_id_cmte_id_dt ON ofec_sched_a_1985_1986 USING btree (cmte_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1985_1986_sub_id_date_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1985_1986_sub_id_date_amt ON ofec_sched_a_1985_1986 USING btree (contb_receipt_dt, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1985_1986_sub_id_line_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1985_1986_sub_id_line_num_amt ON ofec_sched_a_1985_1986 USING btree (line_num, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1985_1986_sub_id_line_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1985_1986_sub_id_line_num_dt ON ofec_sched_a_1985_1986 USING btree (line_num, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1985_1986_two_year_transaction_period_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1985_1986_two_year_transaction_period_amt ON ofec_sched_a_1985_1986 USING btree (two_year_transaction_period, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1985_1986_two_year_transaction_period_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1985_1986_two_year_transaction_period_dt ON ofec_sched_a_1985_1986 USING btree (two_year_transaction_period, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1987_1988_clean_contbr_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1987_1988_clean_contbr_id_amt ON ofec_sched_a_1987_1988 USING btree (clean_contbr_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1987_1988_clean_contbr_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1987_1988_clean_contbr_id_dt ON ofec_sched_a_1987_1988 USING btree (clean_contbr_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1987_1988_contbr_city_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1987_1988_contbr_city_amt ON ofec_sched_a_1987_1988 USING btree (contbr_city, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1987_1988_contbr_city_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1987_1988_contbr_city_dt ON ofec_sched_a_1987_1988 USING btree (contbr_city, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1987_1988_contbr_st_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1987_1988_contbr_st_amt ON ofec_sched_a_1987_1988 USING btree (contbr_st, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1987_1988_contbr_st_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1987_1988_contbr_st_dt ON ofec_sched_a_1987_1988 USING btree (contbr_st, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1987_1988_contbr_zip_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1987_1988_contbr_zip_amt ON ofec_sched_a_1987_1988 USING btree (contbr_zip, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1987_1988_contbr_zip_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1987_1988_contbr_zip_dt ON ofec_sched_a_1987_1988 USING btree (contbr_zip, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1987_1988_contrib_emp_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1987_1988_contrib_emp_text_amt ON ofec_sched_a_1987_1988 USING gin (contributor_employer_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1987_1988_contrib_emp_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1987_1988_contrib_emp_text_dt ON ofec_sched_a_1987_1988 USING gin (contributor_employer_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1987_1988_contrib_name_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1987_1988_contrib_name_text_amt ON ofec_sched_a_1987_1988 USING gin (contributor_name_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1987_1988_contrib_name_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1987_1988_contrib_name_text_dt ON ofec_sched_a_1987_1988 USING gin (contributor_name_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1987_1988_contrib_occ_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1987_1988_contrib_occ_text_amt ON ofec_sched_a_1987_1988 USING gin (contributor_occupation_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1987_1988_contrib_occ_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1987_1988_contrib_occ_text_dt ON ofec_sched_a_1987_1988 USING gin (contributor_occupation_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1987_1988_entity_tp; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1987_1988_entity_tp ON ofec_sched_a_1987_1988 USING btree (entity_tp);
--
-- Name: idx_ofec_sched_a_1987_1988_image_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1987_1988_image_num_amt ON ofec_sched_a_1987_1988 USING btree (image_num, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1987_1988_image_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1987_1988_image_num_dt ON ofec_sched_a_1987_1988 USING btree (image_num, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1987_1988_is_individual_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1987_1988_is_individual_amt ON ofec_sched_a_1987_1988 USING btree (is_individual, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1987_1988_is_individual_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1987_1988_is_individual_dt ON ofec_sched_a_1987_1988 USING btree (is_individual, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1987_1988_pg_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1987_1988_pg_date ON ofec_sched_a_1987_1988 USING btree (pg_date);
--
-- Name: idx_ofec_sched_a_1987_1988_rpt_yr; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1987_1988_rpt_yr ON ofec_sched_a_1987_1988 USING btree (rpt_yr);
--
-- Name: idx_ofec_sched_a_1987_1988_sub_id_amount; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1987_1988_sub_id_amount ON ofec_sched_a_1987_1988 USING btree (contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1987_1988_sub_id_amount_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1987_1988_sub_id_amount_dt ON ofec_sched_a_1987_1988 USING btree (contb_receipt_amt, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1987_1988_sub_id_cmte_id_amount; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1987_1988_sub_id_cmte_id_amount ON ofec_sched_a_1987_1988 USING btree (cmte_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1987_1988_sub_id_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1987_1988_sub_id_cmte_id_amt ON ofec_sched_a_1987_1988 USING btree (cmte_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1987_1988_sub_id_cmte_id_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1987_1988_sub_id_cmte_id_date ON ofec_sched_a_1987_1988 USING btree (cmte_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1987_1988_sub_id_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1987_1988_sub_id_cmte_id_dt ON ofec_sched_a_1987_1988 USING btree (cmte_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1987_1988_sub_id_date_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1987_1988_sub_id_date_amt ON ofec_sched_a_1987_1988 USING btree (contb_receipt_dt, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1987_1988_sub_id_line_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1987_1988_sub_id_line_num_amt ON ofec_sched_a_1987_1988 USING btree (line_num, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1987_1988_sub_id_line_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1987_1988_sub_id_line_num_dt ON ofec_sched_a_1987_1988 USING btree (line_num, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1987_1988_two_year_transaction_period_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1987_1988_two_year_transaction_period_amt ON ofec_sched_a_1987_1988 USING btree (two_year_transaction_period, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1987_1988_two_year_transaction_period_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1987_1988_two_year_transaction_period_dt ON ofec_sched_a_1987_1988 USING btree (two_year_transaction_period, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1989_1990_clean_contbr_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1989_1990_clean_contbr_id_amt ON ofec_sched_a_1989_1990 USING btree (clean_contbr_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1989_1990_clean_contbr_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1989_1990_clean_contbr_id_dt ON ofec_sched_a_1989_1990 USING btree (clean_contbr_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1989_1990_contbr_city_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1989_1990_contbr_city_amt ON ofec_sched_a_1989_1990 USING btree (contbr_city, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1989_1990_contbr_city_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1989_1990_contbr_city_dt ON ofec_sched_a_1989_1990 USING btree (contbr_city, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1989_1990_contbr_st_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1989_1990_contbr_st_amt ON ofec_sched_a_1989_1990 USING btree (contbr_st, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1989_1990_contbr_st_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1989_1990_contbr_st_dt ON ofec_sched_a_1989_1990 USING btree (contbr_st, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1989_1990_contbr_zip_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1989_1990_contbr_zip_amt ON ofec_sched_a_1989_1990 USING btree (contbr_zip, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1989_1990_contbr_zip_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1989_1990_contbr_zip_dt ON ofec_sched_a_1989_1990 USING btree (contbr_zip, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1989_1990_contrib_emp_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1989_1990_contrib_emp_text_amt ON ofec_sched_a_1989_1990 USING gin (contributor_employer_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1989_1990_contrib_emp_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1989_1990_contrib_emp_text_dt ON ofec_sched_a_1989_1990 USING gin (contributor_employer_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1989_1990_contrib_name_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1989_1990_contrib_name_text_amt ON ofec_sched_a_1989_1990 USING gin (contributor_name_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1989_1990_contrib_name_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1989_1990_contrib_name_text_dt ON ofec_sched_a_1989_1990 USING gin (contributor_name_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1989_1990_contrib_occ_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1989_1990_contrib_occ_text_amt ON ofec_sched_a_1989_1990 USING gin (contributor_occupation_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1989_1990_contrib_occ_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1989_1990_contrib_occ_text_dt ON ofec_sched_a_1989_1990 USING gin (contributor_occupation_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1989_1990_entity_tp; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1989_1990_entity_tp ON ofec_sched_a_1989_1990 USING btree (entity_tp);
--
-- Name: idx_ofec_sched_a_1989_1990_image_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1989_1990_image_num_amt ON ofec_sched_a_1989_1990 USING btree (image_num, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1989_1990_image_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1989_1990_image_num_dt ON ofec_sched_a_1989_1990 USING btree (image_num, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1989_1990_is_individual_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1989_1990_is_individual_amt ON ofec_sched_a_1989_1990 USING btree (is_individual, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1989_1990_is_individual_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1989_1990_is_individual_dt ON ofec_sched_a_1989_1990 USING btree (is_individual, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1989_1990_pg_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1989_1990_pg_date ON ofec_sched_a_1989_1990 USING btree (pg_date);
--
-- Name: idx_ofec_sched_a_1989_1990_rpt_yr; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1989_1990_rpt_yr ON ofec_sched_a_1989_1990 USING btree (rpt_yr);
--
-- Name: idx_ofec_sched_a_1989_1990_sub_id_amount; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1989_1990_sub_id_amount ON ofec_sched_a_1989_1990 USING btree (contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1989_1990_sub_id_amount_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1989_1990_sub_id_amount_dt ON ofec_sched_a_1989_1990 USING btree (contb_receipt_amt, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1989_1990_sub_id_cmte_id_amount; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1989_1990_sub_id_cmte_id_amount ON ofec_sched_a_1989_1990 USING btree (cmte_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1989_1990_sub_id_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1989_1990_sub_id_cmte_id_amt ON ofec_sched_a_1989_1990 USING btree (cmte_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1989_1990_sub_id_cmte_id_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1989_1990_sub_id_cmte_id_date ON ofec_sched_a_1989_1990 USING btree (cmte_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1989_1990_sub_id_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1989_1990_sub_id_cmte_id_dt ON ofec_sched_a_1989_1990 USING btree (cmte_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1989_1990_sub_id_date_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1989_1990_sub_id_date_amt ON ofec_sched_a_1989_1990 USING btree (contb_receipt_dt, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1989_1990_sub_id_line_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1989_1990_sub_id_line_num_amt ON ofec_sched_a_1989_1990 USING btree (line_num, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1989_1990_sub_id_line_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1989_1990_sub_id_line_num_dt ON ofec_sched_a_1989_1990 USING btree (line_num, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1989_1990_two_year_transaction_period_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1989_1990_two_year_transaction_period_amt ON ofec_sched_a_1989_1990 USING btree (two_year_transaction_period, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1989_1990_two_year_transaction_period_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1989_1990_two_year_transaction_period_dt ON ofec_sched_a_1989_1990 USING btree (two_year_transaction_period, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1991_1992_clean_contbr_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1991_1992_clean_contbr_id_amt ON ofec_sched_a_1991_1992 USING btree (clean_contbr_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1991_1992_clean_contbr_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1991_1992_clean_contbr_id_dt ON ofec_sched_a_1991_1992 USING btree (clean_contbr_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1991_1992_contbr_city_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1991_1992_contbr_city_amt ON ofec_sched_a_1991_1992 USING btree (contbr_city, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1991_1992_contbr_city_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1991_1992_contbr_city_dt ON ofec_sched_a_1991_1992 USING btree (contbr_city, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1991_1992_contbr_st_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1991_1992_contbr_st_amt ON ofec_sched_a_1991_1992 USING btree (contbr_st, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1991_1992_contbr_st_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1991_1992_contbr_st_dt ON ofec_sched_a_1991_1992 USING btree (contbr_st, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1991_1992_contbr_zip_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1991_1992_contbr_zip_amt ON ofec_sched_a_1991_1992 USING btree (contbr_zip, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1991_1992_contbr_zip_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1991_1992_contbr_zip_dt ON ofec_sched_a_1991_1992 USING btree (contbr_zip, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1991_1992_contrib_emp_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1991_1992_contrib_emp_text_amt ON ofec_sched_a_1991_1992 USING gin (contributor_employer_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1991_1992_contrib_emp_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1991_1992_contrib_emp_text_dt ON ofec_sched_a_1991_1992 USING gin (contributor_employer_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1991_1992_contrib_name_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1991_1992_contrib_name_text_amt ON ofec_sched_a_1991_1992 USING gin (contributor_name_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1991_1992_contrib_name_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1991_1992_contrib_name_text_dt ON ofec_sched_a_1991_1992 USING gin (contributor_name_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1991_1992_contrib_occ_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1991_1992_contrib_occ_text_amt ON ofec_sched_a_1991_1992 USING gin (contributor_occupation_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1991_1992_contrib_occ_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1991_1992_contrib_occ_text_dt ON ofec_sched_a_1991_1992 USING gin (contributor_occupation_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1991_1992_entity_tp; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1991_1992_entity_tp ON ofec_sched_a_1991_1992 USING btree (entity_tp);
--
-- Name: idx_ofec_sched_a_1991_1992_image_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1991_1992_image_num_amt ON ofec_sched_a_1991_1992 USING btree (image_num, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1991_1992_image_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1991_1992_image_num_dt ON ofec_sched_a_1991_1992 USING btree (image_num, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1991_1992_is_individual_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1991_1992_is_individual_amt ON ofec_sched_a_1991_1992 USING btree (is_individual, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1991_1992_is_individual_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1991_1992_is_individual_dt ON ofec_sched_a_1991_1992 USING btree (is_individual, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1991_1992_pg_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1991_1992_pg_date ON ofec_sched_a_1991_1992 USING btree (pg_date);
--
-- Name: idx_ofec_sched_a_1991_1992_rpt_yr; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1991_1992_rpt_yr ON ofec_sched_a_1991_1992 USING btree (rpt_yr);
--
-- Name: idx_ofec_sched_a_1991_1992_sub_id_amount; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1991_1992_sub_id_amount ON ofec_sched_a_1991_1992 USING btree (contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1991_1992_sub_id_amount_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1991_1992_sub_id_amount_dt ON ofec_sched_a_1991_1992 USING btree (contb_receipt_amt, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1991_1992_sub_id_cmte_id_amount; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1991_1992_sub_id_cmte_id_amount ON ofec_sched_a_1991_1992 USING btree (cmte_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1991_1992_sub_id_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1991_1992_sub_id_cmte_id_amt ON ofec_sched_a_1991_1992 USING btree (cmte_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1991_1992_sub_id_cmte_id_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1991_1992_sub_id_cmte_id_date ON ofec_sched_a_1991_1992 USING btree (cmte_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1991_1992_sub_id_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1991_1992_sub_id_cmte_id_dt ON ofec_sched_a_1991_1992 USING btree (cmte_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1991_1992_sub_id_date_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1991_1992_sub_id_date_amt ON ofec_sched_a_1991_1992 USING btree (contb_receipt_dt, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1991_1992_sub_id_line_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1991_1992_sub_id_line_num_amt ON ofec_sched_a_1991_1992 USING btree (line_num, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1991_1992_sub_id_line_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1991_1992_sub_id_line_num_dt ON ofec_sched_a_1991_1992 USING btree (line_num, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1991_1992_two_year_transaction_period_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1991_1992_two_year_transaction_period_amt ON ofec_sched_a_1991_1992 USING btree (two_year_transaction_period, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1991_1992_two_year_transaction_period_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1991_1992_two_year_transaction_period_dt ON ofec_sched_a_1991_1992 USING btree (two_year_transaction_period, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1993_1994_clean_contbr_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1993_1994_clean_contbr_id_amt ON ofec_sched_a_1993_1994 USING btree (clean_contbr_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1993_1994_clean_contbr_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1993_1994_clean_contbr_id_dt ON ofec_sched_a_1993_1994 USING btree (clean_contbr_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1993_1994_contbr_city_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1993_1994_contbr_city_amt ON ofec_sched_a_1993_1994 USING btree (contbr_city, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1993_1994_contbr_city_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1993_1994_contbr_city_dt ON ofec_sched_a_1993_1994 USING btree (contbr_city, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1993_1994_contbr_st_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1993_1994_contbr_st_amt ON ofec_sched_a_1993_1994 USING btree (contbr_st, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1993_1994_contbr_st_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1993_1994_contbr_st_dt ON ofec_sched_a_1993_1994 USING btree (contbr_st, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1993_1994_contbr_zip_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1993_1994_contbr_zip_amt ON ofec_sched_a_1993_1994 USING btree (contbr_zip, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1993_1994_contbr_zip_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1993_1994_contbr_zip_dt ON ofec_sched_a_1993_1994 USING btree (contbr_zip, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1993_1994_contrib_emp_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1993_1994_contrib_emp_text_amt ON ofec_sched_a_1993_1994 USING gin (contributor_employer_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1993_1994_contrib_emp_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1993_1994_contrib_emp_text_dt ON ofec_sched_a_1993_1994 USING gin (contributor_employer_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1993_1994_contrib_name_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1993_1994_contrib_name_text_amt ON ofec_sched_a_1993_1994 USING gin (contributor_name_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1993_1994_contrib_name_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1993_1994_contrib_name_text_dt ON ofec_sched_a_1993_1994 USING gin (contributor_name_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1993_1994_contrib_occ_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1993_1994_contrib_occ_text_amt ON ofec_sched_a_1993_1994 USING gin (contributor_occupation_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1993_1994_contrib_occ_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1993_1994_contrib_occ_text_dt ON ofec_sched_a_1993_1994 USING gin (contributor_occupation_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1993_1994_entity_tp; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1993_1994_entity_tp ON ofec_sched_a_1993_1994 USING btree (entity_tp);
--
-- Name: idx_ofec_sched_a_1993_1994_image_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1993_1994_image_num_amt ON ofec_sched_a_1993_1994 USING btree (image_num, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1993_1994_image_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1993_1994_image_num_dt ON ofec_sched_a_1993_1994 USING btree (image_num, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1993_1994_is_individual_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1993_1994_is_individual_amt ON ofec_sched_a_1993_1994 USING btree (is_individual, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1993_1994_is_individual_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1993_1994_is_individual_dt ON ofec_sched_a_1993_1994 USING btree (is_individual, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1993_1994_pg_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1993_1994_pg_date ON ofec_sched_a_1993_1994 USING btree (pg_date);
--
-- Name: idx_ofec_sched_a_1993_1994_rpt_yr; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1993_1994_rpt_yr ON ofec_sched_a_1993_1994 USING btree (rpt_yr);
--
-- Name: idx_ofec_sched_a_1993_1994_sub_id_amount; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1993_1994_sub_id_amount ON ofec_sched_a_1993_1994 USING btree (contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1993_1994_sub_id_amount_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1993_1994_sub_id_amount_dt ON ofec_sched_a_1993_1994 USING btree (contb_receipt_amt, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1993_1994_sub_id_cmte_id_amount; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1993_1994_sub_id_cmte_id_amount ON ofec_sched_a_1993_1994 USING btree (cmte_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1993_1994_sub_id_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1993_1994_sub_id_cmte_id_amt ON ofec_sched_a_1993_1994 USING btree (cmte_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1993_1994_sub_id_cmte_id_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1993_1994_sub_id_cmte_id_date ON ofec_sched_a_1993_1994 USING btree (cmte_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1993_1994_sub_id_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1993_1994_sub_id_cmte_id_dt ON ofec_sched_a_1993_1994 USING btree (cmte_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1993_1994_sub_id_date_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1993_1994_sub_id_date_amt ON ofec_sched_a_1993_1994 USING btree (contb_receipt_dt, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1993_1994_sub_id_line_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1993_1994_sub_id_line_num_amt ON ofec_sched_a_1993_1994 USING btree (line_num, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1993_1994_sub_id_line_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1993_1994_sub_id_line_num_dt ON ofec_sched_a_1993_1994 USING btree (line_num, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1993_1994_two_year_transaction_period_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1993_1994_two_year_transaction_period_amt ON ofec_sched_a_1993_1994 USING btree (two_year_transaction_period, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1993_1994_two_year_transaction_period_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1993_1994_two_year_transaction_period_dt ON ofec_sched_a_1993_1994 USING btree (two_year_transaction_period, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1995_1996_clean_contbr_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1995_1996_clean_contbr_id_amt ON ofec_sched_a_1995_1996 USING btree (clean_contbr_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1995_1996_clean_contbr_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1995_1996_clean_contbr_id_dt ON ofec_sched_a_1995_1996 USING btree (clean_contbr_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1995_1996_contbr_city_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1995_1996_contbr_city_amt ON ofec_sched_a_1995_1996 USING btree (contbr_city, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1995_1996_contbr_city_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1995_1996_contbr_city_dt ON ofec_sched_a_1995_1996 USING btree (contbr_city, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1995_1996_contbr_st_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1995_1996_contbr_st_amt ON ofec_sched_a_1995_1996 USING btree (contbr_st, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1995_1996_contbr_st_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1995_1996_contbr_st_dt ON ofec_sched_a_1995_1996 USING btree (contbr_st, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1995_1996_contbr_zip_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1995_1996_contbr_zip_amt ON ofec_sched_a_1995_1996 USING btree (contbr_zip, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1995_1996_contbr_zip_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1995_1996_contbr_zip_dt ON ofec_sched_a_1995_1996 USING btree (contbr_zip, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1995_1996_contrib_emp_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1995_1996_contrib_emp_text_amt ON ofec_sched_a_1995_1996 USING gin (contributor_employer_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1995_1996_contrib_emp_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1995_1996_contrib_emp_text_dt ON ofec_sched_a_1995_1996 USING gin (contributor_employer_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1995_1996_contrib_name_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1995_1996_contrib_name_text_amt ON ofec_sched_a_1995_1996 USING gin (contributor_name_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1995_1996_contrib_name_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1995_1996_contrib_name_text_dt ON ofec_sched_a_1995_1996 USING gin (contributor_name_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1995_1996_contrib_occ_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1995_1996_contrib_occ_text_amt ON ofec_sched_a_1995_1996 USING gin (contributor_occupation_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1995_1996_contrib_occ_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1995_1996_contrib_occ_text_dt ON ofec_sched_a_1995_1996 USING gin (contributor_occupation_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1995_1996_entity_tp; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1995_1996_entity_tp ON ofec_sched_a_1995_1996 USING btree (entity_tp);
--
-- Name: idx_ofec_sched_a_1995_1996_image_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1995_1996_image_num_amt ON ofec_sched_a_1995_1996 USING btree (image_num, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1995_1996_image_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1995_1996_image_num_dt ON ofec_sched_a_1995_1996 USING btree (image_num, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1995_1996_is_individual_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1995_1996_is_individual_amt ON ofec_sched_a_1995_1996 USING btree (is_individual, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1995_1996_is_individual_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1995_1996_is_individual_dt ON ofec_sched_a_1995_1996 USING btree (is_individual, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1995_1996_pg_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1995_1996_pg_date ON ofec_sched_a_1995_1996 USING btree (pg_date);
--
-- Name: idx_ofec_sched_a_1995_1996_rpt_yr; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1995_1996_rpt_yr ON ofec_sched_a_1995_1996 USING btree (rpt_yr);
--
-- Name: idx_ofec_sched_a_1995_1996_sub_id_amount; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1995_1996_sub_id_amount ON ofec_sched_a_1995_1996 USING btree (contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1995_1996_sub_id_amount_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1995_1996_sub_id_amount_dt ON ofec_sched_a_1995_1996 USING btree (contb_receipt_amt, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1995_1996_sub_id_cmte_id_amount; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1995_1996_sub_id_cmte_id_amount ON ofec_sched_a_1995_1996 USING btree (cmte_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1995_1996_sub_id_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1995_1996_sub_id_cmte_id_amt ON ofec_sched_a_1995_1996 USING btree (cmte_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1995_1996_sub_id_cmte_id_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1995_1996_sub_id_cmte_id_date ON ofec_sched_a_1995_1996 USING btree (cmte_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1995_1996_sub_id_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1995_1996_sub_id_cmte_id_dt ON ofec_sched_a_1995_1996 USING btree (cmte_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1995_1996_sub_id_date_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1995_1996_sub_id_date_amt ON ofec_sched_a_1995_1996 USING btree (contb_receipt_dt, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1995_1996_sub_id_line_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1995_1996_sub_id_line_num_amt ON ofec_sched_a_1995_1996 USING btree (line_num, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1995_1996_sub_id_line_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1995_1996_sub_id_line_num_dt ON ofec_sched_a_1995_1996 USING btree (line_num, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1995_1996_two_year_transaction_period_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1995_1996_two_year_transaction_period_amt ON ofec_sched_a_1995_1996 USING btree (two_year_transaction_period, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1995_1996_two_year_transaction_period_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1995_1996_two_year_transaction_period_dt ON ofec_sched_a_1995_1996 USING btree (two_year_transaction_period, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1997_1998_clean_contbr_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1997_1998_clean_contbr_id_amt ON ofec_sched_a_1997_1998 USING btree (clean_contbr_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1997_1998_clean_contbr_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1997_1998_clean_contbr_id_dt ON ofec_sched_a_1997_1998 USING btree (clean_contbr_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1997_1998_contbr_city_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1997_1998_contbr_city_amt ON ofec_sched_a_1997_1998 USING btree (contbr_city, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1997_1998_contbr_city_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1997_1998_contbr_city_dt ON ofec_sched_a_1997_1998 USING btree (contbr_city, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1997_1998_contbr_st_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1997_1998_contbr_st_amt ON ofec_sched_a_1997_1998 USING btree (contbr_st, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1997_1998_contbr_st_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1997_1998_contbr_st_dt ON ofec_sched_a_1997_1998 USING btree (contbr_st, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1997_1998_contbr_zip_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1997_1998_contbr_zip_amt ON ofec_sched_a_1997_1998 USING btree (contbr_zip, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1997_1998_contbr_zip_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1997_1998_contbr_zip_dt ON ofec_sched_a_1997_1998 USING btree (contbr_zip, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1997_1998_contrib_emp_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1997_1998_contrib_emp_text_amt ON ofec_sched_a_1997_1998 USING gin (contributor_employer_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1997_1998_contrib_emp_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1997_1998_contrib_emp_text_dt ON ofec_sched_a_1997_1998 USING gin (contributor_employer_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1997_1998_contrib_name_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1997_1998_contrib_name_text_amt ON ofec_sched_a_1997_1998 USING gin (contributor_name_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1997_1998_contrib_name_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1997_1998_contrib_name_text_dt ON ofec_sched_a_1997_1998 USING gin (contributor_name_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1997_1998_contrib_occ_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1997_1998_contrib_occ_text_amt ON ofec_sched_a_1997_1998 USING gin (contributor_occupation_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1997_1998_contrib_occ_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1997_1998_contrib_occ_text_dt ON ofec_sched_a_1997_1998 USING gin (contributor_occupation_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1997_1998_entity_tp; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1997_1998_entity_tp ON ofec_sched_a_1997_1998 USING btree (entity_tp);
--
-- Name: idx_ofec_sched_a_1997_1998_image_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1997_1998_image_num_amt ON ofec_sched_a_1997_1998 USING btree (image_num, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1997_1998_image_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1997_1998_image_num_dt ON ofec_sched_a_1997_1998 USING btree (image_num, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1997_1998_is_individual_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1997_1998_is_individual_amt ON ofec_sched_a_1997_1998 USING btree (is_individual, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1997_1998_is_individual_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1997_1998_is_individual_dt ON ofec_sched_a_1997_1998 USING btree (is_individual, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1997_1998_pg_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1997_1998_pg_date ON ofec_sched_a_1997_1998 USING btree (pg_date);
--
-- Name: idx_ofec_sched_a_1997_1998_rpt_yr; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1997_1998_rpt_yr ON ofec_sched_a_1997_1998 USING btree (rpt_yr);
--
-- Name: idx_ofec_sched_a_1997_1998_sub_id_amount; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1997_1998_sub_id_amount ON ofec_sched_a_1997_1998 USING btree (contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1997_1998_sub_id_amount_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1997_1998_sub_id_amount_dt ON ofec_sched_a_1997_1998 USING btree (contb_receipt_amt, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1997_1998_sub_id_cmte_id_amount; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1997_1998_sub_id_cmte_id_amount ON ofec_sched_a_1997_1998 USING btree (cmte_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1997_1998_sub_id_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1997_1998_sub_id_cmte_id_amt ON ofec_sched_a_1997_1998 USING btree (cmte_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1997_1998_sub_id_cmte_id_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1997_1998_sub_id_cmte_id_date ON ofec_sched_a_1997_1998 USING btree (cmte_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1997_1998_sub_id_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1997_1998_sub_id_cmte_id_dt ON ofec_sched_a_1997_1998 USING btree (cmte_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1997_1998_sub_id_date_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1997_1998_sub_id_date_amt ON ofec_sched_a_1997_1998 USING btree (contb_receipt_dt, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1997_1998_sub_id_line_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1997_1998_sub_id_line_num_amt ON ofec_sched_a_1997_1998 USING btree (line_num, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1997_1998_sub_id_line_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1997_1998_sub_id_line_num_dt ON ofec_sched_a_1997_1998 USING btree (line_num, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1997_1998_two_year_transaction_period_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1997_1998_two_year_transaction_period_amt ON ofec_sched_a_1997_1998 USING btree (two_year_transaction_period, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1997_1998_two_year_transaction_period_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1997_1998_two_year_transaction_period_dt ON ofec_sched_a_1997_1998 USING btree (two_year_transaction_period, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1999_2000_clean_contbr_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1999_2000_clean_contbr_id_amt ON ofec_sched_a_1999_2000 USING btree (clean_contbr_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1999_2000_clean_contbr_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1999_2000_clean_contbr_id_dt ON ofec_sched_a_1999_2000 USING btree (clean_contbr_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1999_2000_contbr_city_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1999_2000_contbr_city_amt ON ofec_sched_a_1999_2000 USING btree (contbr_city, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1999_2000_contbr_city_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1999_2000_contbr_city_dt ON ofec_sched_a_1999_2000 USING btree (contbr_city, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1999_2000_contbr_st_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1999_2000_contbr_st_amt ON ofec_sched_a_1999_2000 USING btree (contbr_st, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1999_2000_contbr_st_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1999_2000_contbr_st_dt ON ofec_sched_a_1999_2000 USING btree (contbr_st, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1999_2000_contbr_zip_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1999_2000_contbr_zip_amt ON ofec_sched_a_1999_2000 USING btree (contbr_zip, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1999_2000_contbr_zip_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1999_2000_contbr_zip_dt ON ofec_sched_a_1999_2000 USING btree (contbr_zip, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1999_2000_contrib_emp_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1999_2000_contrib_emp_text_amt ON ofec_sched_a_1999_2000 USING gin (contributor_employer_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1999_2000_contrib_emp_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1999_2000_contrib_emp_text_dt ON ofec_sched_a_1999_2000 USING gin (contributor_employer_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1999_2000_contrib_name_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1999_2000_contrib_name_text_amt ON ofec_sched_a_1999_2000 USING gin (contributor_name_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1999_2000_contrib_name_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1999_2000_contrib_name_text_dt ON ofec_sched_a_1999_2000 USING gin (contributor_name_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1999_2000_contrib_occ_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1999_2000_contrib_occ_text_amt ON ofec_sched_a_1999_2000 USING gin (contributor_occupation_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1999_2000_contrib_occ_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1999_2000_contrib_occ_text_dt ON ofec_sched_a_1999_2000 USING gin (contributor_occupation_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1999_2000_entity_tp; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1999_2000_entity_tp ON ofec_sched_a_1999_2000 USING btree (entity_tp);
--
-- Name: idx_ofec_sched_a_1999_2000_image_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1999_2000_image_num_amt ON ofec_sched_a_1999_2000 USING btree (image_num, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1999_2000_image_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1999_2000_image_num_dt ON ofec_sched_a_1999_2000 USING btree (image_num, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1999_2000_is_individual_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1999_2000_is_individual_amt ON ofec_sched_a_1999_2000 USING btree (is_individual, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1999_2000_is_individual_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1999_2000_is_individual_dt ON ofec_sched_a_1999_2000 USING btree (is_individual, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1999_2000_pg_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1999_2000_pg_date ON ofec_sched_a_1999_2000 USING btree (pg_date);
--
-- Name: idx_ofec_sched_a_1999_2000_rpt_yr; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1999_2000_rpt_yr ON ofec_sched_a_1999_2000 USING btree (rpt_yr);
--
-- Name: idx_ofec_sched_a_1999_2000_sub_id_amount; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1999_2000_sub_id_amount ON ofec_sched_a_1999_2000 USING btree (contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1999_2000_sub_id_amount_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1999_2000_sub_id_amount_dt ON ofec_sched_a_1999_2000 USING btree (contb_receipt_amt, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1999_2000_sub_id_cmte_id_amount; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1999_2000_sub_id_cmte_id_amount ON ofec_sched_a_1999_2000 USING btree (cmte_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1999_2000_sub_id_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1999_2000_sub_id_cmte_id_amt ON ofec_sched_a_1999_2000 USING btree (cmte_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1999_2000_sub_id_cmte_id_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1999_2000_sub_id_cmte_id_date ON ofec_sched_a_1999_2000 USING btree (cmte_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1999_2000_sub_id_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1999_2000_sub_id_cmte_id_dt ON ofec_sched_a_1999_2000 USING btree (cmte_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1999_2000_sub_id_date_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1999_2000_sub_id_date_amt ON ofec_sched_a_1999_2000 USING btree (contb_receipt_dt, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1999_2000_sub_id_line_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1999_2000_sub_id_line_num_amt ON ofec_sched_a_1999_2000 USING btree (line_num, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1999_2000_sub_id_line_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1999_2000_sub_id_line_num_dt ON ofec_sched_a_1999_2000 USING btree (line_num, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_1999_2000_two_year_transaction_period_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1999_2000_two_year_transaction_period_amt ON ofec_sched_a_1999_2000 USING btree (two_year_transaction_period, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_1999_2000_two_year_transaction_period_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_1999_2000_two_year_transaction_period_dt ON ofec_sched_a_1999_2000 USING btree (two_year_transaction_period, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2001_2002_clean_contbr_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2001_2002_clean_contbr_id_amt ON ofec_sched_a_2001_2002 USING btree (clean_contbr_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2001_2002_clean_contbr_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2001_2002_clean_contbr_id_dt ON ofec_sched_a_2001_2002 USING btree (clean_contbr_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2001_2002_contbr_city_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2001_2002_contbr_city_amt ON ofec_sched_a_2001_2002 USING btree (contbr_city, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2001_2002_contbr_city_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2001_2002_contbr_city_dt ON ofec_sched_a_2001_2002 USING btree (contbr_city, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2001_2002_contbr_st_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2001_2002_contbr_st_amt ON ofec_sched_a_2001_2002 USING btree (contbr_st, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2001_2002_contbr_st_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2001_2002_contbr_st_dt ON ofec_sched_a_2001_2002 USING btree (contbr_st, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2001_2002_contbr_zip_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2001_2002_contbr_zip_amt ON ofec_sched_a_2001_2002 USING btree (contbr_zip, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2001_2002_contbr_zip_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2001_2002_contbr_zip_dt ON ofec_sched_a_2001_2002 USING btree (contbr_zip, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2001_2002_contrib_emp_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2001_2002_contrib_emp_text_amt ON ofec_sched_a_2001_2002 USING gin (contributor_employer_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2001_2002_contrib_emp_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2001_2002_contrib_emp_text_dt ON ofec_sched_a_2001_2002 USING gin (contributor_employer_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2001_2002_contrib_name_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2001_2002_contrib_name_text_amt ON ofec_sched_a_2001_2002 USING gin (contributor_name_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2001_2002_contrib_name_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2001_2002_contrib_name_text_dt ON ofec_sched_a_2001_2002 USING gin (contributor_name_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2001_2002_contrib_occ_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2001_2002_contrib_occ_text_amt ON ofec_sched_a_2001_2002 USING gin (contributor_occupation_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2001_2002_contrib_occ_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2001_2002_contrib_occ_text_dt ON ofec_sched_a_2001_2002 USING gin (contributor_occupation_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2001_2002_entity_tp; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2001_2002_entity_tp ON ofec_sched_a_2001_2002 USING btree (entity_tp);
--
-- Name: idx_ofec_sched_a_2001_2002_image_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2001_2002_image_num_amt ON ofec_sched_a_2001_2002 USING btree (image_num, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2001_2002_image_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2001_2002_image_num_dt ON ofec_sched_a_2001_2002 USING btree (image_num, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2001_2002_is_individual_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2001_2002_is_individual_amt ON ofec_sched_a_2001_2002 USING btree (is_individual, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2001_2002_is_individual_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2001_2002_is_individual_dt ON ofec_sched_a_2001_2002 USING btree (is_individual, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2001_2002_pg_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2001_2002_pg_date ON ofec_sched_a_2001_2002 USING btree (pg_date);
--
-- Name: idx_ofec_sched_a_2001_2002_rpt_yr; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2001_2002_rpt_yr ON ofec_sched_a_2001_2002 USING btree (rpt_yr);
--
-- Name: idx_ofec_sched_a_2001_2002_sub_id_amount; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2001_2002_sub_id_amount ON ofec_sched_a_2001_2002 USING btree (contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2001_2002_sub_id_amount_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2001_2002_sub_id_amount_dt ON ofec_sched_a_2001_2002 USING btree (contb_receipt_amt, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2001_2002_sub_id_cmte_id_amount; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2001_2002_sub_id_cmte_id_amount ON ofec_sched_a_2001_2002 USING btree (cmte_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2001_2002_sub_id_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2001_2002_sub_id_cmte_id_amt ON ofec_sched_a_2001_2002 USING btree (cmte_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2001_2002_sub_id_cmte_id_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2001_2002_sub_id_cmte_id_date ON ofec_sched_a_2001_2002 USING btree (cmte_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2001_2002_sub_id_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2001_2002_sub_id_cmte_id_dt ON ofec_sched_a_2001_2002 USING btree (cmte_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2001_2002_sub_id_date_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2001_2002_sub_id_date_amt ON ofec_sched_a_2001_2002 USING btree (contb_receipt_dt, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2001_2002_sub_id_line_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2001_2002_sub_id_line_num_amt ON ofec_sched_a_2001_2002 USING btree (line_num, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2001_2002_sub_id_line_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2001_2002_sub_id_line_num_dt ON ofec_sched_a_2001_2002 USING btree (line_num, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2001_2002_two_year_transaction_period_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2001_2002_two_year_transaction_period_amt ON ofec_sched_a_2001_2002 USING btree (two_year_transaction_period, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2001_2002_two_year_transaction_period_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2001_2002_two_year_transaction_period_dt ON ofec_sched_a_2001_2002 USING btree (two_year_transaction_period, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2003_2004_clean_contbr_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2003_2004_clean_contbr_id_amt ON ofec_sched_a_2003_2004 USING btree (clean_contbr_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2003_2004_clean_contbr_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2003_2004_clean_contbr_id_dt ON ofec_sched_a_2003_2004 USING btree (clean_contbr_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2003_2004_contbr_city_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2003_2004_contbr_city_amt ON ofec_sched_a_2003_2004 USING btree (contbr_city, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2003_2004_contbr_city_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2003_2004_contbr_city_dt ON ofec_sched_a_2003_2004 USING btree (contbr_city, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2003_2004_contbr_st_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2003_2004_contbr_st_amt ON ofec_sched_a_2003_2004 USING btree (contbr_st, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2003_2004_contbr_st_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2003_2004_contbr_st_dt ON ofec_sched_a_2003_2004 USING btree (contbr_st, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2003_2004_contbr_zip_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2003_2004_contbr_zip_amt ON ofec_sched_a_2003_2004 USING btree (contbr_zip, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2003_2004_contbr_zip_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2003_2004_contbr_zip_dt ON ofec_sched_a_2003_2004 USING btree (contbr_zip, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2003_2004_contrib_emp_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2003_2004_contrib_emp_text_amt ON ofec_sched_a_2003_2004 USING gin (contributor_employer_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2003_2004_contrib_emp_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2003_2004_contrib_emp_text_dt ON ofec_sched_a_2003_2004 USING gin (contributor_employer_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2003_2004_contrib_name_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2003_2004_contrib_name_text_amt ON ofec_sched_a_2003_2004 USING gin (contributor_name_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2003_2004_contrib_name_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2003_2004_contrib_name_text_dt ON ofec_sched_a_2003_2004 USING gin (contributor_name_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2003_2004_contrib_occ_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2003_2004_contrib_occ_text_amt ON ofec_sched_a_2003_2004 USING gin (contributor_occupation_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2003_2004_contrib_occ_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2003_2004_contrib_occ_text_dt ON ofec_sched_a_2003_2004 USING gin (contributor_occupation_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2003_2004_entity_tp; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2003_2004_entity_tp ON ofec_sched_a_2003_2004 USING btree (entity_tp);
--
-- Name: idx_ofec_sched_a_2003_2004_image_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2003_2004_image_num_amt ON ofec_sched_a_2003_2004 USING btree (image_num, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2003_2004_image_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2003_2004_image_num_dt ON ofec_sched_a_2003_2004 USING btree (image_num, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2003_2004_is_individual_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2003_2004_is_individual_amt ON ofec_sched_a_2003_2004 USING btree (is_individual, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2003_2004_is_individual_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2003_2004_is_individual_dt ON ofec_sched_a_2003_2004 USING btree (is_individual, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2003_2004_pg_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2003_2004_pg_date ON ofec_sched_a_2003_2004 USING btree (pg_date);
--
-- Name: idx_ofec_sched_a_2003_2004_rpt_yr; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2003_2004_rpt_yr ON ofec_sched_a_2003_2004 USING btree (rpt_yr);
--
-- Name: idx_ofec_sched_a_2003_2004_sub_id_amount; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2003_2004_sub_id_amount ON ofec_sched_a_2003_2004 USING btree (contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2003_2004_sub_id_amount_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2003_2004_sub_id_amount_dt ON ofec_sched_a_2003_2004 USING btree (contb_receipt_amt, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2003_2004_sub_id_cmte_id_amount; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2003_2004_sub_id_cmte_id_amount ON ofec_sched_a_2003_2004 USING btree (cmte_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2003_2004_sub_id_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2003_2004_sub_id_cmte_id_amt ON ofec_sched_a_2003_2004 USING btree (cmte_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2003_2004_sub_id_cmte_id_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2003_2004_sub_id_cmte_id_date ON ofec_sched_a_2003_2004 USING btree (cmte_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2003_2004_sub_id_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2003_2004_sub_id_cmte_id_dt ON ofec_sched_a_2003_2004 USING btree (cmte_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2003_2004_sub_id_date_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2003_2004_sub_id_date_amt ON ofec_sched_a_2003_2004 USING btree (contb_receipt_dt, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2003_2004_sub_id_line_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2003_2004_sub_id_line_num_amt ON ofec_sched_a_2003_2004 USING btree (line_num, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2003_2004_sub_id_line_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2003_2004_sub_id_line_num_dt ON ofec_sched_a_2003_2004 USING btree (line_num, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2003_2004_two_year_transaction_period_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2003_2004_two_year_transaction_period_amt ON ofec_sched_a_2003_2004 USING btree (two_year_transaction_period, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2003_2004_two_year_transaction_period_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2003_2004_two_year_transaction_period_dt ON ofec_sched_a_2003_2004 USING btree (two_year_transaction_period, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2005_2006_clean_contbr_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2005_2006_clean_contbr_id_amt ON ofec_sched_a_2005_2006 USING btree (clean_contbr_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2005_2006_clean_contbr_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2005_2006_clean_contbr_id_dt ON ofec_sched_a_2005_2006 USING btree (clean_contbr_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2005_2006_contbr_city_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2005_2006_contbr_city_amt ON ofec_sched_a_2005_2006 USING btree (contbr_city, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2005_2006_contbr_city_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2005_2006_contbr_city_dt ON ofec_sched_a_2005_2006 USING btree (contbr_city, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2005_2006_contbr_st_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2005_2006_contbr_st_amt ON ofec_sched_a_2005_2006 USING btree (contbr_st, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2005_2006_contbr_st_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2005_2006_contbr_st_dt ON ofec_sched_a_2005_2006 USING btree (contbr_st, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2005_2006_contbr_zip_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2005_2006_contbr_zip_amt ON ofec_sched_a_2005_2006 USING btree (contbr_zip, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2005_2006_contbr_zip_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2005_2006_contbr_zip_dt ON ofec_sched_a_2005_2006 USING btree (contbr_zip, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2005_2006_contrib_emp_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2005_2006_contrib_emp_text_amt ON ofec_sched_a_2005_2006 USING gin (contributor_employer_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2005_2006_contrib_emp_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2005_2006_contrib_emp_text_dt ON ofec_sched_a_2005_2006 USING gin (contributor_employer_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2005_2006_contrib_name_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2005_2006_contrib_name_text_amt ON ofec_sched_a_2005_2006 USING gin (contributor_name_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2005_2006_contrib_name_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2005_2006_contrib_name_text_dt ON ofec_sched_a_2005_2006 USING gin (contributor_name_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2005_2006_contrib_occ_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2005_2006_contrib_occ_text_amt ON ofec_sched_a_2005_2006 USING gin (contributor_occupation_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2005_2006_contrib_occ_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2005_2006_contrib_occ_text_dt ON ofec_sched_a_2005_2006 USING gin (contributor_occupation_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2005_2006_entity_tp; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2005_2006_entity_tp ON ofec_sched_a_2005_2006 USING btree (entity_tp);
--
-- Name: idx_ofec_sched_a_2005_2006_image_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2005_2006_image_num_amt ON ofec_sched_a_2005_2006 USING btree (image_num, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2005_2006_image_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2005_2006_image_num_dt ON ofec_sched_a_2005_2006 USING btree (image_num, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2005_2006_is_individual_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2005_2006_is_individual_amt ON ofec_sched_a_2005_2006 USING btree (is_individual, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2005_2006_is_individual_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2005_2006_is_individual_dt ON ofec_sched_a_2005_2006 USING btree (is_individual, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2005_2006_pg_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2005_2006_pg_date ON ofec_sched_a_2005_2006 USING btree (pg_date);
--
-- Name: idx_ofec_sched_a_2005_2006_rpt_yr; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2005_2006_rpt_yr ON ofec_sched_a_2005_2006 USING btree (rpt_yr);
--
-- Name: idx_ofec_sched_a_2005_2006_sub_id_amount; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2005_2006_sub_id_amount ON ofec_sched_a_2005_2006 USING btree (contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2005_2006_sub_id_amount_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2005_2006_sub_id_amount_dt ON ofec_sched_a_2005_2006 USING btree (contb_receipt_amt, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2005_2006_sub_id_cmte_id_amount; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2005_2006_sub_id_cmte_id_amount ON ofec_sched_a_2005_2006 USING btree (cmte_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2005_2006_sub_id_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2005_2006_sub_id_cmte_id_amt ON ofec_sched_a_2005_2006 USING btree (cmte_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2005_2006_sub_id_cmte_id_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2005_2006_sub_id_cmte_id_date ON ofec_sched_a_2005_2006 USING btree (cmte_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2005_2006_sub_id_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2005_2006_sub_id_cmte_id_dt ON ofec_sched_a_2005_2006 USING btree (cmte_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2005_2006_sub_id_date_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2005_2006_sub_id_date_amt ON ofec_sched_a_2005_2006 USING btree (contb_receipt_dt, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2005_2006_sub_id_line_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2005_2006_sub_id_line_num_amt ON ofec_sched_a_2005_2006 USING btree (line_num, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2005_2006_sub_id_line_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2005_2006_sub_id_line_num_dt ON ofec_sched_a_2005_2006 USING btree (line_num, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2005_2006_two_year_transaction_period_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2005_2006_two_year_transaction_period_amt ON ofec_sched_a_2005_2006 USING btree (two_year_transaction_period, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2005_2006_two_year_transaction_period_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2005_2006_two_year_transaction_period_dt ON ofec_sched_a_2005_2006 USING btree (two_year_transaction_period, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2007_2008_clean_contbr_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2007_2008_clean_contbr_id_amt ON ofec_sched_a_2007_2008 USING btree (clean_contbr_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2007_2008_clean_contbr_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2007_2008_clean_contbr_id_dt ON ofec_sched_a_2007_2008 USING btree (clean_contbr_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2007_2008_contbr_city_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2007_2008_contbr_city_amt ON ofec_sched_a_2007_2008 USING btree (contbr_city, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2007_2008_contbr_city_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2007_2008_contbr_city_dt ON ofec_sched_a_2007_2008 USING btree (contbr_city, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2007_2008_contbr_st_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2007_2008_contbr_st_amt ON ofec_sched_a_2007_2008 USING btree (contbr_st, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2007_2008_contbr_st_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2007_2008_contbr_st_dt ON ofec_sched_a_2007_2008 USING btree (contbr_st, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2007_2008_contbr_zip_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2007_2008_contbr_zip_amt ON ofec_sched_a_2007_2008 USING btree (contbr_zip, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2007_2008_contbr_zip_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2007_2008_contbr_zip_dt ON ofec_sched_a_2007_2008 USING btree (contbr_zip, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2007_2008_contrib_emp_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2007_2008_contrib_emp_text_amt ON ofec_sched_a_2007_2008 USING gin (contributor_employer_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2007_2008_contrib_emp_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2007_2008_contrib_emp_text_dt ON ofec_sched_a_2007_2008 USING gin (contributor_employer_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2007_2008_contrib_name_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2007_2008_contrib_name_text_amt ON ofec_sched_a_2007_2008 USING gin (contributor_name_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2007_2008_contrib_name_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2007_2008_contrib_name_text_dt ON ofec_sched_a_2007_2008 USING gin (contributor_name_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2007_2008_contrib_occ_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2007_2008_contrib_occ_text_amt ON ofec_sched_a_2007_2008 USING gin (contributor_occupation_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2007_2008_contrib_occ_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2007_2008_contrib_occ_text_dt ON ofec_sched_a_2007_2008 USING gin (contributor_occupation_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2007_2008_entity_tp; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2007_2008_entity_tp ON ofec_sched_a_2007_2008 USING btree (entity_tp);
--
-- Name: idx_ofec_sched_a_2007_2008_image_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2007_2008_image_num_amt ON ofec_sched_a_2007_2008 USING btree (image_num, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2007_2008_image_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2007_2008_image_num_dt ON ofec_sched_a_2007_2008 USING btree (image_num, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2007_2008_is_individual_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2007_2008_is_individual_amt ON ofec_sched_a_2007_2008 USING btree (is_individual, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2007_2008_is_individual_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2007_2008_is_individual_dt ON ofec_sched_a_2007_2008 USING btree (is_individual, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2007_2008_pg_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2007_2008_pg_date ON ofec_sched_a_2007_2008 USING btree (pg_date);
--
-- Name: idx_ofec_sched_a_2007_2008_rpt_yr; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2007_2008_rpt_yr ON ofec_sched_a_2007_2008 USING btree (rpt_yr);
--
-- Name: idx_ofec_sched_a_2007_2008_sub_id_amount; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2007_2008_sub_id_amount ON ofec_sched_a_2007_2008 USING btree (contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2007_2008_sub_id_amount_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2007_2008_sub_id_amount_dt ON ofec_sched_a_2007_2008 USING btree (contb_receipt_amt, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2007_2008_sub_id_cmte_id_amount; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2007_2008_sub_id_cmte_id_amount ON ofec_sched_a_2007_2008 USING btree (cmte_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2007_2008_sub_id_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2007_2008_sub_id_cmte_id_amt ON ofec_sched_a_2007_2008 USING btree (cmte_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2007_2008_sub_id_cmte_id_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2007_2008_sub_id_cmte_id_date ON ofec_sched_a_2007_2008 USING btree (cmte_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2007_2008_sub_id_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2007_2008_sub_id_cmte_id_dt ON ofec_sched_a_2007_2008 USING btree (cmte_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2007_2008_sub_id_date_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2007_2008_sub_id_date_amt ON ofec_sched_a_2007_2008 USING btree (contb_receipt_dt, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2007_2008_sub_id_line_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2007_2008_sub_id_line_num_amt ON ofec_sched_a_2007_2008 USING btree (line_num, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2007_2008_sub_id_line_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2007_2008_sub_id_line_num_dt ON ofec_sched_a_2007_2008 USING btree (line_num, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2007_2008_two_year_transaction_period_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2007_2008_two_year_transaction_period_amt ON ofec_sched_a_2007_2008 USING btree (two_year_transaction_period, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2007_2008_two_year_transaction_period_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2007_2008_two_year_transaction_period_dt ON ofec_sched_a_2007_2008 USING btree (two_year_transaction_period, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2009_2010_clean_contbr_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2009_2010_clean_contbr_id_amt ON ofec_sched_a_2009_2010 USING btree (clean_contbr_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2009_2010_clean_contbr_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2009_2010_clean_contbr_id_dt ON ofec_sched_a_2009_2010 USING btree (clean_contbr_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2009_2010_contbr_city_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2009_2010_contbr_city_amt ON ofec_sched_a_2009_2010 USING btree (contbr_city, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2009_2010_contbr_city_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2009_2010_contbr_city_dt ON ofec_sched_a_2009_2010 USING btree (contbr_city, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2009_2010_contbr_st_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2009_2010_contbr_st_amt ON ofec_sched_a_2009_2010 USING btree (contbr_st, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2009_2010_contbr_st_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2009_2010_contbr_st_dt ON ofec_sched_a_2009_2010 USING btree (contbr_st, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2009_2010_contbr_zip_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2009_2010_contbr_zip_amt ON ofec_sched_a_2009_2010 USING btree (contbr_zip, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2009_2010_contbr_zip_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2009_2010_contbr_zip_dt ON ofec_sched_a_2009_2010 USING btree (contbr_zip, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2009_2010_contrib_emp_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2009_2010_contrib_emp_text_amt ON ofec_sched_a_2009_2010 USING gin (contributor_employer_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2009_2010_contrib_emp_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2009_2010_contrib_emp_text_dt ON ofec_sched_a_2009_2010 USING gin (contributor_employer_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2009_2010_contrib_name_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2009_2010_contrib_name_text_amt ON ofec_sched_a_2009_2010 USING gin (contributor_name_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2009_2010_contrib_name_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2009_2010_contrib_name_text_dt ON ofec_sched_a_2009_2010 USING gin (contributor_name_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2009_2010_contrib_occ_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2009_2010_contrib_occ_text_amt ON ofec_sched_a_2009_2010 USING gin (contributor_occupation_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2009_2010_contrib_occ_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2009_2010_contrib_occ_text_dt ON ofec_sched_a_2009_2010 USING gin (contributor_occupation_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2009_2010_entity_tp; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2009_2010_entity_tp ON ofec_sched_a_2009_2010 USING btree (entity_tp);
--
-- Name: idx_ofec_sched_a_2009_2010_image_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2009_2010_image_num_amt ON ofec_sched_a_2009_2010 USING btree (image_num, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2009_2010_image_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2009_2010_image_num_dt ON ofec_sched_a_2009_2010 USING btree (image_num, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2009_2010_is_individual_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2009_2010_is_individual_amt ON ofec_sched_a_2009_2010 USING btree (is_individual, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2009_2010_is_individual_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2009_2010_is_individual_dt ON ofec_sched_a_2009_2010 USING btree (is_individual, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2009_2010_pg_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2009_2010_pg_date ON ofec_sched_a_2009_2010 USING btree (pg_date);
--
-- Name: idx_ofec_sched_a_2009_2010_rpt_yr; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2009_2010_rpt_yr ON ofec_sched_a_2009_2010 USING btree (rpt_yr);
--
-- Name: idx_ofec_sched_a_2009_2010_sub_id_amount; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2009_2010_sub_id_amount ON ofec_sched_a_2009_2010 USING btree (contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2009_2010_sub_id_amount_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2009_2010_sub_id_amount_dt ON ofec_sched_a_2009_2010 USING btree (contb_receipt_amt, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2009_2010_sub_id_cmte_id_amount; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2009_2010_sub_id_cmte_id_amount ON ofec_sched_a_2009_2010 USING btree (cmte_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2009_2010_sub_id_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2009_2010_sub_id_cmte_id_amt ON ofec_sched_a_2009_2010 USING btree (cmte_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2009_2010_sub_id_cmte_id_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2009_2010_sub_id_cmte_id_date ON ofec_sched_a_2009_2010 USING btree (cmte_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2009_2010_sub_id_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2009_2010_sub_id_cmte_id_dt ON ofec_sched_a_2009_2010 USING btree (cmte_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2009_2010_sub_id_date_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2009_2010_sub_id_date_amt ON ofec_sched_a_2009_2010 USING btree (contb_receipt_dt, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2009_2010_sub_id_line_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2009_2010_sub_id_line_num_amt ON ofec_sched_a_2009_2010 USING btree (line_num, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2009_2010_sub_id_line_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2009_2010_sub_id_line_num_dt ON ofec_sched_a_2009_2010 USING btree (line_num, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2009_2010_two_year_transaction_period_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2009_2010_two_year_transaction_period_amt ON ofec_sched_a_2009_2010 USING btree (two_year_transaction_period, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2009_2010_two_year_transaction_period_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2009_2010_two_year_transaction_period_dt ON ofec_sched_a_2009_2010 USING btree (two_year_transaction_period, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2011_2012_clean_contbr_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2011_2012_clean_contbr_id_amt ON ofec_sched_a_2011_2012 USING btree (clean_contbr_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2011_2012_clean_contbr_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2011_2012_clean_contbr_id_dt ON ofec_sched_a_2011_2012 USING btree (clean_contbr_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2011_2012_contbr_city_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2011_2012_contbr_city_amt ON ofec_sched_a_2011_2012 USING btree (contbr_city, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2011_2012_contbr_city_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2011_2012_contbr_city_dt ON ofec_sched_a_2011_2012 USING btree (contbr_city, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2011_2012_contbr_st_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2011_2012_contbr_st_amt ON ofec_sched_a_2011_2012 USING btree (contbr_st, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2011_2012_contbr_st_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2011_2012_contbr_st_dt ON ofec_sched_a_2011_2012 USING btree (contbr_st, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2011_2012_contbr_zip_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2011_2012_contbr_zip_amt ON ofec_sched_a_2011_2012 USING btree (contbr_zip, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2011_2012_contbr_zip_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2011_2012_contbr_zip_dt ON ofec_sched_a_2011_2012 USING btree (contbr_zip, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2011_2012_contrib_emp_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2011_2012_contrib_emp_text_amt ON ofec_sched_a_2011_2012 USING gin (contributor_employer_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2011_2012_contrib_emp_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2011_2012_contrib_emp_text_dt ON ofec_sched_a_2011_2012 USING gin (contributor_employer_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2011_2012_contrib_name_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2011_2012_contrib_name_text_amt ON ofec_sched_a_2011_2012 USING gin (contributor_name_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2011_2012_contrib_name_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2011_2012_contrib_name_text_dt ON ofec_sched_a_2011_2012 USING gin (contributor_name_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2011_2012_contrib_occ_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2011_2012_contrib_occ_text_amt ON ofec_sched_a_2011_2012 USING gin (contributor_occupation_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2011_2012_contrib_occ_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2011_2012_contrib_occ_text_dt ON ofec_sched_a_2011_2012 USING gin (contributor_occupation_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2011_2012_entity_tp; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2011_2012_entity_tp ON ofec_sched_a_2011_2012 USING btree (entity_tp);
--
-- Name: idx_ofec_sched_a_2011_2012_image_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2011_2012_image_num_amt ON ofec_sched_a_2011_2012 USING btree (image_num, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2011_2012_image_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2011_2012_image_num_dt ON ofec_sched_a_2011_2012 USING btree (image_num, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2011_2012_is_individual_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2011_2012_is_individual_amt ON ofec_sched_a_2011_2012 USING btree (is_individual, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2011_2012_is_individual_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2011_2012_is_individual_dt ON ofec_sched_a_2011_2012 USING btree (is_individual, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2011_2012_pg_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2011_2012_pg_date ON ofec_sched_a_2011_2012 USING btree (pg_date);
--
-- Name: idx_ofec_sched_a_2011_2012_rpt_yr; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2011_2012_rpt_yr ON ofec_sched_a_2011_2012 USING btree (rpt_yr);
--
-- Name: idx_ofec_sched_a_2011_2012_sub_id_amount; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2011_2012_sub_id_amount ON ofec_sched_a_2011_2012 USING btree (contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2011_2012_sub_id_amount_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2011_2012_sub_id_amount_dt ON ofec_sched_a_2011_2012 USING btree (contb_receipt_amt, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2011_2012_sub_id_cmte_id_amount; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2011_2012_sub_id_cmte_id_amount ON ofec_sched_a_2011_2012 USING btree (cmte_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2011_2012_sub_id_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2011_2012_sub_id_cmte_id_amt ON ofec_sched_a_2011_2012 USING btree (cmte_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2011_2012_sub_id_cmte_id_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2011_2012_sub_id_cmte_id_date ON ofec_sched_a_2011_2012 USING btree (cmte_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2011_2012_sub_id_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2011_2012_sub_id_cmte_id_dt ON ofec_sched_a_2011_2012 USING btree (cmte_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2011_2012_sub_id_date_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2011_2012_sub_id_date_amt ON ofec_sched_a_2011_2012 USING btree (contb_receipt_dt, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2011_2012_sub_id_line_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2011_2012_sub_id_line_num_amt ON ofec_sched_a_2011_2012 USING btree (line_num, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2011_2012_sub_id_line_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2011_2012_sub_id_line_num_dt ON ofec_sched_a_2011_2012 USING btree (line_num, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2011_2012_two_year_transaction_period_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2011_2012_two_year_transaction_period_amt ON ofec_sched_a_2011_2012 USING btree (two_year_transaction_period, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2011_2012_two_year_transaction_period_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2011_2012_two_year_transaction_period_dt ON ofec_sched_a_2011_2012 USING btree (two_year_transaction_period, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2013_2014_clean_contbr_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2013_2014_clean_contbr_id_amt ON ofec_sched_a_2013_2014 USING btree (clean_contbr_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2013_2014_clean_contbr_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2013_2014_clean_contbr_id_dt ON ofec_sched_a_2013_2014 USING btree (clean_contbr_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2013_2014_contbr_city_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2013_2014_contbr_city_amt ON ofec_sched_a_2013_2014 USING btree (contbr_city, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2013_2014_contbr_city_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2013_2014_contbr_city_dt ON ofec_sched_a_2013_2014 USING btree (contbr_city, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2013_2014_contbr_st_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2013_2014_contbr_st_amt ON ofec_sched_a_2013_2014 USING btree (contbr_st, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2013_2014_contbr_st_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2013_2014_contbr_st_dt ON ofec_sched_a_2013_2014 USING btree (contbr_st, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2013_2014_contbr_zip_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2013_2014_contbr_zip_amt ON ofec_sched_a_2013_2014 USING btree (contbr_zip, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2013_2014_contbr_zip_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2013_2014_contbr_zip_dt ON ofec_sched_a_2013_2014 USING btree (contbr_zip, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2013_2014_contrib_emp_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2013_2014_contrib_emp_text_amt ON ofec_sched_a_2013_2014 USING gin (contributor_employer_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2013_2014_contrib_emp_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2013_2014_contrib_emp_text_dt ON ofec_sched_a_2013_2014 USING gin (contributor_employer_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2013_2014_contrib_name_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2013_2014_contrib_name_text_amt ON ofec_sched_a_2013_2014 USING gin (contributor_name_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2013_2014_contrib_name_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2013_2014_contrib_name_text_dt ON ofec_sched_a_2013_2014 USING gin (contributor_name_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2013_2014_contrib_occ_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2013_2014_contrib_occ_text_amt ON ofec_sched_a_2013_2014 USING gin (contributor_occupation_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2013_2014_contrib_occ_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2013_2014_contrib_occ_text_dt ON ofec_sched_a_2013_2014 USING gin (contributor_occupation_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2013_2014_entity_tp; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2013_2014_entity_tp ON ofec_sched_a_2013_2014 USING btree (entity_tp);
--
-- Name: idx_ofec_sched_a_2013_2014_image_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2013_2014_image_num_amt ON ofec_sched_a_2013_2014 USING btree (image_num, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2013_2014_image_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2013_2014_image_num_dt ON ofec_sched_a_2013_2014 USING btree (image_num, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2013_2014_is_individual_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2013_2014_is_individual_amt ON ofec_sched_a_2013_2014 USING btree (is_individual, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2013_2014_is_individual_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2013_2014_is_individual_dt ON ofec_sched_a_2013_2014 USING btree (is_individual, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2013_2014_pg_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2013_2014_pg_date ON ofec_sched_a_2013_2014 USING btree (pg_date);
--
-- Name: idx_ofec_sched_a_2013_2014_rpt_yr; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2013_2014_rpt_yr ON ofec_sched_a_2013_2014 USING btree (rpt_yr);
--
-- Name: idx_ofec_sched_a_2013_2014_sub_id_amount; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2013_2014_sub_id_amount ON ofec_sched_a_2013_2014 USING btree (contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2013_2014_sub_id_amount_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2013_2014_sub_id_amount_dt ON ofec_sched_a_2013_2014 USING btree (contb_receipt_amt, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2013_2014_sub_id_cmte_id_amount; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2013_2014_sub_id_cmte_id_amount ON ofec_sched_a_2013_2014 USING btree (cmte_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2013_2014_sub_id_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2013_2014_sub_id_cmte_id_amt ON ofec_sched_a_2013_2014 USING btree (cmte_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2013_2014_sub_id_cmte_id_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2013_2014_sub_id_cmte_id_date ON ofec_sched_a_2013_2014 USING btree (cmte_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2013_2014_sub_id_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2013_2014_sub_id_cmte_id_dt ON ofec_sched_a_2013_2014 USING btree (cmte_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2013_2014_sub_id_date_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2013_2014_sub_id_date_amt ON ofec_sched_a_2013_2014 USING btree (contb_receipt_dt, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2013_2014_sub_id_line_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2013_2014_sub_id_line_num_amt ON ofec_sched_a_2013_2014 USING btree (line_num, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2013_2014_sub_id_line_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2013_2014_sub_id_line_num_dt ON ofec_sched_a_2013_2014 USING btree (line_num, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2013_2014_two_year_transaction_period_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2013_2014_two_year_transaction_period_amt ON ofec_sched_a_2013_2014 USING btree (two_year_transaction_period, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2013_2014_two_year_transaction_period_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2013_2014_two_year_transaction_period_dt ON ofec_sched_a_2013_2014 USING btree (two_year_transaction_period, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2015_2016_clean_contbr_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2015_2016_clean_contbr_id_amt ON ofec_sched_a_2015_2016 USING btree (clean_contbr_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2015_2016_clean_contbr_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2015_2016_clean_contbr_id_dt ON ofec_sched_a_2015_2016 USING btree (clean_contbr_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2015_2016_contbr_city_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2015_2016_contbr_city_amt ON ofec_sched_a_2015_2016 USING btree (contbr_city, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2015_2016_contbr_city_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2015_2016_contbr_city_dt ON ofec_sched_a_2015_2016 USING btree (contbr_city, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2015_2016_contbr_st_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2015_2016_contbr_st_amt ON ofec_sched_a_2015_2016 USING btree (contbr_st, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2015_2016_contbr_st_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2015_2016_contbr_st_dt ON ofec_sched_a_2015_2016 USING btree (contbr_st, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2015_2016_contbr_zip_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2015_2016_contbr_zip_amt ON ofec_sched_a_2015_2016 USING btree (contbr_zip, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2015_2016_contbr_zip_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2015_2016_contbr_zip_dt ON ofec_sched_a_2015_2016 USING btree (contbr_zip, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2015_2016_contrib_emp_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2015_2016_contrib_emp_text_amt ON ofec_sched_a_2015_2016 USING gin (contributor_employer_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2015_2016_contrib_emp_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2015_2016_contrib_emp_text_dt ON ofec_sched_a_2015_2016 USING gin (contributor_employer_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2015_2016_contrib_name_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2015_2016_contrib_name_text_amt ON ofec_sched_a_2015_2016 USING gin (contributor_name_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2015_2016_contrib_name_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2015_2016_contrib_name_text_dt ON ofec_sched_a_2015_2016 USING gin (contributor_name_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2015_2016_contrib_occ_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2015_2016_contrib_occ_text_amt ON ofec_sched_a_2015_2016 USING gin (contributor_occupation_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2015_2016_contrib_occ_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2015_2016_contrib_occ_text_dt ON ofec_sched_a_2015_2016 USING gin (contributor_occupation_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2015_2016_entity_tp; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2015_2016_entity_tp ON ofec_sched_a_2015_2016 USING btree (entity_tp);
--
-- Name: idx_ofec_sched_a_2015_2016_image_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2015_2016_image_num_amt ON ofec_sched_a_2015_2016 USING btree (image_num, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2015_2016_image_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2015_2016_image_num_dt ON ofec_sched_a_2015_2016 USING btree (image_num, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2015_2016_is_individual_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2015_2016_is_individual_amt ON ofec_sched_a_2015_2016 USING btree (is_individual, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2015_2016_is_individual_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2015_2016_is_individual_dt ON ofec_sched_a_2015_2016 USING btree (is_individual, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2015_2016_pg_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2015_2016_pg_date ON ofec_sched_a_2015_2016 USING btree (pg_date);
--
-- Name: idx_ofec_sched_a_2015_2016_rpt_yr; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2015_2016_rpt_yr ON ofec_sched_a_2015_2016 USING btree (rpt_yr);
--
-- Name: idx_ofec_sched_a_2015_2016_sub_id_amount; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2015_2016_sub_id_amount ON ofec_sched_a_2015_2016 USING btree (contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2015_2016_sub_id_amount_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2015_2016_sub_id_amount_dt ON ofec_sched_a_2015_2016 USING btree (contb_receipt_amt, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2015_2016_sub_id_cmte_id_amount; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2015_2016_sub_id_cmte_id_amount ON ofec_sched_a_2015_2016 USING btree (cmte_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2015_2016_sub_id_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2015_2016_sub_id_cmte_id_amt ON ofec_sched_a_2015_2016 USING btree (cmte_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2015_2016_sub_id_cmte_id_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2015_2016_sub_id_cmte_id_date ON ofec_sched_a_2015_2016 USING btree (cmte_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2015_2016_sub_id_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2015_2016_sub_id_cmte_id_dt ON ofec_sched_a_2015_2016 USING btree (cmte_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2015_2016_sub_id_date_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2015_2016_sub_id_date_amt ON ofec_sched_a_2015_2016 USING btree (contb_receipt_dt, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2015_2016_sub_id_line_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2015_2016_sub_id_line_num_amt ON ofec_sched_a_2015_2016 USING btree (line_num, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2015_2016_sub_id_line_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2015_2016_sub_id_line_num_dt ON ofec_sched_a_2015_2016 USING btree (line_num, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2015_2016_two_year_transaction_period_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2015_2016_two_year_transaction_period_amt ON ofec_sched_a_2015_2016 USING btree (two_year_transaction_period, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2015_2016_two_year_transaction_period_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2015_2016_two_year_transaction_period_dt ON ofec_sched_a_2015_2016 USING btree (two_year_transaction_period, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2017_2018_clean_contbr_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2017_2018_clean_contbr_id_amt ON ofec_sched_a_2017_2018 USING btree (clean_contbr_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2017_2018_clean_contbr_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2017_2018_clean_contbr_id_dt ON ofec_sched_a_2017_2018 USING btree (clean_contbr_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2017_2018_contbr_city_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2017_2018_contbr_city_amt ON ofec_sched_a_2017_2018 USING btree (contbr_city, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2017_2018_contbr_city_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2017_2018_contbr_city_dt ON ofec_sched_a_2017_2018 USING btree (contbr_city, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2017_2018_contbr_st_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2017_2018_contbr_st_amt ON ofec_sched_a_2017_2018 USING btree (contbr_st, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2017_2018_contbr_st_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2017_2018_contbr_st_dt ON ofec_sched_a_2017_2018 USING btree (contbr_st, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2017_2018_contbr_zip_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2017_2018_contbr_zip_amt ON ofec_sched_a_2017_2018 USING btree (contbr_zip, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2017_2018_contbr_zip_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2017_2018_contbr_zip_dt ON ofec_sched_a_2017_2018 USING btree (contbr_zip, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2017_2018_contrib_emp_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2017_2018_contrib_emp_text_amt ON ofec_sched_a_2017_2018 USING gin (contributor_employer_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2017_2018_contrib_emp_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2017_2018_contrib_emp_text_dt ON ofec_sched_a_2017_2018 USING gin (contributor_employer_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2017_2018_contrib_name_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2017_2018_contrib_name_text_amt ON ofec_sched_a_2017_2018 USING gin (contributor_name_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2017_2018_contrib_name_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2017_2018_contrib_name_text_dt ON ofec_sched_a_2017_2018 USING gin (contributor_name_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2017_2018_contrib_occ_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2017_2018_contrib_occ_text_amt ON ofec_sched_a_2017_2018 USING gin (contributor_occupation_text, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2017_2018_contrib_occ_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2017_2018_contrib_occ_text_dt ON ofec_sched_a_2017_2018 USING gin (contributor_occupation_text, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2017_2018_entity_tp; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2017_2018_entity_tp ON ofec_sched_a_2017_2018 USING btree (entity_tp);
--
-- Name: idx_ofec_sched_a_2017_2018_image_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2017_2018_image_num_amt ON ofec_sched_a_2017_2018 USING btree (image_num, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2017_2018_image_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2017_2018_image_num_dt ON ofec_sched_a_2017_2018 USING btree (image_num, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2017_2018_is_individual_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2017_2018_is_individual_amt ON ofec_sched_a_2017_2018 USING btree (is_individual, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2017_2018_is_individual_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2017_2018_is_individual_dt ON ofec_sched_a_2017_2018 USING btree (is_individual, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2017_2018_pg_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2017_2018_pg_date ON ofec_sched_a_2017_2018 USING btree (pg_date);
--
-- Name: idx_ofec_sched_a_2017_2018_rpt_yr; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2017_2018_rpt_yr ON ofec_sched_a_2017_2018 USING btree (rpt_yr);
--
-- Name: idx_ofec_sched_a_2017_2018_sub_id_amount; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2017_2018_sub_id_amount ON ofec_sched_a_2017_2018 USING btree (contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2017_2018_sub_id_amount_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2017_2018_sub_id_amount_dt ON ofec_sched_a_2017_2018 USING btree (contb_receipt_amt, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2017_2018_sub_id_cmte_id_amount; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2017_2018_sub_id_cmte_id_amount ON ofec_sched_a_2017_2018 USING btree (cmte_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2017_2018_sub_id_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2017_2018_sub_id_cmte_id_amt ON ofec_sched_a_2017_2018 USING btree (cmte_id, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2017_2018_sub_id_cmte_id_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2017_2018_sub_id_cmte_id_date ON ofec_sched_a_2017_2018 USING btree (cmte_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2017_2018_sub_id_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2017_2018_sub_id_cmte_id_dt ON ofec_sched_a_2017_2018 USING btree (cmte_id, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2017_2018_sub_id_date_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2017_2018_sub_id_date_amt ON ofec_sched_a_2017_2018 USING btree (contb_receipt_dt, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2017_2018_sub_id_line_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2017_2018_sub_id_line_num_amt ON ofec_sched_a_2017_2018 USING btree (line_num, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2017_2018_sub_id_line_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2017_2018_sub_id_line_num_dt ON ofec_sched_a_2017_2018 USING btree (line_num, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_a_2017_2018_two_year_transaction_period_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2017_2018_two_year_transaction_period_amt ON ofec_sched_a_2017_2018 USING btree (two_year_transaction_period, contb_receipt_amt, sub_id);
--
-- Name: idx_ofec_sched_a_2017_2018_two_year_transaction_period_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_a_2017_2018_two_year_transaction_period_dt ON ofec_sched_a_2017_2018 USING btree (two_year_transaction_period, contb_receipt_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1977_1978_clean_recipient_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1977_1978_clean_recipient_cmte_id_amt ON ofec_sched_b_1977_1978 USING btree (clean_recipient_cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1977_1978_clean_recipient_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1977_1978_clean_recipient_cmte_id_dt ON ofec_sched_b_1977_1978 USING btree (clean_recipient_cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1977_1978_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1977_1978_cmte_id_amt ON ofec_sched_b_1977_1978 USING btree (cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1977_1978_cmte_id_disb_amt_sub_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1977_1978_cmte_id_disb_amt_sub_id ON ofec_sched_b_1977_1978 USING btree (cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1977_1978_cmte_id_disb_dt_sub_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1977_1978_cmte_id_disb_dt_sub_id ON ofec_sched_b_1977_1978 USING btree (cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1977_1978_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1977_1978_cmte_id_dt ON ofec_sched_b_1977_1978 USING btree (cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1977_1978_disb_desc_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1977_1978_disb_desc_text_amt ON ofec_sched_b_1977_1978 USING gin (disbursement_description_text, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1977_1978_disb_desc_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1977_1978_disb_desc_text_dt ON ofec_sched_b_1977_1978 USING gin (disbursement_description_text, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1977_1978_image_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1977_1978_image_num_amt ON ofec_sched_b_1977_1978 USING btree (image_num, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1977_1978_image_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1977_1978_image_num_dt ON ofec_sched_b_1977_1978 USING btree (image_num, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1977_1978_pg_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1977_1978_pg_date ON ofec_sched_b_1977_1978 USING btree (pg_date);
--
-- Name: idx_ofec_sched_b_1977_1978_recip_name_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1977_1978_recip_name_text_amt ON ofec_sched_b_1977_1978 USING gin (recipient_name_text, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1977_1978_recip_name_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1977_1978_recip_name_text_dt ON ofec_sched_b_1977_1978 USING gin (recipient_name_text, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1977_1978_recipient_city_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1977_1978_recipient_city_amt ON ofec_sched_b_1977_1978 USING btree (recipient_city, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1977_1978_recipient_city_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1977_1978_recipient_city_dt ON ofec_sched_b_1977_1978 USING btree (recipient_city, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1977_1978_recipient_st_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1977_1978_recipient_st_amt ON ofec_sched_b_1977_1978 USING btree (recipient_st, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1977_1978_recipient_st_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1977_1978_recipient_st_dt ON ofec_sched_b_1977_1978 USING btree (recipient_st, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1977_1978_rpt_yr_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1977_1978_rpt_yr_amt ON ofec_sched_b_1977_1978 USING btree (rpt_yr, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1977_1978_rpt_yr_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1977_1978_rpt_yr_dt ON ofec_sched_b_1977_1978 USING btree (rpt_yr, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1977_1978_sub_id_amount_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1977_1978_sub_id_amount_dt ON ofec_sched_b_1977_1978 USING btree (disb_amt, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1977_1978_sub_id_date_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1977_1978_sub_id_date_amt ON ofec_sched_b_1977_1978 USING btree (disb_dt, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1977_1978_sub_id_line_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1977_1978_sub_id_line_num_amt ON ofec_sched_b_1977_1978 USING btree (line_num, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1977_1978_sub_id_line_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1977_1978_sub_id_line_num_dt ON ofec_sched_b_1977_1978 USING btree (line_num, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1977_1978_two_year_transaction_period_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1977_1978_two_year_transaction_period_amt ON ofec_sched_b_1977_1978 USING btree (two_year_transaction_period, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1977_1978_two_year_transaction_period_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1977_1978_two_year_transaction_period_dt ON ofec_sched_b_1977_1978 USING btree (two_year_transaction_period, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1979_1980_clean_recipient_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1979_1980_clean_recipient_cmte_id_amt ON ofec_sched_b_1979_1980 USING btree (clean_recipient_cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1979_1980_clean_recipient_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1979_1980_clean_recipient_cmte_id_dt ON ofec_sched_b_1979_1980 USING btree (clean_recipient_cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1979_1980_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1979_1980_cmte_id_amt ON ofec_sched_b_1979_1980 USING btree (cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1979_1980_cmte_id_disb_amt_sub_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1979_1980_cmte_id_disb_amt_sub_id ON ofec_sched_b_1979_1980 USING btree (cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1979_1980_cmte_id_disb_dt_sub_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1979_1980_cmte_id_disb_dt_sub_id ON ofec_sched_b_1979_1980 USING btree (cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1979_1980_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1979_1980_cmte_id_dt ON ofec_sched_b_1979_1980 USING btree (cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1979_1980_disb_desc_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1979_1980_disb_desc_text_amt ON ofec_sched_b_1979_1980 USING gin (disbursement_description_text, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1979_1980_disb_desc_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1979_1980_disb_desc_text_dt ON ofec_sched_b_1979_1980 USING gin (disbursement_description_text, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1979_1980_image_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1979_1980_image_num_amt ON ofec_sched_b_1979_1980 USING btree (image_num, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1979_1980_image_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1979_1980_image_num_dt ON ofec_sched_b_1979_1980 USING btree (image_num, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1979_1980_pg_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1979_1980_pg_date ON ofec_sched_b_1979_1980 USING btree (pg_date);
--
-- Name: idx_ofec_sched_b_1979_1980_recip_name_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1979_1980_recip_name_text_amt ON ofec_sched_b_1979_1980 USING gin (recipient_name_text, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1979_1980_recip_name_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1979_1980_recip_name_text_dt ON ofec_sched_b_1979_1980 USING gin (recipient_name_text, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1979_1980_recipient_city_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1979_1980_recipient_city_amt ON ofec_sched_b_1979_1980 USING btree (recipient_city, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1979_1980_recipient_city_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1979_1980_recipient_city_dt ON ofec_sched_b_1979_1980 USING btree (recipient_city, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1979_1980_recipient_st_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1979_1980_recipient_st_amt ON ofec_sched_b_1979_1980 USING btree (recipient_st, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1979_1980_recipient_st_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1979_1980_recipient_st_dt ON ofec_sched_b_1979_1980 USING btree (recipient_st, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1979_1980_rpt_yr_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1979_1980_rpt_yr_amt ON ofec_sched_b_1979_1980 USING btree (rpt_yr, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1979_1980_rpt_yr_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1979_1980_rpt_yr_dt ON ofec_sched_b_1979_1980 USING btree (rpt_yr, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1979_1980_sub_id_amount_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1979_1980_sub_id_amount_dt ON ofec_sched_b_1979_1980 USING btree (disb_amt, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1979_1980_sub_id_date_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1979_1980_sub_id_date_amt ON ofec_sched_b_1979_1980 USING btree (disb_dt, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1979_1980_sub_id_line_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1979_1980_sub_id_line_num_amt ON ofec_sched_b_1979_1980 USING btree (line_num, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1979_1980_sub_id_line_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1979_1980_sub_id_line_num_dt ON ofec_sched_b_1979_1980 USING btree (line_num, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1979_1980_two_year_transaction_period_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1979_1980_two_year_transaction_period_amt ON ofec_sched_b_1979_1980 USING btree (two_year_transaction_period, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1979_1980_two_year_transaction_period_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1979_1980_two_year_transaction_period_dt ON ofec_sched_b_1979_1980 USING btree (two_year_transaction_period, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1981_1982_clean_recipient_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1981_1982_clean_recipient_cmte_id_amt ON ofec_sched_b_1981_1982 USING btree (clean_recipient_cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1981_1982_clean_recipient_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1981_1982_clean_recipient_cmte_id_dt ON ofec_sched_b_1981_1982 USING btree (clean_recipient_cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1981_1982_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1981_1982_cmte_id_amt ON ofec_sched_b_1981_1982 USING btree (cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1981_1982_cmte_id_disb_amt_sub_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1981_1982_cmte_id_disb_amt_sub_id ON ofec_sched_b_1981_1982 USING btree (cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1981_1982_cmte_id_disb_dt_sub_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1981_1982_cmte_id_disb_dt_sub_id ON ofec_sched_b_1981_1982 USING btree (cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1981_1982_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1981_1982_cmte_id_dt ON ofec_sched_b_1981_1982 USING btree (cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1981_1982_disb_desc_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1981_1982_disb_desc_text_amt ON ofec_sched_b_1981_1982 USING gin (disbursement_description_text, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1981_1982_disb_desc_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1981_1982_disb_desc_text_dt ON ofec_sched_b_1981_1982 USING gin (disbursement_description_text, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1981_1982_image_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1981_1982_image_num_amt ON ofec_sched_b_1981_1982 USING btree (image_num, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1981_1982_image_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1981_1982_image_num_dt ON ofec_sched_b_1981_1982 USING btree (image_num, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1981_1982_pg_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1981_1982_pg_date ON ofec_sched_b_1981_1982 USING btree (pg_date);
--
-- Name: idx_ofec_sched_b_1981_1982_recip_name_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1981_1982_recip_name_text_amt ON ofec_sched_b_1981_1982 USING gin (recipient_name_text, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1981_1982_recip_name_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1981_1982_recip_name_text_dt ON ofec_sched_b_1981_1982 USING gin (recipient_name_text, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1981_1982_recipient_city_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1981_1982_recipient_city_amt ON ofec_sched_b_1981_1982 USING btree (recipient_city, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1981_1982_recipient_city_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1981_1982_recipient_city_dt ON ofec_sched_b_1981_1982 USING btree (recipient_city, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1981_1982_recipient_st_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1981_1982_recipient_st_amt ON ofec_sched_b_1981_1982 USING btree (recipient_st, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1981_1982_recipient_st_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1981_1982_recipient_st_dt ON ofec_sched_b_1981_1982 USING btree (recipient_st, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1981_1982_rpt_yr_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1981_1982_rpt_yr_amt ON ofec_sched_b_1981_1982 USING btree (rpt_yr, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1981_1982_rpt_yr_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1981_1982_rpt_yr_dt ON ofec_sched_b_1981_1982 USING btree (rpt_yr, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1981_1982_sub_id_amount_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1981_1982_sub_id_amount_dt ON ofec_sched_b_1981_1982 USING btree (disb_amt, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1981_1982_sub_id_date_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1981_1982_sub_id_date_amt ON ofec_sched_b_1981_1982 USING btree (disb_dt, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1981_1982_sub_id_line_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1981_1982_sub_id_line_num_amt ON ofec_sched_b_1981_1982 USING btree (line_num, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1981_1982_sub_id_line_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1981_1982_sub_id_line_num_dt ON ofec_sched_b_1981_1982 USING btree (line_num, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1981_1982_two_year_transaction_period_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1981_1982_two_year_transaction_period_amt ON ofec_sched_b_1981_1982 USING btree (two_year_transaction_period, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1981_1982_two_year_transaction_period_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1981_1982_two_year_transaction_period_dt ON ofec_sched_b_1981_1982 USING btree (two_year_transaction_period, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1983_1984_clean_recipient_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1983_1984_clean_recipient_cmte_id_amt ON ofec_sched_b_1983_1984 USING btree (clean_recipient_cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1983_1984_clean_recipient_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1983_1984_clean_recipient_cmte_id_dt ON ofec_sched_b_1983_1984 USING btree (clean_recipient_cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1983_1984_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1983_1984_cmte_id_amt ON ofec_sched_b_1983_1984 USING btree (cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1983_1984_cmte_id_disb_amt_sub_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1983_1984_cmte_id_disb_amt_sub_id ON ofec_sched_b_1983_1984 USING btree (cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1983_1984_cmte_id_disb_dt_sub_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1983_1984_cmte_id_disb_dt_sub_id ON ofec_sched_b_1983_1984 USING btree (cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1983_1984_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1983_1984_cmte_id_dt ON ofec_sched_b_1983_1984 USING btree (cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1983_1984_disb_desc_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1983_1984_disb_desc_text_amt ON ofec_sched_b_1983_1984 USING gin (disbursement_description_text, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1983_1984_disb_desc_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1983_1984_disb_desc_text_dt ON ofec_sched_b_1983_1984 USING gin (disbursement_description_text, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1983_1984_image_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1983_1984_image_num_amt ON ofec_sched_b_1983_1984 USING btree (image_num, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1983_1984_image_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1983_1984_image_num_dt ON ofec_sched_b_1983_1984 USING btree (image_num, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1983_1984_pg_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1983_1984_pg_date ON ofec_sched_b_1983_1984 USING btree (pg_date);
--
-- Name: idx_ofec_sched_b_1983_1984_recip_name_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1983_1984_recip_name_text_amt ON ofec_sched_b_1983_1984 USING gin (recipient_name_text, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1983_1984_recip_name_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1983_1984_recip_name_text_dt ON ofec_sched_b_1983_1984 USING gin (recipient_name_text, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1983_1984_recipient_city_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1983_1984_recipient_city_amt ON ofec_sched_b_1983_1984 USING btree (recipient_city, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1983_1984_recipient_city_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1983_1984_recipient_city_dt ON ofec_sched_b_1983_1984 USING btree (recipient_city, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1983_1984_recipient_st_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1983_1984_recipient_st_amt ON ofec_sched_b_1983_1984 USING btree (recipient_st, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1983_1984_recipient_st_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1983_1984_recipient_st_dt ON ofec_sched_b_1983_1984 USING btree (recipient_st, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1983_1984_rpt_yr_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1983_1984_rpt_yr_amt ON ofec_sched_b_1983_1984 USING btree (rpt_yr, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1983_1984_rpt_yr_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1983_1984_rpt_yr_dt ON ofec_sched_b_1983_1984 USING btree (rpt_yr, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1983_1984_sub_id_amount_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1983_1984_sub_id_amount_dt ON ofec_sched_b_1983_1984 USING btree (disb_amt, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1983_1984_sub_id_date_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1983_1984_sub_id_date_amt ON ofec_sched_b_1983_1984 USING btree (disb_dt, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1983_1984_sub_id_line_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1983_1984_sub_id_line_num_amt ON ofec_sched_b_1983_1984 USING btree (line_num, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1983_1984_sub_id_line_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1983_1984_sub_id_line_num_dt ON ofec_sched_b_1983_1984 USING btree (line_num, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1983_1984_two_year_transaction_period_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1983_1984_two_year_transaction_period_amt ON ofec_sched_b_1983_1984 USING btree (two_year_transaction_period, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1983_1984_two_year_transaction_period_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1983_1984_two_year_transaction_period_dt ON ofec_sched_b_1983_1984 USING btree (two_year_transaction_period, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1985_1986_clean_recipient_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1985_1986_clean_recipient_cmte_id_amt ON ofec_sched_b_1985_1986 USING btree (clean_recipient_cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1985_1986_clean_recipient_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1985_1986_clean_recipient_cmte_id_dt ON ofec_sched_b_1985_1986 USING btree (clean_recipient_cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1985_1986_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1985_1986_cmte_id_amt ON ofec_sched_b_1985_1986 USING btree (cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1985_1986_cmte_id_disb_amt_sub_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1985_1986_cmte_id_disb_amt_sub_id ON ofec_sched_b_1985_1986 USING btree (cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1985_1986_cmte_id_disb_dt_sub_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1985_1986_cmte_id_disb_dt_sub_id ON ofec_sched_b_1985_1986 USING btree (cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1985_1986_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1985_1986_cmte_id_dt ON ofec_sched_b_1985_1986 USING btree (cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1985_1986_disb_desc_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1985_1986_disb_desc_text_amt ON ofec_sched_b_1985_1986 USING gin (disbursement_description_text, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1985_1986_disb_desc_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1985_1986_disb_desc_text_dt ON ofec_sched_b_1985_1986 USING gin (disbursement_description_text, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1985_1986_image_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1985_1986_image_num_amt ON ofec_sched_b_1985_1986 USING btree (image_num, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1985_1986_image_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1985_1986_image_num_dt ON ofec_sched_b_1985_1986 USING btree (image_num, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1985_1986_pg_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1985_1986_pg_date ON ofec_sched_b_1985_1986 USING btree (pg_date);
--
-- Name: idx_ofec_sched_b_1985_1986_recip_name_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1985_1986_recip_name_text_amt ON ofec_sched_b_1985_1986 USING gin (recipient_name_text, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1985_1986_recip_name_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1985_1986_recip_name_text_dt ON ofec_sched_b_1985_1986 USING gin (recipient_name_text, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1985_1986_recipient_city_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1985_1986_recipient_city_amt ON ofec_sched_b_1985_1986 USING btree (recipient_city, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1985_1986_recipient_city_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1985_1986_recipient_city_dt ON ofec_sched_b_1985_1986 USING btree (recipient_city, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1985_1986_recipient_st_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1985_1986_recipient_st_amt ON ofec_sched_b_1985_1986 USING btree (recipient_st, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1985_1986_recipient_st_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1985_1986_recipient_st_dt ON ofec_sched_b_1985_1986 USING btree (recipient_st, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1985_1986_rpt_yr_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1985_1986_rpt_yr_amt ON ofec_sched_b_1985_1986 USING btree (rpt_yr, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1985_1986_rpt_yr_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1985_1986_rpt_yr_dt ON ofec_sched_b_1985_1986 USING btree (rpt_yr, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1985_1986_sub_id_amount_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1985_1986_sub_id_amount_dt ON ofec_sched_b_1985_1986 USING btree (disb_amt, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1985_1986_sub_id_date_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1985_1986_sub_id_date_amt ON ofec_sched_b_1985_1986 USING btree (disb_dt, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1985_1986_sub_id_line_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1985_1986_sub_id_line_num_amt ON ofec_sched_b_1985_1986 USING btree (line_num, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1985_1986_sub_id_line_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1985_1986_sub_id_line_num_dt ON ofec_sched_b_1985_1986 USING btree (line_num, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1985_1986_two_year_transaction_period_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1985_1986_two_year_transaction_period_amt ON ofec_sched_b_1985_1986 USING btree (two_year_transaction_period, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1985_1986_two_year_transaction_period_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1985_1986_two_year_transaction_period_dt ON ofec_sched_b_1985_1986 USING btree (two_year_transaction_period, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1987_1988_clean_recipient_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1987_1988_clean_recipient_cmte_id_amt ON ofec_sched_b_1987_1988 USING btree (clean_recipient_cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1987_1988_clean_recipient_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1987_1988_clean_recipient_cmte_id_dt ON ofec_sched_b_1987_1988 USING btree (clean_recipient_cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1987_1988_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1987_1988_cmte_id_amt ON ofec_sched_b_1987_1988 USING btree (cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1987_1988_cmte_id_disb_amt_sub_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1987_1988_cmte_id_disb_amt_sub_id ON ofec_sched_b_1987_1988 USING btree (cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1987_1988_cmte_id_disb_dt_sub_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1987_1988_cmte_id_disb_dt_sub_id ON ofec_sched_b_1987_1988 USING btree (cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1987_1988_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1987_1988_cmte_id_dt ON ofec_sched_b_1987_1988 USING btree (cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1987_1988_disb_desc_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1987_1988_disb_desc_text_amt ON ofec_sched_b_1987_1988 USING gin (disbursement_description_text, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1987_1988_disb_desc_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1987_1988_disb_desc_text_dt ON ofec_sched_b_1987_1988 USING gin (disbursement_description_text, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1987_1988_image_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1987_1988_image_num_amt ON ofec_sched_b_1987_1988 USING btree (image_num, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1987_1988_image_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1987_1988_image_num_dt ON ofec_sched_b_1987_1988 USING btree (image_num, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1987_1988_pg_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1987_1988_pg_date ON ofec_sched_b_1987_1988 USING btree (pg_date);
--
-- Name: idx_ofec_sched_b_1987_1988_recip_name_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1987_1988_recip_name_text_amt ON ofec_sched_b_1987_1988 USING gin (recipient_name_text, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1987_1988_recip_name_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1987_1988_recip_name_text_dt ON ofec_sched_b_1987_1988 USING gin (recipient_name_text, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1987_1988_recipient_city_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1987_1988_recipient_city_amt ON ofec_sched_b_1987_1988 USING btree (recipient_city, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1987_1988_recipient_city_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1987_1988_recipient_city_dt ON ofec_sched_b_1987_1988 USING btree (recipient_city, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1987_1988_recipient_st_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1987_1988_recipient_st_amt ON ofec_sched_b_1987_1988 USING btree (recipient_st, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1987_1988_recipient_st_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1987_1988_recipient_st_dt ON ofec_sched_b_1987_1988 USING btree (recipient_st, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1987_1988_rpt_yr_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1987_1988_rpt_yr_amt ON ofec_sched_b_1987_1988 USING btree (rpt_yr, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1987_1988_rpt_yr_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1987_1988_rpt_yr_dt ON ofec_sched_b_1987_1988 USING btree (rpt_yr, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1987_1988_sub_id_amount_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1987_1988_sub_id_amount_dt ON ofec_sched_b_1987_1988 USING btree (disb_amt, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1987_1988_sub_id_date_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1987_1988_sub_id_date_amt ON ofec_sched_b_1987_1988 USING btree (disb_dt, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1987_1988_sub_id_line_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1987_1988_sub_id_line_num_amt ON ofec_sched_b_1987_1988 USING btree (line_num, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1987_1988_sub_id_line_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1987_1988_sub_id_line_num_dt ON ofec_sched_b_1987_1988 USING btree (line_num, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1987_1988_two_year_transaction_period_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1987_1988_two_year_transaction_period_amt ON ofec_sched_b_1987_1988 USING btree (two_year_transaction_period, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1987_1988_two_year_transaction_period_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1987_1988_two_year_transaction_period_dt ON ofec_sched_b_1987_1988 USING btree (two_year_transaction_period, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1989_1990_clean_recipient_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1989_1990_clean_recipient_cmte_id_amt ON ofec_sched_b_1989_1990 USING btree (clean_recipient_cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1989_1990_clean_recipient_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1989_1990_clean_recipient_cmte_id_dt ON ofec_sched_b_1989_1990 USING btree (clean_recipient_cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1989_1990_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1989_1990_cmte_id_amt ON ofec_sched_b_1989_1990 USING btree (cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1989_1990_cmte_id_disb_amt_sub_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1989_1990_cmte_id_disb_amt_sub_id ON ofec_sched_b_1989_1990 USING btree (cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1989_1990_cmte_id_disb_dt_sub_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1989_1990_cmte_id_disb_dt_sub_id ON ofec_sched_b_1989_1990 USING btree (cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1989_1990_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1989_1990_cmte_id_dt ON ofec_sched_b_1989_1990 USING btree (cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1989_1990_disb_desc_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1989_1990_disb_desc_text_amt ON ofec_sched_b_1989_1990 USING gin (disbursement_description_text, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1989_1990_disb_desc_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1989_1990_disb_desc_text_dt ON ofec_sched_b_1989_1990 USING gin (disbursement_description_text, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1989_1990_image_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1989_1990_image_num_amt ON ofec_sched_b_1989_1990 USING btree (image_num, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1989_1990_image_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1989_1990_image_num_dt ON ofec_sched_b_1989_1990 USING btree (image_num, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1989_1990_pg_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1989_1990_pg_date ON ofec_sched_b_1989_1990 USING btree (pg_date);
--
-- Name: idx_ofec_sched_b_1989_1990_recip_name_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1989_1990_recip_name_text_amt ON ofec_sched_b_1989_1990 USING gin (recipient_name_text, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1989_1990_recip_name_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1989_1990_recip_name_text_dt ON ofec_sched_b_1989_1990 USING gin (recipient_name_text, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1989_1990_recipient_city_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1989_1990_recipient_city_amt ON ofec_sched_b_1989_1990 USING btree (recipient_city, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1989_1990_recipient_city_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1989_1990_recipient_city_dt ON ofec_sched_b_1989_1990 USING btree (recipient_city, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1989_1990_recipient_st_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1989_1990_recipient_st_amt ON ofec_sched_b_1989_1990 USING btree (recipient_st, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1989_1990_recipient_st_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1989_1990_recipient_st_dt ON ofec_sched_b_1989_1990 USING btree (recipient_st, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1989_1990_rpt_yr_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1989_1990_rpt_yr_amt ON ofec_sched_b_1989_1990 USING btree (rpt_yr, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1989_1990_rpt_yr_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1989_1990_rpt_yr_dt ON ofec_sched_b_1989_1990 USING btree (rpt_yr, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1989_1990_sub_id_amount_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1989_1990_sub_id_amount_dt ON ofec_sched_b_1989_1990 USING btree (disb_amt, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1989_1990_sub_id_date_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1989_1990_sub_id_date_amt ON ofec_sched_b_1989_1990 USING btree (disb_dt, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1989_1990_sub_id_line_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1989_1990_sub_id_line_num_amt ON ofec_sched_b_1989_1990 USING btree (line_num, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1989_1990_sub_id_line_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1989_1990_sub_id_line_num_dt ON ofec_sched_b_1989_1990 USING btree (line_num, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1989_1990_two_year_transaction_period_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1989_1990_two_year_transaction_period_amt ON ofec_sched_b_1989_1990 USING btree (two_year_transaction_period, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1989_1990_two_year_transaction_period_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1989_1990_two_year_transaction_period_dt ON ofec_sched_b_1989_1990 USING btree (two_year_transaction_period, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1991_1992_clean_recipient_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1991_1992_clean_recipient_cmte_id_amt ON ofec_sched_b_1991_1992 USING btree (clean_recipient_cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1991_1992_clean_recipient_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1991_1992_clean_recipient_cmte_id_dt ON ofec_sched_b_1991_1992 USING btree (clean_recipient_cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1991_1992_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1991_1992_cmte_id_amt ON ofec_sched_b_1991_1992 USING btree (cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1991_1992_cmte_id_disb_amt_sub_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1991_1992_cmte_id_disb_amt_sub_id ON ofec_sched_b_1991_1992 USING btree (cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1991_1992_cmte_id_disb_dt_sub_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1991_1992_cmte_id_disb_dt_sub_id ON ofec_sched_b_1991_1992 USING btree (cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1991_1992_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1991_1992_cmte_id_dt ON ofec_sched_b_1991_1992 USING btree (cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1991_1992_disb_desc_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1991_1992_disb_desc_text_amt ON ofec_sched_b_1991_1992 USING gin (disbursement_description_text, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1991_1992_disb_desc_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1991_1992_disb_desc_text_dt ON ofec_sched_b_1991_1992 USING gin (disbursement_description_text, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1991_1992_image_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1991_1992_image_num_amt ON ofec_sched_b_1991_1992 USING btree (image_num, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1991_1992_image_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1991_1992_image_num_dt ON ofec_sched_b_1991_1992 USING btree (image_num, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1991_1992_pg_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1991_1992_pg_date ON ofec_sched_b_1991_1992 USING btree (pg_date);
--
-- Name: idx_ofec_sched_b_1991_1992_recip_name_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1991_1992_recip_name_text_amt ON ofec_sched_b_1991_1992 USING gin (recipient_name_text, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1991_1992_recip_name_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1991_1992_recip_name_text_dt ON ofec_sched_b_1991_1992 USING gin (recipient_name_text, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1991_1992_recipient_city_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1991_1992_recipient_city_amt ON ofec_sched_b_1991_1992 USING btree (recipient_city, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1991_1992_recipient_city_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1991_1992_recipient_city_dt ON ofec_sched_b_1991_1992 USING btree (recipient_city, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1991_1992_recipient_st_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1991_1992_recipient_st_amt ON ofec_sched_b_1991_1992 USING btree (recipient_st, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1991_1992_recipient_st_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1991_1992_recipient_st_dt ON ofec_sched_b_1991_1992 USING btree (recipient_st, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1991_1992_rpt_yr_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1991_1992_rpt_yr_amt ON ofec_sched_b_1991_1992 USING btree (rpt_yr, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1991_1992_rpt_yr_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1991_1992_rpt_yr_dt ON ofec_sched_b_1991_1992 USING btree (rpt_yr, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1991_1992_sub_id_amount_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1991_1992_sub_id_amount_dt ON ofec_sched_b_1991_1992 USING btree (disb_amt, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1991_1992_sub_id_date_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1991_1992_sub_id_date_amt ON ofec_sched_b_1991_1992 USING btree (disb_dt, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1991_1992_sub_id_line_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1991_1992_sub_id_line_num_amt ON ofec_sched_b_1991_1992 USING btree (line_num, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1991_1992_sub_id_line_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1991_1992_sub_id_line_num_dt ON ofec_sched_b_1991_1992 USING btree (line_num, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1991_1992_two_year_transaction_period_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1991_1992_two_year_transaction_period_amt ON ofec_sched_b_1991_1992 USING btree (two_year_transaction_period, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1991_1992_two_year_transaction_period_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1991_1992_two_year_transaction_period_dt ON ofec_sched_b_1991_1992 USING btree (two_year_transaction_period, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1993_1994_clean_recipient_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1993_1994_clean_recipient_cmte_id_amt ON ofec_sched_b_1993_1994 USING btree (clean_recipient_cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1993_1994_clean_recipient_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1993_1994_clean_recipient_cmte_id_dt ON ofec_sched_b_1993_1994 USING btree (clean_recipient_cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1993_1994_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1993_1994_cmte_id_amt ON ofec_sched_b_1993_1994 USING btree (cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1993_1994_cmte_id_disb_amt_sub_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1993_1994_cmte_id_disb_amt_sub_id ON ofec_sched_b_1993_1994 USING btree (cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1993_1994_cmte_id_disb_dt_sub_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1993_1994_cmte_id_disb_dt_sub_id ON ofec_sched_b_1993_1994 USING btree (cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1993_1994_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1993_1994_cmte_id_dt ON ofec_sched_b_1993_1994 USING btree (cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1993_1994_disb_desc_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1993_1994_disb_desc_text_amt ON ofec_sched_b_1993_1994 USING gin (disbursement_description_text, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1993_1994_disb_desc_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1993_1994_disb_desc_text_dt ON ofec_sched_b_1993_1994 USING gin (disbursement_description_text, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1993_1994_image_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1993_1994_image_num_amt ON ofec_sched_b_1993_1994 USING btree (image_num, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1993_1994_image_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1993_1994_image_num_dt ON ofec_sched_b_1993_1994 USING btree (image_num, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1993_1994_pg_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1993_1994_pg_date ON ofec_sched_b_1993_1994 USING btree (pg_date);
--
-- Name: idx_ofec_sched_b_1993_1994_recip_name_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1993_1994_recip_name_text_amt ON ofec_sched_b_1993_1994 USING gin (recipient_name_text, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1993_1994_recip_name_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1993_1994_recip_name_text_dt ON ofec_sched_b_1993_1994 USING gin (recipient_name_text, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1993_1994_recipient_city_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1993_1994_recipient_city_amt ON ofec_sched_b_1993_1994 USING btree (recipient_city, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1993_1994_recipient_city_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1993_1994_recipient_city_dt ON ofec_sched_b_1993_1994 USING btree (recipient_city, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1993_1994_recipient_st_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1993_1994_recipient_st_amt ON ofec_sched_b_1993_1994 USING btree (recipient_st, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1993_1994_recipient_st_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1993_1994_recipient_st_dt ON ofec_sched_b_1993_1994 USING btree (recipient_st, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1993_1994_rpt_yr_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1993_1994_rpt_yr_amt ON ofec_sched_b_1993_1994 USING btree (rpt_yr, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1993_1994_rpt_yr_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1993_1994_rpt_yr_dt ON ofec_sched_b_1993_1994 USING btree (rpt_yr, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1993_1994_sub_id_amount_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1993_1994_sub_id_amount_dt ON ofec_sched_b_1993_1994 USING btree (disb_amt, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1993_1994_sub_id_date_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1993_1994_sub_id_date_amt ON ofec_sched_b_1993_1994 USING btree (disb_dt, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1993_1994_sub_id_line_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1993_1994_sub_id_line_num_amt ON ofec_sched_b_1993_1994 USING btree (line_num, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1993_1994_sub_id_line_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1993_1994_sub_id_line_num_dt ON ofec_sched_b_1993_1994 USING btree (line_num, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1993_1994_two_year_transaction_period_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1993_1994_two_year_transaction_period_amt ON ofec_sched_b_1993_1994 USING btree (two_year_transaction_period, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1993_1994_two_year_transaction_period_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1993_1994_two_year_transaction_period_dt ON ofec_sched_b_1993_1994 USING btree (two_year_transaction_period, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1995_1996_clean_recipient_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1995_1996_clean_recipient_cmte_id_amt ON ofec_sched_b_1995_1996 USING btree (clean_recipient_cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1995_1996_clean_recipient_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1995_1996_clean_recipient_cmte_id_dt ON ofec_sched_b_1995_1996 USING btree (clean_recipient_cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1995_1996_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1995_1996_cmte_id_amt ON ofec_sched_b_1995_1996 USING btree (cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1995_1996_cmte_id_disb_amt_sub_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1995_1996_cmte_id_disb_amt_sub_id ON ofec_sched_b_1995_1996 USING btree (cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1995_1996_cmte_id_disb_dt_sub_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1995_1996_cmte_id_disb_dt_sub_id ON ofec_sched_b_1995_1996 USING btree (cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1995_1996_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1995_1996_cmte_id_dt ON ofec_sched_b_1995_1996 USING btree (cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1995_1996_disb_desc_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1995_1996_disb_desc_text_amt ON ofec_sched_b_1995_1996 USING gin (disbursement_description_text, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1995_1996_disb_desc_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1995_1996_disb_desc_text_dt ON ofec_sched_b_1995_1996 USING gin (disbursement_description_text, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1995_1996_image_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1995_1996_image_num_amt ON ofec_sched_b_1995_1996 USING btree (image_num, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1995_1996_image_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1995_1996_image_num_dt ON ofec_sched_b_1995_1996 USING btree (image_num, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1995_1996_pg_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1995_1996_pg_date ON ofec_sched_b_1995_1996 USING btree (pg_date);
--
-- Name: idx_ofec_sched_b_1995_1996_recip_name_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1995_1996_recip_name_text_amt ON ofec_sched_b_1995_1996 USING gin (recipient_name_text, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1995_1996_recip_name_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1995_1996_recip_name_text_dt ON ofec_sched_b_1995_1996 USING gin (recipient_name_text, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1995_1996_recipient_city_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1995_1996_recipient_city_amt ON ofec_sched_b_1995_1996 USING btree (recipient_city, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1995_1996_recipient_city_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1995_1996_recipient_city_dt ON ofec_sched_b_1995_1996 USING btree (recipient_city, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1995_1996_recipient_st_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1995_1996_recipient_st_amt ON ofec_sched_b_1995_1996 USING btree (recipient_st, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1995_1996_recipient_st_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1995_1996_recipient_st_dt ON ofec_sched_b_1995_1996 USING btree (recipient_st, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1995_1996_rpt_yr_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1995_1996_rpt_yr_amt ON ofec_sched_b_1995_1996 USING btree (rpt_yr, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1995_1996_rpt_yr_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1995_1996_rpt_yr_dt ON ofec_sched_b_1995_1996 USING btree (rpt_yr, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1995_1996_sub_id_amount_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1995_1996_sub_id_amount_dt ON ofec_sched_b_1995_1996 USING btree (disb_amt, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1995_1996_sub_id_date_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1995_1996_sub_id_date_amt ON ofec_sched_b_1995_1996 USING btree (disb_dt, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1995_1996_sub_id_line_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1995_1996_sub_id_line_num_amt ON ofec_sched_b_1995_1996 USING btree (line_num, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1995_1996_sub_id_line_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1995_1996_sub_id_line_num_dt ON ofec_sched_b_1995_1996 USING btree (line_num, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1995_1996_two_year_transaction_period_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1995_1996_two_year_transaction_period_amt ON ofec_sched_b_1995_1996 USING btree (two_year_transaction_period, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1995_1996_two_year_transaction_period_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1995_1996_two_year_transaction_period_dt ON ofec_sched_b_1995_1996 USING btree (two_year_transaction_period, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1997_1998_clean_recipient_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1997_1998_clean_recipient_cmte_id_amt ON ofec_sched_b_1997_1998 USING btree (clean_recipient_cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1997_1998_clean_recipient_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1997_1998_clean_recipient_cmte_id_dt ON ofec_sched_b_1997_1998 USING btree (clean_recipient_cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1997_1998_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1997_1998_cmte_id_amt ON ofec_sched_b_1997_1998 USING btree (cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1997_1998_cmte_id_disb_amt_sub_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1997_1998_cmte_id_disb_amt_sub_id ON ofec_sched_b_1997_1998 USING btree (cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1997_1998_cmte_id_disb_dt_sub_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1997_1998_cmte_id_disb_dt_sub_id ON ofec_sched_b_1997_1998 USING btree (cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1997_1998_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1997_1998_cmte_id_dt ON ofec_sched_b_1997_1998 USING btree (cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1997_1998_disb_desc_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1997_1998_disb_desc_text_amt ON ofec_sched_b_1997_1998 USING gin (disbursement_description_text, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1997_1998_disb_desc_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1997_1998_disb_desc_text_dt ON ofec_sched_b_1997_1998 USING gin (disbursement_description_text, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1997_1998_image_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1997_1998_image_num_amt ON ofec_sched_b_1997_1998 USING btree (image_num, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1997_1998_image_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1997_1998_image_num_dt ON ofec_sched_b_1997_1998 USING btree (image_num, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1997_1998_pg_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1997_1998_pg_date ON ofec_sched_b_1997_1998 USING btree (pg_date);
--
-- Name: idx_ofec_sched_b_1997_1998_recip_name_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1997_1998_recip_name_text_amt ON ofec_sched_b_1997_1998 USING gin (recipient_name_text, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1997_1998_recip_name_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1997_1998_recip_name_text_dt ON ofec_sched_b_1997_1998 USING gin (recipient_name_text, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1997_1998_recipient_city_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1997_1998_recipient_city_amt ON ofec_sched_b_1997_1998 USING btree (recipient_city, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1997_1998_recipient_city_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1997_1998_recipient_city_dt ON ofec_sched_b_1997_1998 USING btree (recipient_city, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1997_1998_recipient_st_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1997_1998_recipient_st_amt ON ofec_sched_b_1997_1998 USING btree (recipient_st, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1997_1998_recipient_st_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1997_1998_recipient_st_dt ON ofec_sched_b_1997_1998 USING btree (recipient_st, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1997_1998_rpt_yr_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1997_1998_rpt_yr_amt ON ofec_sched_b_1997_1998 USING btree (rpt_yr, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1997_1998_rpt_yr_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1997_1998_rpt_yr_dt ON ofec_sched_b_1997_1998 USING btree (rpt_yr, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1997_1998_sub_id_amount_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1997_1998_sub_id_amount_dt ON ofec_sched_b_1997_1998 USING btree (disb_amt, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1997_1998_sub_id_date_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1997_1998_sub_id_date_amt ON ofec_sched_b_1997_1998 USING btree (disb_dt, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1997_1998_sub_id_line_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1997_1998_sub_id_line_num_amt ON ofec_sched_b_1997_1998 USING btree (line_num, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1997_1998_sub_id_line_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1997_1998_sub_id_line_num_dt ON ofec_sched_b_1997_1998 USING btree (line_num, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1997_1998_two_year_transaction_period_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1997_1998_two_year_transaction_period_amt ON ofec_sched_b_1997_1998 USING btree (two_year_transaction_period, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1997_1998_two_year_transaction_period_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1997_1998_two_year_transaction_period_dt ON ofec_sched_b_1997_1998 USING btree (two_year_transaction_period, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1999_2000_clean_recipient_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1999_2000_clean_recipient_cmte_id_amt ON ofec_sched_b_1999_2000 USING btree (clean_recipient_cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1999_2000_clean_recipient_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1999_2000_clean_recipient_cmte_id_dt ON ofec_sched_b_1999_2000 USING btree (clean_recipient_cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1999_2000_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1999_2000_cmte_id_amt ON ofec_sched_b_1999_2000 USING btree (cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1999_2000_cmte_id_disb_amt_sub_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1999_2000_cmte_id_disb_amt_sub_id ON ofec_sched_b_1999_2000 USING btree (cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1999_2000_cmte_id_disb_dt_sub_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1999_2000_cmte_id_disb_dt_sub_id ON ofec_sched_b_1999_2000 USING btree (cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1999_2000_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1999_2000_cmte_id_dt ON ofec_sched_b_1999_2000 USING btree (cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1999_2000_disb_desc_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1999_2000_disb_desc_text_amt ON ofec_sched_b_1999_2000 USING gin (disbursement_description_text, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1999_2000_disb_desc_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1999_2000_disb_desc_text_dt ON ofec_sched_b_1999_2000 USING gin (disbursement_description_text, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1999_2000_image_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1999_2000_image_num_amt ON ofec_sched_b_1999_2000 USING btree (image_num, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1999_2000_image_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1999_2000_image_num_dt ON ofec_sched_b_1999_2000 USING btree (image_num, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1999_2000_pg_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1999_2000_pg_date ON ofec_sched_b_1999_2000 USING btree (pg_date);
--
-- Name: idx_ofec_sched_b_1999_2000_recip_name_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1999_2000_recip_name_text_amt ON ofec_sched_b_1999_2000 USING gin (recipient_name_text, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1999_2000_recip_name_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1999_2000_recip_name_text_dt ON ofec_sched_b_1999_2000 USING gin (recipient_name_text, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1999_2000_recipient_city_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1999_2000_recipient_city_amt ON ofec_sched_b_1999_2000 USING btree (recipient_city, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1999_2000_recipient_city_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1999_2000_recipient_city_dt ON ofec_sched_b_1999_2000 USING btree (recipient_city, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1999_2000_recipient_st_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1999_2000_recipient_st_amt ON ofec_sched_b_1999_2000 USING btree (recipient_st, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1999_2000_recipient_st_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1999_2000_recipient_st_dt ON ofec_sched_b_1999_2000 USING btree (recipient_st, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1999_2000_rpt_yr_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1999_2000_rpt_yr_amt ON ofec_sched_b_1999_2000 USING btree (rpt_yr, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1999_2000_rpt_yr_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1999_2000_rpt_yr_dt ON ofec_sched_b_1999_2000 USING btree (rpt_yr, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1999_2000_sub_id_amount_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1999_2000_sub_id_amount_dt ON ofec_sched_b_1999_2000 USING btree (disb_amt, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1999_2000_sub_id_date_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1999_2000_sub_id_date_amt ON ofec_sched_b_1999_2000 USING btree (disb_dt, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1999_2000_sub_id_line_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1999_2000_sub_id_line_num_amt ON ofec_sched_b_1999_2000 USING btree (line_num, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1999_2000_sub_id_line_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1999_2000_sub_id_line_num_dt ON ofec_sched_b_1999_2000 USING btree (line_num, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_1999_2000_two_year_transaction_period_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1999_2000_two_year_transaction_period_amt ON ofec_sched_b_1999_2000 USING btree (two_year_transaction_period, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_1999_2000_two_year_transaction_period_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_1999_2000_two_year_transaction_period_dt ON ofec_sched_b_1999_2000 USING btree (two_year_transaction_period, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2001_2002_clean_recipient_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2001_2002_clean_recipient_cmte_id_amt ON ofec_sched_b_2001_2002 USING btree (clean_recipient_cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2001_2002_clean_recipient_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2001_2002_clean_recipient_cmte_id_dt ON ofec_sched_b_2001_2002 USING btree (clean_recipient_cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2001_2002_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2001_2002_cmte_id_amt ON ofec_sched_b_2001_2002 USING btree (cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2001_2002_cmte_id_disb_amt_sub_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2001_2002_cmte_id_disb_amt_sub_id ON ofec_sched_b_2001_2002 USING btree (cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2001_2002_cmte_id_disb_dt_sub_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2001_2002_cmte_id_disb_dt_sub_id ON ofec_sched_b_2001_2002 USING btree (cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2001_2002_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2001_2002_cmte_id_dt ON ofec_sched_b_2001_2002 USING btree (cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2001_2002_disb_desc_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2001_2002_disb_desc_text_amt ON ofec_sched_b_2001_2002 USING gin (disbursement_description_text, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2001_2002_disb_desc_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2001_2002_disb_desc_text_dt ON ofec_sched_b_2001_2002 USING gin (disbursement_description_text, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2001_2002_image_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2001_2002_image_num_amt ON ofec_sched_b_2001_2002 USING btree (image_num, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2001_2002_image_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2001_2002_image_num_dt ON ofec_sched_b_2001_2002 USING btree (image_num, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2001_2002_pg_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2001_2002_pg_date ON ofec_sched_b_2001_2002 USING btree (pg_date);
--
-- Name: idx_ofec_sched_b_2001_2002_recip_name_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2001_2002_recip_name_text_amt ON ofec_sched_b_2001_2002 USING gin (recipient_name_text, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2001_2002_recip_name_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2001_2002_recip_name_text_dt ON ofec_sched_b_2001_2002 USING gin (recipient_name_text, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2001_2002_recipient_city_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2001_2002_recipient_city_amt ON ofec_sched_b_2001_2002 USING btree (recipient_city, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2001_2002_recipient_city_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2001_2002_recipient_city_dt ON ofec_sched_b_2001_2002 USING btree (recipient_city, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2001_2002_recipient_st_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2001_2002_recipient_st_amt ON ofec_sched_b_2001_2002 USING btree (recipient_st, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2001_2002_recipient_st_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2001_2002_recipient_st_dt ON ofec_sched_b_2001_2002 USING btree (recipient_st, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2001_2002_rpt_yr_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2001_2002_rpt_yr_amt ON ofec_sched_b_2001_2002 USING btree (rpt_yr, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2001_2002_rpt_yr_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2001_2002_rpt_yr_dt ON ofec_sched_b_2001_2002 USING btree (rpt_yr, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2001_2002_sub_id_amount_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2001_2002_sub_id_amount_dt ON ofec_sched_b_2001_2002 USING btree (disb_amt, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2001_2002_sub_id_date_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2001_2002_sub_id_date_amt ON ofec_sched_b_2001_2002 USING btree (disb_dt, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2001_2002_sub_id_line_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2001_2002_sub_id_line_num_amt ON ofec_sched_b_2001_2002 USING btree (line_num, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2001_2002_sub_id_line_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2001_2002_sub_id_line_num_dt ON ofec_sched_b_2001_2002 USING btree (line_num, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2001_2002_two_year_transaction_period_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2001_2002_two_year_transaction_period_amt ON ofec_sched_b_2001_2002 USING btree (two_year_transaction_period, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2001_2002_two_year_transaction_period_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2001_2002_two_year_transaction_period_dt ON ofec_sched_b_2001_2002 USING btree (two_year_transaction_period, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2003_2004_clean_recipient_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2003_2004_clean_recipient_cmte_id_amt ON ofec_sched_b_2003_2004 USING btree (clean_recipient_cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2003_2004_clean_recipient_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2003_2004_clean_recipient_cmte_id_dt ON ofec_sched_b_2003_2004 USING btree (clean_recipient_cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2003_2004_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2003_2004_cmte_id_amt ON ofec_sched_b_2003_2004 USING btree (cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2003_2004_cmte_id_disb_amt_sub_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2003_2004_cmte_id_disb_amt_sub_id ON ofec_sched_b_2003_2004 USING btree (cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2003_2004_cmte_id_disb_dt_sub_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2003_2004_cmte_id_disb_dt_sub_id ON ofec_sched_b_2003_2004 USING btree (cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2003_2004_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2003_2004_cmte_id_dt ON ofec_sched_b_2003_2004 USING btree (cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2003_2004_disb_desc_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2003_2004_disb_desc_text_amt ON ofec_sched_b_2003_2004 USING gin (disbursement_description_text, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2003_2004_disb_desc_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2003_2004_disb_desc_text_dt ON ofec_sched_b_2003_2004 USING gin (disbursement_description_text, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2003_2004_image_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2003_2004_image_num_amt ON ofec_sched_b_2003_2004 USING btree (image_num, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2003_2004_image_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2003_2004_image_num_dt ON ofec_sched_b_2003_2004 USING btree (image_num, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2003_2004_pg_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2003_2004_pg_date ON ofec_sched_b_2003_2004 USING btree (pg_date);
--
-- Name: idx_ofec_sched_b_2003_2004_recip_name_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2003_2004_recip_name_text_amt ON ofec_sched_b_2003_2004 USING gin (recipient_name_text, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2003_2004_recip_name_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2003_2004_recip_name_text_dt ON ofec_sched_b_2003_2004 USING gin (recipient_name_text, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2003_2004_recipient_city_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2003_2004_recipient_city_amt ON ofec_sched_b_2003_2004 USING btree (recipient_city, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2003_2004_recipient_city_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2003_2004_recipient_city_dt ON ofec_sched_b_2003_2004 USING btree (recipient_city, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2003_2004_recipient_st_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2003_2004_recipient_st_amt ON ofec_sched_b_2003_2004 USING btree (recipient_st, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2003_2004_recipient_st_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2003_2004_recipient_st_dt ON ofec_sched_b_2003_2004 USING btree (recipient_st, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2003_2004_rpt_yr_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2003_2004_rpt_yr_amt ON ofec_sched_b_2003_2004 USING btree (rpt_yr, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2003_2004_rpt_yr_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2003_2004_rpt_yr_dt ON ofec_sched_b_2003_2004 USING btree (rpt_yr, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2003_2004_sub_id_amount_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2003_2004_sub_id_amount_dt ON ofec_sched_b_2003_2004 USING btree (disb_amt, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2003_2004_sub_id_date_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2003_2004_sub_id_date_amt ON ofec_sched_b_2003_2004 USING btree (disb_dt, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2003_2004_sub_id_line_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2003_2004_sub_id_line_num_amt ON ofec_sched_b_2003_2004 USING btree (line_num, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2003_2004_sub_id_line_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2003_2004_sub_id_line_num_dt ON ofec_sched_b_2003_2004 USING btree (line_num, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2003_2004_two_year_transaction_period_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2003_2004_two_year_transaction_period_amt ON ofec_sched_b_2003_2004 USING btree (two_year_transaction_period, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2003_2004_two_year_transaction_period_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2003_2004_two_year_transaction_period_dt ON ofec_sched_b_2003_2004 USING btree (two_year_transaction_period, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2005_2006_clean_recipient_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2005_2006_clean_recipient_cmte_id_amt ON ofec_sched_b_2005_2006 USING btree (clean_recipient_cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2005_2006_clean_recipient_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2005_2006_clean_recipient_cmte_id_dt ON ofec_sched_b_2005_2006 USING btree (clean_recipient_cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2005_2006_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2005_2006_cmte_id_amt ON ofec_sched_b_2005_2006 USING btree (cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2005_2006_cmte_id_disb_amt_sub_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2005_2006_cmte_id_disb_amt_sub_id ON ofec_sched_b_2005_2006 USING btree (cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2005_2006_cmte_id_disb_dt_sub_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2005_2006_cmte_id_disb_dt_sub_id ON ofec_sched_b_2005_2006 USING btree (cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2005_2006_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2005_2006_cmte_id_dt ON ofec_sched_b_2005_2006 USING btree (cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2005_2006_disb_desc_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2005_2006_disb_desc_text_amt ON ofec_sched_b_2005_2006 USING gin (disbursement_description_text, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2005_2006_disb_desc_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2005_2006_disb_desc_text_dt ON ofec_sched_b_2005_2006 USING gin (disbursement_description_text, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2005_2006_image_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2005_2006_image_num_amt ON ofec_sched_b_2005_2006 USING btree (image_num, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2005_2006_image_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2005_2006_image_num_dt ON ofec_sched_b_2005_2006 USING btree (image_num, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2005_2006_pg_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2005_2006_pg_date ON ofec_sched_b_2005_2006 USING btree (pg_date);
--
-- Name: idx_ofec_sched_b_2005_2006_recip_name_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2005_2006_recip_name_text_amt ON ofec_sched_b_2005_2006 USING gin (recipient_name_text, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2005_2006_recip_name_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2005_2006_recip_name_text_dt ON ofec_sched_b_2005_2006 USING gin (recipient_name_text, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2005_2006_recipient_city_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2005_2006_recipient_city_amt ON ofec_sched_b_2005_2006 USING btree (recipient_city, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2005_2006_recipient_city_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2005_2006_recipient_city_dt ON ofec_sched_b_2005_2006 USING btree (recipient_city, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2005_2006_recipient_st_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2005_2006_recipient_st_amt ON ofec_sched_b_2005_2006 USING btree (recipient_st, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2005_2006_recipient_st_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2005_2006_recipient_st_dt ON ofec_sched_b_2005_2006 USING btree (recipient_st, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2005_2006_rpt_yr_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2005_2006_rpt_yr_amt ON ofec_sched_b_2005_2006 USING btree (rpt_yr, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2005_2006_rpt_yr_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2005_2006_rpt_yr_dt ON ofec_sched_b_2005_2006 USING btree (rpt_yr, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2005_2006_sub_id_amount_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2005_2006_sub_id_amount_dt ON ofec_sched_b_2005_2006 USING btree (disb_amt, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2005_2006_sub_id_date_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2005_2006_sub_id_date_amt ON ofec_sched_b_2005_2006 USING btree (disb_dt, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2005_2006_sub_id_line_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2005_2006_sub_id_line_num_amt ON ofec_sched_b_2005_2006 USING btree (line_num, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2005_2006_sub_id_line_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2005_2006_sub_id_line_num_dt ON ofec_sched_b_2005_2006 USING btree (line_num, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2005_2006_two_year_transaction_period_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2005_2006_two_year_transaction_period_amt ON ofec_sched_b_2005_2006 USING btree (two_year_transaction_period, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2005_2006_two_year_transaction_period_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2005_2006_two_year_transaction_period_dt ON ofec_sched_b_2005_2006 USING btree (two_year_transaction_period, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2007_2008_clean_recipient_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2007_2008_clean_recipient_cmte_id_amt ON ofec_sched_b_2007_2008 USING btree (clean_recipient_cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2007_2008_clean_recipient_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2007_2008_clean_recipient_cmte_id_dt ON ofec_sched_b_2007_2008 USING btree (clean_recipient_cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2007_2008_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2007_2008_cmte_id_amt ON ofec_sched_b_2007_2008 USING btree (cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2007_2008_cmte_id_disb_amt_sub_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2007_2008_cmte_id_disb_amt_sub_id ON ofec_sched_b_2007_2008 USING btree (cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2007_2008_cmte_id_disb_dt_sub_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2007_2008_cmte_id_disb_dt_sub_id ON ofec_sched_b_2007_2008 USING btree (cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2007_2008_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2007_2008_cmte_id_dt ON ofec_sched_b_2007_2008 USING btree (cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2007_2008_disb_desc_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2007_2008_disb_desc_text_amt ON ofec_sched_b_2007_2008 USING gin (disbursement_description_text, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2007_2008_disb_desc_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2007_2008_disb_desc_text_dt ON ofec_sched_b_2007_2008 USING gin (disbursement_description_text, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2007_2008_image_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2007_2008_image_num_amt ON ofec_sched_b_2007_2008 USING btree (image_num, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2007_2008_image_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2007_2008_image_num_dt ON ofec_sched_b_2007_2008 USING btree (image_num, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2007_2008_pg_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2007_2008_pg_date ON ofec_sched_b_2007_2008 USING btree (pg_date);
--
-- Name: idx_ofec_sched_b_2007_2008_recip_name_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2007_2008_recip_name_text_amt ON ofec_sched_b_2007_2008 USING gin (recipient_name_text, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2007_2008_recip_name_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2007_2008_recip_name_text_dt ON ofec_sched_b_2007_2008 USING gin (recipient_name_text, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2007_2008_recipient_city_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2007_2008_recipient_city_amt ON ofec_sched_b_2007_2008 USING btree (recipient_city, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2007_2008_recipient_city_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2007_2008_recipient_city_dt ON ofec_sched_b_2007_2008 USING btree (recipient_city, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2007_2008_recipient_st_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2007_2008_recipient_st_amt ON ofec_sched_b_2007_2008 USING btree (recipient_st, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2007_2008_recipient_st_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2007_2008_recipient_st_dt ON ofec_sched_b_2007_2008 USING btree (recipient_st, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2007_2008_rpt_yr_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2007_2008_rpt_yr_amt ON ofec_sched_b_2007_2008 USING btree (rpt_yr, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2007_2008_rpt_yr_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2007_2008_rpt_yr_dt ON ofec_sched_b_2007_2008 USING btree (rpt_yr, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2007_2008_sub_id_amount_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2007_2008_sub_id_amount_dt ON ofec_sched_b_2007_2008 USING btree (disb_amt, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2007_2008_sub_id_date_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2007_2008_sub_id_date_amt ON ofec_sched_b_2007_2008 USING btree (disb_dt, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2007_2008_sub_id_line_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2007_2008_sub_id_line_num_amt ON ofec_sched_b_2007_2008 USING btree (line_num, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2007_2008_sub_id_line_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2007_2008_sub_id_line_num_dt ON ofec_sched_b_2007_2008 USING btree (line_num, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2007_2008_two_year_transaction_period_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2007_2008_two_year_transaction_period_amt ON ofec_sched_b_2007_2008 USING btree (two_year_transaction_period, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2007_2008_two_year_transaction_period_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2007_2008_two_year_transaction_period_dt ON ofec_sched_b_2007_2008 USING btree (two_year_transaction_period, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2009_2010_clean_recipient_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2009_2010_clean_recipient_cmte_id_amt ON ofec_sched_b_2009_2010 USING btree (clean_recipient_cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2009_2010_clean_recipient_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2009_2010_clean_recipient_cmte_id_dt ON ofec_sched_b_2009_2010 USING btree (clean_recipient_cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2009_2010_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2009_2010_cmte_id_amt ON ofec_sched_b_2009_2010 USING btree (cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2009_2010_cmte_id_disb_amt_sub_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2009_2010_cmte_id_disb_amt_sub_id ON ofec_sched_b_2009_2010 USING btree (cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2009_2010_cmte_id_disb_dt_sub_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2009_2010_cmte_id_disb_dt_sub_id ON ofec_sched_b_2009_2010 USING btree (cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2009_2010_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2009_2010_cmte_id_dt ON ofec_sched_b_2009_2010 USING btree (cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2009_2010_disb_desc_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2009_2010_disb_desc_text_amt ON ofec_sched_b_2009_2010 USING gin (disbursement_description_text, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2009_2010_disb_desc_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2009_2010_disb_desc_text_dt ON ofec_sched_b_2009_2010 USING gin (disbursement_description_text, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2009_2010_image_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2009_2010_image_num_amt ON ofec_sched_b_2009_2010 USING btree (image_num, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2009_2010_image_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2009_2010_image_num_dt ON ofec_sched_b_2009_2010 USING btree (image_num, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2009_2010_pg_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2009_2010_pg_date ON ofec_sched_b_2009_2010 USING btree (pg_date);
--
-- Name: idx_ofec_sched_b_2009_2010_recip_name_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2009_2010_recip_name_text_amt ON ofec_sched_b_2009_2010 USING gin (recipient_name_text, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2009_2010_recip_name_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2009_2010_recip_name_text_dt ON ofec_sched_b_2009_2010 USING gin (recipient_name_text, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2009_2010_recipient_city_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2009_2010_recipient_city_amt ON ofec_sched_b_2009_2010 USING btree (recipient_city, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2009_2010_recipient_city_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2009_2010_recipient_city_dt ON ofec_sched_b_2009_2010 USING btree (recipient_city, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2009_2010_recipient_st_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2009_2010_recipient_st_amt ON ofec_sched_b_2009_2010 USING btree (recipient_st, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2009_2010_recipient_st_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2009_2010_recipient_st_dt ON ofec_sched_b_2009_2010 USING btree (recipient_st, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2009_2010_rpt_yr_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2009_2010_rpt_yr_amt ON ofec_sched_b_2009_2010 USING btree (rpt_yr, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2009_2010_rpt_yr_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2009_2010_rpt_yr_dt ON ofec_sched_b_2009_2010 USING btree (rpt_yr, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2009_2010_sub_id_amount_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2009_2010_sub_id_amount_dt ON ofec_sched_b_2009_2010 USING btree (disb_amt, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2009_2010_sub_id_date_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2009_2010_sub_id_date_amt ON ofec_sched_b_2009_2010 USING btree (disb_dt, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2009_2010_sub_id_line_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2009_2010_sub_id_line_num_amt ON ofec_sched_b_2009_2010 USING btree (line_num, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2009_2010_sub_id_line_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2009_2010_sub_id_line_num_dt ON ofec_sched_b_2009_2010 USING btree (line_num, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2009_2010_two_year_transaction_period_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2009_2010_two_year_transaction_period_amt ON ofec_sched_b_2009_2010 USING btree (two_year_transaction_period, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2009_2010_two_year_transaction_period_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2009_2010_two_year_transaction_period_dt ON ofec_sched_b_2009_2010 USING btree (two_year_transaction_period, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2011_2012_clean_recipient_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2011_2012_clean_recipient_cmte_id_amt ON ofec_sched_b_2011_2012 USING btree (clean_recipient_cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2011_2012_clean_recipient_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2011_2012_clean_recipient_cmte_id_dt ON ofec_sched_b_2011_2012 USING btree (clean_recipient_cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2011_2012_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2011_2012_cmte_id_amt ON ofec_sched_b_2011_2012 USING btree (cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2011_2012_cmte_id_disb_amt_sub_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2011_2012_cmte_id_disb_amt_sub_id ON ofec_sched_b_2011_2012 USING btree (cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2011_2012_cmte_id_disb_dt_sub_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2011_2012_cmte_id_disb_dt_sub_id ON ofec_sched_b_2011_2012 USING btree (cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2011_2012_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2011_2012_cmte_id_dt ON ofec_sched_b_2011_2012 USING btree (cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2011_2012_disb_desc_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2011_2012_disb_desc_text_amt ON ofec_sched_b_2011_2012 USING gin (disbursement_description_text, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2011_2012_disb_desc_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2011_2012_disb_desc_text_dt ON ofec_sched_b_2011_2012 USING gin (disbursement_description_text, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2011_2012_image_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2011_2012_image_num_amt ON ofec_sched_b_2011_2012 USING btree (image_num, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2011_2012_image_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2011_2012_image_num_dt ON ofec_sched_b_2011_2012 USING btree (image_num, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2011_2012_pg_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2011_2012_pg_date ON ofec_sched_b_2011_2012 USING btree (pg_date);
--
-- Name: idx_ofec_sched_b_2011_2012_recip_name_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2011_2012_recip_name_text_amt ON ofec_sched_b_2011_2012 USING gin (recipient_name_text, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2011_2012_recip_name_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2011_2012_recip_name_text_dt ON ofec_sched_b_2011_2012 USING gin (recipient_name_text, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2011_2012_recipient_city_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2011_2012_recipient_city_amt ON ofec_sched_b_2011_2012 USING btree (recipient_city, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2011_2012_recipient_city_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2011_2012_recipient_city_dt ON ofec_sched_b_2011_2012 USING btree (recipient_city, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2011_2012_recipient_st_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2011_2012_recipient_st_amt ON ofec_sched_b_2011_2012 USING btree (recipient_st, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2011_2012_recipient_st_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2011_2012_recipient_st_dt ON ofec_sched_b_2011_2012 USING btree (recipient_st, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2011_2012_rpt_yr_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2011_2012_rpt_yr_amt ON ofec_sched_b_2011_2012 USING btree (rpt_yr, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2011_2012_rpt_yr_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2011_2012_rpt_yr_dt ON ofec_sched_b_2011_2012 USING btree (rpt_yr, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2011_2012_sub_id_amount_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2011_2012_sub_id_amount_dt ON ofec_sched_b_2011_2012 USING btree (disb_amt, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2011_2012_sub_id_date_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2011_2012_sub_id_date_amt ON ofec_sched_b_2011_2012 USING btree (disb_dt, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2011_2012_sub_id_line_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2011_2012_sub_id_line_num_amt ON ofec_sched_b_2011_2012 USING btree (line_num, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2011_2012_sub_id_line_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2011_2012_sub_id_line_num_dt ON ofec_sched_b_2011_2012 USING btree (line_num, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2011_2012_two_year_transaction_period_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2011_2012_two_year_transaction_period_amt ON ofec_sched_b_2011_2012 USING btree (two_year_transaction_period, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2011_2012_two_year_transaction_period_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2011_2012_two_year_transaction_period_dt ON ofec_sched_b_2011_2012 USING btree (two_year_transaction_period, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2013_2014_clean_recipient_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2013_2014_clean_recipient_cmte_id_amt ON ofec_sched_b_2013_2014 USING btree (clean_recipient_cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2013_2014_clean_recipient_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2013_2014_clean_recipient_cmte_id_dt ON ofec_sched_b_2013_2014 USING btree (clean_recipient_cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2013_2014_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2013_2014_cmte_id_amt ON ofec_sched_b_2013_2014 USING btree (cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2013_2014_cmte_id_disb_amt_sub_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2013_2014_cmte_id_disb_amt_sub_id ON ofec_sched_b_2013_2014 USING btree (cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2013_2014_cmte_id_disb_dt_sub_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2013_2014_cmte_id_disb_dt_sub_id ON ofec_sched_b_2013_2014 USING btree (cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2013_2014_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2013_2014_cmte_id_dt ON ofec_sched_b_2013_2014 USING btree (cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2013_2014_disb_desc_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2013_2014_disb_desc_text_amt ON ofec_sched_b_2013_2014 USING gin (disbursement_description_text, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2013_2014_disb_desc_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2013_2014_disb_desc_text_dt ON ofec_sched_b_2013_2014 USING gin (disbursement_description_text, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2013_2014_image_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2013_2014_image_num_amt ON ofec_sched_b_2013_2014 USING btree (image_num, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2013_2014_image_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2013_2014_image_num_dt ON ofec_sched_b_2013_2014 USING btree (image_num, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2013_2014_pg_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2013_2014_pg_date ON ofec_sched_b_2013_2014 USING btree (pg_date);
--
-- Name: idx_ofec_sched_b_2013_2014_recip_name_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2013_2014_recip_name_text_amt ON ofec_sched_b_2013_2014 USING gin (recipient_name_text, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2013_2014_recip_name_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2013_2014_recip_name_text_dt ON ofec_sched_b_2013_2014 USING gin (recipient_name_text, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2013_2014_recipient_city_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2013_2014_recipient_city_amt ON ofec_sched_b_2013_2014 USING btree (recipient_city, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2013_2014_recipient_city_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2013_2014_recipient_city_dt ON ofec_sched_b_2013_2014 USING btree (recipient_city, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2013_2014_recipient_st_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2013_2014_recipient_st_amt ON ofec_sched_b_2013_2014 USING btree (recipient_st, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2013_2014_recipient_st_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2013_2014_recipient_st_dt ON ofec_sched_b_2013_2014 USING btree (recipient_st, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2013_2014_rpt_yr_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2013_2014_rpt_yr_amt ON ofec_sched_b_2013_2014 USING btree (rpt_yr, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2013_2014_rpt_yr_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2013_2014_rpt_yr_dt ON ofec_sched_b_2013_2014 USING btree (rpt_yr, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2013_2014_sub_id_amount_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2013_2014_sub_id_amount_dt ON ofec_sched_b_2013_2014 USING btree (disb_amt, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2013_2014_sub_id_date_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2013_2014_sub_id_date_amt ON ofec_sched_b_2013_2014 USING btree (disb_dt, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2013_2014_sub_id_line_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2013_2014_sub_id_line_num_amt ON ofec_sched_b_2013_2014 USING btree (line_num, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2013_2014_sub_id_line_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2013_2014_sub_id_line_num_dt ON ofec_sched_b_2013_2014 USING btree (line_num, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2013_2014_two_year_transaction_period_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2013_2014_two_year_transaction_period_amt ON ofec_sched_b_2013_2014 USING btree (two_year_transaction_period, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2013_2014_two_year_transaction_period_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2013_2014_two_year_transaction_period_dt ON ofec_sched_b_2013_2014 USING btree (two_year_transaction_period, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2015_2016_clean_recipient_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2015_2016_clean_recipient_cmte_id_amt ON ofec_sched_b_2015_2016 USING btree (clean_recipient_cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2015_2016_clean_recipient_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2015_2016_clean_recipient_cmte_id_dt ON ofec_sched_b_2015_2016 USING btree (clean_recipient_cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2015_2016_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2015_2016_cmte_id_amt ON ofec_sched_b_2015_2016 USING btree (cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2015_2016_cmte_id_disb_amt_sub_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2015_2016_cmte_id_disb_amt_sub_id ON ofec_sched_b_2015_2016 USING btree (cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2015_2016_cmte_id_disb_dt_sub_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2015_2016_cmte_id_disb_dt_sub_id ON ofec_sched_b_2015_2016 USING btree (cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2015_2016_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2015_2016_cmte_id_dt ON ofec_sched_b_2015_2016 USING btree (cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2015_2016_disb_desc_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2015_2016_disb_desc_text_amt ON ofec_sched_b_2015_2016 USING gin (disbursement_description_text, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2015_2016_disb_desc_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2015_2016_disb_desc_text_dt ON ofec_sched_b_2015_2016 USING gin (disbursement_description_text, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2015_2016_image_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2015_2016_image_num_amt ON ofec_sched_b_2015_2016 USING btree (image_num, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2015_2016_image_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2015_2016_image_num_dt ON ofec_sched_b_2015_2016 USING btree (image_num, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2015_2016_pg_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2015_2016_pg_date ON ofec_sched_b_2015_2016 USING btree (pg_date);
--
-- Name: idx_ofec_sched_b_2015_2016_recip_name_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2015_2016_recip_name_text_amt ON ofec_sched_b_2015_2016 USING gin (recipient_name_text, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2015_2016_recip_name_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2015_2016_recip_name_text_dt ON ofec_sched_b_2015_2016 USING gin (recipient_name_text, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2015_2016_recipient_city_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2015_2016_recipient_city_amt ON ofec_sched_b_2015_2016 USING btree (recipient_city, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2015_2016_recipient_city_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2015_2016_recipient_city_dt ON ofec_sched_b_2015_2016 USING btree (recipient_city, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2015_2016_recipient_st_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2015_2016_recipient_st_amt ON ofec_sched_b_2015_2016 USING btree (recipient_st, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2015_2016_recipient_st_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2015_2016_recipient_st_dt ON ofec_sched_b_2015_2016 USING btree (recipient_st, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2015_2016_rpt_yr_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2015_2016_rpt_yr_amt ON ofec_sched_b_2015_2016 USING btree (rpt_yr, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2015_2016_rpt_yr_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2015_2016_rpt_yr_dt ON ofec_sched_b_2015_2016 USING btree (rpt_yr, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2015_2016_sub_id_amount_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2015_2016_sub_id_amount_dt ON ofec_sched_b_2015_2016 USING btree (disb_amt, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2015_2016_sub_id_date_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2015_2016_sub_id_date_amt ON ofec_sched_b_2015_2016 USING btree (disb_dt, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2015_2016_sub_id_line_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2015_2016_sub_id_line_num_amt ON ofec_sched_b_2015_2016 USING btree (line_num, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2015_2016_sub_id_line_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2015_2016_sub_id_line_num_dt ON ofec_sched_b_2015_2016 USING btree (line_num, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2015_2016_two_year_transaction_period_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2015_2016_two_year_transaction_period_amt ON ofec_sched_b_2015_2016 USING btree (two_year_transaction_period, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2015_2016_two_year_transaction_period_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2015_2016_two_year_transaction_period_dt ON ofec_sched_b_2015_2016 USING btree (two_year_transaction_period, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2017_2018_clean_recipient_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2017_2018_clean_recipient_cmte_id_amt ON ofec_sched_b_2017_2018 USING btree (clean_recipient_cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2017_2018_clean_recipient_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2017_2018_clean_recipient_cmte_id_dt ON ofec_sched_b_2017_2018 USING btree (clean_recipient_cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2017_2018_cmte_id_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2017_2018_cmte_id_amt ON ofec_sched_b_2017_2018 USING btree (cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2017_2018_cmte_id_disb_amt_sub_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2017_2018_cmte_id_disb_amt_sub_id ON ofec_sched_b_2017_2018 USING btree (cmte_id, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2017_2018_cmte_id_disb_dt_sub_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2017_2018_cmte_id_disb_dt_sub_id ON ofec_sched_b_2017_2018 USING btree (cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2017_2018_cmte_id_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2017_2018_cmte_id_dt ON ofec_sched_b_2017_2018 USING btree (cmte_id, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2017_2018_disb_desc_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2017_2018_disb_desc_text_amt ON ofec_sched_b_2017_2018 USING gin (disbursement_description_text, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2017_2018_disb_desc_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2017_2018_disb_desc_text_dt ON ofec_sched_b_2017_2018 USING gin (disbursement_description_text, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2017_2018_image_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2017_2018_image_num_amt ON ofec_sched_b_2017_2018 USING btree (image_num, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2017_2018_image_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2017_2018_image_num_dt ON ofec_sched_b_2017_2018 USING btree (image_num, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2017_2018_pg_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2017_2018_pg_date ON ofec_sched_b_2017_2018 USING btree (pg_date);
--
-- Name: idx_ofec_sched_b_2017_2018_recip_name_text_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2017_2018_recip_name_text_amt ON ofec_sched_b_2017_2018 USING gin (recipient_name_text, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2017_2018_recip_name_text_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2017_2018_recip_name_text_dt ON ofec_sched_b_2017_2018 USING gin (recipient_name_text, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2017_2018_recipient_city_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2017_2018_recipient_city_amt ON ofec_sched_b_2017_2018 USING btree (recipient_city, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2017_2018_recipient_city_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2017_2018_recipient_city_dt ON ofec_sched_b_2017_2018 USING btree (recipient_city, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2017_2018_recipient_st_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2017_2018_recipient_st_amt ON ofec_sched_b_2017_2018 USING btree (recipient_st, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2017_2018_recipient_st_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2017_2018_recipient_st_dt ON ofec_sched_b_2017_2018 USING btree (recipient_st, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2017_2018_rpt_yr_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2017_2018_rpt_yr_amt ON ofec_sched_b_2017_2018 USING btree (rpt_yr, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2017_2018_rpt_yr_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2017_2018_rpt_yr_dt ON ofec_sched_b_2017_2018 USING btree (rpt_yr, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2017_2018_sub_id_amount_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2017_2018_sub_id_amount_dt ON ofec_sched_b_2017_2018 USING btree (disb_amt, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2017_2018_sub_id_date_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2017_2018_sub_id_date_amt ON ofec_sched_b_2017_2018 USING btree (disb_dt, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2017_2018_sub_id_line_num_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2017_2018_sub_id_line_num_amt ON ofec_sched_b_2017_2018 USING btree (line_num, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2017_2018_sub_id_line_num_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2017_2018_sub_id_line_num_dt ON ofec_sched_b_2017_2018 USING btree (line_num, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_b_2017_2018_two_year_transaction_period_amt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2017_2018_two_year_transaction_period_amt ON ofec_sched_b_2017_2018 USING btree (two_year_transaction_period, disb_amt, sub_id);
--
-- Name: idx_ofec_sched_b_2017_2018_two_year_transaction_period_dt; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_b_2017_2018_two_year_transaction_period_dt ON ofec_sched_b_2017_2018 USING btree (two_year_transaction_period, disb_dt, sub_id);
--
-- Name: idx_ofec_sched_e_cal_ytd_ofc_sought_sub_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_e_cal_ytd_ofc_sought_sub_id ON ofec_sched_e USING btree (cal_ytd_ofc_sought, sub_id);
--
-- Name: idx_ofec_sched_e_cmte_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_e_cmte_id ON ofec_sched_e USING btree (cmte_id);
--
-- Name: idx_ofec_sched_e_cycle_rpt_yr; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_e_cycle_rpt_yr ON ofec_sched_e USING btree (get_cycle(rpt_yr));
--
-- Name: idx_ofec_sched_e_entity_tp; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_e_entity_tp ON ofec_sched_e USING btree (entity_tp);
--
-- Name: idx_ofec_sched_e_exp_amt_sub_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_e_exp_amt_sub_id ON ofec_sched_e USING btree (exp_amt, sub_id);
--
-- Name: idx_ofec_sched_e_exp_dt_sub_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_e_exp_dt_sub_id ON ofec_sched_e USING btree (exp_dt, sub_id);
--
-- Name: idx_ofec_sched_e_filing_form; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_e_filing_form ON ofec_sched_e USING btree (filing_form);
--
-- Name: idx_ofec_sched_e_image_num; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_e_image_num ON ofec_sched_e USING btree (image_num);
--
-- Name: idx_ofec_sched_e_is_notice; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_e_is_notice ON ofec_sched_e USING btree (is_notice);
--
-- Name: idx_ofec_sched_e_payee_name_text; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_e_payee_name_text ON ofec_sched_e USING gin (payee_name_text);
--
-- Name: idx_ofec_sched_e_pg_date; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_e_pg_date ON ofec_sched_e USING btree (pg_date);
--
-- Name: idx_ofec_sched_e_rpt_yr; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_e_rpt_yr ON ofec_sched_e USING btree (rpt_yr);
--
-- Name: idx_ofec_sched_e_s_o_cand_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX idx_ofec_sched_e_s_o_cand_id ON ofec_sched_e USING btree (s_o_cand_id);
--
-- Name: ix_ofec_election_dates_index; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ix_ofec_election_dates_index ON ofec_election_dates USING btree (index);
--
-- Name: ix_ofec_nicknames_index; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ix_ofec_nicknames_index ON ofec_nicknames USING btree (index);
--
-- Name: ix_ofec_pacronyms_index; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ix_ofec_pacronyms_index ON ofec_pacronyms USING btree (index);
--
-- Name: ofec_amendments_mv_tmp_idx_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE UNIQUE INDEX ofec_amendments_mv_tmp_idx_idx1 ON ofec_amendments_mv USING btree (idx);
--
-- Name: ofec_cand_cmte_linkage_mv_tmp_cand_election_yr_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_cand_cmte_linkage_mv_tmp_cand_election_yr_idx ON ofec_cand_cmte_linkage_mv USING btree (cand_election_yr);
--
-- Name: ofec_cand_cmte_linkage_mv_tmp_cand_id_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_cand_cmte_linkage_mv_tmp_cand_id_idx ON ofec_cand_cmte_linkage_mv USING btree (cand_id);
--
-- Name: ofec_cand_cmte_linkage_mv_tmp_cmte_id_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_cand_cmte_linkage_mv_tmp_cmte_id_idx ON ofec_cand_cmte_linkage_mv USING btree (cmte_id);
--
-- Name: ofec_cand_cmte_linkage_mv_tmp_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE UNIQUE INDEX ofec_cand_cmte_linkage_mv_tmp_idx_idx ON ofec_cand_cmte_linkage_mv USING btree (idx);
--
-- Name: ofec_candidate_detail_mv_tmp_candidate_id_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_candidate_detail_mv_tmp_candidate_id_idx ON ofec_candidate_detail_mv USING btree (candidate_id);
--
-- Name: ofec_candidate_detail_mv_tmp_candidate_status_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_candidate_detail_mv_tmp_candidate_status_idx ON ofec_candidate_detail_mv USING btree (candidate_status);
--
-- Name: ofec_candidate_detail_mv_tmp_cycles_candidate_id_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_candidate_detail_mv_tmp_cycles_candidate_id_idx1 ON ofec_candidate_detail_mv USING btree (cycles, candidate_id);
--
-- Name: ofec_candidate_detail_mv_tmp_cycles_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_candidate_detail_mv_tmp_cycles_idx ON ofec_candidate_detail_mv USING gin (cycles);
--
-- Name: ofec_candidate_detail_mv_tmp_district_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_candidate_detail_mv_tmp_district_idx ON ofec_candidate_detail_mv USING btree (district);
--
-- Name: ofec_candidate_detail_mv_tmp_election_years_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_candidate_detail_mv_tmp_election_years_idx ON ofec_candidate_detail_mv USING gin (election_years);
--
-- Name: ofec_candidate_detail_mv_tmp_first_file_date_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_candidate_detail_mv_tmp_first_file_date_idx ON ofec_candidate_detail_mv USING btree (first_file_date);
--
-- Name: ofec_candidate_detail_mv_tmp_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE UNIQUE INDEX ofec_candidate_detail_mv_tmp_idx_idx ON ofec_candidate_detail_mv USING btree (idx);
--
-- Name: ofec_candidate_detail_mv_tmp_incumbent_challenge_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_candidate_detail_mv_tmp_incumbent_challenge_idx ON ofec_candidate_detail_mv USING btree (incumbent_challenge);
--
-- Name: ofec_candidate_detail_mv_tmp_load_date_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_candidate_detail_mv_tmp_load_date_idx ON ofec_candidate_detail_mv USING btree (load_date);
--
-- Name: ofec_candidate_detail_mv_tmp_name_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_candidate_detail_mv_tmp_name_idx ON ofec_candidate_detail_mv USING btree (name);
--
-- Name: ofec_candidate_detail_mv_tmp_office_full_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_candidate_detail_mv_tmp_office_full_idx1 ON ofec_candidate_detail_mv USING btree (office_full);
--
-- Name: ofec_candidate_detail_mv_tmp_office_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_candidate_detail_mv_tmp_office_idx ON ofec_candidate_detail_mv USING btree (office);
--
-- Name: ofec_candidate_detail_mv_tmp_party_full_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_candidate_detail_mv_tmp_party_full_idx1 ON ofec_candidate_detail_mv USING btree (party_full);
--
-- Name: ofec_candidate_detail_mv_tmp_party_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_candidate_detail_mv_tmp_party_idx ON ofec_candidate_detail_mv USING btree (party);
--
-- Name: ofec_candidate_detail_mv_tmp_state_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_candidate_detail_mv_tmp_state_idx ON ofec_candidate_detail_mv USING btree (state);
--
-- Name: ofec_candidate_election_mv_tm_cand_election_year_candidate_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_candidate_election_mv_tm_cand_election_year_candidate_idx1 ON ofec_candidate_election_mv USING btree (cand_election_year, candidate_id);
--
-- Name: ofec_candidate_election_mv_tm_candidate_id_cand_election_ye_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE UNIQUE INDEX ofec_candidate_election_mv_tm_candidate_id_cand_election_ye_idx ON ofec_candidate_election_mv USING btree (candidate_id, cand_election_year);
--
-- Name: ofec_candidate_election_mv_tmp_cand_election_year_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_candidate_election_mv_tmp_cand_election_year_idx ON ofec_candidate_election_mv USING btree (cand_election_year);
--
-- Name: ofec_candidate_election_mv_tmp_candidate_id_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_candidate_election_mv_tmp_candidate_id_idx ON ofec_candidate_election_mv USING btree (candidate_id);
--
-- Name: ofec_candidate_election_mv_tmp_prev_election_year_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_candidate_election_mv_tmp_prev_election_year_idx ON ofec_candidate_election_mv USING btree (prev_election_year);
--
-- Name: ofec_candidate_flag_tmp_candidate_id_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_candidate_flag_tmp_candidate_id_idx1 ON ofec_candidate_flag USING btree (candidate_id);
--
-- Name: ofec_candidate_flag_tmp_federal_funds_flag_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_candidate_flag_tmp_federal_funds_flag_idx1 ON ofec_candidate_flag USING btree (federal_funds_flag);
--
-- Name: ofec_candidate_flag_tmp_has_raised_funds_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_candidate_flag_tmp_has_raised_funds_idx1 ON ofec_candidate_flag USING btree (has_raised_funds);
--
-- Name: ofec_candidate_flag_tmp_idx_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE UNIQUE INDEX ofec_candidate_flag_tmp_idx_idx1 ON ofec_candidate_flag USING btree (idx);
--
-- Name: ofec_candidate_fulltext_mv_tmp_fulltxt_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_candidate_fulltext_mv_tmp_fulltxt_idx1 ON ofec_candidate_fulltext_mv USING gin (fulltxt);
--
-- Name: ofec_candidate_fulltext_mv_tmp_idx_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE UNIQUE INDEX ofec_candidate_fulltext_mv_tmp_idx_idx1 ON ofec_candidate_fulltext_mv USING btree (idx);
--
-- Name: ofec_candidate_fulltext_mv_tmp_receipts_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_candidate_fulltext_mv_tmp_receipts_idx1 ON ofec_candidate_fulltext_mv USING btree (receipts);
--
-- Name: ofec_candidate_history_latest_cand_election_year_candidate_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_candidate_history_latest_cand_election_year_candidate_idx1 ON ofec_candidate_history_latest_mv USING btree (cand_election_year, candidate_id);
--
-- Name: ofec_candidate_history_latest_candidate_id_cand_election_ye_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE UNIQUE INDEX ofec_candidate_history_latest_candidate_id_cand_election_ye_idx ON ofec_candidate_history_latest_mv USING btree (candidate_id, cand_election_year);
--
-- Name: ofec_candidate_history_latest_mv_tmp_cand_election_year_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_candidate_history_latest_mv_tmp_cand_election_year_idx ON ofec_candidate_history_latest_mv USING btree (cand_election_year);
--
-- Name: ofec_candidate_history_latest_mv_tmp_candidate_id_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_candidate_history_latest_mv_tmp_candidate_id_idx ON ofec_candidate_history_latest_mv USING btree (candidate_id);
--
-- Name: ofec_candidate_history_mv_tmp_candidate_id_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_candidate_history_mv_tmp_candidate_id_idx ON ofec_candidate_history_mv USING btree (candidate_id);
--
-- Name: ofec_candidate_history_mv_tmp_district_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_candidate_history_mv_tmp_district_idx1 ON ofec_candidate_history_mv USING btree (district);
--
-- Name: ofec_candidate_history_mv_tmp_district_number_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_candidate_history_mv_tmp_district_number_idx1 ON ofec_candidate_history_mv USING btree (district_number);
--
-- Name: ofec_candidate_history_mv_tmp_first_file_date_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_candidate_history_mv_tmp_first_file_date_idx ON ofec_candidate_history_mv USING btree (first_file_date);
--
-- Name: ofec_candidate_history_mv_tmp_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE UNIQUE INDEX ofec_candidate_history_mv_tmp_idx_idx ON ofec_candidate_history_mv USING btree (idx);
--
-- Name: ofec_candidate_history_mv_tmp_load_date_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_candidate_history_mv_tmp_load_date_idx ON ofec_candidate_history_mv USING btree (load_date);
--
-- Name: ofec_candidate_history_mv_tmp_office_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_candidate_history_mv_tmp_office_idx1 ON ofec_candidate_history_mv USING btree (office);
--
-- Name: ofec_candidate_history_mv_tmp_state_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_candidate_history_mv_tmp_state_idx1 ON ofec_candidate_history_mv USING btree (state);
--
-- Name: ofec_candidate_history_mv_tmp_two_year_period_candidate_id_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_candidate_history_mv_tmp_two_year_period_candidate_id_idx1 ON ofec_candidate_history_mv USING btree (two_year_period, candidate_id);
--
-- Name: ofec_candidate_history_mv_tmp_two_year_period_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_candidate_history_mv_tmp_two_year_period_idx ON ofec_candidate_history_mv USING btree (two_year_period);
--
-- Name: ofec_candidate_totals_mv_tmp_candidate_id_cycle_is_election_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE UNIQUE INDEX ofec_candidate_totals_mv_tmp_candidate_id_cycle_is_election_idx ON ofec_candidate_totals_mv USING btree (candidate_id, cycle, is_election);
--
-- Name: ofec_candidate_totals_mv_tmp_candidate_id_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_candidate_totals_mv_tmp_candidate_id_idx ON ofec_candidate_totals_mv USING btree (candidate_id);
--
-- Name: ofec_candidate_totals_mv_tmp_cycle_candidate_id_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_candidate_totals_mv_tmp_cycle_candidate_id_idx1 ON ofec_candidate_totals_mv USING btree (cycle, candidate_id);
--
-- Name: ofec_candidate_totals_mv_tmp_cycle_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_candidate_totals_mv_tmp_cycle_idx ON ofec_candidate_totals_mv USING btree (cycle);
--
-- Name: ofec_candidate_totals_mv_tmp_disbursements_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_candidate_totals_mv_tmp_disbursements_idx ON ofec_candidate_totals_mv USING btree (disbursements);
--
-- Name: ofec_candidate_totals_mv_tmp_election_year_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_candidate_totals_mv_tmp_election_year_idx ON ofec_candidate_totals_mv USING btree (election_year);
--
-- Name: ofec_candidate_totals_mv_tmp_federal_funds_flag_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_candidate_totals_mv_tmp_federal_funds_flag_idx1 ON ofec_candidate_totals_mv USING btree (federal_funds_flag);
--
-- Name: ofec_candidate_totals_mv_tmp_has_raised_funds_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_candidate_totals_mv_tmp_has_raised_funds_idx1 ON ofec_candidate_totals_mv USING btree (has_raised_funds);
--
-- Name: ofec_candidate_totals_mv_tmp_is_election_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_candidate_totals_mv_tmp_is_election_idx ON ofec_candidate_totals_mv USING btree (is_election);
--
-- Name: ofec_candidate_totals_mv_tmp_receipts_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_candidate_totals_mv_tmp_receipts_idx ON ofec_candidate_totals_mv USING btree (receipts);
--
-- Name: ofec_committee_detail_mv_tmp_candidate_ids_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_committee_detail_mv_tmp_candidate_ids_idx1 ON ofec_committee_detail_mv USING gin (candidate_ids);
--
-- Name: ofec_committee_detail_mv_tmp_committee_id_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_committee_detail_mv_tmp_committee_id_idx1 ON ofec_committee_detail_mv USING btree (committee_id);
--
-- Name: ofec_committee_detail_mv_tmp_committee_type_full_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_committee_detail_mv_tmp_committee_type_full_idx1 ON ofec_committee_detail_mv USING btree (committee_type_full);
--
-- Name: ofec_committee_detail_mv_tmp_committee_type_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_committee_detail_mv_tmp_committee_type_idx1 ON ofec_committee_detail_mv USING btree (committee_type);
--
-- Name: ofec_committee_detail_mv_tmp_cycles_candidate_ids_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_committee_detail_mv_tmp_cycles_candidate_ids_idx1 ON ofec_committee_detail_mv USING gin (cycles, candidate_ids);
--
-- Name: ofec_committee_detail_mv_tmp_cycles_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_committee_detail_mv_tmp_cycles_idx1 ON ofec_committee_detail_mv USING gin (cycles);
--
-- Name: ofec_committee_detail_mv_tmp_designation_full_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_committee_detail_mv_tmp_designation_full_idx1 ON ofec_committee_detail_mv USING btree (designation_full);
--
-- Name: ofec_committee_detail_mv_tmp_designation_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_committee_detail_mv_tmp_designation_idx1 ON ofec_committee_detail_mv USING btree (designation);
--
-- Name: ofec_committee_detail_mv_tmp_first_file_date_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_committee_detail_mv_tmp_first_file_date_idx1 ON ofec_committee_detail_mv USING btree (first_file_date);
--
-- Name: ofec_committee_detail_mv_tmp_idx_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE UNIQUE INDEX ofec_committee_detail_mv_tmp_idx_idx1 ON ofec_committee_detail_mv USING btree (idx);
--
-- Name: ofec_committee_detail_mv_tmp_last_file_date_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_committee_detail_mv_tmp_last_file_date_idx1 ON ofec_committee_detail_mv USING btree (last_file_date);
--
-- Name: ofec_committee_detail_mv_tmp_name_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_committee_detail_mv_tmp_name_idx1 ON ofec_committee_detail_mv USING btree (name);
--
-- Name: ofec_committee_detail_mv_tmp_organization_type_full_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_committee_detail_mv_tmp_organization_type_full_idx1 ON ofec_committee_detail_mv USING btree (organization_type_full);
--
-- Name: ofec_committee_detail_mv_tmp_organization_type_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_committee_detail_mv_tmp_organization_type_idx1 ON ofec_committee_detail_mv USING btree (organization_type);
--
-- Name: ofec_committee_detail_mv_tmp_party_full_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_committee_detail_mv_tmp_party_full_idx1 ON ofec_committee_detail_mv USING btree (party_full);
--
-- Name: ofec_committee_detail_mv_tmp_party_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_committee_detail_mv_tmp_party_idx1 ON ofec_committee_detail_mv USING btree (party);
--
-- Name: ofec_committee_detail_mv_tmp_state_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_committee_detail_mv_tmp_state_idx1 ON ofec_committee_detail_mv USING btree (state);
--
-- Name: ofec_committee_detail_mv_tmp_treasurer_name_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_committee_detail_mv_tmp_treasurer_name_idx1 ON ofec_committee_detail_mv USING btree (treasurer_name);
--
-- Name: ofec_committee_detail_mv_tmp_treasurer_text_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_committee_detail_mv_tmp_treasurer_text_idx1 ON ofec_committee_detail_mv USING gin (treasurer_text);
--
-- Name: ofec_committee_fulltext_mv_tmp_fulltxt_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_committee_fulltext_mv_tmp_fulltxt_idx1 ON ofec_committee_fulltext_mv USING gin (fulltxt);
--
-- Name: ofec_committee_fulltext_mv_tmp_idx_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE UNIQUE INDEX ofec_committee_fulltext_mv_tmp_idx_idx1 ON ofec_committee_fulltext_mv USING btree (idx);
--
-- Name: ofec_committee_fulltext_mv_tmp_receipts_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_committee_fulltext_mv_tmp_receipts_idx1 ON ofec_committee_fulltext_mv USING btree (receipts);
--
-- Name: ofec_committee_history_mv_tmp_committee_id_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_committee_history_mv_tmp_committee_id_idx1 ON ofec_committee_history_mv USING btree (committee_id);
--
-- Name: ofec_committee_history_mv_tmp_cycle_committee_id_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_committee_history_mv_tmp_cycle_committee_id_idx1 ON ofec_committee_history_mv USING btree (cycle, committee_id);
--
-- Name: ofec_committee_history_mv_tmp_cycle_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_committee_history_mv_tmp_cycle_idx1 ON ofec_committee_history_mv USING btree (cycle);
--
-- Name: ofec_committee_history_mv_tmp_designation_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_committee_history_mv_tmp_designation_idx1 ON ofec_committee_history_mv USING btree (designation);
--
-- Name: ofec_committee_history_mv_tmp_first_file_date_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_committee_history_mv_tmp_first_file_date_idx ON ofec_committee_history_mv USING btree (first_file_date);
--
-- Name: ofec_committee_history_mv_tmp_idx_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE UNIQUE INDEX ofec_committee_history_mv_tmp_idx_idx1 ON ofec_committee_history_mv USING btree (idx);
--
-- Name: ofec_committee_history_mv_tmp_name_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_committee_history_mv_tmp_name_idx1 ON ofec_committee_history_mv USING btree (name);
--
-- Name: ofec_communication_cost_aggregate__support_oppose_indicator_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_communication_cost_aggregate__support_oppose_indicator_idx ON ofec_communication_cost_aggregate_candidate_mv USING btree (support_oppose_indicator);
--
-- Name: ofec_communication_cost_aggregate_candidate_mv_tmp_cand_id_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_communication_cost_aggregate_candidate_mv_tmp_cand_id_idx ON ofec_communication_cost_aggregate_candidate_mv USING btree (cand_id);
--
-- Name: ofec_communication_cost_aggregate_candidate_mv_tmp_cmte_id_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_communication_cost_aggregate_candidate_mv_tmp_cmte_id_idx ON ofec_communication_cost_aggregate_candidate_mv USING btree (cmte_id);
--
-- Name: ofec_communication_cost_aggregate_candidate_mv_tmp_count_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_communication_cost_aggregate_candidate_mv_tmp_count_idx ON ofec_communication_cost_aggregate_candidate_mv USING btree (count);
--
-- Name: ofec_communication_cost_aggregate_candidate_mv_tmp_cycle_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_communication_cost_aggregate_candidate_mv_tmp_cycle_idx ON ofec_communication_cost_aggregate_candidate_mv USING btree (cycle);
--
-- Name: ofec_communication_cost_aggregate_candidate_mv_tmp_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE UNIQUE INDEX ofec_communication_cost_aggregate_candidate_mv_tmp_idx_idx ON ofec_communication_cost_aggregate_candidate_mv USING btree (idx);
--
-- Name: ofec_communication_cost_aggregate_candidate_mv_tmp_total_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_communication_cost_aggregate_candidate_mv_tmp_total_idx ON ofec_communication_cost_aggregate_candidate_mv USING btree (total);
--
-- Name: ofec_communication_cost_mv_tmp_cand_id_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_communication_cost_mv_tmp_cand_id_idx ON ofec_communication_cost_mv USING btree (cand_id);
--
-- Name: ofec_communication_cost_mv_tmp_cmte_id_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_communication_cost_mv_tmp_cmte_id_idx ON ofec_communication_cost_mv USING btree (cmte_id);
--
-- Name: ofec_communication_cost_mv_tmp_communication_class_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_communication_cost_mv_tmp_communication_class_idx ON ofec_communication_cost_mv USING btree (communication_class);
--
-- Name: ofec_communication_cost_mv_tmp_communication_cost_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_communication_cost_mv_tmp_communication_cost_idx ON ofec_communication_cost_mv USING btree (communication_cost);
--
-- Name: ofec_communication_cost_mv_tmp_communication_dt_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_communication_cost_mv_tmp_communication_dt_idx ON ofec_communication_cost_mv USING btree (communication_dt);
--
-- Name: ofec_communication_cost_mv_tmp_communication_tp_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_communication_cost_mv_tmp_communication_tp_idx ON ofec_communication_cost_mv USING btree (communication_tp);
--
-- Name: ofec_communication_cost_mv_tmp_filing_form_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_communication_cost_mv_tmp_filing_form_idx ON ofec_communication_cost_mv USING btree (filing_form);
--
-- Name: ofec_communication_cost_mv_tmp_image_num_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_communication_cost_mv_tmp_image_num_idx ON ofec_communication_cost_mv USING btree (image_num);
--
-- Name: ofec_communication_cost_mv_tmp_s_o_cand_office_district_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_communication_cost_mv_tmp_s_o_cand_office_district_idx ON ofec_communication_cost_mv USING btree (s_o_cand_office_district);
--
-- Name: ofec_communication_cost_mv_tmp_s_o_cand_office_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_communication_cost_mv_tmp_s_o_cand_office_idx ON ofec_communication_cost_mv USING btree (s_o_cand_office);
--
-- Name: ofec_communication_cost_mv_tmp_s_o_cand_office_st_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_communication_cost_mv_tmp_s_o_cand_office_st_idx ON ofec_communication_cost_mv USING btree (s_o_cand_office_st);
--
-- Name: ofec_communication_cost_mv_tmp_s_o_ind_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_communication_cost_mv_tmp_s_o_ind_idx ON ofec_communication_cost_mv USING btree (s_o_ind);
--
-- Name: ofec_communication_cost_mv_tmp_sub_id_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE UNIQUE INDEX ofec_communication_cost_mv_tmp_sub_id_idx ON ofec_communication_cost_mv USING btree (sub_id);
--
-- Name: ofec_election_dates_district_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_election_dates_district_idx ON ofec_election_dates USING btree (district);
--
-- Name: ofec_election_dates_election_yr_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_election_dates_election_yr_idx ON ofec_election_dates USING btree (election_yr);
--
-- Name: ofec_election_dates_office_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_election_dates_office_idx ON ofec_election_dates USING btree (office);
--
-- Name: ofec_election_dates_senate_class_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_election_dates_senate_class_idx ON ofec_election_dates USING btree (senate_class);
--
-- Name: ofec_election_dates_state_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_election_dates_state_idx ON ofec_election_dates USING btree (state);
--
-- Name: ofec_election_result_mv_tmp_cand_office_district_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_election_result_mv_tmp_cand_office_district_idx1 ON ofec_election_result_mv USING btree (cand_office_district);
--
-- Name: ofec_election_result_mv_tmp_cand_office_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_election_result_mv_tmp_cand_office_idx1 ON ofec_election_result_mv USING btree (cand_office);
--
-- Name: ofec_election_result_mv_tmp_cand_office_st_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_election_result_mv_tmp_cand_office_st_idx1 ON ofec_election_result_mv USING btree (cand_office_st);
--
-- Name: ofec_election_result_mv_tmp_election_yr_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_election_result_mv_tmp_election_yr_idx1 ON ofec_election_result_mv USING btree (election_yr);
--
-- Name: ofec_election_result_mv_tmp_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE UNIQUE INDEX ofec_election_result_mv_tmp_idx_idx ON ofec_election_result_mv USING btree (idx);
--
-- Name: ofec_electioneering_aggregate_candidate_mv_tmp_cand_id_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_electioneering_aggregate_candidate_mv_tmp_cand_id_idx ON ofec_electioneering_aggregate_candidate_mv USING btree (cand_id);
--
-- Name: ofec_electioneering_aggregate_candidate_mv_tmp_cmte_id_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_electioneering_aggregate_candidate_mv_tmp_cmte_id_idx ON ofec_electioneering_aggregate_candidate_mv USING btree (cmte_id);
--
-- Name: ofec_electioneering_aggregate_candidate_mv_tmp_count_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_electioneering_aggregate_candidate_mv_tmp_count_idx ON ofec_electioneering_aggregate_candidate_mv USING btree (count);
--
-- Name: ofec_electioneering_aggregate_candidate_mv_tmp_cycle_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_electioneering_aggregate_candidate_mv_tmp_cycle_idx ON ofec_electioneering_aggregate_candidate_mv USING btree (cycle);
--
-- Name: ofec_electioneering_aggregate_candidate_mv_tmp_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE UNIQUE INDEX ofec_electioneering_aggregate_candidate_mv_tmp_idx_idx ON ofec_electioneering_aggregate_candidate_mv USING btree (idx);
--
-- Name: ofec_electioneering_aggregate_candidate_mv_tmp_total_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_electioneering_aggregate_candidate_mv_tmp_total_idx ON ofec_electioneering_aggregate_candidate_mv USING btree (total);
--
-- Name: ofec_electioneering_mv_tmp_calculated_cand_share_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_electioneering_mv_tmp_calculated_cand_share_idx ON ofec_electioneering_mv USING btree (calculated_cand_share);
--
-- Name: ofec_electioneering_mv_tmp_cand_id_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_electioneering_mv_tmp_cand_id_idx ON ofec_electioneering_mv USING btree (cand_id);
--
-- Name: ofec_electioneering_mv_tmp_cand_office_district_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_electioneering_mv_tmp_cand_office_district_idx ON ofec_electioneering_mv USING btree (cand_office_district);
--
-- Name: ofec_electioneering_mv_tmp_cand_office_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_electioneering_mv_tmp_cand_office_idx ON ofec_electioneering_mv USING btree (cand_office);
--
-- Name: ofec_electioneering_mv_tmp_cand_office_st_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_electioneering_mv_tmp_cand_office_st_idx ON ofec_electioneering_mv USING btree (cand_office_st);
--
-- Name: ofec_electioneering_mv_tmp_cmte_id_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_electioneering_mv_tmp_cmte_id_idx ON ofec_electioneering_mv USING btree (cmte_id);
--
-- Name: ofec_electioneering_mv_tmp_disb_dt_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_electioneering_mv_tmp_disb_dt_idx1 ON ofec_electioneering_mv USING btree (disb_dt);
--
-- Name: ofec_electioneering_mv_tmp_f9_begin_image_num_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_electioneering_mv_tmp_f9_begin_image_num_idx ON ofec_electioneering_mv USING btree (f9_begin_image_num);
--
-- Name: ofec_electioneering_mv_tmp_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE UNIQUE INDEX ofec_electioneering_mv_tmp_idx_idx ON ofec_electioneering_mv USING btree (idx);
--
-- Name: ofec_electioneering_mv_tmp_purpose_description_text_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_electioneering_mv_tmp_purpose_description_text_idx1 ON ofec_electioneering_mv USING gin (purpose_description_text);
--
-- Name: ofec_electioneering_mv_tmp_reported_disb_amt_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_electioneering_mv_tmp_reported_disb_amt_idx ON ofec_electioneering_mv USING btree (reported_disb_amt);
--
-- Name: ofec_electioneering_mv_tmp_rpt_yr_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_electioneering_mv_tmp_rpt_yr_idx ON ofec_electioneering_mv USING btree (rpt_yr);
--
-- Name: ofec_electioneering_mv_tmp_sb_image_num_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_electioneering_mv_tmp_sb_image_num_idx ON ofec_electioneering_mv USING btree (sb_image_num);
--
-- Name: ofec_filings_amendments_all_mv_tmp_file_num_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_filings_amendments_all_mv_tmp_file_num_idx1 ON ofec_filings_amendments_all_mv USING btree (file_num);
--
-- Name: ofec_filings_amendments_all_mv_tmp_idx2_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE UNIQUE INDEX ofec_filings_amendments_all_mv_tmp_idx2_idx ON ofec_filings_amendments_all_mv USING btree (idx2);
--
-- Name: ofec_filings_mv_tmp_amendment_indicator_idx_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_filings_mv_tmp_amendment_indicator_idx_idx1 ON ofec_filings_mv USING btree (amendment_indicator, idx);
--
-- Name: ofec_filings_mv_tmp_beginning_image_number_idx_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_filings_mv_tmp_beginning_image_number_idx_idx1 ON ofec_filings_mv USING btree (beginning_image_number, idx);
--
-- Name: ofec_filings_mv_tmp_candidate_id_idx_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_filings_mv_tmp_candidate_id_idx_idx1 ON ofec_filings_mv USING btree (candidate_id, idx);
--
-- Name: ofec_filings_mv_tmp_committee_id_idx_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_filings_mv_tmp_committee_id_idx_idx1 ON ofec_filings_mv USING btree (committee_id, idx);
--
-- Name: ofec_filings_mv_tmp_coverage_end_date_idx_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_filings_mv_tmp_coverage_end_date_idx_idx1 ON ofec_filings_mv USING btree (coverage_end_date, idx);
--
-- Name: ofec_filings_mv_tmp_coverage_start_date_idx_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_filings_mv_tmp_coverage_start_date_idx_idx1 ON ofec_filings_mv USING btree (coverage_start_date, idx);
--
-- Name: ofec_filings_mv_tmp_cycle_committee_id_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_filings_mv_tmp_cycle_committee_id_idx1 ON ofec_filings_mv USING btree (cycle, committee_id);
--
-- Name: ofec_filings_mv_tmp_cycle_idx_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_filings_mv_tmp_cycle_idx_idx1 ON ofec_filings_mv USING btree (cycle, idx);
--
-- Name: ofec_filings_mv_tmp_district_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_filings_mv_tmp_district_idx_idx ON ofec_filings_mv USING btree (district, idx);
--
-- Name: ofec_filings_mv_tmp_form_type_idx_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_filings_mv_tmp_form_type_idx_idx1 ON ofec_filings_mv USING btree (form_type, idx);
--
-- Name: ofec_filings_mv_tmp_idx_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE UNIQUE INDEX ofec_filings_mv_tmp_idx_idx1 ON ofec_filings_mv USING btree (idx);
--
-- Name: ofec_filings_mv_tmp_office_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_filings_mv_tmp_office_idx_idx ON ofec_filings_mv USING btree (office, idx);
--
-- Name: ofec_filings_mv_tmp_party_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_filings_mv_tmp_party_idx_idx ON ofec_filings_mv USING btree (party, idx);
--
-- Name: ofec_filings_mv_tmp_primary_general_indicator_idx_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_filings_mv_tmp_primary_general_indicator_idx_idx1 ON ofec_filings_mv USING btree (primary_general_indicator, idx);
--
-- Name: ofec_filings_mv_tmp_receipt_date_idx_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_filings_mv_tmp_receipt_date_idx_idx1 ON ofec_filings_mv USING btree (receipt_date, idx);
--
-- Name: ofec_filings_mv_tmp_report_type_full_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_filings_mv_tmp_report_type_full_idx_idx ON ofec_filings_mv USING btree (report_type_full, idx);
--
-- Name: ofec_filings_mv_tmp_report_type_idx_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_filings_mv_tmp_report_type_idx_idx1 ON ofec_filings_mv USING btree (report_type, idx);
--
-- Name: ofec_filings_mv_tmp_report_year_idx_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_filings_mv_tmp_report_year_idx_idx1 ON ofec_filings_mv USING btree (report_year, idx);
--
-- Name: ofec_filings_mv_tmp_state_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_filings_mv_tmp_state_idx_idx ON ofec_filings_mv USING btree (state, idx);
--
-- Name: ofec_filings_mv_tmp_total_disbursements_idx_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_filings_mv_tmp_total_disbursements_idx_idx1 ON ofec_filings_mv USING btree (total_disbursements, idx);
--
-- Name: ofec_filings_mv_tmp_total_independent_expenditures_idx_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_filings_mv_tmp_total_independent_expenditures_idx_idx1 ON ofec_filings_mv USING btree (total_independent_expenditures, idx);
--
-- Name: ofec_filings_mv_tmp_total_receipts_idx_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_filings_mv_tmp_total_receipts_idx_idx1 ON ofec_filings_mv USING btree (total_receipts, idx);
--
-- Name: ofec_house_senate_electronic_amendments_mv_tmp_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE UNIQUE INDEX ofec_house_senate_electronic_amendments_mv_tmp_idx_idx ON ofec_house_senate_electronic_amendments_mv USING btree (idx);
--
-- Name: ofec_house_senate_paper_amendments_mv_tmp_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE UNIQUE INDEX ofec_house_senate_paper_amendments_mv_tmp_idx_idx ON ofec_house_senate_paper_amendments_mv USING btree (idx);
--
-- Name: ofec_pac_party_electronic_amendments_mv_tmp_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE UNIQUE INDEX ofec_pac_party_electronic_amendments_mv_tmp_idx_idx ON ofec_pac_party_electronic_amendments_mv USING btree (idx);
--
-- Name: ofec_pac_party_paper_amendments_mv_tmp_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE UNIQUE INDEX ofec_pac_party_paper_amendments_mv_tmp_idx_idx ON ofec_pac_party_paper_amendments_mv USING btree (idx);
--
-- Name: ofec_presidential_electronic_amendments_mv_tmp_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE UNIQUE INDEX ofec_presidential_electronic_amendments_mv_tmp_idx_idx ON ofec_presidential_electronic_amendments_mv USING btree (idx);
--
-- Name: ofec_presidential_paper_amendments_mv_tmp_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE UNIQUE INDEX ofec_presidential_paper_amendments_mv_tmp_idx_idx ON ofec_presidential_paper_amendments_mv USING btree (idx);
--
-- Name: ofec_rad_mv_tmp_analyst_email_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_rad_mv_tmp_analyst_email_idx ON ofec_rad_mv USING btree (analyst_email);
--
-- Name: ofec_rad_mv_tmp_analyst_id_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_rad_mv_tmp_analyst_id_idx ON ofec_rad_mv USING btree (analyst_id);
--
-- Name: ofec_rad_mv_tmp_analyst_short_id_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_rad_mv_tmp_analyst_short_id_idx ON ofec_rad_mv USING btree (analyst_short_id);
--
-- Name: ofec_rad_mv_tmp_analyst_title_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_rad_mv_tmp_analyst_title_idx1 ON ofec_rad_mv USING btree (analyst_title);
--
-- Name: ofec_rad_mv_tmp_committee_id_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_rad_mv_tmp_committee_id_idx ON ofec_rad_mv USING btree (committee_id);
--
-- Name: ofec_rad_mv_tmp_committee_name_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_rad_mv_tmp_committee_name_idx ON ofec_rad_mv USING btree (committee_name);
--
-- Name: ofec_rad_mv_tmp_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE UNIQUE INDEX ofec_rad_mv_tmp_idx_idx ON ofec_rad_mv USING btree (idx);
--
-- Name: ofec_rad_mv_tmp_last_name_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_rad_mv_tmp_last_name_idx ON ofec_rad_mv USING btree (last_name);
--
-- Name: ofec_rad_mv_tmp_name_txt_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_rad_mv_tmp_name_txt_idx ON ofec_rad_mv USING gin (name_txt);
--
-- Name: ofec_rad_mv_tmp_rad_branch_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_rad_mv_tmp_rad_branch_idx ON ofec_rad_mv USING btree (rad_branch);
--
-- Name: ofec_rad_mv_tmp_telephone_ext_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_rad_mv_tmp_telephone_ext_idx ON ofec_rad_mv USING btree (telephone_ext);
--
-- Name: ofec_reports_house_senate_mv__total_disbursements_period_id_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_reports_house_senate_mv__total_disbursements_period_id_idx ON ofec_reports_house_senate_mv USING btree (total_disbursements_period, idx);
--
-- Name: ofec_reports_house_senate_mv_tmp_beginning_image_number_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_reports_house_senate_mv_tmp_beginning_image_number_idx_idx ON ofec_reports_house_senate_mv USING btree (beginning_image_number, idx);
--
-- Name: ofec_reports_house_senate_mv_tmp_committee_id_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_reports_house_senate_mv_tmp_committee_id_idx_idx ON ofec_reports_house_senate_mv USING btree (committee_id, idx);
--
-- Name: ofec_reports_house_senate_mv_tmp_coverage_end_date_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_reports_house_senate_mv_tmp_coverage_end_date_idx_idx ON ofec_reports_house_senate_mv USING btree (coverage_end_date, idx);
--
-- Name: ofec_reports_house_senate_mv_tmp_coverage_start_date_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_reports_house_senate_mv_tmp_coverage_start_date_idx_idx ON ofec_reports_house_senate_mv USING btree (coverage_start_date, idx);
--
-- Name: ofec_reports_house_senate_mv_tmp_cycle_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_reports_house_senate_mv_tmp_cycle_idx_idx ON ofec_reports_house_senate_mv USING btree (cycle, idx);
--
-- Name: ofec_reports_house_senate_mv_tmp_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE UNIQUE INDEX ofec_reports_house_senate_mv_tmp_idx_idx ON ofec_reports_house_senate_mv USING btree (idx);
--
-- Name: ofec_reports_house_senate_mv_tmp_is_amended_idx_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_reports_house_senate_mv_tmp_is_amended_idx_idx1 ON ofec_reports_house_senate_mv USING btree (is_amended, idx);
--
-- Name: ofec_reports_house_senate_mv_tmp_receipt_date_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_reports_house_senate_mv_tmp_receipt_date_idx_idx ON ofec_reports_house_senate_mv USING btree (receipt_date, idx);
--
-- Name: ofec_reports_house_senate_mv_tmp_report_type_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_reports_house_senate_mv_tmp_report_type_idx_idx ON ofec_reports_house_senate_mv USING btree (report_type, idx);
--
-- Name: ofec_reports_house_senate_mv_tmp_report_year_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_reports_house_senate_mv_tmp_report_year_idx_idx ON ofec_reports_house_senate_mv USING btree (report_year, idx);
--
-- Name: ofec_reports_house_senate_mv_tmp_total_receipts_period_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_reports_house_senate_mv_tmp_total_receipts_period_idx_idx ON ofec_reports_house_senate_mv USING btree (total_receipts_period, idx);
--
-- Name: ofec_reports_ie_only_mv_tmp_beginning_image_number_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_reports_ie_only_mv_tmp_beginning_image_number_idx_idx ON ofec_reports_ie_only_mv USING btree (beginning_image_number, idx);
--
-- Name: ofec_reports_ie_only_mv_tmp_committee_id_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_reports_ie_only_mv_tmp_committee_id_idx_idx ON ofec_reports_ie_only_mv USING btree (committee_id, idx);
--
-- Name: ofec_reports_ie_only_mv_tmp_coverage_end_date_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_reports_ie_only_mv_tmp_coverage_end_date_idx_idx ON ofec_reports_ie_only_mv USING btree (coverage_end_date, idx);
--
-- Name: ofec_reports_ie_only_mv_tmp_coverage_start_date_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_reports_ie_only_mv_tmp_coverage_start_date_idx_idx ON ofec_reports_ie_only_mv USING btree (coverage_start_date, idx);
--
-- Name: ofec_reports_ie_only_mv_tmp_cycle_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_reports_ie_only_mv_tmp_cycle_idx_idx ON ofec_reports_ie_only_mv USING btree (cycle, idx);
--
-- Name: ofec_reports_ie_only_mv_tmp_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE UNIQUE INDEX ofec_reports_ie_only_mv_tmp_idx_idx ON ofec_reports_ie_only_mv USING btree (idx);
--
-- Name: ofec_reports_ie_only_mv_tmp_independent_expenditures_period_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_reports_ie_only_mv_tmp_independent_expenditures_period_idx ON ofec_reports_ie_only_mv USING btree (independent_expenditures_period, idx);
--
-- Name: ofec_reports_ie_only_mv_tmp_is_amended_idx_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_reports_ie_only_mv_tmp_is_amended_idx_idx1 ON ofec_reports_ie_only_mv USING btree (is_amended, idx);
--
-- Name: ofec_reports_ie_only_mv_tmp_receipt_date_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_reports_ie_only_mv_tmp_receipt_date_idx_idx ON ofec_reports_ie_only_mv USING btree (receipt_date, idx);
--
-- Name: ofec_reports_ie_only_mv_tmp_report_type_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_reports_ie_only_mv_tmp_report_type_idx_idx ON ofec_reports_ie_only_mv USING btree (report_type, idx);
--
-- Name: ofec_reports_ie_only_mv_tmp_report_year_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_reports_ie_only_mv_tmp_report_year_idx_idx ON ofec_reports_ie_only_mv USING btree (report_year, idx);
--
-- Name: ofec_reports_pacs_parties_mv__independent_expenditures_per_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_reports_pacs_parties_mv__independent_expenditures_per_idx1 ON ofec_reports_pacs_parties_mv USING btree (independent_expenditures_period, idx);
--
-- Name: ofec_reports_pacs_parties_mv__total_disbursements_period_id_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_reports_pacs_parties_mv__total_disbursements_period_id_idx ON ofec_reports_pacs_parties_mv USING btree (total_disbursements_period, idx);
--
-- Name: ofec_reports_pacs_parties_mv_tmp_beginning_image_number_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_reports_pacs_parties_mv_tmp_beginning_image_number_idx_idx ON ofec_reports_pacs_parties_mv USING btree (beginning_image_number, idx);
--
-- Name: ofec_reports_pacs_parties_mv_tmp_committee_id_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_reports_pacs_parties_mv_tmp_committee_id_idx_idx ON ofec_reports_pacs_parties_mv USING btree (committee_id, idx);
--
-- Name: ofec_reports_pacs_parties_mv_tmp_coverage_end_date_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_reports_pacs_parties_mv_tmp_coverage_end_date_idx_idx ON ofec_reports_pacs_parties_mv USING btree (coverage_end_date, idx);
--
-- Name: ofec_reports_pacs_parties_mv_tmp_coverage_start_date_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_reports_pacs_parties_mv_tmp_coverage_start_date_idx_idx ON ofec_reports_pacs_parties_mv USING btree (coverage_start_date, idx);
--
-- Name: ofec_reports_pacs_parties_mv_tmp_cycle_committee_id_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_reports_pacs_parties_mv_tmp_cycle_committee_id_idx1 ON ofec_reports_pacs_parties_mv USING btree (cycle, committee_id);
--
-- Name: ofec_reports_pacs_parties_mv_tmp_cycle_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_reports_pacs_parties_mv_tmp_cycle_idx_idx ON ofec_reports_pacs_parties_mv USING btree (cycle, idx);
--
-- Name: ofec_reports_pacs_parties_mv_tmp_cycle_idx_idx3; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_reports_pacs_parties_mv_tmp_cycle_idx_idx3 ON ofec_reports_pacs_parties_mv USING btree (cycle, idx);
--
-- Name: ofec_reports_pacs_parties_mv_tmp_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE UNIQUE INDEX ofec_reports_pacs_parties_mv_tmp_idx_idx ON ofec_reports_pacs_parties_mv USING btree (idx);
--
-- Name: ofec_reports_pacs_parties_mv_tmp_is_amended_idx_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_reports_pacs_parties_mv_tmp_is_amended_idx_idx1 ON ofec_reports_pacs_parties_mv USING btree (is_amended, idx);
--
-- Name: ofec_reports_pacs_parties_mv_tmp_receipt_date_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_reports_pacs_parties_mv_tmp_receipt_date_idx_idx ON ofec_reports_pacs_parties_mv USING btree (receipt_date, idx);
--
-- Name: ofec_reports_pacs_parties_mv_tmp_report_type_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_reports_pacs_parties_mv_tmp_report_type_idx_idx ON ofec_reports_pacs_parties_mv USING btree (report_type, idx);
--
-- Name: ofec_reports_pacs_parties_mv_tmp_report_year_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_reports_pacs_parties_mv_tmp_report_year_idx_idx ON ofec_reports_pacs_parties_mv USING btree (report_year, idx);
--
-- Name: ofec_reports_pacs_parties_mv_tmp_total_receipts_period_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_reports_pacs_parties_mv_tmp_total_receipts_period_idx_idx ON ofec_reports_pacs_parties_mv USING btree (total_receipts_period, idx);
--
-- Name: ofec_reports_presidential_mv__total_disbursements_period_id_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_reports_presidential_mv__total_disbursements_period_id_idx ON ofec_reports_presidential_mv USING btree (total_disbursements_period, idx);
--
-- Name: ofec_reports_presidential_mv_tmp_beginning_image_number_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_reports_presidential_mv_tmp_beginning_image_number_idx_idx ON ofec_reports_presidential_mv USING btree (beginning_image_number, idx);
--
-- Name: ofec_reports_presidential_mv_tmp_committee_id_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_reports_presidential_mv_tmp_committee_id_idx_idx ON ofec_reports_presidential_mv USING btree (committee_id, idx);
--
-- Name: ofec_reports_presidential_mv_tmp_coverage_end_date_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_reports_presidential_mv_tmp_coverage_end_date_idx_idx ON ofec_reports_presidential_mv USING btree (coverage_end_date, idx);
--
-- Name: ofec_reports_presidential_mv_tmp_coverage_start_date_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_reports_presidential_mv_tmp_coverage_start_date_idx_idx ON ofec_reports_presidential_mv USING btree (coverage_start_date, idx);
--
-- Name: ofec_reports_presidential_mv_tmp_cycle_committee_id_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_reports_presidential_mv_tmp_cycle_committee_id_idx1 ON ofec_reports_presidential_mv USING btree (cycle, committee_id);
--
-- Name: ofec_reports_presidential_mv_tmp_cycle_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_reports_presidential_mv_tmp_cycle_idx_idx ON ofec_reports_presidential_mv USING btree (cycle, idx);
--
-- Name: ofec_reports_presidential_mv_tmp_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE UNIQUE INDEX ofec_reports_presidential_mv_tmp_idx_idx ON ofec_reports_presidential_mv USING btree (idx);
--
-- Name: ofec_reports_presidential_mv_tmp_is_amended_idx_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_reports_presidential_mv_tmp_is_amended_idx_idx1 ON ofec_reports_presidential_mv USING btree (is_amended, idx);
--
-- Name: ofec_reports_presidential_mv_tmp_receipt_date_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_reports_presidential_mv_tmp_receipt_date_idx_idx ON ofec_reports_presidential_mv USING btree (receipt_date, idx);
--
-- Name: ofec_reports_presidential_mv_tmp_report_type_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_reports_presidential_mv_tmp_report_type_idx_idx ON ofec_reports_presidential_mv USING btree (report_type, idx);
--
-- Name: ofec_reports_presidential_mv_tmp_report_year_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_reports_presidential_mv_tmp_report_year_idx_idx ON ofec_reports_presidential_mv USING btree (report_year, idx);
--
-- Name: ofec_reports_presidential_mv_tmp_total_receipts_period_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_reports_presidential_mv_tmp_total_receipts_period_idx_idx ON ofec_reports_presidential_mv USING btree (total_receipts_period, idx);
--
-- Name: ofec_sched_a_ag_st_recipient_totals_cmte_type_full_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_ag_st_recipient_totals_cmte_type_full_idx ON ofec_sched_a_aggregate_state_recipient_totals USING btree (committee_type_full, idx);
--
-- Name: ofec_sched_a_ag_st_recipient_totals_cmte_type_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_ag_st_recipient_totals_cmte_type_idx ON ofec_sched_a_aggregate_state_recipient_totals USING btree (committee_type, idx);
--
-- Name: ofec_sched_a_ag_st_recipient_totals_cycle_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_ag_st_recipient_totals_cycle_idx ON ofec_sched_a_aggregate_state_recipient_totals USING btree (cycle, idx);
--
-- Name: ofec_sched_a_ag_st_recipient_totals_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE UNIQUE INDEX ofec_sched_a_ag_st_recipient_totals_idx ON ofec_sched_a_aggregate_state_recipient_totals USING btree (idx);
--
-- Name: ofec_sched_a_ag_st_recipient_totals_state_full_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_ag_st_recipient_totals_state_full_idx ON ofec_sched_a_aggregate_state_recipient_totals USING btree (state_full, idx);
--
-- Name: ofec_sched_a_ag_st_recipient_totals_state_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_ag_st_recipient_totals_state_idx ON ofec_sched_a_aggregate_state_recipient_totals USING btree (state, idx);
--
-- Name: ofec_sched_a_aggregate_contributor_cmte_id_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_contributor_cmte_id_idx_idx ON ofec_sched_a_aggregate_contributor USING btree (cmte_id, idx);
--
-- Name: ofec_sched_a_aggregate_contributor_contbr_id_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_contributor_contbr_id_idx_idx ON ofec_sched_a_aggregate_contributor USING btree (contbr_id, idx);
--
-- Name: ofec_sched_a_aggregate_contributor_count_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_contributor_count_idx_idx ON ofec_sched_a_aggregate_contributor USING btree (count, idx);
--
-- Name: ofec_sched_a_aggregate_contributor_cycle_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_contributor_cycle_idx_idx ON ofec_sched_a_aggregate_contributor USING btree (cycle, idx);
--
-- Name: ofec_sched_a_aggregate_contributor_total_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_contributor_total_idx_idx ON ofec_sched_a_aggregate_contributor USING btree (total, idx);
--
-- Name: ofec_sched_a_aggregate_contributor_type_cmte_id_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_contributor_type_cmte_id_idx ON ofec_sched_a_aggregate_contributor_type USING btree (cmte_id);
--
-- Name: ofec_sched_a_aggregate_contributor_type_count_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_contributor_type_count_idx ON ofec_sched_a_aggregate_contributor_type USING btree (count);
--
-- Name: ofec_sched_a_aggregate_contributor_type_cycle_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_contributor_type_cycle_idx ON ofec_sched_a_aggregate_contributor_type USING btree (cycle);
--
-- Name: ofec_sched_a_aggregate_contributor_type_individual_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_contributor_type_individual_idx ON ofec_sched_a_aggregate_contributor_type USING btree (individual);
--
-- Name: ofec_sched_a_aggregate_contributor_type_total_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_contributor_type_total_idx ON ofec_sched_a_aggregate_contributor_type USING btree (total);
--
-- Name: ofec_sched_a_aggregate_employer_cmte_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_employer_cmte_id ON ofec_sched_a_aggregate_employer USING btree (cmte_id);
--
-- Name: ofec_sched_a_aggregate_employer_count; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_employer_count ON ofec_sched_a_aggregate_employer USING btree (count);
--
-- Name: ofec_sched_a_aggregate_employer_cycle; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_employer_cycle ON ofec_sched_a_aggregate_employer USING btree (cycle);
--
-- Name: ofec_sched_a_aggregate_employer_cycle_cmte_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_employer_cycle_cmte_id ON ofec_sched_a_aggregate_employer USING btree (cycle, cmte_id);
--
-- Name: ofec_sched_a_aggregate_employer_employer; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_employer_employer ON ofec_sched_a_aggregate_employer USING btree (employer);
--
-- Name: ofec_sched_a_aggregate_employer_total; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_employer_total ON ofec_sched_a_aggregate_employer USING btree (total);
--
-- Name: ofec_sched_a_aggregate_occupation_cmte_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_occupation_cmte_id ON ofec_sched_a_aggregate_occupation USING btree (cmte_id);
--
-- Name: ofec_sched_a_aggregate_occupation_count; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_occupation_count ON ofec_sched_a_aggregate_occupation USING btree (count);
--
-- Name: ofec_sched_a_aggregate_occupation_cycle; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_occupation_cycle ON ofec_sched_a_aggregate_occupation USING btree (cycle);
--
-- Name: ofec_sched_a_aggregate_occupation_cycle_cmte_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_occupation_cycle_cmte_id ON ofec_sched_a_aggregate_occupation USING btree (cycle, cmte_id);
--
-- Name: ofec_sched_a_aggregate_occupation_occupation; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_occupation_occupation ON ofec_sched_a_aggregate_occupation USING btree (occupation);
--
-- Name: ofec_sched_a_aggregate_occupation_total; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_occupation_total ON ofec_sched_a_aggregate_occupation USING btree (total);
--
-- Name: ofec_sched_a_aggregate_size_cmte_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_size_cmte_id ON ofec_sched_a_aggregate_size USING btree (cmte_id);
--
-- Name: ofec_sched_a_aggregate_size_cmte_id_cycle; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_size_cmte_id_cycle ON ofec_sched_a_aggregate_size USING btree (cmte_id, cycle);
--
-- Name: ofec_sched_a_aggregate_size_count; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_size_count ON ofec_sched_a_aggregate_size USING btree (count);
--
-- Name: ofec_sched_a_aggregate_size_cycle; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_size_cycle ON ofec_sched_a_aggregate_size USING btree (cycle);
--
-- Name: ofec_sched_a_aggregate_size_merged_cmte_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_size_merged_cmte_idx ON ofec_sched_a_aggregate_size_merged USING btree (cmte_id);
--
-- Name: ofec_sched_a_aggregate_size_merged_cycle; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_size_merged_cycle ON ofec_sched_a_aggregate_size_merged USING btree (cycle);
--
-- Name: ofec_sched_a_aggregate_size_merged_cycle_cmte_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_size_merged_cycle_cmte_id ON ofec_sched_a_aggregate_size_merged USING btree (cycle, cmte_id);
--
-- Name: ofec_sched_a_aggregate_size_merged_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE UNIQUE INDEX ofec_sched_a_aggregate_size_merged_idx ON ofec_sched_a_aggregate_size_merged USING btree (idx);
--
-- Name: ofec_sched_a_aggregate_size_merged_mv_tmp_cmte_id_idx_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_size_merged_mv_tmp_cmte_id_idx_idx1 ON ofec_sched_a_aggregate_size_merged_mv USING btree (cmte_id, idx);
--
-- Name: ofec_sched_a_aggregate_size_merged_mv_tmp_count_idx_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_size_merged_mv_tmp_count_idx_idx1 ON ofec_sched_a_aggregate_size_merged_mv USING btree (count, idx);
--
-- Name: ofec_sched_a_aggregate_size_merged_mv_tmp_cycle_cmte_id_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_size_merged_mv_tmp_cycle_cmte_id_idx1 ON ofec_sched_a_aggregate_size_merged_mv USING btree (cycle, cmte_id);
--
-- Name: ofec_sched_a_aggregate_size_merged_mv_tmp_cycle_idx_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_size_merged_mv_tmp_cycle_idx_idx1 ON ofec_sched_a_aggregate_size_merged_mv USING btree (cycle, idx);
--
-- Name: ofec_sched_a_aggregate_size_merged_mv_tmp_idx_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE UNIQUE INDEX ofec_sched_a_aggregate_size_merged_mv_tmp_idx_idx1 ON ofec_sched_a_aggregate_size_merged_mv USING btree (idx);
--
-- Name: ofec_sched_a_aggregate_size_merged_mv_tmp_size_idx_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_size_merged_mv_tmp_size_idx_idx1 ON ofec_sched_a_aggregate_size_merged_mv USING btree (size, idx);
--
-- Name: ofec_sched_a_aggregate_size_merged_mv_tmp_total_idx_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_size_merged_mv_tmp_total_idx_idx1 ON ofec_sched_a_aggregate_size_merged_mv USING btree (total, idx);
--
-- Name: ofec_sched_a_aggregate_size_merged_size; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_size_merged_size ON ofec_sched_a_aggregate_size_merged USING btree (size);
--
-- Name: ofec_sched_a_aggregate_size_size; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_size_size ON ofec_sched_a_aggregate_size USING btree (size);
--
-- Name: ofec_sched_a_aggregate_size_total; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_size_total ON ofec_sched_a_aggregate_size USING btree (total);
--
-- Name: ofec_sched_a_aggregate_state_cmte_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_state_cmte_id ON ofec_sched_a_aggregate_state USING btree (cmte_id);
--
-- Name: ofec_sched_a_aggregate_state_cmte_id_old; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_state_cmte_id_old ON ofec_sched_a_aggregate_state_old USING btree (cmte_id);
--
-- Name: ofec_sched_a_aggregate_state_count; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_state_count ON ofec_sched_a_aggregate_state USING btree (count);
--
-- Name: ofec_sched_a_aggregate_state_count_old; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_state_count_old ON ofec_sched_a_aggregate_state_old USING btree (count);
--
-- Name: ofec_sched_a_aggregate_state_cycle; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_state_cycle ON ofec_sched_a_aggregate_state USING btree (cycle);
--
-- Name: ofec_sched_a_aggregate_state_cycle_cmte_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_state_cycle_cmte_id ON ofec_sched_a_aggregate_state USING btree (cycle, cmte_id);
--
-- Name: ofec_sched_a_aggregate_state_cycle_cmte_id_old; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_state_cycle_cmte_id_old ON ofec_sched_a_aggregate_state_old USING btree (cycle, cmte_id);
--
-- Name: ofec_sched_a_aggregate_state_cycle_old; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_state_cycle_old ON ofec_sched_a_aggregate_state_old USING btree (cycle);
--
-- Name: ofec_sched_a_aggregate_state_state; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_state_state ON ofec_sched_a_aggregate_state USING btree (state);
--
-- Name: ofec_sched_a_aggregate_state_state_full; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_state_state_full ON ofec_sched_a_aggregate_state USING btree (state_full);
--
-- Name: ofec_sched_a_aggregate_state_state_full_old; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_state_state_full_old ON ofec_sched_a_aggregate_state_old USING btree (state_full);
--
-- Name: ofec_sched_a_aggregate_state_state_old; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_state_state_old ON ofec_sched_a_aggregate_state_old USING btree (state);
--
-- Name: ofec_sched_a_aggregate_state_total; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_state_total ON ofec_sched_a_aggregate_state USING btree (total);
--
-- Name: ofec_sched_a_aggregate_state_total_old; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_state_total_old ON ofec_sched_a_aggregate_state_old USING btree (total);
--
-- Name: ofec_sched_a_aggregate_zip_cmte_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_zip_cmte_id ON ofec_sched_a_aggregate_zip USING btree (cmte_id);
--
-- Name: ofec_sched_a_aggregate_zip_count; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_zip_count ON ofec_sched_a_aggregate_zip USING btree (count);
--
-- Name: ofec_sched_a_aggregate_zip_cycle; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_zip_cycle ON ofec_sched_a_aggregate_zip USING btree (cycle);
--
-- Name: ofec_sched_a_aggregate_zip_state; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_zip_state ON ofec_sched_a_aggregate_zip USING btree (state);
--
-- Name: ofec_sched_a_aggregate_zip_state_full; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_zip_state_full ON ofec_sched_a_aggregate_zip USING btree (state_full);
--
-- Name: ofec_sched_a_aggregate_zip_total; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_zip_total ON ofec_sched_a_aggregate_zip USING btree (total);
--
-- Name: ofec_sched_a_aggregate_zip_zip; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_aggregate_zip_zip ON ofec_sched_a_aggregate_zip USING btree (zip);
--
-- Name: ofec_sched_a_fulltext_contributor_employer_text_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_fulltext_contributor_employer_text_idx ON ofec_sched_a_fulltext USING gin (contributor_employer_text);
--
-- Name: ofec_sched_a_fulltext_contributor_name_text_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_fulltext_contributor_name_text_idx ON ofec_sched_a_fulltext USING gin (contributor_name_text);
--
-- Name: ofec_sched_a_fulltext_contributor_occupation_text_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_fulltext_contributor_occupation_text_idx ON ofec_sched_a_fulltext USING gin (contributor_occupation_text);
--
-- Name: ofec_sched_a_queue_new_sub_id_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_queue_new_sub_id_idx ON ofec_sched_a_queue_new USING btree (sub_id);
--
-- Name: ofec_sched_a_queue_new_timestamp_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_queue_new_timestamp_idx ON ofec_sched_a_queue_new USING btree ("timestamp");
--
-- Name: ofec_sched_a_queue_new_two_year_transaction_period_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_queue_new_two_year_transaction_period_idx ON ofec_sched_a_queue_new USING btree (two_year_transaction_period);
--
-- Name: ofec_sched_a_queue_old_sub_id_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_queue_old_sub_id_idx ON ofec_sched_a_queue_old USING btree (sub_id);
--
-- Name: ofec_sched_a_queue_old_timestamp_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_queue_old_timestamp_idx ON ofec_sched_a_queue_old USING btree ("timestamp");
--
-- Name: ofec_sched_a_queue_old_two_year_transaction_period_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_a_queue_old_two_year_transaction_period_idx ON ofec_sched_a_queue_old USING btree (two_year_transaction_period);
--
-- Name: ofec_sched_b_aggregate_purpose_cmte_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_b_aggregate_purpose_cmte_id ON ofec_sched_b_aggregate_purpose USING btree (cmte_id);
--
-- Name: ofec_sched_b_aggregate_purpose_count; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_b_aggregate_purpose_count ON ofec_sched_b_aggregate_purpose USING btree (count);
--
-- Name: ofec_sched_b_aggregate_purpose_cycle; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_b_aggregate_purpose_cycle ON ofec_sched_b_aggregate_purpose USING btree (cycle);
--
-- Name: ofec_sched_b_aggregate_purpose_cycle_cmte_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_b_aggregate_purpose_cycle_cmte_id ON ofec_sched_b_aggregate_purpose USING btree (cycle, cmte_id);
--
-- Name: ofec_sched_b_aggregate_purpose_purpose; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_b_aggregate_purpose_purpose ON ofec_sched_b_aggregate_purpose USING btree (purpose);
--
-- Name: ofec_sched_b_aggregate_purpose_total; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_b_aggregate_purpose_total ON ofec_sched_b_aggregate_purpose USING btree (total);
--
-- Name: ofec_sched_b_aggregate_recipient_cmte_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_b_aggregate_recipient_cmte_id ON ofec_sched_b_aggregate_recipient USING btree (cmte_id);
--
-- Name: ofec_sched_b_aggregate_recipient_count; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_b_aggregate_recipient_count ON ofec_sched_b_aggregate_recipient USING btree (count);
--
-- Name: ofec_sched_b_aggregate_recipient_cycle; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_b_aggregate_recipient_cycle ON ofec_sched_b_aggregate_recipient USING btree (cycle);
--
-- Name: ofec_sched_b_aggregate_recipient_cycle_cmte_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_b_aggregate_recipient_cycle_cmte_id ON ofec_sched_b_aggregate_recipient USING btree (cycle, cmte_id);
--
-- Name: ofec_sched_b_aggregate_recipient_id_cmte_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_b_aggregate_recipient_id_cmte_id ON ofec_sched_b_aggregate_recipient_id USING btree (cmte_id);
--
-- Name: ofec_sched_b_aggregate_recipient_id_cmte_id_cycle; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_b_aggregate_recipient_id_cmte_id_cycle ON ofec_sched_b_aggregate_recipient_id USING btree (cmte_id, cycle);
--
-- Name: ofec_sched_b_aggregate_recipient_id_count; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_b_aggregate_recipient_id_count ON ofec_sched_b_aggregate_recipient_id USING btree (count);
--
-- Name: ofec_sched_b_aggregate_recipient_id_cycle; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_b_aggregate_recipient_id_cycle ON ofec_sched_b_aggregate_recipient_id USING btree (cycle);
--
-- Name: ofec_sched_b_aggregate_recipient_id_recipient_cmte_id; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_b_aggregate_recipient_id_recipient_cmte_id ON ofec_sched_b_aggregate_recipient_id USING btree (recipient_cmte_id);
--
-- Name: ofec_sched_b_aggregate_recipient_id_total; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_b_aggregate_recipient_id_total ON ofec_sched_b_aggregate_recipient_id USING btree (total);
--
-- Name: ofec_sched_b_aggregate_recipient_recipient_nm; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_b_aggregate_recipient_recipient_nm ON ofec_sched_b_aggregate_recipient USING btree (recipient_nm);
--
-- Name: ofec_sched_b_aggregate_recipient_total; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_b_aggregate_recipient_total ON ofec_sched_b_aggregate_recipient USING btree (total);
--
-- Name: ofec_sched_b_fulltext_disbursement_description_text_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_b_fulltext_disbursement_description_text_idx ON ofec_sched_b_fulltext USING gin (disbursement_description_text);
--
-- Name: ofec_sched_b_fulltext_recipient_name_text_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_b_fulltext_recipient_name_text_idx ON ofec_sched_b_fulltext USING gin (recipient_name_text);
--
-- Name: ofec_sched_b_queue_new_sub_id_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_b_queue_new_sub_id_idx ON ofec_sched_b_queue_new USING btree (sub_id);
--
-- Name: ofec_sched_b_queue_new_timestamp_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_b_queue_new_timestamp_idx ON ofec_sched_b_queue_new USING btree ("timestamp");
--
-- Name: ofec_sched_b_queue_new_two_year_transaction_period_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_b_queue_new_two_year_transaction_period_idx ON ofec_sched_b_queue_new USING btree (two_year_transaction_period);
--
-- Name: ofec_sched_b_queue_old_sub_id_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_b_queue_old_sub_id_idx ON ofec_sched_b_queue_old USING btree (sub_id);
--
-- Name: ofec_sched_b_queue_old_timestamp_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_b_queue_old_timestamp_idx ON ofec_sched_b_queue_old USING btree ("timestamp");
--
-- Name: ofec_sched_b_queue_old_two_year_transaction_period_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_b_queue_old_two_year_transaction_period_idx ON ofec_sched_b_queue_old USING btree (two_year_transaction_period);
--
-- Name: ofec_sched_c_mv_tmp_cand_nm_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_c_mv_tmp_cand_nm_idx1 ON ofec_sched_c_mv USING btree (cand_nm);
--
-- Name: ofec_sched_c_mv_tmp_candidate_name_text_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_c_mv_tmp_candidate_name_text_idx1 ON ofec_sched_c_mv USING gin (candidate_name_text);
--
-- Name: ofec_sched_c_mv_tmp_cmte_id_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_c_mv_tmp_cmte_id_idx1 ON ofec_sched_c_mv USING btree (cmte_id);
--
-- Name: ofec_sched_c_mv_tmp_get_cycle_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_c_mv_tmp_get_cycle_idx1 ON ofec_sched_c_mv USING btree (get_cycle(rpt_yr));
--
-- Name: ofec_sched_c_mv_tmp_image_num_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_c_mv_tmp_image_num_idx1 ON ofec_sched_c_mv USING btree (image_num);
--
-- Name: ofec_sched_c_mv_tmp_incurred_dt_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_c_mv_tmp_incurred_dt_idx1 ON ofec_sched_c_mv USING btree (incurred_dt);
--
-- Name: ofec_sched_c_mv_tmp_incurred_dt_sub_id_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_c_mv_tmp_incurred_dt_sub_id_idx1 ON ofec_sched_c_mv USING btree (incurred_dt, sub_id);
--
-- Name: ofec_sched_c_mv_tmp_loan_source_name_text_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_c_mv_tmp_loan_source_name_text_idx1 ON ofec_sched_c_mv USING gin (loan_source_name_text);
--
-- Name: ofec_sched_c_mv_tmp_orig_loan_amt_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_c_mv_tmp_orig_loan_amt_idx1 ON ofec_sched_c_mv USING btree (orig_loan_amt);
--
-- Name: ofec_sched_c_mv_tmp_orig_loan_amt_sub_id_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_c_mv_tmp_orig_loan_amt_sub_id_idx1 ON ofec_sched_c_mv USING btree (orig_loan_amt, sub_id);
--
-- Name: ofec_sched_c_mv_tmp_pg_date_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_c_mv_tmp_pg_date_idx1 ON ofec_sched_c_mv USING btree (pg_date);
--
-- Name: ofec_sched_c_mv_tmp_pymt_to_dt_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_c_mv_tmp_pymt_to_dt_idx1 ON ofec_sched_c_mv USING btree (pymt_to_dt);
--
-- Name: ofec_sched_c_mv_tmp_pymt_to_dt_sub_id_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_c_mv_tmp_pymt_to_dt_sub_id_idx1 ON ofec_sched_c_mv USING btree (pymt_to_dt, sub_id);
--
-- Name: ofec_sched_c_mv_tmp_rpt_yr_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_c_mv_tmp_rpt_yr_idx1 ON ofec_sched_c_mv USING btree (rpt_yr);
--
-- Name: ofec_sched_c_mv_tmp_sub_id_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE UNIQUE INDEX ofec_sched_c_mv_tmp_sub_id_idx1 ON ofec_sched_c_mv USING btree (sub_id);
--
-- Name: ofec_sched_e_aggregate_candidate_m_support_oppose_indicator_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_e_aggregate_candidate_m_support_oppose_indicator_idx ON ofec_sched_e_aggregate_candidate_mv USING btree (support_oppose_indicator);
--
-- Name: ofec_sched_e_aggregate_candidate_mv_tmp_cand_id_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_e_aggregate_candidate_mv_tmp_cand_id_idx ON ofec_sched_e_aggregate_candidate_mv USING btree (cand_id);
--
-- Name: ofec_sched_e_aggregate_candidate_mv_tmp_cmte_id_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_e_aggregate_candidate_mv_tmp_cmte_id_idx ON ofec_sched_e_aggregate_candidate_mv USING btree (cmte_id);
--
-- Name: ofec_sched_e_aggregate_candidate_mv_tmp_count_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_e_aggregate_candidate_mv_tmp_count_idx ON ofec_sched_e_aggregate_candidate_mv USING btree (count);
--
-- Name: ofec_sched_e_aggregate_candidate_mv_tmp_cycle_cand_id_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_e_aggregate_candidate_mv_tmp_cycle_cand_id_idx ON ofec_sched_e_aggregate_candidate_mv USING btree (cycle, cand_id);
--
-- Name: ofec_sched_e_aggregate_candidate_mv_tmp_cycle_cmte_id_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_e_aggregate_candidate_mv_tmp_cycle_cmte_id_idx ON ofec_sched_e_aggregate_candidate_mv USING btree (cycle, cmte_id);
--
-- Name: ofec_sched_e_aggregate_candidate_mv_tmp_cycle_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_e_aggregate_candidate_mv_tmp_cycle_idx ON ofec_sched_e_aggregate_candidate_mv USING btree (cycle);
--
-- Name: ofec_sched_e_aggregate_candidate_mv_tmp_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE UNIQUE INDEX ofec_sched_e_aggregate_candidate_mv_tmp_idx_idx ON ofec_sched_e_aggregate_candidate_mv USING btree (idx);
--
-- Name: ofec_sched_e_aggregate_candidate_mv_tmp_total_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_e_aggregate_candidate_mv_tmp_total_idx ON ofec_sched_e_aggregate_candidate_mv USING btree (total);
--
-- Name: ofec_sched_e_queue_new_sub_id_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_e_queue_new_sub_id_idx ON ofec_sched_e_queue_new USING btree (sub_id);
--
-- Name: ofec_sched_e_queue_new_timestamp_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_e_queue_new_timestamp_idx ON ofec_sched_e_queue_new USING btree ("timestamp");
--
-- Name: ofec_sched_e_queue_old_sub_id_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_e_queue_old_sub_id_idx ON ofec_sched_e_queue_old USING btree (sub_id);
--
-- Name: ofec_sched_e_queue_old_timestamp_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_e_queue_old_timestamp_idx ON ofec_sched_e_queue_old USING btree ("timestamp");
--
-- Name: ofec_sched_f_mv_tmp_cand_id_sub_id_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_f_mv_tmp_cand_id_sub_id_idx1 ON ofec_sched_f_mv USING btree (cand_id, sub_id);
--
-- Name: ofec_sched_f_mv_tmp_cmte_id_sub_id_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_f_mv_tmp_cmte_id_sub_id_idx1 ON ofec_sched_f_mv USING btree (cmte_id, sub_id);
--
-- Name: ofec_sched_f_mv_tmp_exp_amt_sub_id_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_f_mv_tmp_exp_amt_sub_id_idx1 ON ofec_sched_f_mv USING btree (exp_amt, sub_id);
--
-- Name: ofec_sched_f_mv_tmp_exp_dt_sub_id_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_f_mv_tmp_exp_dt_sub_id_idx1 ON ofec_sched_f_mv USING btree (exp_dt, sub_id);
--
-- Name: ofec_sched_f_mv_tmp_image_num_sub_id_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_f_mv_tmp_image_num_sub_id_idx1 ON ofec_sched_f_mv USING btree (image_num, sub_id);
--
-- Name: ofec_sched_f_mv_tmp_payee_name_text_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_sched_f_mv_tmp_payee_name_text_idx1 ON ofec_sched_f_mv USING gin (payee_name_text);
--
-- Name: ofec_sched_f_mv_tmp_sub_id_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE UNIQUE INDEX ofec_sched_f_mv_tmp_sub_id_idx1 ON ofec_sched_f_mv USING btree (sub_id);
--
-- Name: ofec_totals_candidate_committ_candidate_id_cycle_full_elect_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE UNIQUE INDEX ofec_totals_candidate_committ_candidate_id_cycle_full_elect_idx ON ofec_totals_candidate_committees_mv USING btree (candidate_id, cycle, full_election);
--
-- Name: ofec_totals_candidate_committees_mv_tmp_candidate_id_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_totals_candidate_committees_mv_tmp_candidate_id_idx ON ofec_totals_candidate_committees_mv USING btree (candidate_id);
--
-- Name: ofec_totals_candidate_committees_mv_tmp_cycle_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_totals_candidate_committees_mv_tmp_cycle_idx ON ofec_totals_candidate_committees_mv USING btree (cycle);
--
-- Name: ofec_totals_candidate_committees_mv_tmp_disbursements_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_totals_candidate_committees_mv_tmp_disbursements_idx ON ofec_totals_candidate_committees_mv USING btree (disbursements);
--
-- Name: ofec_totals_candidate_committees_mv_tmp_election_year_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_totals_candidate_committees_mv_tmp_election_year_idx ON ofec_totals_candidate_committees_mv USING btree (election_year);
--
-- Name: ofec_totals_candidate_committees_mv_tmp_federal_funds_flag_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_totals_candidate_committees_mv_tmp_federal_funds_flag_idx ON ofec_totals_candidate_committees_mv USING btree (federal_funds_flag);
--
-- Name: ofec_totals_candidate_committees_mv_tmp_receipts_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_totals_candidate_committees_mv_tmp_receipts_idx ON ofec_totals_candidate_committees_mv USING btree (receipts);
--
-- Name: ofec_totals_combined_mv_tmp_committee_designation_full_sub__idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_totals_combined_mv_tmp_committee_designation_full_sub__idx ON ofec_totals_combined_mv USING btree (committee_designation_full, sub_id);
--
-- Name: ofec_totals_combined_mv_tmp_committee_id_sub_id_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_totals_combined_mv_tmp_committee_id_sub_id_idx1 ON ofec_totals_combined_mv USING btree (committee_id, sub_id);
--
-- Name: ofec_totals_combined_mv_tmp_committee_type_full_sub_id_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_totals_combined_mv_tmp_committee_type_full_sub_id_idx ON ofec_totals_combined_mv USING btree (committee_type_full, sub_id);
--
-- Name: ofec_totals_combined_mv_tmp_cycle_sub_id_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_totals_combined_mv_tmp_cycle_sub_id_idx1 ON ofec_totals_combined_mv USING btree (cycle, sub_id);
--
-- Name: ofec_totals_combined_mv_tmp_disbursements_sub_id_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_totals_combined_mv_tmp_disbursements_sub_id_idx1 ON ofec_totals_combined_mv USING btree (disbursements, sub_id);
--
-- Name: ofec_totals_combined_mv_tmp_receipts_sub_id_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_totals_combined_mv_tmp_receipts_sub_id_idx1 ON ofec_totals_combined_mv USING btree (receipts, sub_id);
--
-- Name: ofec_totals_combined_mv_tmp_sub_id_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE UNIQUE INDEX ofec_totals_combined_mv_tmp_sub_id_idx1 ON ofec_totals_combined_mv USING btree (sub_id);
--
-- Name: ofec_totals_house_senate_mv_t_committee_designation_full_id_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_totals_house_senate_mv_t_committee_designation_full_id_idx ON ofec_totals_house_senate_mv USING btree (committee_designation_full, idx);
--
-- Name: ofec_totals_house_senate_mv_tmp_candidate_id_idx_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_totals_house_senate_mv_tmp_candidate_id_idx_idx1 ON ofec_totals_house_senate_mv USING btree (candidate_id, idx);
--
-- Name: ofec_totals_house_senate_mv_tmp_committee_id_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_totals_house_senate_mv_tmp_committee_id_idx_idx ON ofec_totals_house_senate_mv USING btree (committee_id, idx);
--
-- Name: ofec_totals_house_senate_mv_tmp_committee_type_full_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_totals_house_senate_mv_tmp_committee_type_full_idx_idx ON ofec_totals_house_senate_mv USING btree (committee_type_full, idx);
--
-- Name: ofec_totals_house_senate_mv_tmp_cycle_committee_id_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_totals_house_senate_mv_tmp_cycle_committee_id_idx1 ON ofec_totals_house_senate_mv USING btree (cycle, committee_id);
--
-- Name: ofec_totals_house_senate_mv_tmp_cycle_committee_id_idx3; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_totals_house_senate_mv_tmp_cycle_committee_id_idx3 ON ofec_totals_house_senate_mv USING btree (cycle, committee_id);
--
-- Name: ofec_totals_house_senate_mv_tmp_cycle_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_totals_house_senate_mv_tmp_cycle_idx_idx ON ofec_totals_house_senate_mv USING btree (cycle, idx);
--
-- Name: ofec_totals_house_senate_mv_tmp_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE UNIQUE INDEX ofec_totals_house_senate_mv_tmp_idx_idx ON ofec_totals_house_senate_mv USING btree (idx);
--
-- Name: ofec_totals_ie_only_mv_tmp_committee_designation_full_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_totals_ie_only_mv_tmp_committee_designation_full_idx_idx ON ofec_totals_ie_only_mv USING btree (committee_designation_full, idx);
--
-- Name: ofec_totals_ie_only_mv_tmp_committee_id_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_totals_ie_only_mv_tmp_committee_id_idx_idx ON ofec_totals_ie_only_mv USING btree (committee_id, idx);
--
-- Name: ofec_totals_ie_only_mv_tmp_committee_type_full_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_totals_ie_only_mv_tmp_committee_type_full_idx_idx ON ofec_totals_ie_only_mv USING btree (committee_type_full, idx);
--
-- Name: ofec_totals_ie_only_mv_tmp_cycle_committee_id_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_totals_ie_only_mv_tmp_cycle_committee_id_idx1 ON ofec_totals_ie_only_mv USING btree (cycle, committee_id);
--
-- Name: ofec_totals_ie_only_mv_tmp_cycle_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_totals_ie_only_mv_tmp_cycle_idx_idx ON ofec_totals_ie_only_mv USING btree (cycle, idx);
--
-- Name: ofec_totals_ie_only_mv_tmp_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE UNIQUE INDEX ofec_totals_ie_only_mv_tmp_idx_idx ON ofec_totals_ie_only_mv USING btree (idx);
--
-- Name: ofec_totals_pacs_mv_tmp_committee_designation_full_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_totals_pacs_mv_tmp_committee_designation_full_idx_idx ON ofec_totals_pacs_mv USING btree (committee_designation_full, idx);
--
-- Name: ofec_totals_pacs_mv_tmp_committee_id_idx_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_totals_pacs_mv_tmp_committee_id_idx_idx1 ON ofec_totals_pacs_mv USING btree (committee_id, idx);
--
-- Name: ofec_totals_pacs_mv_tmp_committee_type_full_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_totals_pacs_mv_tmp_committee_type_full_idx_idx ON ofec_totals_pacs_mv USING btree (committee_type_full, idx);
--
-- Name: ofec_totals_pacs_mv_tmp_committee_type_idx_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_totals_pacs_mv_tmp_committee_type_idx_idx1 ON ofec_totals_pacs_mv USING btree (committee_type, idx);
--
-- Name: ofec_totals_pacs_mv_tmp_cycle_idx_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_totals_pacs_mv_tmp_cycle_idx_idx1 ON ofec_totals_pacs_mv USING btree (cycle, idx);
--
-- Name: ofec_totals_pacs_mv_tmp_designation_idx_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_totals_pacs_mv_tmp_designation_idx_idx1 ON ofec_totals_pacs_mv USING btree (designation, idx);
--
-- Name: ofec_totals_pacs_mv_tmp_disbursements_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_totals_pacs_mv_tmp_disbursements_idx1 ON ofec_totals_pacs_mv USING btree (disbursements);
--
-- Name: ofec_totals_pacs_mv_tmp_idx_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE UNIQUE INDEX ofec_totals_pacs_mv_tmp_idx_idx1 ON ofec_totals_pacs_mv USING btree (idx);
--
-- Name: ofec_totals_pacs_mv_tmp_receipts_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_totals_pacs_mv_tmp_receipts_idx1 ON ofec_totals_pacs_mv USING btree (receipts);
--
-- Name: ofec_totals_pacs_parties_mv_t_committee_designation_full_id_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_totals_pacs_parties_mv_t_committee_designation_full_id_idx ON ofec_totals_pacs_parties_mv USING btree (committee_designation_full, idx);
--
-- Name: ofec_totals_pacs_parties_mv_tmp_committee_id_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_totals_pacs_parties_mv_tmp_committee_id_idx_idx ON ofec_totals_pacs_parties_mv USING btree (committee_id, idx);
--
-- Name: ofec_totals_pacs_parties_mv_tmp_committee_type_full_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_totals_pacs_parties_mv_tmp_committee_type_full_idx_idx ON ofec_totals_pacs_parties_mv USING btree (committee_type_full, idx);
--
-- Name: ofec_totals_pacs_parties_mv_tmp_committee_type_idx_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_totals_pacs_parties_mv_tmp_committee_type_idx_idx1 ON ofec_totals_pacs_parties_mv USING btree (committee_type, idx);
--
-- Name: ofec_totals_pacs_parties_mv_tmp_cycle_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_totals_pacs_parties_mv_tmp_cycle_idx_idx ON ofec_totals_pacs_parties_mv USING btree (cycle, idx);
--
-- Name: ofec_totals_pacs_parties_mv_tmp_designation_idx_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_totals_pacs_parties_mv_tmp_designation_idx_idx1 ON ofec_totals_pacs_parties_mv USING btree (designation, idx);
--
-- Name: ofec_totals_pacs_parties_mv_tmp_disbursements_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_totals_pacs_parties_mv_tmp_disbursements_idx1 ON ofec_totals_pacs_parties_mv USING btree (disbursements);
--
-- Name: ofec_totals_pacs_parties_mv_tmp_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE UNIQUE INDEX ofec_totals_pacs_parties_mv_tmp_idx_idx ON ofec_totals_pacs_parties_mv USING btree (idx);
--
-- Name: ofec_totals_pacs_parties_mv_tmp_receipts_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_totals_pacs_parties_mv_tmp_receipts_idx1 ON ofec_totals_pacs_parties_mv USING btree (receipts);
--
-- Name: ofec_totals_parties_mv_tmp_committee_designation_full_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_totals_parties_mv_tmp_committee_designation_full_idx_idx ON ofec_totals_parties_mv USING btree (committee_designation_full, idx);
--
-- Name: ofec_totals_parties_mv_tmp_committee_id_idx_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_totals_parties_mv_tmp_committee_id_idx_idx1 ON ofec_totals_parties_mv USING btree (committee_id, idx);
--
-- Name: ofec_totals_parties_mv_tmp_committee_type_full_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_totals_parties_mv_tmp_committee_type_full_idx_idx ON ofec_totals_parties_mv USING btree (committee_type_full, idx);
--
-- Name: ofec_totals_parties_mv_tmp_committee_type_idx_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_totals_parties_mv_tmp_committee_type_idx_idx1 ON ofec_totals_parties_mv USING btree (committee_type, idx);
--
-- Name: ofec_totals_parties_mv_tmp_cycle_idx_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_totals_parties_mv_tmp_cycle_idx_idx1 ON ofec_totals_parties_mv USING btree (cycle, idx);
--
-- Name: ofec_totals_parties_mv_tmp_designation_idx_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_totals_parties_mv_tmp_designation_idx_idx1 ON ofec_totals_parties_mv USING btree (designation, idx);
--
-- Name: ofec_totals_parties_mv_tmp_disbursements_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_totals_parties_mv_tmp_disbursements_idx1 ON ofec_totals_parties_mv USING btree (disbursements);
--
-- Name: ofec_totals_parties_mv_tmp_idx_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE UNIQUE INDEX ofec_totals_parties_mv_tmp_idx_idx1 ON ofec_totals_parties_mv USING btree (idx);
--
-- Name: ofec_totals_parties_mv_tmp_receipts_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_totals_parties_mv_tmp_receipts_idx1 ON ofec_totals_parties_mv USING btree (receipts);
--
-- Name: ofec_totals_presidential_mv_t_committee_designation_full_id_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_totals_presidential_mv_t_committee_designation_full_id_idx ON ofec_totals_presidential_mv USING btree (committee_designation_full, idx);
--
-- Name: ofec_totals_presidential_mv_tmp_committee_id_idx_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_totals_presidential_mv_tmp_committee_id_idx_idx1 ON ofec_totals_presidential_mv USING btree (committee_id, idx);
--
-- Name: ofec_totals_presidential_mv_tmp_committee_type_full_idx_idx; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_totals_presidential_mv_tmp_committee_type_full_idx_idx ON ofec_totals_presidential_mv USING btree (committee_type_full, idx);
--
-- Name: ofec_totals_presidential_mv_tmp_cycle_committee_id_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_totals_presidential_mv_tmp_cycle_committee_id_idx1 ON ofec_totals_presidential_mv USING btree (cycle, committee_id);
--
-- Name: ofec_totals_presidential_mv_tmp_cycle_idx_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE INDEX ofec_totals_presidential_mv_tmp_cycle_idx_idx1 ON ofec_totals_presidential_mv USING btree (cycle, idx);
--
-- Name: ofec_totals_presidential_mv_tmp_idx_idx1; Type: INDEX; Schema: public; Owner: fec
--
CREATE UNIQUE INDEX ofec_totals_presidential_mv_tmp_idx_idx1 ON ofec_totals_presidential_mv USING btree (idx);
SET search_path = real_efile, pg_catalog;
--
-- Name: brin_index; Type: INDEX; Schema: real_efile; Owner: fec
--
CREATE INDEX brin_index ON reps USING btree ("timestamp");
--
-- Name: contributor_employer_text_idx; Type: INDEX; Schema: real_efile; Owner: fec
--
CREATE INDEX contributor_employer_text_idx ON sa7 USING gin (contributor_employer_text);
--
-- Name: contributor_name_text_idx; Type: INDEX; Schema: real_efile; Owner: fec
--
CREATE INDEX contributor_name_text_idx ON sa7 USING gin (contributor_name_text);
--
-- Name: contributor_occupation_text_idx; Type: INDEX; Schema: real_efile; Owner: fec
--
CREATE INDEX contributor_occupation_text_idx ON sa7 USING gin (contributor_occupation_text);
--
-- Name: f3_comid_idx; Type: INDEX; Schema: real_efile; Owner: fec
--
CREATE INDEX f3_comid_idx ON f3 USING btree (comid);
--
-- Name: f3_create_dt_idx; Type: INDEX; Schema: real_efile; Owner: fec
--
CREATE INDEX f3_create_dt_idx ON f3 USING btree (create_dt);
--
-- Name: f3_repid_idx; Type: INDEX; Schema: real_efile; Owner: fec
--
CREATE INDEX f3_repid_idx ON f3 USING btree (repid);
--
-- Name: f3p_comid_idx; Type: INDEX; Schema: real_efile; Owner: fec
--
CREATE INDEX f3p_comid_idx ON f3p USING btree (comid);
--
-- Name: f3p_create_dt_idx; Type: INDEX; Schema: real_efile; Owner: fec
--
CREATE INDEX f3p_create_dt_idx ON f3p USING btree (create_dt);
--
-- Name: f3p_repid_idx; Type: INDEX; Schema: real_efile; Owner: fec
--
CREATE INDEX f3p_repid_idx ON f3p USING btree (repid);
--
-- Name: f3x_comid_idx; Type: INDEX; Schema: real_efile; Owner: fec
--
CREATE INDEX f3x_comid_idx ON f3x USING btree (comid);
--
-- Name: f3x_create_dt_idx; Type: INDEX; Schema: real_efile; Owner: fec
--
CREATE INDEX f3x_create_dt_idx ON f3x USING btree (create_dt);
--
-- Name: f57_comid_idx; Type: INDEX; Schema: real_efile; Owner: fec
--
CREATE INDEX f57_comid_idx ON f57 USING btree (comid);
--
-- Name: f57_create_dt_idx; Type: INDEX; Schema: real_efile; Owner: fec
--
CREATE INDEX f57_create_dt_idx ON f57 USING btree (create_dt);
--
-- Name: f57_exp_date_idx; Type: INDEX; Schema: real_efile; Owner: fec
--
CREATE INDEX f57_exp_date_idx ON f57 USING btree (exp_date DESC);
--
-- Name: f57_repid_idx; Type: INDEX; Schema: real_efile; Owner: fec
--
CREATE INDEX f57_repid_idx ON f57 USING btree (repid);
--
-- Name: real_efile_f3_comid_idx; Type: INDEX; Schema: real_efile; Owner: fec
--
CREATE INDEX real_efile_f3_comid_idx ON f3 USING btree (comid);
--
-- Name: real_efile_f3_create_dt_idx; Type: INDEX; Schema: real_efile; Owner: fec
--
CREATE INDEX real_efile_f3_create_dt_idx ON f3 USING btree (create_dt);
--
-- Name: real_efile_f3p_comid_idx; Type: INDEX; Schema: real_efile; Owner: fec
--
CREATE INDEX real_efile_f3p_comid_idx ON f3p USING btree (comid);
--
-- Name: real_efile_f3p_create_dt_idx; Type: INDEX; Schema: real_efile; Owner: fec
--
CREATE INDEX real_efile_f3p_create_dt_idx ON f3p USING btree (create_dt);
--
-- Name: real_efile_reps_comid_idx; Type: INDEX; Schema: real_efile; Owner: fec
--
CREATE INDEX real_efile_reps_comid_idx ON reps USING btree (comid);
--
-- Name: real_efile_sa7_amount_idx; Type: INDEX; Schema: real_efile; Owner: fec
--
CREATE INDEX real_efile_sa7_amount_idx ON sa7 USING btree (amount);
--
-- Name: real_efile_sa7_date_con_idx; Type: INDEX; Schema: real_efile; Owner: fec
--
CREATE INDEX real_efile_sa7_date_con_idx ON sa7 USING btree (date_con);
--
-- Name: real_efile_sa7_repid_idx; Type: INDEX; Schema: real_efile; Owner: fec
--
CREATE INDEX real_efile_sa7_repid_idx ON sa7 USING btree (repid);
--
-- Name: real_efile_sb4_repid_idx; Type: INDEX; Schema: real_efile; Owner: fec
--
CREATE INDEX real_efile_sb4_repid_idx ON sb4 USING btree (repid);
--
-- Name: reps_create_dt_idx; Type: INDEX; Schema: real_efile; Owner: fec
--
CREATE INDEX reps_create_dt_idx ON reps USING brin (create_dt);
--
-- Name: reps_filed_date_idx; Type: INDEX; Schema: real_efile; Owner: fec
--
CREATE INDEX reps_filed_date_idx ON reps USING brin (filed_date);
--
-- Name: reps_timestamp_idx; Type: INDEX; Schema: real_efile; Owner: fec
--
CREATE INDEX reps_timestamp_idx ON reps USING brin ("timestamp");
--
-- Name: sb4_amount_idx; Type: INDEX; Schema: real_efile; Owner: fec
--
CREATE INDEX sb4_amount_idx ON sb4 USING btree (amount);
--
-- Name: sb4_comid_idx; Type: INDEX; Schema: real_efile; Owner: fec
--
CREATE INDEX sb4_comid_idx ON sb4 USING btree (comid);
--
-- Name: sb4_date_dis_idx; Type: INDEX; Schema: real_efile; Owner: fec
--
CREATE INDEX sb4_date_dis_idx ON sb4 USING btree (date_dis);
--
-- Name: sb4_repid_idx; Type: INDEX; Schema: real_efile; Owner: fec
--
CREATE INDEX sb4_repid_idx ON sb4 USING btree (repid);
--
-- Name: sb4_state_idx; Type: INDEX; Schema: real_efile; Owner: fec
--
CREATE INDEX sb4_state_idx ON sb4 USING btree (state);
--
-- Name: sb4_transdesc_idx; Type: INDEX; Schema: real_efile; Owner: fec
--
CREATE INDEX sb4_transdesc_idx ON sb4 USING btree (transdesc);
--
-- Name: summary_create_dt_idx; Type: INDEX; Schema: real_efile; Owner: fec
--
CREATE INDEX summary_create_dt_idx ON summary USING btree (create_dt);
--
-- Name: summary_repid_idx; Type: INDEX; Schema: real_efile; Owner: fec
--
CREATE INDEX summary_repid_idx ON summary USING btree (repid);
SET search_path = staging, pg_catalog;
--
-- Name: idx_operations_log_pg_date; Type: INDEX; Schema: staging; Owner: fec
--
CREATE INDEX idx_operations_log_pg_date ON operations_log USING btree (pg_date); | the_stack |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.