2017-06-23 21:00:42 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
|
|
|
from django.db import migrations, models
|
|
|
|
from django.conf import settings
|
|
|
|
import django.utils.timezone
|
|
|
|
|
|
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
|
|
|
|
dependencies = [
|
|
|
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
2018-06-09 13:36:16 +00:00
|
|
|
("music", "0004_track_tags"),
|
2017-06-23 21:00:42 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
operations = [
|
|
|
|
migrations.CreateModel(
|
2018-06-09 13:36:16 +00:00
|
|
|
name="RadioSession",
|
2017-06-23 21:00:42 +00:00
|
|
|
fields=[
|
2018-06-09 13:36:16 +00:00
|
|
|
(
|
|
|
|
"id",
|
|
|
|
models.AutoField(
|
|
|
|
verbose_name="ID",
|
|
|
|
primary_key=True,
|
|
|
|
serialize=False,
|
|
|
|
auto_created=True,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
("radio_type", models.CharField(max_length=50)),
|
|
|
|
(
|
|
|
|
"creation_date",
|
|
|
|
models.DateTimeField(default=django.utils.timezone.now),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"user",
|
|
|
|
models.ForeignKey(
|
|
|
|
related_name="radio_sessions",
|
|
|
|
blank=True,
|
|
|
|
to=settings.AUTH_USER_MODEL,
|
|
|
|
null=True,
|
|
|
|
on_delete=models.CASCADE,
|
|
|
|
),
|
|
|
|
),
|
2017-06-23 21:00:42 +00:00
|
|
|
],
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
2018-06-09 13:36:16 +00:00
|
|
|
name="RadioSessionTrack",
|
2017-06-23 21:00:42 +00:00
|
|
|
fields=[
|
2018-06-09 13:36:16 +00:00
|
|
|
(
|
|
|
|
"id",
|
|
|
|
models.AutoField(
|
|
|
|
verbose_name="ID",
|
|
|
|
primary_key=True,
|
|
|
|
serialize=False,
|
|
|
|
auto_created=True,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
("position", models.IntegerField(default=1)),
|
|
|
|
(
|
|
|
|
"session",
|
|
|
|
models.ForeignKey(
|
|
|
|
to="radios.RadioSession",
|
|
|
|
related_name="session_tracks",
|
|
|
|
on_delete=models.CASCADE,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"track",
|
|
|
|
models.ForeignKey(
|
|
|
|
to="music.Track",
|
|
|
|
related_name="radio_session_tracks",
|
|
|
|
on_delete=models.CASCADE,
|
|
|
|
),
|
|
|
|
),
|
2017-06-23 21:00:42 +00:00
|
|
|
],
|
2018-06-09 13:36:16 +00:00
|
|
|
options={"ordering": ("session", "position")},
|
2017-06-23 21:00:42 +00:00
|
|
|
),
|
|
|
|
migrations.AlterUniqueTogether(
|
2018-06-09 13:36:16 +00:00
|
|
|
name="radiosessiontrack", unique_together=set([("session", "position")])
|
2017-06-23 21:00:42 +00:00
|
|
|
),
|
|
|
|
]
|