Ticket #688 (closed defect: duplicate)

Opened 4 years ago

Last modified 4 years ago

schemamigration --add-index creates invisible migrations

Reported by: steve@… Owned by: andrew
Priority: major Milestone: 1.0
Component: commands Version: 0.7.2
Keywords: Cc:

Description

If you create a schemamigration to add an index the migration file name is created with a dot in it. This keeps it from being visible to migrate. If you subsequently rename the migration py file to remove the dot it is a valid python file.

Should probably generate the file w/o the dot. Unless there is a different way to specify the class.name

$  python ./manage.py schemamigration --add-index=Myapp.effective_date myapp
 + Added index for ['effective_date'] on myapp.Myapp
Created 0002_add_index_Myapp.effective_date.py. You can now apply this migration with: ./manage.py migrate myapp
$  python ./manage.py migrate myapp --list

 myapp
  (*) 0001_initial

$ ls myapp/migrations/
0001_initial.py  0001_initial.pyc  0002_add_index_Myapp.effective_date.py  __init__.py  __init__.pyc

$ cd myapp/migrations/
/home/sschwarz/feebill/myapp/migrations
/myapp/migrations$ mv 0002_add_index_Myapp.effective_date.py 0002_add_index_Myapp_effective_date.py
/myapp/migrations$ cd ..
/myapp$ cd ..
$  python ./manage.py migrate myapp --list

 myapp
  (*) 0001_initial
  ( ) 0002_add_index_Myapp_effective_date

Change History

comment:1 Changed 4 years ago by andrew

  • Status changed from new to closed
  • Resolution set to duplicate
  • Milestone set to 1.0

Duplicate of #653.

Note: See TracTickets for help on using tickets.