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.

113 lines
5.1 KiB

6 months ago
# Generated by Django 5.0.6 on 2024-06-02 04:11
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Genre',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=100, verbose_name='类型')),
],
options={
'verbose_name': '电影类型',
'verbose_name_plural': '电影类型',
'db_table': 'Genre',
},
),
migrations.CreateModel(
name='Movie',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=256, verbose_name='电影名')),
('imdb_id', models.IntegerField(verbose_name='imdb_id')),
('time', models.CharField(blank=True, max_length=256, verbose_name='时长')),
('release_time', models.CharField(blank=True, max_length=256, verbose_name='发行时间')),
('intro', models.TextField(blank=True, verbose_name='简介')),
('director', models.CharField(blank=True, max_length=256, verbose_name='导演')),
('actor', models.CharField(blank=True, max_length=256, verbose_name='演员')),
('writers', models.CharField(blank=True, max_length=256, verbose_name='编剧')),
('genre', models.ManyToManyField(to='movie.genre', verbose_name='类型')),
],
options={
'verbose_name': '电影信息',
'verbose_name_plural': '电影信息',
'db_table': 'Movie',
},
),
migrations.CreateModel(
name='Movie_hot',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('rating_number', models.IntegerField(verbose_name='评分人数')),
('movie', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='movie.movie', verbose_name='电影名')),
],
options={
'verbose_name': '最热电影',
'verbose_name_plural': '最热电影',
'db_table': 'Movie_hot',
},
),
migrations.CreateModel(
name='Movie_rating',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('score', models.FloatField(verbose_name='评分')),
('comment', models.TextField(blank=True, verbose_name='评论')),
('movie', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='movie.movie', verbose_name='电影')),
],
options={
'verbose_name': '电影评分信息',
'verbose_name_plural': '电影评分信息',
'db_table': 'Movie_rating',
},
),
migrations.CreateModel(
name='Movie_similarity',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('similarity', models.FloatField(verbose_name='相似度')),
('movie_source', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='movie_source', to='movie.movie')),
('movie_target', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='movie_target', to='movie.movie')),
],
options={
'verbose_name': '电影相似度',
'verbose_name_plural': '电影相似度',
},
),
migrations.AddField(
model_name='movie',
name='movie_similarity',
field=models.ManyToManyField(through='movie.Movie_similarity', to='movie.movie', verbose_name='相似电影'),
),
migrations.CreateModel(
name='User',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=128, unique=True, verbose_name='用户名')),
('password', models.CharField(max_length=256, verbose_name='密码')),
('email', models.EmailField(max_length=254, unique=True, verbose_name='邮箱')),
('rating_movies', models.ManyToManyField(through='movie.Movie_rating', to='movie.movie')),
],
options={
'verbose_name': '用户信息',
'verbose_name_plural': '用户信息',
'db_table': 'Usser',
},
),
migrations.AddField(
model_name='movie_rating',
name='user',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='movie.user', verbose_name='用户'),
),
]