# ADD CONSTRAINT Duplicate Columns

**URL:** <https://forum.liquibase.org/t/add-constraint-duplicate-columns/5512>\
**Category:** General Discussion\
**Created:** [May 26, 2021, 5:15am UTC](https://forum.liquibase.org/t/add-constraint-duplicate-columns/5512 "2021-05-26T05:15:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![thatoneguy](https://avatars.discourse-cdn.com/v4/letter/t/c67d28/32.png) [@thatoneguy](https://forum.liquibase.org/u/thatoneguy)\
**Post date:** [May 26, 2021, 5:15am UTC](https://forum.liquibase.org/t/add-constraint-duplicate-columns/5512/1 "2021-05-26T05:15:58Z")

</div>

MySQL 8.0

I have an issue with generated change logs from both generateChangeLog and diffChangeLog output a changeset for a unique index with the column listed twice in the statement which causes MySQL to fail

```
-- changeset x:1622005346024-5
ALTER TABLE im.taba ADD CONSTRAINT name_UNIQUE UNIQUE (name, name);

-- changeset x:1622005346024-6
CREATE UNIQUE INDEX name_UNIQUE ON im.taba(name);

```

this is the table create statement, minus extra stuff

```
CREATE TABLE `taba` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`name` VARCHAR(255) NULL DEFAULT NULL COLLATE 'utf8mb4_0900_ai_ci',
`tt` INT(11) NULL DEFAULT NULL,
CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `name_UNIQUE` (`name`) USING BTREE,
INDEX `taba_FK_tt` (`tt`) USING BTREE,
CONSTRAINT `taba_FK_tt` FOREIGN KEY (`tt`) REFERENCES `im`.`tt` (`id`) ON UPDATE NO ACTION ON DELETE NO ACTION
)
COLLATE='utf8mb4_0900_ai_ci'
ENGINE=InnoDB
;
```

---

<div class="post-metadata">

**Author:** ![aditi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.liquibase.org/aditi/32/356_2.png) [@aditi](https://forum.liquibase.org/u/aditi)\
**Post date:** [June 2, 2021, 7:30pm UTC](https://forum.liquibase.org/t/add-constraint-duplicate-columns/5512/2 "2021-06-02T19:30:22Z")

</div>

H @thatoneguy ,

What exact issue are you facing? What exact error you are getting? Also, please provide the command that you are using to obtain the output.

Thanks,  
@aditi
