Opened 10 years ago
Closed 10 years ago
#24051 closed Bug (fixed)
Tables are not created in specified tablespace when DEFAULT_TABLESPACE is specified
Reported by: | douglasjreynolds | Owned by: | nobody |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | 1.7 |
Severity: | Release blocker | Keywords: | Tablespace model |
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
When DEFAULT_TABLESPACE is specified in the project settings.py using database backend, django.db.backends.postgresql_psycopg2, the DDL does not include the 'TABLESPACE' keyword, and the table is created in the default PostgreSQL tablespace.
This does not affect the INDEX tablespace. The INDEXes are always created in the correct tablespace (both with just DEFAULT_TABLESPACE and/or DEFAULT_INDEX_TABLESPACE).
The patch is based off of Django 1.7.1.
I have attached a patch to correct this issue. It fixed the issue for me.
Attachments (1)
Change History (7)
by , 10 years ago
Attachment: | django_tablespace_patch.diff added |
---|
follow-up: 2 comment:1 by , 10 years ago
Needs tests: | set |
---|---|
Severity: | Normal → Release blocker |
Triage Stage: | Unreviewed → Accepted |
Could you add a test and release notes for 1.7.2? If you are able to send a pull request on GitHub, that will ease testing and review, thanks.
follow-up: 3 comment:2 by , 10 years ago
Replying to timgraham:
Could you add a test and release notes for 1.7.2? If you are able to send a pull request on GitHub, that will ease testing and review, thanks.
I am attempting to get a pull request ready for you on GitHub. I am not real familiar with GitHub, so bear with me.
comment:3 by , 10 years ago
Replying to douglasjreynolds:
Replying to timgraham:
Could you add a test and release notes for 1.7.2? If you are able to send a pull request on GitHub, that will ease testing and review, thanks.
I am attempting to get a pull request ready for you on GitHub. I am not real familiar with GitHub, so bear with me.
I have put the code, tests, and documentation in pull request https://github.com/django/django/pull/3796
After looking at the master branch, I saw that code had been included to correct this issue. It looks like this was caused by the new makemigration code in 1.7.
Let me know if you need anything else!
comment:4 by , 10 years ago
Needs tests: | unset |
---|
Alternate patch without creating new tests: https://github.com/django/django/pull/3798
comment:5 by , 10 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
comment:6 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Tablespace patch of django.db.backends.schema