Primary Key creation order is incorrect.

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply
ChangHyeon Lee
Posts: 11
Joined: Wed 14 Jun 2017 05:46

Primary Key creation order is incorrect.

Post by ChangHyeon Lee » Mon 03 Dec 2018 14:35

I declared the Primary Key as follows.

-------------------------
| Test |
-------------------------
| Key1 |
| Key2 |
| Data1 |
-------------------------

When I run "Update database from Model" in efml Designer,
I expected the generated SQL to be:

CREATE TABLE TESTS (
KEY1 CHAR(2) NOT NULL,
KEY2 CHAR(2) NOT NULL,
DATA1 VARCHAR(100) NOT NULL,
PRIMARY KEY (KEY1, KEY2)
);

However, the generated SQL is as follows:

CREATE TABLE kidsbrown.TESTS (
KEY1 CHAR(2) NOT NULL,
KEY2 CHAR(2) NOT NULL,
DATA1 VARCHAR(100) NOT NULL,
PRIMARY KEY (KEY2, KEY1)
);

What's the problem?

The version I am using is 8.12.1278.

Shalex
Site Admin
Posts: 8597
Joined: Thu 14 Aug 2008 12:44

Re: Primary Key creation order is incorrect.

Post by Shalex » Wed 05 Dec 2018 19:21

Thank you for your report. We have reproduced the issue and are investigating it. We will notify you about the result.

Shalex
Site Admin
Posts: 8597
Joined: Thu 14 Aug 2008 12:44

Re: Primary Key creation order is incorrect.

Post by Shalex » Thu 10 Jan 2019 19:11

The bug with detecting order of columns in composite primary key with two or more columns by Update To Database and by Update From Database wizards in EF Core is fixed: viewtopic.php?f=2&t=38261.

Post Reply