#25494: db_table option doesn't work in ManyToMany fields which using through
option
------------------------------------+--------------------------------------
     Reporter:  mehranakk           |                    Owner:  nobody
         Type:  Bug                 |                   Status:  closed
    Component:  Migrations          |                  Version:  1.8
     Severity:  Normal              |               Resolution:  needsinfo
     Keywords:  db_table migration  |             Triage Stage:  Unreviewed
    Has patch:  0                   |      Needs documentation:  0
  Needs tests:  0                   |  Patch needs improvement:  0
Easy pickings:  0                   |                    UI/UX:  0
------------------------------------+--------------------------------------
Changes (by charettes):

 * status:  new => closed
 * needs_better_patch:   => 0
 * resolution:   => needsinfo
 * needs_tests:   => 0
 * needs_docs:   => 0


Comment:

 Hi mehranakk,

 I'm afraid I cannot reproduce the reported issue against the
 `stable/1.8.x` and `master` branches using PostgreSQL with the provided
 details.

 Here's the two scenarios I've tried:

 ''In two steps''

 1. Define the models with no explicit table name for the intermediary
 model.
 2. Create the initial migration via `makemigration`.
 3. Alter the intermediary model definition to include an explicit table
 name via the `db_table` option.
 4. Create the second migration using `makemigration` and assert it
 contains the appropriate `AlterModelTable` operation.
 5. Run the migrations using `migrate` and assert the intermediary table
 has the explicit table name as desired.

 ''In one step''

 1. Define the models with an explicit table name for the intermediary
 table via the `db_table` option.
 2. Create the initial migration via `makemigration` and assert the
 `CreateModel` operation has the correct `db_table` defined.
 3. Run the migrations using `migrate` and assert the intermediary table
 has the explicit table name as desired.

 Please re-open this ticket if you can provide more info. A detailed step
 by step description of the actions performed would help.

--
Ticket URL: <https://code.djangoproject.com/ticket/25494#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.638de9a2b2a79abe79327c7b81fbb89b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to