ArchiveBox/archivebox/api/migrations/0001_initial.py

30 lines
968 B
Python
Raw Normal View History

# Generated by Django 4.2.11 on 2024-04-25 04:19
2024-04-09 23:29:24 +00:00
import api.models
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import uuid
2024-04-09 23:29:24 +00:00
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='APIToken',
2024-04-09 23:29:24 +00:00
fields=[
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
('token', models.CharField(default=api.models.generate_secret_token, max_length=32, unique=True)),
2024-04-09 23:29:24 +00:00
('created', models.DateTimeField(auto_now_add=True)),
('expires', models.DateTimeField(blank=True, null=True)),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
2024-04-09 23:29:24 +00:00
],
),
]