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

[lib] Revert django-axe 4.5.3 Model removale of trusted column #1971

Merged
merged 2 commits into from
Apr 2, 2021
Merged

Conversation

romainr
Copy link
Contributor

@romainr romainr commented Apr 2, 2021

Here we revert jazzband/django-axes@60f2a8e
to put back the trusted column in the model.

But we don't delete the 0005 migration to avoid limbo in case it was
already applied.

Here we revert jazzband/django-axes@60f2a8e
to put back the `trusted` column in the model.

But we don't delete the 0005 migration to avoid limbo in case it was
already applied.
@romainr romainr self-assigned this Apr 2, 2021
@romainr
Copy link
Contributor Author

romainr commented Apr 2, 2021

omain@unreal:~/tmp/hue-4.9.0$ ls build/env/lib/python2.7/site-packages/django_axes-4.5.4-py2.7.egg/axes/migrations/ -l
total 60
-rw-rw-r-- 1 romain romain 2344 Apr  2 06:45 0001_initial.py
-rw-rw-r-- 1 romain romain 2020 Apr  2 06:45 0001_initial.pyc
-rw-rw-r-- 1 romain romain 1743 Apr  2 06:45 0002_auto_20151217_2044.py
-rw-rw-r-- 1 romain romain 1513 Apr  2 06:45 0002_auto_20151217_2044.pyc
-rw-rw-r-- 1 romain romain 1968 Apr  2 06:45 0003_auto_20160322_0929.py
-rw-rw-r-- 1 romain romain 1675 Apr  2 06:45 0003_auto_20160322_0929.pyc
-rw-rw-r-- 1 romain romain 2083 Apr  2 06:45 0004_auto_20181024_1538.py
-rw-rw-r-- 1 romain romain 1759 Apr  2 06:45 0004_auto_20181024_1538.pyc
-rw-rw-r-- 1 romain romain  333 Apr  2 06:45 0005_remove_accessattempt_trusted.py
-rw-rw-r-- 1 romain romain  788 Apr  2 06:45 0005_remove_accessattempt_trusted.pyc
-rw-rw-r-- 1 romain romain  433 Apr  2 06:45 0006_add_accessattempt_trusted.py
-rw-rw-r-- 1 romain romain  885 Apr  2 06:45 0006_add_accessattempt_trusted.pyc
-rw-rw-r-- 1 romain romain  482 Apr  2 06:50 0007_auto_20210402_0650.py
-rw-rw-r-- 1 romain romain 1008 Apr  2 06:50 0007_auto_20210402_0650.pyc
-rw-rw-r-- 1 romain romain    0 Apr  2 06:45 __init__.py
-rw-rw-r-- 1 romain romain  207 Apr  2 06:45 __init__.pyc
romain@unreal:~/tmp/hue-4.9.0$ less build/env/lib/python2.7/site-packages/django_axes-4.5.4-py2.7.egg/axes/migrations/0007_auto_20210402_0650.py 
romain@unreal:~/tmp/hue-4.9.0$ less build/env/lib/python2.7/site-packages/django_axes-4.5.4-py2.7.egg/axes/migrations/0006_add_accessattempt_trusted.py
romain@unreal:~/tmp/hue-4.9.0$ ^C
romain@unreal:~/tmp/hue-4.9.0$ cat build/env/lib/python2.7/site-packages/django_axes-4.5.4-py2.7.egg/axes/migrations/0006_add_accessattempt_trusted.py
# Revert field drop to keep the DB backward compatible with old Hue


from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('axes', '0005_remove_accessattempt_trusted'),
    ]

    operations = [
        migrations.AddField(
            model_name='accessattempt',
            name='trusted',
            field=models.BooleanField(default=False),
        ),
    ]
    
    
romain@unreal:~/tmp/hue-4.9.0$ cat build/env/lib/python2.7/site-packages/django_axes-4.5.4-py2.7.egg/axes/migrations/0007_auto_20210402_0650.py
# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2021-04-02 06:50
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('axes', '0006_add_accessattempt_trusted'),
    ]

    operations = [
        migrations.AlterField(
            model_name='accessattempt',
            name='trusted',
            field=models.BooleanField(db_index=True, default=False),
        ),
    ]

To avoid any new auto generated migration
@romainr
Copy link
Contributor Author

romainr commented Apr 2, 2021

Now good post make apps:

ls build/env/lib/python2.7/site-packages/django_axes-4.5.4-py2.7.egg/axes/migrations/ -l
total 52
-rw-rw-r-- 1 romain romain 2344 Apr  2 07:00 0001_initial.py
-rw-rw-r-- 1 romain romain 2020 Apr  2 07:00 0001_initial.pyc
-rw-rw-r-- 1 romain romain 1743 Apr  2 07:00 0002_auto_20151217_2044.py
-rw-rw-r-- 1 romain romain 1513 Apr  2 07:00 0002_auto_20151217_2044.pyc
-rw-rw-r-- 1 romain romain 1968 Apr  2 07:00 0003_auto_20160322_0929.py
-rw-rw-r-- 1 romain romain 1675 Apr  2 07:00 0003_auto_20160322_0929.pyc
-rw-rw-r-- 1 romain romain 2083 Apr  2 07:00 0004_auto_20181024_1538.py
-rw-rw-r-- 1 romain romain 1759 Apr  2 07:00 0004_auto_20181024_1538.pyc
-rw-rw-r-- 1 romain romain  333 Apr  2 07:00 0005_remove_accessattempt_trusted.py
-rw-rw-r-- 1 romain romain  788 Apr  2 07:00 0005_remove_accessattempt_trusted.pyc
-rw-rw-r-- 1 romain romain  448 Apr  2 07:00 0006_add_accessattempt_trusted.py
-rw-rw-r-- 1 romain romain  913 Apr  2 07:00 0006_add_accessattempt_trusted.pyc
-rw-rw-r-- 1 romain romain    0 Apr  2 07:00 __init__.py
-rw-rw-r-- 1 romain romain  207 Apr  2 07:00 __init__.pyc

Copy link
Collaborator

@wing2fly wing2fly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested, and it won't remove the column 'trusted' again.

@romainr romainr merged commit 0e419a7 into master Apr 2, 2021
@romainr romainr deleted the axes branch April 2, 2021 17:25
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

Successfully merging this pull request may close these issues.

None yet

2 participants