Modify

Ticket #979 (new defect)

Opened 2 years ago

Last modified 2 years ago

Changing from ManyToMany to a CharField seeks to drop non existant tablename

Reported by: Zenobius Jiricek <zenobius.jiricek@…> Owned by: andrew
Priority: minor Milestone: The Future
Component: migrations Version: 0.7.3
Keywords: Cc:

Description

South 0.7.3
Django 1.3.1

I had a model with a ManyToMany? field that pointed at cms.Placholder.

Then I decided to change it to a CharField? that is based on a generator class providing options built from a qury of cms.Placeholder.objects.all().values('slot').distinct().

So I commented out the ManyToMany? field, inserted the new CharField? with its choices generator, and generated a migration. No errors so far.

However when I attempt to perform the migration, it complains about a non existant tablename :

django.db.utils.DatabaseError: no such table: cmsplugin_embedpagesplugin_placeholders

Looking at the migration I can see that it has mis-calculated the table name to drop.

Notice that in migration 2, I simply had to either, manually change the table name or ignore the exception.

I've attached the models.py, and both the migrations.

Attachments

models.py (1.7 KB) - added by Zenobius Jiricek <zenobius.jiricek@…> 2 years ago.
application model
0001_initial.py (4.4 KB) - added by Zenobius Jiricek <zenobius.jiricek@…> 2 years ago.
initial migration
0002_auto__add_field_embedpagesplugin_placeholders.py (3.9 KB) - added by Zenobius Jiricek <zenobius.jiricek@…> 2 years ago.

Change History

Changed 2 years ago by Zenobius Jiricek <zenobius.jiricek@…>

application model

Changed 2 years ago by Zenobius Jiricek <zenobius.jiricek@…>

initial migration

Changed 2 years ago by Zenobius Jiricek <zenobius.jiricek@…>

comment:1 Changed 2 years ago by andrew

Why didn't you have a cmsplugin_embedpagesplugin_placeholders table? It seems like you should have had one to support the previous ManyToMany?.

View

Add a comment

Modify Ticket

Action
as new
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.