Page 1 of 1

Primary Key creation order is incorrect.

Posted: Mon 03 Dec 2018 14:35
by ChangHyeon Lee
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.

Re: Primary Key creation order is incorrect.

Posted: Wed 05 Dec 2018 19:21
by Shalex
Thank you for your report. We have reproduced the issue and are investigating it. We will notify you about the result.

Re: Primary Key creation order is incorrect.

Posted: Thu 10 Jan 2019 19:11
by Shalex
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.