You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
1.3 KiB

# Generated by Django 4.0.5 on 2022-06-20 11:19
2 years ago
2 years ago
from django.db import migrations, models
import django.db.models.deletion
import leftists.models
2 years ago
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Domain',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('fqdn', models.CharField(max_length=512, unique=True, verbose_name='FQDN')),
],
),
2 years ago
migrations.CreateModel(
name='ShortLink',
fields=[
('slug', models.CharField(max_length=6, primary_key=True, serialize=False, unique=True)),
('location', models.CharField(max_length=100, validators=[leftists.models.validate_location], verbose_name='short link')),
2 years ago
('to', models.URLField(max_length=2500, verbose_name='redirect to')),
('click_count', models.IntegerField(default=0)),
('domain', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='links', to='leftists.domain')),
2 years ago
],
options={
'unique_together': {('domain', 'location')},
},
),
]