2018-03-30 16:53:41 +00:00
|
|
|
# Generated by Django 2.0.3 on 2018-03-30 15:24
|
2018-01-18 17:45:00 +00:00
|
|
|
|
|
|
|
from django.conf import settings
|
|
|
|
import django.core.validators
|
|
|
|
from django.db import migrations, models
|
|
|
|
import django.db.models.deletion
|
|
|
|
|
|
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
|
|
|
|
initial = True
|
|
|
|
|
|
|
|
dependencies = [
|
|
|
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
2018-03-30 16:53:41 +00:00
|
|
|
('radio', '0002_naming_and_sorting'),
|
2018-01-18 17:45:00 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
operations = [
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='RadioProfile',
|
|
|
|
fields=[
|
|
|
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
2018-03-30 16:53:41 +00:00
|
|
|
('disabled', models.BooleanField(default=False, verbose_name='disabled state')),
|
|
|
|
('disabled_date', models.DateTimeField(blank=True, default=None, null=True, verbose_name='disabled on')),
|
|
|
|
('disabled_reason', models.TextField(blank=True, verbose_name='reason for disabling')),
|
2018-01-18 17:45:00 +00:00
|
|
|
('created_date', models.DateTimeField(auto_now_add=True, verbose_name='added on')),
|
|
|
|
('modified_date', models.DateTimeField(auto_now=True, verbose_name='last modified')),
|
|
|
|
('favorites', models.ManyToManyField(related_name='song_favorites', to='radio.Song')),
|
|
|
|
],
|
|
|
|
options={
|
|
|
|
'abstract': False,
|
|
|
|
},
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='Rating',
|
|
|
|
fields=[
|
|
|
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
|
|
('created_date', models.DateTimeField(auto_now_add=True, verbose_name='added on')),
|
|
|
|
('modified_date', models.DateTimeField(auto_now=True, verbose_name='last modified')),
|
|
|
|
('value', models.PositiveIntegerField(validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(5)], verbose_name='song rating')),
|
|
|
|
('profile', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='rating_profile', to='profiles.RadioProfile')),
|
|
|
|
('song', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='radio.Song')),
|
|
|
|
],
|
|
|
|
options={
|
|
|
|
'abstract': False,
|
|
|
|
},
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='SongRequest',
|
|
|
|
fields=[
|
|
|
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
|
|
('created_date', models.DateTimeField(auto_now_add=True, verbose_name='added on')),
|
|
|
|
('modified_date', models.DateTimeField(auto_now=True, verbose_name='last modified')),
|
|
|
|
('queued_at', models.DateTimeField(blank=True, default=None, null=True, verbose_name='song queued at')),
|
|
|
|
('played_at', models.DateTimeField(blank=True, default=None, null=True, verbose_name='song played at')),
|
|
|
|
('profile', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='request_profile', to='profiles.RadioProfile')),
|
|
|
|
('song', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='radio.Song')),
|
|
|
|
],
|
|
|
|
options={
|
2018-01-19 17:18:50 +00:00
|
|
|
'ordering': ['-created_date'],
|
2018-01-18 17:45:00 +00:00
|
|
|
},
|
|
|
|
),
|
|
|
|
migrations.AddField(
|
|
|
|
model_name='radioprofile',
|
|
|
|
name='ratings',
|
|
|
|
field=models.ManyToManyField(related_name='song_ratings', through='profiles.Rating', to='radio.Song'),
|
|
|
|
),
|
|
|
|
migrations.AddField(
|
|
|
|
model_name='radioprofile',
|
|
|
|
name='song_requests',
|
|
|
|
field=models.ManyToManyField(related_name='song_requests', through='profiles.SongRequest', to='radio.Song'),
|
|
|
|
),
|
|
|
|
migrations.AddField(
|
|
|
|
model_name='radioprofile',
|
|
|
|
name='user',
|
|
|
|
field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
|
|
|
|
),
|
|
|
|
]
|