I have moved my table from app_a
to other app_b
using db_table
. I initially added meta information as,
# app_b.models.ppy
class Table(models.Model)
# all fields
class Meta:
db_table = 'app_a_table'
app_label = 'app_a'
If I make any changes in this table in app_b
, migrations is not generating new migration file under migration folder.
It says.
No changes detected in app 'app_b'
I tried from this ans, and commented app_label = 'app_a'
. Now after migration it detects the changes and create the migration file.
Then I execute python manage.py migrate
command, it is constantly asking to delete original table app_a_table
.
The following content types are stale and need to be deleted:
app_a | table
Any objects related to these content types by a foreign key will also
be deleted. Are you sure you want to delete these content types?
If you're unsure, answer 'no'.
Type 'yes' to continue, or 'no' to cancel: no
How do I suppress this notification? How do I tell django migration that this table exists in different app?
After I moved my table from app_a
to other app_b
using db_table
and app_label
.
Migrations are working if I run them only for app_a
.
python manage.py makemigrations app_a
This command run migration for app_b