mirror of
https://gitlab.crans.org/mediatek/med.git
synced 2024-12-26 17:42:23 +00:00
45 lines
1.9 KiB
Python
45 lines
1.9 KiB
Python
# -*- coding: utf-8 -*-
|
|
from __future__ import unicode_literals
|
|
|
|
from django.db import migrations, models
|
|
import django.db.models.deletion
|
|
from django.conf import settings
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name='User',
|
|
fields=[
|
|
('id', models.AutoField(serialize=False, verbose_name='ID', primary_key=True, auto_created=True)),
|
|
('password', models.CharField(max_length=128, verbose_name='password')),
|
|
('last_login', models.DateTimeField(blank=True, verbose_name='last login', null=True)),
|
|
('name', models.CharField(max_length=255)),
|
|
('surname', models.CharField(max_length=255)),
|
|
('email', models.EmailField(max_length=254)),
|
|
('state', models.IntegerField(default=0, choices=[(0, 'STATE_ACTIVE'), (1, 'STATE_DISABLED'), (2, 'STATE_ARCHIVE')])),
|
|
('pseudo', models.CharField(max_length=32, unique=True)),
|
|
('registered', models.DateTimeField(auto_now_add=True)),
|
|
('admin', models.BooleanField(default=False)),
|
|
],
|
|
options={
|
|
'abstract': False,
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='Request',
|
|
fields=[
|
|
('id', models.AutoField(serialize=False, verbose_name='ID', primary_key=True, auto_created=True)),
|
|
('type', models.CharField(max_length=2, choices=[('PW', 'Mot de passe'), ('EM', 'Email')])),
|
|
('token', models.CharField(max_length=32)),
|
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
|
('expires_at', models.DateTimeField()),
|
|
('user', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)),
|
|
],
|
|
),
|
|
]
|