0007_user_last_login.py 703 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# ----------------------------------------------------------------------
# Restore User.last_login
# ----------------------------------------------------------------------
# Copyright (C) 2007-2019 The NOC Project
# See LICENSE for details
# ----------------------------------------------------------------------

# Third-party modules
from django.db.models import DateTimeField

# NOC modules
from noc.core.migration.base import BaseMigration


class Migration(BaseMigration):
    def migrate(self):
        if not self.db.has_column("auth_user", "last_login"):
            self.db.add_column(
                "auth_user", "last_login", DateTimeField("Last Login", blank=True, null=True)
            )