mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2024-11-27 03:00:22 -06:00
Added MSQL test cases for Domain.
This commit is contained in:
parent
47f26cc377
commit
0ca65d7cfe
@ -1,69 +0,0 @@
|
||||
{
|
||||
"scenarios": [{
|
||||
"type": "create",
|
||||
"name": "Create Domain",
|
||||
"endpoint": "NODE-domain.obj",
|
||||
"sql_endpoint": "NODE-domain.sql_id",
|
||||
"data": {
|
||||
"name": "Dom1_$%{}[]()&*^!@\"'`\\/#",
|
||||
"schema": "public",
|
||||
"schema_id": "<SCHEMA_ID>",
|
||||
"basensp": "public",
|
||||
"description": "test_comment",
|
||||
"basetype": "bigint",
|
||||
"typdefault": "5",
|
||||
"typnotnull": "true",
|
||||
"constraints": [{
|
||||
"conname": "constraint_1",
|
||||
"consrc": "true",
|
||||
"convalidated": "true"
|
||||
}],
|
||||
"seclabels": []
|
||||
},
|
||||
"expected_sql_file": "create_domain.sql"
|
||||
}, {
|
||||
"type": "alter",
|
||||
"name": "Alter domain comment",
|
||||
"endpoint": "NODE-domain.obj_id",
|
||||
"sql_endpoint": "NODE-domain.sql_id",
|
||||
"data": {
|
||||
"description": "test updated domain comment"
|
||||
},
|
||||
"expected_sql_file": "alter_domain_comment.sql"
|
||||
}, {
|
||||
"type": "alter",
|
||||
"name": "Alter domain null type",
|
||||
"endpoint": "NODE-domain.obj_id",
|
||||
"sql_endpoint": "NODE-domain.sql_id",
|
||||
"data": {
|
||||
"typnotnull": "false"
|
||||
},
|
||||
"expected_sql_file": "alter_domain_null_type.sql"
|
||||
}, {
|
||||
"type": "alter",
|
||||
"name": "Alter domain default expression",
|
||||
"endpoint": "NODE-domain.obj_id",
|
||||
"sql_endpoint": "NODE-domain.sql_id",
|
||||
"data": {
|
||||
"typdefault": "3"
|
||||
},
|
||||
"expected_sql_file": "alter_domain_default_expression.sql"
|
||||
}, {
|
||||
"type": "alter",
|
||||
"name": "Alter domain name",
|
||||
"endpoint": "NODE-domain.obj_id",
|
||||
"sql_endpoint": "NODE-domain.sql_id",
|
||||
"data": {
|
||||
"name": "Dom2_$%{}[]()&*^!@\"'`\\/#"
|
||||
},
|
||||
"expected_sql_file": "alter_domain_name.sql"
|
||||
}, {
|
||||
"type": "delete",
|
||||
"name": "Drop domain",
|
||||
"endpoint": "NODE-domain.delete_id",
|
||||
"data": {
|
||||
"name": "Dom2_$%{}[]()&*^!@\"'`\\/#"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
@ -3,14 +3,18 @@
|
||||
-- DROP DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#";
|
||||
|
||||
CREATE DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
AS bigint
|
||||
AS text
|
||||
COLLATE pg_catalog."C"
|
||||
DEFAULT 5
|
||||
NOT NULL;
|
||||
|
||||
ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#" OWNER TO <OWNER>;
|
||||
ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#" OWNER TO postgres;
|
||||
|
||||
ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
ADD CONSTRAINT constraint_1 CHECK (true);
|
||||
ADD CONSTRAINT constraint_1 CHECK (3 < 5);
|
||||
|
||||
ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
ADD CONSTRAINT constraint_2 CHECK (4 < 2) NOT VALID;
|
||||
|
||||
COMMENT ON DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'test updated domain comment';
|
@ -3,13 +3,17 @@
|
||||
-- DROP DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#";
|
||||
|
||||
CREATE DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
AS bigint
|
||||
AS text
|
||||
COLLATE pg_catalog."C"
|
||||
DEFAULT 3;
|
||||
|
||||
ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#" OWNER TO <OWNER>;
|
||||
ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#" OWNER TO postgres;
|
||||
|
||||
ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
ADD CONSTRAINT constraint_1 CHECK (true);
|
||||
ADD CONSTRAINT constraint_1 CHECK (3 < 5);
|
||||
|
||||
ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
ADD CONSTRAINT constraint_2 CHECK (4 < 2) NOT VALID;
|
||||
|
||||
COMMENT ON DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'test updated domain comment';
|
@ -3,13 +3,17 @@
|
||||
-- DROP DOMAIN public."Dom2_$%{}[]()&*^!@""'`\/#";
|
||||
|
||||
CREATE DOMAIN public."Dom2_$%{}[]()&*^!@""'`\/#"
|
||||
AS bigint
|
||||
AS text
|
||||
COLLATE pg_catalog."C"
|
||||
DEFAULT 3;
|
||||
|
||||
ALTER DOMAIN public."Dom2_$%{}[]()&*^!@""'`\/#" OWNER TO <OWNER>;
|
||||
ALTER DOMAIN public."Dom2_$%{}[]()&*^!@""'`\/#" OWNER TO postgres;
|
||||
|
||||
ALTER DOMAIN public."Dom2_$%{}[]()&*^!@""'`\/#"
|
||||
ADD CONSTRAINT constraint_1 CHECK (true);
|
||||
ADD CONSTRAINT constraint_1 CHECK (3 < 5);
|
||||
|
||||
ALTER DOMAIN public."Dom2_$%{}[]()&*^!@""'`\/#"
|
||||
ADD CONSTRAINT constraint_2 CHECK (4 < 2) NOT VALID;
|
||||
|
||||
COMMENT ON DOMAIN public."Dom2_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'test updated domain comment';
|
@ -3,13 +3,17 @@
|
||||
-- DROP DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#";
|
||||
|
||||
CREATE DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
AS bigint
|
||||
AS text
|
||||
COLLATE pg_catalog."C"
|
||||
DEFAULT 5;
|
||||
|
||||
ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#" OWNER TO <OWNER>;
|
||||
ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#" OWNER TO postgres;
|
||||
|
||||
ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
ADD CONSTRAINT constraint_1 CHECK (true);
|
||||
ADD CONSTRAINT constraint_1 CHECK (3 < 5);
|
||||
|
||||
ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
ADD CONSTRAINT constraint_2 CHECK (4 < 2) NOT VALID;
|
||||
|
||||
COMMENT ON DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'test updated domain comment';
|
@ -0,0 +1,20 @@
|
||||
-- DOMAIN: public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
|
||||
-- DROP DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#";
|
||||
|
||||
CREATE DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
AS text
|
||||
COLLATE pg_catalog."C"
|
||||
DEFAULT 5
|
||||
NOT NULL;
|
||||
|
||||
ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#" OWNER TO postgres;
|
||||
|
||||
ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
ADD CONSTRAINT constraint_1 CHECK (3 < 5);
|
||||
|
||||
ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
ADD CONSTRAINT constraint_2 CHECK (4 < 2) NOT VALID;
|
||||
|
||||
COMMENT ON DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'test_comment';
|
@ -3,14 +3,11 @@
|
||||
-- DROP DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#";
|
||||
|
||||
CREATE DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
AS bigint
|
||||
DEFAULT 5
|
||||
AS numeric(5,2)
|
||||
DEFAULT 3
|
||||
NOT NULL;
|
||||
|
||||
ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#" OWNER TO <OWNER>;
|
||||
|
||||
ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
ADD CONSTRAINT constraint_1 CHECK (true);
|
||||
ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#" OWNER TO postgres;
|
||||
|
||||
COMMENT ON DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'test_comment';
|
@ -0,0 +1,2 @@
|
||||
COMMENT ON DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'test updated domain comment';
|
@ -0,0 +1,2 @@
|
||||
ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
SET DEFAULT 3;
|
@ -0,0 +1,2 @@
|
||||
ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
RENAME TO "Dom2_$%{}[]()&*^!@""'`\/#";
|
@ -0,0 +1,2 @@
|
||||
ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
DROP NOT NULL;
|
@ -0,0 +1,16 @@
|
||||
CREATE DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
AS text
|
||||
COLLATE pg_catalog."C"
|
||||
DEFAULT 5
|
||||
NOT NULL;
|
||||
|
||||
ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#" OWNER TO postgres;
|
||||
|
||||
ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
ADD CONSTRAINT constraint_1 CHECK (3 < 5);
|
||||
|
||||
ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
ADD CONSTRAINT constraint_2 CHECK (4 < 2) NOT VALID;
|
||||
|
||||
COMMENT ON DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'test_comment';
|
@ -0,0 +1,9 @@
|
||||
CREATE DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
AS numeric(5,2)
|
||||
DEFAULT 3
|
||||
NOT NULL;
|
||||
|
||||
ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#" OWNER TO postgres;
|
||||
|
||||
COMMENT ON DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'test_comment';
|
@ -0,0 +1,114 @@
|
||||
{
|
||||
"scenarios": [{
|
||||
"type": "create",
|
||||
"name": "Create Domain with all options",
|
||||
"endpoint": "NODE-domain.obj",
|
||||
"sql_endpoint": "NODE-domain.sql_id",
|
||||
"msql_endpoint": "NODE-domain.msql",
|
||||
"data": {
|
||||
"name": "Dom1_$%{}[]()&*^!@\"'`\\/#",
|
||||
"schema": "public",
|
||||
"schema_id": "<SCHEMA_ID>",
|
||||
"owner": "postgres",
|
||||
"basensp": "public",
|
||||
"description": "test_comment",
|
||||
"basetype": "text",
|
||||
"collname": "pg_catalog.\"C\"",
|
||||
"typdefault": "5",
|
||||
"typnotnull": "true",
|
||||
"constraints": [{
|
||||
"conname": "constraint_1",
|
||||
"consrc": "3 < 5",
|
||||
"convalidated": true
|
||||
}, {
|
||||
"conname": "constraint_2",
|
||||
"consrc": "4 < 2",
|
||||
"convalidated": false
|
||||
}],
|
||||
"seclabels": []
|
||||
},
|
||||
"expected_sql_file": "create_domain.sql",
|
||||
"expected_msql_file": "msql_create_domain.sql"
|
||||
}, {
|
||||
"type": "alter",
|
||||
"name": "Alter domain comment",
|
||||
"endpoint": "NODE-domain.obj_id",
|
||||
"sql_endpoint": "NODE-domain.sql_id",
|
||||
"msql_endpoint": "NODE-domain.msql_id",
|
||||
"data": {
|
||||
"description": "test updated domain comment"
|
||||
},
|
||||
"expected_sql_file": "alter_domain_comment.sql",
|
||||
"expected_msql_file": "msql_alter_domain_comment.sql"
|
||||
}, {
|
||||
"type": "alter",
|
||||
"name": "Alter domain null type",
|
||||
"endpoint": "NODE-domain.obj_id",
|
||||
"sql_endpoint": "NODE-domain.sql_id",
|
||||
"msql_endpoint": "NODE-domain.msql_id",
|
||||
"data": {
|
||||
"typnotnull": "false"
|
||||
},
|
||||
"expected_sql_file": "alter_domain_null_type.sql",
|
||||
"expected_msql_file": "msql_alter_domain_null_type.sql"
|
||||
}, {
|
||||
"type": "alter",
|
||||
"name": "Alter domain default expression",
|
||||
"endpoint": "NODE-domain.obj_id",
|
||||
"sql_endpoint": "NODE-domain.sql_id",
|
||||
"msql_endpoint": "NODE-domain.msql_id",
|
||||
"data": {
|
||||
"typdefault": "3"
|
||||
},
|
||||
"expected_sql_file": "alter_domain_default_expression.sql",
|
||||
"expected_msql_file": "msql_alter_domain_default_expression.sql"
|
||||
}, {
|
||||
"type": "alter",
|
||||
"name": "Alter domain name",
|
||||
"endpoint": "NODE-domain.obj_id",
|
||||
"sql_endpoint": "NODE-domain.sql_id",
|
||||
"msql_endpoint": "NODE-domain.msql_id",
|
||||
"data": {
|
||||
"name": "Dom2_$%{}[]()&*^!@\"'`\\/#"
|
||||
},
|
||||
"expected_sql_file": "alter_domain_name.sql",
|
||||
"expected_msql_file": "msql_alter_domain_name.sql"
|
||||
}, {
|
||||
"type": "delete",
|
||||
"name": "Drop domain of text data type",
|
||||
"endpoint": "NODE-domain.delete_id",
|
||||
"data": {
|
||||
"name": "Dom2_$%{}[]()&*^!@\"'`\\/#"
|
||||
}
|
||||
}, {
|
||||
"type": "create",
|
||||
"name": "Create Domain with numeric data type",
|
||||
"endpoint": "NODE-domain.obj",
|
||||
"sql_endpoint": "NODE-domain.sql_id",
|
||||
"msql_endpoint": "NODE-domain.msql",
|
||||
"data": {
|
||||
"name": "Dom1_$%{}[]()&*^!@\"'`\\/#",
|
||||
"schema": "public",
|
||||
"schema_id": "<SCHEMA_ID>",
|
||||
"owner": "postgres",
|
||||
"basensp": "public",
|
||||
"description": "test_comment",
|
||||
"basetype": "numeric",
|
||||
"typlen": 5,
|
||||
"precision": 2,
|
||||
"typdefault": "3",
|
||||
"typnotnull": "true",
|
||||
"seclabels": []
|
||||
},
|
||||
"expected_sql_file": "create_domain_numeric.sql",
|
||||
"expected_msql_file": "msql_create_domain_numeric.sql"
|
||||
}, {
|
||||
"type": "delete",
|
||||
"name": "Drop domain of numeric data type",
|
||||
"endpoint": "NODE-domain.delete_id",
|
||||
"data": {
|
||||
"name": "Dom2_$%{}[]()&*^!@\"'`\\/#"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
-- DOMAIN: public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
|
||||
-- DROP DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#";
|
||||
|
||||
CREATE DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
AS text
|
||||
COLLATE pg_catalog."C"
|
||||
DEFAULT 5
|
||||
NOT NULL;
|
||||
|
||||
ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#" OWNER TO enterprisedb;
|
||||
|
||||
ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
ADD CONSTRAINT constraint_1 CHECK (3 < 5);
|
||||
|
||||
ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
ADD CONSTRAINT constraint_2 CHECK (4 < 2) NOT VALID;
|
||||
|
||||
COMMENT ON DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'test updated domain comment';
|
@ -0,0 +1,19 @@
|
||||
-- DOMAIN: public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
|
||||
-- DROP DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#";
|
||||
|
||||
CREATE DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
AS text
|
||||
COLLATE pg_catalog."C"
|
||||
DEFAULT 3;
|
||||
|
||||
ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#" OWNER TO enterprisedb;
|
||||
|
||||
ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
ADD CONSTRAINT constraint_1 CHECK (3 < 5);
|
||||
|
||||
ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
ADD CONSTRAINT constraint_2 CHECK (4 < 2) NOT VALID;
|
||||
|
||||
COMMENT ON DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'test updated domain comment';
|
@ -0,0 +1,19 @@
|
||||
-- DOMAIN: public."Dom2_$%{}[]()&*^!@""'`\/#"
|
||||
|
||||
-- DROP DOMAIN public."Dom2_$%{}[]()&*^!@""'`\/#";
|
||||
|
||||
CREATE DOMAIN public."Dom2_$%{}[]()&*^!@""'`\/#"
|
||||
AS text
|
||||
COLLATE pg_catalog."C"
|
||||
DEFAULT 3;
|
||||
|
||||
ALTER DOMAIN public."Dom2_$%{}[]()&*^!@""'`\/#" OWNER TO enterprisedb;
|
||||
|
||||
ALTER DOMAIN public."Dom2_$%{}[]()&*^!@""'`\/#"
|
||||
ADD CONSTRAINT constraint_1 CHECK (3 < 5);
|
||||
|
||||
ALTER DOMAIN public."Dom2_$%{}[]()&*^!@""'`\/#"
|
||||
ADD CONSTRAINT constraint_2 CHECK (4 < 2) NOT VALID;
|
||||
|
||||
COMMENT ON DOMAIN public."Dom2_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'test updated domain comment';
|
@ -0,0 +1,19 @@
|
||||
-- DOMAIN: public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
|
||||
-- DROP DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#";
|
||||
|
||||
CREATE DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
AS text
|
||||
COLLATE pg_catalog."C"
|
||||
DEFAULT 5;
|
||||
|
||||
ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#" OWNER TO enterprisedb;
|
||||
|
||||
ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
ADD CONSTRAINT constraint_1 CHECK (3 < 5);
|
||||
|
||||
ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
ADD CONSTRAINT constraint_2 CHECK (4 < 2) NOT VALID;
|
||||
|
||||
COMMENT ON DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'test updated domain comment';
|
@ -0,0 +1,20 @@
|
||||
-- DOMAIN: public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
|
||||
-- DROP DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#";
|
||||
|
||||
CREATE DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
AS text
|
||||
COLLATE pg_catalog."C"
|
||||
DEFAULT 5
|
||||
NOT NULL;
|
||||
|
||||
ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#" OWNER TO enterprisedb;
|
||||
|
||||
ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
ADD CONSTRAINT constraint_1 CHECK (3 < 5);
|
||||
|
||||
ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
ADD CONSTRAINT constraint_2 CHECK (4 < 2) NOT VALID;
|
||||
|
||||
COMMENT ON DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'test_comment';
|
@ -0,0 +1,13 @@
|
||||
-- DOMAIN: public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
|
||||
-- DROP DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#";
|
||||
|
||||
CREATE DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
AS numeric(5,2)
|
||||
DEFAULT 3
|
||||
NOT NULL;
|
||||
|
||||
ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#" OWNER TO enterprisedb;
|
||||
|
||||
COMMENT ON DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'test_comment';
|
@ -0,0 +1,2 @@
|
||||
COMMENT ON DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'test updated domain comment';
|
@ -0,0 +1,2 @@
|
||||
ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
SET DEFAULT 3;
|
@ -0,0 +1,2 @@
|
||||
ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
RENAME TO "Dom2_$%{}[]()&*^!@""'`\/#";
|
@ -0,0 +1,2 @@
|
||||
ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
DROP NOT NULL;
|
@ -0,0 +1,16 @@
|
||||
CREATE DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
AS text
|
||||
COLLATE pg_catalog."C"
|
||||
DEFAULT 5
|
||||
NOT NULL;
|
||||
|
||||
ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#" OWNER TO enterprisedb;
|
||||
|
||||
ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
ADD CONSTRAINT constraint_1 CHECK (3 < 5);
|
||||
|
||||
ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
ADD CONSTRAINT constraint_2 CHECK (4 < 2) NOT VALID;
|
||||
|
||||
COMMENT ON DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'test_comment';
|
@ -0,0 +1,9 @@
|
||||
CREATE DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
AS numeric(5,2)
|
||||
DEFAULT 3
|
||||
NOT NULL;
|
||||
|
||||
ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#" OWNER TO enterprisedb;
|
||||
|
||||
COMMENT ON DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'test_comment';
|
@ -0,0 +1,114 @@
|
||||
{
|
||||
"scenarios": [{
|
||||
"type": "create",
|
||||
"name": "Create Domain with all options",
|
||||
"endpoint": "NODE-domain.obj",
|
||||
"sql_endpoint": "NODE-domain.sql_id",
|
||||
"msql_endpoint": "NODE-domain.msql",
|
||||
"data": {
|
||||
"name": "Dom1_$%{}[]()&*^!@\"'`\\/#",
|
||||
"schema": "public",
|
||||
"schema_id": "<SCHEMA_ID>",
|
||||
"owner": "enterprisedb",
|
||||
"basensp": "public",
|
||||
"description": "test_comment",
|
||||
"basetype": "text",
|
||||
"collname": "pg_catalog.\"C\"",
|
||||
"typdefault": "5",
|
||||
"typnotnull": "true",
|
||||
"constraints": [{
|
||||
"conname": "constraint_1",
|
||||
"consrc": "3 < 5",
|
||||
"convalidated": true
|
||||
},{
|
||||
"conname": "constraint_2",
|
||||
"consrc": "4 < 2",
|
||||
"convalidated": false
|
||||
}],
|
||||
"seclabels": []
|
||||
},
|
||||
"expected_sql_file": "create_domain.sql",
|
||||
"expected_msql_file": "msql_create_domain.sql"
|
||||
}, {
|
||||
"type": "alter",
|
||||
"name": "Alter domain comment",
|
||||
"endpoint": "NODE-domain.obj_id",
|
||||
"sql_endpoint": "NODE-domain.sql_id",
|
||||
"msql_endpoint": "NODE-domain.msql_id",
|
||||
"data": {
|
||||
"description": "test updated domain comment"
|
||||
},
|
||||
"expected_sql_file": "alter_domain_comment.sql",
|
||||
"expected_msql_file": "msql_alter_domain_comment.sql"
|
||||
}, {
|
||||
"type": "alter",
|
||||
"name": "Alter domain null type",
|
||||
"endpoint": "NODE-domain.obj_id",
|
||||
"sql_endpoint": "NODE-domain.sql_id",
|
||||
"msql_endpoint": "NODE-domain.msql_id",
|
||||
"data": {
|
||||
"typnotnull": "false"
|
||||
},
|
||||
"expected_sql_file": "alter_domain_null_type.sql",
|
||||
"expected_msql_file": "msql_alter_domain_null_type.sql"
|
||||
}, {
|
||||
"type": "alter",
|
||||
"name": "Alter domain default expression",
|
||||
"endpoint": "NODE-domain.obj_id",
|
||||
"sql_endpoint": "NODE-domain.sql_id",
|
||||
"msql_endpoint": "NODE-domain.msql_id",
|
||||
"data": {
|
||||
"typdefault": "3"
|
||||
},
|
||||
"expected_sql_file": "alter_domain_default_expression.sql",
|
||||
"expected_msql_file": "msql_alter_domain_default_expression.sql"
|
||||
}, {
|
||||
"type": "alter",
|
||||
"name": "Alter domain name",
|
||||
"endpoint": "NODE-domain.obj_id",
|
||||
"sql_endpoint": "NODE-domain.sql_id",
|
||||
"msql_endpoint": "NODE-domain.msql_id",
|
||||
"data": {
|
||||
"name": "Dom2_$%{}[]()&*^!@\"'`\\/#"
|
||||
},
|
||||
"expected_sql_file": "alter_domain_name.sql",
|
||||
"expected_msql_file": "msql_alter_domain_name.sql"
|
||||
}, {
|
||||
"type": "delete",
|
||||
"name": "Drop domain of text data type",
|
||||
"endpoint": "NODE-domain.delete_id",
|
||||
"data": {
|
||||
"name": "Dom2_$%{}[]()&*^!@\"'`\\/#"
|
||||
}
|
||||
}, {
|
||||
"type": "create",
|
||||
"name": "Create Domain with numeric data type",
|
||||
"endpoint": "NODE-domain.obj",
|
||||
"sql_endpoint": "NODE-domain.sql_id",
|
||||
"msql_endpoint": "NODE-domain.msql",
|
||||
"data": {
|
||||
"name": "Dom1_$%{}[]()&*^!@\"'`\\/#",
|
||||
"schema": "public",
|
||||
"schema_id": "<SCHEMA_ID>",
|
||||
"owner": "enterprisedb",
|
||||
"basensp": "public",
|
||||
"description": "test_comment",
|
||||
"basetype": "numeric",
|
||||
"typlen": 5,
|
||||
"precision": 2,
|
||||
"typdefault": "3",
|
||||
"typnotnull": "true",
|
||||
"seclabels": []
|
||||
},
|
||||
"expected_sql_file": "create_domain_numeric.sql",
|
||||
"expected_msql_file": "msql_create_domain_numeric.sql"
|
||||
}, {
|
||||
"type": "delete",
|
||||
"name": "Drop domain of numeric data type",
|
||||
"endpoint": "NODE-domain.delete_id",
|
||||
"data": {
|
||||
"name": "Dom2_$%{}[]()&*^!@\"'`\\/#"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue
Block a user