Changes between Initial Version and Version 1 of Ticket #23577, comment 36


Ignore:
Timestamp:
Jun 12, 2023, 4:38:43 AM (11 months ago)
Author:
Steven Mapes

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #23577, comment 36

    initial v1  
    1 So I ended up created a duplicate of this ticket for issue #34647 but thanks to clavay's suggestion I managed to also get a work around by running {{{makemigrations}}}then editing the {{{CreateModel}}} and changing the name and db_table entries for all tables that were created (I use custom table names as the app name prefix breaks the DB naming convention policy that's in place for the project.
    2 
    3 I then added {{{migrations.RenameModel}}} statements for each of the models I needed to rename back, four of them, then finally had to run a {{{migrations.RunSQL}}} to perform the actual rename of the underlying databases tables.
     1So I ended up created a duplicate of this ticket for issue #34647 and I had a look at Clavay's suggestion but one of the issues here is that Django then detects the change in future migrations, at least if you rename the name and the db_table) and then it puts it back into a broken state as the SQL migrations that are generated are still wrong. So the work around needs to be run as raw SQL in order to bypass Django knowing about it.
Back to Top