Changes between Initial Version and Version 1 of Ticket #37208, comment 1
- Timestamp:
- Jul 8, 2026, 3:13:14 AM (98 minutes ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #37208, comment 1
initial v1 1 1 == A quick fix 2 I didn't changed the migration file, keep that as like: 2 3 I played with the migration files, when I changed the `db_persist=True` in my `models.py` file, I knew that if I run `makemigrations` one more time, django will create a new migration file for me which changes my VIRTUAL column to STORED, that I didn't wanted, so I did like: 4 5 1. Updated the models.py, `db_persist=True` 6 2. Run `makemigrations` one more time to have a migration file like: 3 7 {{{ 4 8 operations = [ 5 migrations.A ddField(9 migrations.AlterField( 6 10 model_name="symbol", 7 11 name="tmp", 8 12 field=models.GeneratedField( 9 db_persist= False, # 👈 NOTE, this hasn't changed13 db_persist=True, 10 14 expression=models.Q(("standard_symbol_tmp__isnull", False)), 11 15 null=True, … … 15 19 ] 16 20 }}} 21 3. I didn't want to run migrate with --fake, so I migration file to 22 {{{ 23 operations = [ 24 migrations.SeparateDatabaseAndState( 25 state_operations=[ 26 migrations.AlterField( 27 model_name="symbol", 28 name="tmp", 29 field=models.GeneratedField( 30 db_persist=True, 31 expression=models.Q(("standard_symbol_tmp__isnull", False)), 32 null=True, 33 output_field=models.BooleanField(), 34 ), 35 ), 36 ], 37 database_operations=[], # 👈 nothing runs against the DB 38 ), 39 ] 40 }}} 17 41 18 And changed the model and set `db_persist=True`, then DID NOT create new migration file, then all things worked. 19 I know I could also do a fake migration too. 42 Then when I run the `migrate`, Django's migration state updated and my DB DIDN'T CHANGED.