mirror of
https://github.com/dolthub/dolt.git
synced 2026-01-25 03:09:00 -06:00
only allow update-tag on format __DOLT__
This commit is contained in:
@@ -25,6 +25,7 @@ import (
|
||||
"github.com/dolthub/dolt/go/libraries/doltcore/env"
|
||||
"github.com/dolthub/dolt/go/libraries/doltcore/schema"
|
||||
"github.com/dolthub/dolt/go/libraries/utils/argparser"
|
||||
"github.com/dolthub/dolt/go/store/types"
|
||||
)
|
||||
|
||||
var updateTagDocs = cli.CommandDocumentationContent{
|
||||
@@ -69,6 +70,11 @@ func (cmd UpdateTagCmd) Exec(ctx context.Context, commandStr string, args []stri
|
||||
help, usage := cli.HelpAndUsagePrinters(cli.CommandDocsForCommandString(commandStr, updateTagDocs, ap))
|
||||
apr := cli.ParseArgsOrDie(ap, args, help)
|
||||
|
||||
if !types.IsFormat_DOLT(dEnv.DoltDB.Format()) {
|
||||
verr := errhand.BuildDError("update-tag is only available in storage format __DOLT__").Build()
|
||||
return commands.HandleVErrAndExitCode(verr, usage)
|
||||
}
|
||||
|
||||
if len(apr.Args) != 3 {
|
||||
verr := errhand.BuildDError("must provide <table> <column> <tag>").Build()
|
||||
return commands.HandleVErrAndExitCode(verr, usage)
|
||||
|
||||
@@ -291,6 +291,24 @@ DELIM
|
||||
[[ $output =~ "col1 | 10186" ]] || false
|
||||
}
|
||||
|
||||
@test "column_tags: update-tag only available on __DOLT__" {
|
||||
mkdir ld
|
||||
mkdir dev
|
||||
|
||||
cd ld
|
||||
DOLT_DEFAULT_BIN_FORMAT=__LD_1__ dolt init
|
||||
run dolt schema update-tag t col 5
|
||||
[ $status -ne 0 ]
|
||||
echo $output
|
||||
[[ $output =~ "update-tag is only available in storage format __DOLT__" ]] || false
|
||||
|
||||
cd ../dev
|
||||
DOLT_DEFAULT_BIN_FORMAT=__DOLT_DEV__ dolt init
|
||||
run dolt schema update-tag t col 5
|
||||
[ $status -ne 0 ]
|
||||
[[ $output =~ "update-tag is only available in storage format __DOLT__" ]] || false
|
||||
}
|
||||
|
||||
@test "column_tags: update-tag updates a columns tag" {
|
||||
skip_nbf_not_dolt
|
||||
|
||||
|
||||
Reference in New Issue
Block a user