Determining if MySQL table index exists before creating

前端 未结 7 1760
一向
一向 2021-02-04 14:35

Our system\'s automated database migration process involves running .sql scripts containing new table definitions and their accompanying indexes.

I require the ability t

7条回答
  •  梦谈多话
    2021-02-04 15:25

    You could just create another table with the correct indices, copy everything from the old table and then drop it and rename the new table back to what the old one used to be. A bit hackish and might be a bit heavy for big tables but still fairly straightforward.

提交回复
热议问题