diff --git a/akarpov/music/migrations/0016_anonmusicuser_song_created_song_volume_and_more.py b/akarpov/music/migrations/0016_anonmusicuser_song_created_song_volume_and_more.py new file mode 100644 index 0000000..67e57d5 --- /dev/null +++ b/akarpov/music/migrations/0016_anonmusicuser_song_created_song_volume_and_more.py @@ -0,0 +1,79 @@ +# Generated by Django 4.2.8 on 2024-01-17 13:13 + +import django.contrib.postgres.fields +from django.db import migrations, models +import django.db.models.deletion +import django.utils.timezone +import uuid + + +class Migration(migrations.Migration): + dependencies = [ + ("music", "0015_usermusicprofile"), + ] + + operations = [ + migrations.CreateModel( + name="AnonMusicUser", + fields=[ + ( + "id", + models.UUIDField( + default=uuid.uuid4, + editable=False, + primary_key=True, + serialize=False, + ), + ), + ], + ), + migrations.AddField( + model_name="song", + name="created", + field=models.DateTimeField( + auto_now_add=True, default=django.utils.timezone.now + ), + preserve_default=False, + ), + migrations.AddField( + model_name="song", + name="volume", + field=django.contrib.postgres.fields.ArrayField( + base_field=models.IntegerField(), null=True, size=None + ), + ), + migrations.CreateModel( + name="AnonMusicUserHistory", + fields=[ + ( + "id", + models.BigAutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("created", models.DateTimeField(auto_now_add=True)), + ( + "song", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="anon_listeners", + to="music.song", + ), + ), + ( + "user", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="songs_listened", + to="music.anonmusicuser", + ), + ), + ], + options={ + "ordering": ["-created"], + }, + ), + ]