PageRenderTime 58ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/whambush/apps/videos/migrations/0034_auto__del_field_flag_video.py

https://gitlab.com/urbanjunglestudio/whambush-api
Python | 161 lines | 147 code | 10 blank | 4 comment | 0 complexity | 31a94ecb132017d85f0a9924194a995c MD5 | raw file
  1. # -*- coding: utf-8 -*-
  2. from south.utils import datetime_utils as datetime
  3. from south.db import db
  4. from south.v2 import SchemaMigration
  5. from django.db import models
  6. class Migration(SchemaMigration):
  7. def forwards(self, orm):
  8. # Deleting field 'Flag.video'
  9. db.delete_column(u'videos_flag', 'video_id')
  10. def backwards(self, orm):
  11. # User chose to not deal with backwards NULL issues for 'Flag.video'
  12. raise RuntimeError("Cannot reverse this migration. 'Flag.video' and its values cannot be restored.")
  13. # The following code is provided here to aid in writing a correct migration # Adding field 'Flag.video'
  14. db.add_column(u'videos_flag', 'video',
  15. self.gf('django.db.models.fields.related.ForeignKey')(to=orm['videos.Video']),
  16. keep_default=False)
  17. models = {
  18. u'accounts.follow': {
  19. 'Meta': {'unique_together': "(('from_user', 'to_user'),)", 'object_name': 'Follow'},
  20. 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
  21. 'from_user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'follow_set_from'", 'to': u"orm['accounts.WhamUser']"}),
  22. u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  23. 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
  24. 'to_user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'follow_set_to'", 'to': u"orm['accounts.WhamUser']"})
  25. },
  26. u'accounts.whamuser': {
  27. 'Meta': {'ordering': "['username']", 'object_name': 'WhamUser'},
  28. 'birthday': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
  29. 'changed_email_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
  30. 'country': ('django.db.models.fields.CharField', [], {'max_length': '2'}),
  31. 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
  32. 'description': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
  33. 'email': ('django.db.models.fields.EmailField', [], {'unique': 'True', 'max_length': '75', 'blank': 'True'}),
  34. 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
  35. 'following': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'followed_by'", 'symmetrical': 'False', 'through': u"orm['accounts.Follow']", 'to': u"orm['accounts.WhamUser']"}),
  36. 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}),
  37. u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  38. 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
  39. 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
  40. 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
  41. 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
  42. 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
  43. 'linked_user': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': u"orm['accounts.WhamUser']", 'null': 'True', 'blank': 'True'}),
  44. 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
  45. 'profile_picture': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
  46. 'rank': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
  47. 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}),
  48. 'user_type': ('django.db.models.fields.IntegerField', [], {'default': '0', 'blank': 'True'}),
  49. 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
  50. },
  51. u'auth.group': {
  52. 'Meta': {'object_name': 'Group'},
  53. u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  54. 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
  55. 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
  56. },
  57. u'auth.permission': {
  58. 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'},
  59. 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
  60. 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}),
  61. u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  62. 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
  63. },
  64. u'contenttypes.contenttype': {
  65. 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
  66. 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
  67. u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  68. 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
  69. 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
  70. },
  71. u'hashtags.hashtag': {
  72. 'Meta': {'object_name': 'Hashtag'},
  73. 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
  74. u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  75. 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
  76. 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '200'})
  77. },
  78. u'missions.mission': {
  79. 'Meta': {'object_name': 'Mission'},
  80. 'added_by': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounts.WhamUser']"}),
  81. 'bananas': ('django.db.models.fields.IntegerField', [], {'default': '0', 'blank': 'True'}),
  82. 'country': ('django.db.models.fields.CharField', [], {'max_length': '2'}),
  83. 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
  84. 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
  85. 'end_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
  86. 'icon_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
  87. u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  88. 'is_push_sent': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
  89. 'is_videos_ranked': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
  90. 'linked_video': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'linked_video_mission'", 'null': 'True', 'to': u"orm['videos.Video']"}),
  91. 'mission_type': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
  92. 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
  93. 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
  94. 'price': ('django.db.models.fields.TextField', [], {'default': "''", 'blank': 'True'}),
  95. 'start_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'})
  96. },
  97. u'videos.featuredvideos': {
  98. 'Meta': {'object_name': 'FeaturedVideos'},
  99. 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
  100. u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  101. 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
  102. 'videos': ('sortedm2m.fields.SortedManyToManyField', [], {'symmetrical': 'False', 'to': u"orm['videos.Video']", 'null': 'True', 'blank': 'True'})
  103. },
  104. u'videos.flag': {
  105. 'Meta': {'object_name': 'Flag'},
  106. 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
  107. 'flag_type': ('django.db.models.fields.IntegerField', [], {'default': '0', 'blank': 'True'}),
  108. u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  109. 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
  110. 'object_pk': ('django.db.models.fields.IntegerField', [], {}),
  111. 'reason_code': ('django.db.models.fields.IntegerField', [], {}),
  112. 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounts.WhamUser']"})
  113. },
  114. u'videos.video': {
  115. 'Meta': {'ordering': "['-published_at']", 'object_name': 'Video'},
  116. 'added_by': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounts.WhamUser']"}),
  117. 'country': ('django.db.models.fields.CharField', [], {'max_length': '2'}),
  118. 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
  119. 'deleted_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
  120. 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
  121. 'external_id': ('django.db.models.fields.CharField', [], {'max_length': '20'}),
  122. 'hosting': ('django.db.models.fields.CharField', [], {'default': "'vzaar'", 'max_length': '30'}),
  123. u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  124. 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
  125. 'is_mission_winner': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
  126. 'is_processed': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
  127. 'mission': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': u"orm['missions.Mission']", 'null': 'True', 'blank': 'True'}),
  128. 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
  129. 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
  130. 'published_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
  131. 'rank': ('django.db.models.fields.IntegerField', [], {'default': '0', 'blank': 'True'}),
  132. 'slug': ('django_extensions.db.fields.AutoSlugField', [], {'null': 'True', 'populate_from': "'name'", 'allow_duplicates': 'False', 'max_length': '50', 'separator': "u'-'", 'blank': 'True', 'unique': 'True', 'overwrite': 'False'}),
  133. 'tags': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['hashtags.Hashtag']", 'symmetrical': 'False', 'blank': 'True'}),
  134. 'video_type': ('django.db.models.fields.IntegerField', [], {'default': '0', 'blank': 'True'}),
  135. 'view_count': ('django.db.models.fields.IntegerField', [], {'default': '0', 'blank': 'True'})
  136. },
  137. u'videos.videofeed': {
  138. 'Meta': {'object_name': 'VideoFeed'},
  139. 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
  140. 'default_icon': ('django.db.models.fields.IntegerField', [], {'default': '0', 'blank': 'True'}),
  141. 'endpoint_url': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
  142. 'icon_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
  143. u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  144. 'is_default': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
  145. 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
  146. 'name': ('django.db.models.fields.CharField', [], {'max_length': '30'}),
  147. 'order': ('django.db.models.fields.IntegerField', [], {}),
  148. 'version': ('django.db.models.fields.CharField', [], {'default': "'1.0'", 'max_length': '20'})
  149. }
  150. }
  151. complete_apps = ['videos']