69 lines
2.4 KiB
Python
69 lines
2.4 KiB
Python
# Generated by Django 3.0.5 on 2020-04-24 16:01
|
|
|
|
from django.db import migrations, models
|
|
import django.db.models.deletion
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
initial = True
|
|
|
|
dependencies = [
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name='Anime',
|
|
fields=[
|
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('titolo', models.CharField(max_length=120)),
|
|
('descrizione', models.CharField(max_length=120)),
|
|
],
|
|
options={
|
|
'verbose_name': 'Anime',
|
|
'verbose_name_plural': 'Anime',
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='GenereAnime',
|
|
fields=[
|
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('genere', models.CharField(max_length=120)),
|
|
],
|
|
options={
|
|
'verbose_name': 'Genere',
|
|
'verbose_name_plural': 'Generi',
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='Stagioni',
|
|
fields=[
|
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('numero_stagione', models.IntegerField()),
|
|
('anime', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='animestagioni', to='Anime.Anime')),
|
|
],
|
|
options={
|
|
'verbose_name': 'Stagione',
|
|
'verbose_name_plural': 'Stagioni',
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='Episodi',
|
|
fields=[
|
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('numero_episodio', models.IntegerField()),
|
|
('streaming_link', models.URLField()),
|
|
('stagione', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='stagione', to='Anime.Stagioni')),
|
|
],
|
|
options={
|
|
'verbose_name': 'Episodio',
|
|
'verbose_name_plural': 'Episodi',
|
|
},
|
|
),
|
|
migrations.AddField(
|
|
model_name='anime',
|
|
name='genere',
|
|
field=models.ManyToManyField(to='Anime.GenereAnime'),
|
|
),
|
|
]
|