Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#21692 closed Bug (fixed)

'CREATE TABLE' of initial migration doesn't quote table name

Reported by: Ramiro Morales Owned by: Ramiro Morales <cramm0@…>
Component: Migrations Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

If yo add a model whose table name is e.g. 'select' you get this error when running the corresponding migration:

Postgres:

LINE 1: CREATE TABLE select ("when" varchar(1) NOT NULL PRIMARY KEY)

SQLite:

near "select": syntax error

Change History (5)

comment:1 Changed 3 years ago by Ramiro Morales

Has patch: set
Triage Stage: UnreviewedAccepted

comment:2 Changed 3 years ago by Simon Charette

Triage Stage: AcceptedReady for checkin

Patch makes sense and passes tests on Py2/3 SQLite/Postgres

comment:3 Changed 3 years ago by Ramiro Morales <cramm0@…>

Owner: set to Ramiro Morales <cramm0@…>
Resolution: fixed
Status: newclosed

In 3efd1b8b939c0a600b2d63317d224ebaab766f01:

Fixed #21692 -- Quote table name when creating it.

comment:4 Changed 3 years ago by Ramiro Morales <cramm0@…>

In 61cfcec5b7d47232a1d6facbde71d4cca35986eb:

Merge pull request #2120 from ramiro/schema-creation-quoting

Fixed #21692 -- Quote table name when creating it.

comment:5 Changed 3 years ago by Ramiro Morales <cramm0@…>

In 3518e9ec1f23f0278aefea6738f9d49eb7d4fe52:

Amend test table name so it doesn't clash.

Refs #21692 and 3efd1b8b939.

Note: See TracTickets for help on using tickets.
Back to Top