2
0

0001_initial.py 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. # Generated by Django 3.2.6 on 2021-12-04 01:50
  2. import datetime
  3. from django.conf import settings
  4. from django.db import migrations, models
  5. import django.db.models.deletion
  6. class Migration(migrations.Migration):
  7. initial = True
  8. dependencies = [
  9. migrations.swappable_dependency(settings.AUTH_USER_MODEL),
  10. ]
  11. operations = [
  12. migrations.CreateModel(
  13. name='Playlist',
  14. fields=[
  15. ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  16. ('channel_id', models.TextField(blank=True)),
  17. ('channel_name', models.TextField(blank=True)),
  18. ('is_yt_mix', models.BooleanField(default=False)),
  19. ('playlist_id', models.CharField(max_length=150)),
  20. ('name', models.CharField(blank=True, max_length=150)),
  21. ('thumbnail_url', models.TextField(blank=True)),
  22. ('description', models.TextField(default='No description')),
  23. ('video_count', models.IntegerField(default=0)),
  24. ('published_at', models.DateTimeField(blank=True)),
  25. ('is_private_on_yt', models.BooleanField(default=False)),
  26. ('playlist_yt_player_HTML', models.TextField(blank=True)),
  27. ('playlist_duration', models.CharField(blank=True, max_length=69)),
  28. ('playlist_duration_in_seconds', models.IntegerField(default=0)),
  29. ('started_on', models.DateTimeField(auto_now_add=True, null=True)),
  30. ('last_watched', models.DateTimeField(auto_now_add=True, null=True)),
  31. ('user_notes', models.TextField(default='')),
  32. ('user_label', models.CharField(default='', max_length=100)),
  33. ('marked_as', models.CharField(default='none', max_length=100)),
  34. ('is_favorite', models.BooleanField(blank=True, default=False)),
  35. ('num_of_accesses', models.IntegerField(default='0')),
  36. ('last_accessed_on', models.DateTimeField(default=datetime.datetime.now)),
  37. ('is_user_owned', models.BooleanField(default=True)),
  38. ('auto_check_for_updates', models.BooleanField(default=False)),
  39. ('is_in_db', models.BooleanField(default=False)),
  40. ('created_at', models.DateTimeField(auto_now_add=True)),
  41. ('updated_at', models.DateTimeField(auto_now=True)),
  42. ('last_full_scan_at', models.DateTimeField(auto_now_add=True)),
  43. ('has_playlist_changed', models.BooleanField(default=False)),
  44. ('has_new_updates', models.BooleanField(default=False)),
  45. ],
  46. ),
  47. migrations.CreateModel(
  48. name='Video',
  49. fields=[
  50. ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  51. ('video_id', models.CharField(max_length=100)),
  52. ('name', models.CharField(blank=True, max_length=100)),
  53. ('duration', models.CharField(blank=True, max_length=100)),
  54. ('duration_in_seconds', models.IntegerField(default=0)),
  55. ('thumbnail_url', models.TextField(blank=True)),
  56. ('published_at', models.DateTimeField(blank=True, null=True)),
  57. ('description', models.TextField(default='')),
  58. ('has_cc', models.BooleanField(blank=True, default=False, null=True)),
  59. ('liked', models.BooleanField(default=False)),
  60. ('public_stats_viewable', models.BooleanField(default=True)),
  61. ('view_count', models.IntegerField(default=0)),
  62. ('like_count', models.IntegerField(default=0)),
  63. ('dislike_count', models.IntegerField(default=0)),
  64. ('comment_count', models.IntegerField(default=0)),
  65. ('yt_player_HTML', models.TextField(blank=True)),
  66. ('channel_id', models.TextField(blank=True)),
  67. ('channel_name', models.TextField(blank=True)),
  68. ('is_unavailable_on_yt', models.BooleanField(default=False)),
  69. ('was_deleted_on_yt', models.BooleanField(default=False)),
  70. ('is_planned_to_watch', models.BooleanField(default=False)),
  71. ('is_marked_as_watched', models.BooleanField(default=False)),
  72. ('is_favorite', models.BooleanField(blank=True, default=False)),
  73. ('num_of_accesses', models.IntegerField(default=0)),
  74. ('user_label', models.CharField(blank=True, max_length=100)),
  75. ('user_notes', models.TextField(blank=True)),
  76. ('created_at', models.DateTimeField(auto_now_add=True)),
  77. ('updated_at', models.DateTimeField(auto_now=True)),
  78. ('video_details_modified', models.BooleanField(default=False)),
  79. ('video_details_modified_at', models.DateTimeField(auto_now_add=True)),
  80. (
  81. 'untube_user',
  82. models.ForeignKey(
  83. null=True,
  84. on_delete=django.db.models.deletion.CASCADE,
  85. related_name='videos',
  86. to=settings.AUTH_USER_MODEL
  87. )
  88. ),
  89. ],
  90. ),
  91. migrations.CreateModel(
  92. name='Tag',
  93. fields=[
  94. ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  95. ('name', models.CharField(max_length=69)),
  96. ('times_viewed', models.IntegerField(default=0)),
  97. ('times_viewed_per_week', models.IntegerField(default=0)),
  98. ('last_views_reset', models.DateTimeField(default=datetime.datetime.now)),
  99. ('created_at', models.DateTimeField(auto_now_add=True)),
  100. ('updated_at', models.DateTimeField(auto_now=True)),
  101. (
  102. 'created_by',
  103. models.ForeignKey(
  104. null=True,
  105. on_delete=django.db.models.deletion.CASCADE,
  106. related_name='playlist_tags',
  107. to=settings.AUTH_USER_MODEL
  108. )
  109. ),
  110. ],
  111. ),
  112. migrations.CreateModel(
  113. name='PlaylistItem',
  114. fields=[
  115. ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  116. ('playlist_item_id', models.CharField(max_length=100)),
  117. ('video_position', models.IntegerField(blank=True)),
  118. ('published_at', models.DateTimeField(default=datetime.datetime.now)),
  119. ('channel_id', models.CharField(max_length=250, null=True)),
  120. ('channel_name', models.CharField(max_length=250, null=True)),
  121. ('is_duplicate', models.BooleanField(default=False)),
  122. ('is_marked_as_watched', models.BooleanField(blank=True, default=False)),
  123. ('num_of_accesses', models.IntegerField(default=0)),
  124. ('created_at', models.DateTimeField(auto_now_add=True)),
  125. ('updated_at', models.DateTimeField(auto_now=True)),
  126. (
  127. 'playlist',
  128. models.ForeignKey(
  129. null=True,
  130. on_delete=django.db.models.deletion.CASCADE,
  131. related_name='playlist_items',
  132. to='main.playlist'
  133. )
  134. ),
  135. ('video', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='main.video')),
  136. ],
  137. ),
  138. migrations.AddField(
  139. model_name='playlist',
  140. name='tags',
  141. field=models.ManyToManyField(related_name='playlists', to='main.Tag'),
  142. ),
  143. migrations.AddField(
  144. model_name='playlist',
  145. name='untube_user',
  146. field=models.ForeignKey(
  147. null=True,
  148. on_delete=django.db.models.deletion.CASCADE,
  149. related_name='playlists',
  150. to=settings.AUTH_USER_MODEL
  151. ),
  152. ),
  153. migrations.AddField(
  154. model_name='playlist',
  155. name='videos',
  156. field=models.ManyToManyField(related_name='playlists', to='main.Video'),
  157. ),
  158. migrations.CreateModel(
  159. name='Pin',
  160. fields=[
  161. ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  162. ('kind', models.CharField(max_length=100)),
  163. (
  164. 'playlist',
  165. models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='main.playlist')
  166. ),
  167. (
  168. 'untube_user',
  169. models.ForeignKey(
  170. null=True,
  171. on_delete=django.db.models.deletion.CASCADE,
  172. related_name='pins',
  173. to=settings.AUTH_USER_MODEL
  174. )
  175. ),
  176. ('video', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='main.video')),
  177. ],
  178. ),
  179. ]