mirror of
https://github.com/dolthub/dolt.git
synced 2026-04-27 15:41:44 -05:00
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:
Executable
+56
@@ -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
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user