Skip to content

[9.x] Remove index name when adding primary key on MySQL - #45515

Merged
taylorotwell merged 1 commit into
laravel:9.xfrom
hafezdivandari:patch-2
Jan 6, 2023
Merged

[9.x] Remove index name when adding primary key on MySQL#45515
taylorotwell merged 1 commit into
laravel:9.xfrom
hafezdivandari:patch-2

Conversation

@hafezdivandari

Copy link
Copy Markdown
Contributor

It is kind of a bug fix, MySQL doesn't have index name for primary key, check the syntax on 5.7 and 8.0

ALTER TABLE tbl_name
    [alter_option [, alter_option] ...]
    [partition_options]

alter_option: {
    table_options
  | ADD [CONSTRAINT [symbol]] PRIMARY KEY
        [index_type] (key_part,...)
        [index_option] ...
  | DROP PRIMARY KEY
}

key_part: {col_name [(length)] | (expr)} [ASC | DESC]

index_type:
    USING {BTREE | HASH}

index_option: {
    KEY_BLOCK_SIZE [=] value
  | index_type
  | WITH PARSER parser_name
  | COMMENT 'string'
  | {VISIBLE | INVISIBLE}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants