Graphs and tables for your Spotify account.
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.

77 lines
2.9 KiB

  1. from django.db import migrations, models
  2. import django.db.models.deletion
  3. class Migration(migrations.Migration):
  4. initial = True
  5. dependencies = [
  6. ]
  7. operations = [
  8. migrations.CreateModel(
  9. name='Artist',
  10. fields=[
  11. ('artist_id', models.CharField(max_length=30, primary_key=True, serialize=False)),
  12. ('name', models.CharField(max_length=50, unique=True)),
  13. ('genre', models.CharField(max_length=20)),
  14. ],
  15. options={
  16. 'verbose_name_plural': 'Artists',
  17. 'verbose_name': 'Artist',
  18. },
  19. ),
  20. migrations.CreateModel(
  21. name='Track',
  22. fields=[
  23. ('track_id', models.CharField(max_length=30, primary_key=True, serialize=False)),
  24. ('year', models.PositiveSmallIntegerField()),
  25. ('popularity', models.PositiveSmallIntegerField()),
  26. ('runtime', models.PositiveSmallIntegerField()),
  27. ('name', models.CharField(max_length=75)),
  28. ],
  29. options={
  30. 'verbose_name_plural': 'Tracks',
  31. 'verbose_name': 'Track',
  32. },
  33. ),
  34. migrations.CreateModel(
  35. name='User',
  36. fields=[
  37. ('user_id', models.CharField(max_length=30, primary_key=True, serialize=False)),
  38. ],
  39. options={
  40. 'verbose_name_plural': 'Users',
  41. 'verbose_name': 'User',
  42. },
  43. ),
  44. migrations.CreateModel(
  45. name='AudioFeatures',
  46. fields=[
  47. ('track', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to='spotifyvis.Track')),
  48. ('danceability', models.DecimalField(decimal_places=2, max_digits=2)),
  49. ('energy', models.DecimalField(decimal_places=2, max_digits=2)),
  50. ('loudness', models.DecimalField(decimal_places=2, max_digits=2)),
  51. ('speechiness', models.DecimalField(decimal_places=2, max_digits=2)),
  52. ('acousticness', models.DecimalField(decimal_places=2, max_digits=2)),
  53. ('instrumentalness', models.DecimalField(decimal_places=2, max_digits=2)),
  54. ('valence', models.DecimalField(decimal_places=2, max_digits=2)),
  55. ('tempo', models.DecimalField(decimal_places=2, max_digits=2)),
  56. ],
  57. options={
  58. 'verbose_name_plural': 'AudioFeatures',
  59. 'verbose_name': 'AudioFeatures',
  60. },
  61. ),
  62. migrations.AddField(
  63. model_name='track',
  64. name='artists',
  65. field=models.ManyToManyField(blank=True, to='spotifyvis.Artist'),
  66. ),
  67. migrations.AddField(
  68. model_name='track',
  69. name='users',
  70. field=models.ManyToManyField(blank=True, to='spotifyvis.User'),
  71. ),
  72. ]