#!/usr/bin/env bats load $BATS_TEST_DIRNAME/helper/common.bash setup() { setup_common } teardown() { assert_feature_version teardown_common } @test "sql-create-tables: create a single primary key table" { dolt sql < 0) ); CREATE TABLE t2 LIKE t1; SELECT count(CONSTRAINT_NAME), count(distinct CONSTRAINT_NAME) FROM information_schema.table_constraints WHERE CONSTRAINT_TYPE="CHECK"; SQL [ "$status" -eq 0 ] [[ "$output" =~ "2,2" ]] || false } @test "sql-create-tables: ALTER TABLE ... COMMENT on a table with a primary key" { # See https://github.com/dolthub/dolt/issues/11164 dolt sql -q "CREATE TABLE t(id INT NOT NULL, PRIMARY KEY (id));" run dolt sql -q "ALTER TABLE t COMMENT='c';" [ "$status" -eq 0 ] run dolt sql -q "SHOW CREATE TABLE t;" [ "$status" -eq 0 ] [[ "$output" =~ "COMMENT='c'" ]] || false }