Opened 6 years ago
Closed 6 years ago
#31257 closed Bug (worksforme)
Migrations don't apply changes for decimal_places on MySQL.
| 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 (last modified by )
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 (1)
comment:1 by , 6 years ago
| Description: | modified (diff) |
|---|---|
| Resolution: | → worksforme |
| Status: | new → closed |
| Summary: | django migration has not been correctly applied for decimal_places - mysql → Migrations don't apply changes for decimal_places on MySQL. |
Note:
See TracTickets
for help on using tickets.
I cannot reproduce this issues with
DecimalFieldordjmoney.models.fields.MoneyField.