Skip to content

Commit

Permalink
add migration
Browse files Browse the repository at this point in the history
  • Loading branch information
YaroslavBordovoy committed Dec 8, 2024
1 parent 9cbe6ef commit a20e297
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions cinema/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Generated by Django 4.1 on 2024-12-08 14:51

from django.db import migrations, models


class Migration(migrations.Migration):

initial = True

dependencies = [
]

operations = [
migrations.CreateModel(
name='Actor',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('first_name', models.CharField(max_length=255)),
('last_name', models.CharField(max_length=255)),
],
),
migrations.CreateModel(
name='CinemaHall',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=255)),
('rows', models.PositiveIntegerField()),
('seats_in_row', models.PositiveIntegerField()),
],
),
migrations.CreateModel(
name='Genre',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=255, unique=True)),
],
),
migrations.CreateModel(
name='Movie',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=255)),
('description', models.TextField()),
('duration', models.IntegerField()),
('actors', models.ManyToManyField(related_name='movies', to='cinema.actor')),
('genres', models.ManyToManyField(related_name='movies', to='cinema.genre')),
],
),
]

0 comments on commit a20e297

Please sign in to comment.