Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

django-hvad migration: How to modify old migrations? #321

Open
sowinski opened this issue Jul 7, 2022 · 0 comments
Open

django-hvad migration: How to modify old migrations? #321

sowinski opened this issue Jul 7, 2022 · 0 comments

Comments

@sowinski
Copy link

sowinski commented Jul 7, 2022

Hi,

I replaced django-hvad with django-parler (which works fine now) but I don't know how to "modify" my migration files.

I have for example this migration file:

Generated by Django 2.0 on 2018-10-30 08:15

from django.db import migrations
import django.db.models.deletion
import hvad.fields


class Migration(migrations.Migration):

    dependencies = [
        ('mycity', '0011_mydistricttranslation_slug'),
    ]

    operations = [
        migrations.AddField(
            model_name='mycity',
            name='_hvad_query',
            field=hvad.fields.SingleTranslationObject('mycity.MyCity', 'mycity.MyCityTranslation'),
        ),
        migrations.AddField(
            model_name='mydistrict',
            name='_hvad_query',
            field=hvad.fields.SingleTranslationObject('mycity.MyDistrict', 'mycity.MyDistrictTranslation'),
        ),
        migrations.AlterField(
            model_name='mycitytranslation',
            name='master',
            field=hvad.fields.MasterKey(editable=False, on_delete=django.db.models.deletion.CASCADE, related_name='translations', to='mycity.MyCity'),
        ),
        migrations.AlterField(
            model_name='mydistricttranslation',
            name='master',
            field=hvad.fields.MasterKey(editable=False, on_delete=django.db.models.deletion.CASCADE, related_name='translations', to='mycity.MyDistrict'),
        ),
    ]

If I delete the hvad package I can not run the server, because it raise an exception that it can not import hvad.

I guess I have to modify somehow this migration file. But I don't know how.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant