开发者

How do I remove a uniqueness constraint from a MySQL table?

开发者 https://www.devze.com 2023-02-22 00:30 出处:网络
I created a table in a MySQL database via the following: CREATE TABLE `newsubscriptions_orderspecification` (

I created a table in a MySQL database via the following:

CREATE TABLE `newsubscriptions_orderspecification` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `display_name` varchar(256) NOT NULL,
    `sub_def_id` integer UNSIGNED NOT NULL开发者_开发知识库,
    `source_code_id` integer UNSIGNED NOT NULL,
    `order_code_id` integer UNSIGNED NOT NULL,
    `rate` numeric(5, 2) NOT NULL,
    `type` varchar(4) NOT NULL,
    `region` varchar(4) NOT NULL,
    `term` varchar(4) NOT NULL,
    `buyer_type` varchar(4) NOT NULL,
    `is_active` bool NOT NULL,
    UNIQUE (`sub_def_id`, `buyer_type`, `rate`, `is_active`)
)
;

How can I remove the uniqueness constraint?


use this:

ALTER TABLE  `newsubscriptions_orderspecification` DROP INDEX  `sub_def_id`
0

精彩评论

暂无评论...
验证码 换一张
取 消