Skip to content
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.

Quote issue to preserve the case of the column name #127

Closed
SOHELAHMED7 opened this issue Jan 2, 2023 · 1 comment · Fixed by SOHELAHMED7/yii2-openapi#9
Closed

Quote issue to preserve the case of the column name #127

SOHELAHMED7 opened this issue Jan 2, 2023 · 1 comment · Fixed by SOHELAHMED7/yii2-openapi#9

Comments

@SOHELAHMED7
Copy link
Contributor

In PgSQL, if a table is created with camel case (or other way in which case of all chars is not same) column name e.g. firstName without the quotes then it is case insensitive and is converted to e.g. firstname

In order to make it case-sensitive, column name should be quoted "firstName" everywhere it is used.

However this is not same in MySQL.

@SOHELAHMED7
Copy link
Contributor Author

-- Mysql will say error: #1060 - Duplicate column name 'firstname'

CREATE TABLE `tmp_table_2_` (
	`firstName` varchar(255) NOT NULL,
    `firstname` varchar(255) NOT NULL
)
-- Pgsql will run this successfully

CREATE TABLE `tmp_table_2_` (
	"firstName" varchar(255) NOT NULL,
    "firstname" varchar(255) NOT NULL
)

SOHELAHMED7 added a commit to SOHELAHMED7/yii2-openapi that referenced this issue Jan 2, 2023
SOHELAHMED7 added a commit to SOHELAHMED7/yii2-openapi that referenced this issue Jan 3, 2023
…e-case-of-the-column-name

Draft - Fix issue - Quote issue to preserve the case of the column name cebe#127
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
1 participant