我通过以下方法在MySQL数据库中创建了一个表:
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`)
)
;
Run Code Online (Sandbox Code Playgroud)
如何删除唯一性约束?
Nan*_*nne 12
用这个:
ALTER TABLE `newsubscriptions_orderspecification` DROP INDEX `sub_def_id`
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4881 次 |
| 最近记录: |