Bug #91277 Forward Engineer SQL Create Script can't export PRIMARY KEY's collation
Submitted: 15 Jun 2018 9:21 Modified: 15 Jun 2018 10:24
Reporter: Tsubasa Tanaka (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Workbench: Modeling Severity:S3 (Non-critical)
Version:8.0.11-rc OS:Microsoft Windows (10)
Assigned to: CPU Architecture:x86

[15 Jun 2018 9:21] Tsubasa Tanaka
Description:
Forward Engineer SQL Create Script can't export PRIMARY KEY's collation.

Descending PRIMARY KEY (like "PRIMARY KEY (id DESC)") has been exported without ASC|DESC definition.

How to repeat:
Put following SQL into "test.sql".

```
CREATE TABLE t1 (num int unsigned NOT NULL, PRIMARY KEY (num DESC));
```

Import it into MySQL Workbench.

- File
  - New Model
- File
  - Import
    - Reverse Engineer MySQL Create Script
      - Choose "test.sql"

Imported definition has descending PRIMARY KEY correctly.
(Can confirm open "t1" table and click "Indexes")

But Export this into SQL Script, I lose "DESC" keyword.

- File
  - Export
    - Forward Engineer SQL Create Script

```
-- -----------------------------------------------------
-- Table `mydb`.`t1`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `mydb`.`t1` (
  `num` INT UNSIGNED NOT NULL,
  PRIMARY KEY (`num`));
```
[15 Jun 2018 10:24] MySQL Verification Team
Hello Tanaka-San,

Thank you for the report and feedback!

Thanks,
Umesh