Opened 5 years ago

Last modified 5 years ago

#31257 closed Bug

django migration has not been correctly applied for decimal_places - mysql — at Initial Version

Reported by: Zbynek Drlik Owned by: nobody
Component: Migrations Version: 2.2
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I use mysql in django and have these migration file
`
class Migration(migrations.Migration):

dependencies = [

('ft', '0010_auto_20191027_2255'),

]

operations = [

migrations.AlterField(

model_name='polozkydokl',
name='jedn_cena',
field=djmoney.models.fields.MoneyField(decimal_places=4, default=Decimal('0'), default_currency='EUR', max_digits=12, verbose_name='Jednotková cena'),

),

]

`
Migration has been already applied but in db there is still old decimal_places=3 schema
`| jedn_cena | decimal(12,3) | NO | | NULL | |
`

`
python3 manage.py sqlmigrate ft 0011_auto_20200103_1523
BEGIN;
--
-- Alter field jedn_cena on polozkydokl
--
COMMIT;

`

Change History (0)

Note: See TracTickets for help on using tickets.
Back to Top