mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Add Reverse Engineered SQL tests for Constraints. Fixes #4475
This commit is contained in:
committed by
Dave Page
parent
710d520631
commit
8168f623c4
@@ -0,0 +1,9 @@
|
||||
-- Constraint: Chk_$%{}[]()&*^!@"'`\/#a
|
||||
|
||||
-- ALTER TABLE testschema.tableforcon DROP CONSTRAINT "Chk_$%{}[]()&*^!@""'`\/#a";
|
||||
|
||||
ALTER TABLE testschema.tableforcon
|
||||
ADD CONSTRAINT "Chk_$%{}[]()&*^!@""'`\/#a" CHECK (col1 > 1);
|
||||
|
||||
COMMENT ON CONSTRAINT "Chk_$%{}[]()&*^!@""'`\/#a" ON testschema.tableforcon
|
||||
IS 'Comment for alter';
|
||||
@@ -0,0 +1,10 @@
|
||||
-- Constraint: Chk_$%{}[]()&*^!@"'`\/#
|
||||
|
||||
-- ALTER TABLE testschema.tableforcon DROP CONSTRAINT "Chk_$%{}[]()&*^!@""'`\/#";
|
||||
|
||||
ALTER TABLE testschema.tableforcon
|
||||
ADD CONSTRAINT "Chk_$%{}[]()&*^!@""'`\/#" CHECK (col1 > 1)
|
||||
NOT VALID;
|
||||
|
||||
COMMENT ON CONSTRAINT "Chk_$%{}[]()&*^!@""'`\/#" ON testschema.tableforcon
|
||||
IS 'Comment for create';
|
||||
@@ -0,0 +1,6 @@
|
||||
ALTER TABLE testschema.tableforcon
|
||||
RENAME CONSTRAINT "Chk_$%{}[]()&*^!@""'`\/#" TO "Chk_$%{}[]()&*^!@""'`\/#a";
|
||||
ALTER TABLE testschema.tableforcon
|
||||
VALIDATE CONSTRAINT "Chk_$%{}[]()&*^!@""'`\/#a";
|
||||
COMMENT ON CONSTRAINT "Chk_$%{}[]()&*^!@""'`\/#a" ON testschema.tableforcon
|
||||
IS 'Comment for alter';
|
||||
@@ -0,0 +1,56 @@
|
||||
{
|
||||
"scenarios": [
|
||||
{
|
||||
"type": "create",
|
||||
"name": "Create Table",
|
||||
"endpoint": "NODE-table.obj",
|
||||
"sql_endpoint": "NODE-table.sql_id",
|
||||
"data": {
|
||||
"name": "tableforcon",
|
||||
"columns": [{
|
||||
"name": "col1",
|
||||
"cltype": "integer",
|
||||
"is_primary_key": true
|
||||
}],
|
||||
"is_partitioned": false,
|
||||
"schema": "testschema",
|
||||
"spcname": "pg_default"
|
||||
},
|
||||
"store_table_id": true
|
||||
},
|
||||
{
|
||||
"type": "create",
|
||||
"name": "Create Check Constraint",
|
||||
"endpoint": "NODE-check_constraint.obj",
|
||||
"sql_endpoint": "NODE-check_constraint.sql_id",
|
||||
"data": {
|
||||
"name": "Chk_$%{}[]()&*^!@\"'`\\/#",
|
||||
"comment": "Comment for create",
|
||||
"consrc": "col1 > 1",
|
||||
"connoinherit": false,
|
||||
"convalidated": true
|
||||
},
|
||||
"expected_sql_file": "create_check_constraint.sql"
|
||||
}, {
|
||||
"type": "alter",
|
||||
"name": "Alter Check Constraint",
|
||||
"endpoint": "NODE-check_constraint.obj_id",
|
||||
"sql_endpoint": "NODE-check_constraint.sql_id",
|
||||
"msql_endpoint": "NODE-check_constraint.msql_id",
|
||||
"data": {
|
||||
"name": "Chk_$%{}[]()&*^!@\"'`\\/#a",
|
||||
"convalidated": false,
|
||||
"comment": "Comment for alter"
|
||||
},
|
||||
"expected_sql_file": "alter_check_constraint.sql",
|
||||
"expected_msql_file": "msql_check_constraint.sql"
|
||||
}, {
|
||||
"type": "delete",
|
||||
"name": "Drop Check Constraint",
|
||||
"endpoint": "NODE-check_constraint.delete_id",
|
||||
"data": {
|
||||
"name": "Chk_$%{}[]()&*^!@\"'`\\/#a"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user