From c40331fcc1653d1f28089f3cffb9ed1f6c3e1438 Mon Sep 17 00:00:00 2001 From: PCoder Date: Mon, 6 May 2019 08:07:26 +0200 Subject: [PATCH] Add deleteduser model --- membership/migrations/0009_deleteduser.py | 25 +++++++++++++++++++++++ membership/models.py | 9 ++++++++ 2 files changed, 34 insertions(+) create mode 100644 membership/migrations/0009_deleteduser.py diff --git a/membership/migrations/0009_deleteduser.py b/membership/migrations/0009_deleteduser.py new file mode 100644 index 00000000..146d3847 --- /dev/null +++ b/membership/migrations/0009_deleteduser.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.4 on 2019-05-06 06:06 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('membership', '0008_change_user_id_to_customer_id_in_djangocms_blog'), + ] + + operations = [ + migrations.CreateModel( + name='DeletedUser', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('user_id', models.PositiveIntegerField()), + ('name', models.CharField(max_length=254)), + ('email', models.EmailField(max_length=254, unique=True)), + ('deleted_at', models.DateTimeField(auto_now_add=True)), + ], + ), + ] diff --git a/membership/models.py b/membership/models.py index c5e83735..1a622bd5 100644 --- a/membership/models.py +++ b/membership/models.py @@ -265,6 +265,15 @@ class CreditCards(models.Model): pass +class DeletedUser(models.Model): + user_id = models.PositiveIntegerField() + + # why 254 ? => to be consistent with legacy code + name = models.CharField(max_length=254) + email = models.EmailField(unique=True, max_length=254) + deleted_at = models.DateTimeField(auto_now_add=True) + + class Calendar(models.Model): datebooked = models.DateField() user = models.ForeignKey(CustomUser)