Merge pull request #218 from liquidata-inc/tim/adds-bats-test

Added skipped bats test for schema diffs on adding a primary key
This commit is contained in:
Tim Sehn
2019-11-18 16:35:32 -08:00
committed by GitHub
2 changed files with 67 additions and 0 deletions
+56
View File
@@ -0,0 +1,56 @@
{
"columns": [
{
"tag": 0,
"name": "pk",
"kind": "int",
"is_part_of_pk": false,
"col_constraints": [
{
"constraint_type": "not_null",
"params": null
}
]
},
{
"tag": 1,
"name": "c1",
"kind": "int",
"is_part_of_pk": true,
"col_constraints": []
},
{
"tag": 2,
"name": "c2",
"kind": "int",
"is_part_of_pk": false,
"col_constraints": []
},
{
"tag": 3,
"name": "c3",
"kind": "int",
"is_part_of_pk": false,
"col_constraints": []
},
{
"tag": 4,
"name": "c4",
"kind": "int",
"is_part_of_pk": false,
"col_constraints": []
},
{
"tag": 5,
"name": "c5",
"kind": "int",
"is_part_of_pk": true,
"col_constraints": [
{
"constraint_type": "not_null",
"params": null
}
]
}
]
}
+11
View File
@@ -104,6 +104,17 @@ teardown() {
[[ "$output" =~ "PRIMARY KEY" ]] || false
}
@test "add another primary key. view the schema diff" {
dolt table create -s=`batshelper 1pk5col-ints.schema` test
dolt add test
dolt commit -m "committed table so we can see diffs"
dolt table create -f -s=`batshelper 1pk5col-ints-add-pk.schema` test
run dolt diff --schema
[ "$status" -eq 0 ]
skip "Schema diff output does not handle adding primary keys. Additionally, rows that should not be in the diff show up."
[[ "$output" =~ "PRIMARY KEY" ]] || false
}
@test "adding and dropping column should produce no diff" {
dolt table create -s=`batshelper 1pk5col-ints.schema` test
dolt add test