Opened 18 months ago

Closed 18 months ago

Last modified 18 months ago

#21692 closed Bug (fixed)

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

Reported by: ramiro 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 18 months ago by ramiro

  • Has patch set
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 18 months ago by charettes

  • Triage Stage changed from Accepted to Ready for checkin

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

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

  • Owner set to Ramiro Morales <cramm0@…>
  • Resolution set to fixed
  • Status changed from new to closed

In 3efd1b8b939c0a600b2d63317d224ebaab766f01:

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

comment:4 Changed 18 months 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 18 months 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