fix: bailing out on no PRIMARY/UNIQUE KEY
This commit is contained in:
parent
28557a60b0
commit
1d84cb933c
@ -95,7 +95,7 @@ func (this *Inspector) InspectTableColumnsAndUniqueKeys(tableName string) (colum
|
||||
|
||||
func (this *Inspector) InspectOriginalTable() (err error) {
|
||||
this.migrationContext.OriginalTableColumns, this.migrationContext.OriginalTableUniqueKeys, err = this.InspectTableColumnsAndUniqueKeys(this.migrationContext.OriginalTableName)
|
||||
if err == nil {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
|
9
localtests/no-unique-key/create.sql
Normal file
9
localtests/no-unique-key/create.sql
Normal file
@ -0,0 +1,9 @@
|
||||
drop table if exists gh_ost_test;
|
||||
create table gh_ost_test (
|
||||
i int not null,
|
||||
ts timestamp default current_timestamp,
|
||||
dt datetime,
|
||||
key i_idx(i)
|
||||
) auto_increment=1;
|
||||
|
||||
drop event if exists gh_ost_test;
|
1
localtests/no-unique-key/expect_failure
Normal file
1
localtests/no-unique-key/expect_failure
Normal file
@ -0,0 +1 @@
|
||||
No PRIMARY nor UNIQUE key found in table
|
1
localtests/no-unique-key/extra_args
Normal file
1
localtests/no-unique-key/extra_args
Normal file
@ -0,0 +1 @@
|
||||
--alter="add column v varchar(32)"
|
Loading…
Reference in New Issue
Block a user