/whambush/apps/videos/migrations/0034_auto__del_field_flag_video.py
Python | 161 lines | 147 code | 10 blank | 4 comment | 0 complexity | 31a94ecb132017d85f0a9924194a995c MD5 | raw file
- # -*- coding: utf-8 -*-
- from south.utils import datetime_utils as datetime
- from south.db import db
- from south.v2 import SchemaMigration
- from django.db import models
- class Migration(SchemaMigration):
- def forwards(self, orm):
- # Deleting field 'Flag.video'
- db.delete_column(u'videos_flag', 'video_id')
- def backwards(self, orm):
- # User chose to not deal with backwards NULL issues for 'Flag.video'
- raise RuntimeError("Cannot reverse this migration. 'Flag.video' and its values cannot be restored.")
-
- # The following code is provided here to aid in writing a correct migration # Adding field 'Flag.video'
- db.add_column(u'videos_flag', 'video',
- self.gf('django.db.models.fields.related.ForeignKey')(to=orm['videos.Video']),
- keep_default=False)
- models = {
- u'accounts.follow': {
- 'Meta': {'unique_together': "(('from_user', 'to_user'),)", 'object_name': 'Follow'},
- 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
- 'from_user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'follow_set_from'", 'to': u"orm['accounts.WhamUser']"}),
- u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
- 'to_user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'follow_set_to'", 'to': u"orm['accounts.WhamUser']"})
- },
- u'accounts.whamuser': {
- 'Meta': {'ordering': "['username']", 'object_name': 'WhamUser'},
- 'birthday': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
- 'changed_email_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
- 'country': ('django.db.models.fields.CharField', [], {'max_length': '2'}),
- 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
- 'description': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
- 'email': ('django.db.models.fields.EmailField', [], {'unique': 'True', 'max_length': '75', 'blank': 'True'}),
- 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
- 'following': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'followed_by'", 'symmetrical': 'False', 'through': u"orm['accounts.Follow']", 'to': u"orm['accounts.WhamUser']"}),
- 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}),
- u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
- 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
- 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
- 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
- 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
- 'linked_user': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': u"orm['accounts.WhamUser']", 'null': 'True', 'blank': 'True'}),
- 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
- 'profile_picture': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
- 'rank': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
- 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}),
- 'user_type': ('django.db.models.fields.IntegerField', [], {'default': '0', 'blank': 'True'}),
- 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
- },
- u'auth.group': {
- 'Meta': {'object_name': 'Group'},
- u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
- 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
- },
- u'auth.permission': {
- 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'},
- 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
- 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}),
- u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
- },
- u'contenttypes.contenttype': {
- 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
- 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
- u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
- 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
- },
- u'hashtags.hashtag': {
- 'Meta': {'object_name': 'Hashtag'},
- 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
- u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
- 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '200'})
- },
- u'missions.mission': {
- 'Meta': {'object_name': 'Mission'},
- 'added_by': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounts.WhamUser']"}),
- 'bananas': ('django.db.models.fields.IntegerField', [], {'default': '0', 'blank': 'True'}),
- 'country': ('django.db.models.fields.CharField', [], {'max_length': '2'}),
- 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
- 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
- 'end_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
- 'icon_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
- u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'is_push_sent': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
- 'is_videos_ranked': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
- 'linked_video': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'linked_video_mission'", 'null': 'True', 'to': u"orm['videos.Video']"}),
- 'mission_type': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
- 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
- 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
- 'price': ('django.db.models.fields.TextField', [], {'default': "''", 'blank': 'True'}),
- 'start_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'})
- },
- u'videos.featuredvideos': {
- 'Meta': {'object_name': 'FeaturedVideos'},
- 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
- u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
- 'videos': ('sortedm2m.fields.SortedManyToManyField', [], {'symmetrical': 'False', 'to': u"orm['videos.Video']", 'null': 'True', 'blank': 'True'})
- },
- u'videos.flag': {
- 'Meta': {'object_name': 'Flag'},
- 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
- 'flag_type': ('django.db.models.fields.IntegerField', [], {'default': '0', 'blank': 'True'}),
- u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
- 'object_pk': ('django.db.models.fields.IntegerField', [], {}),
- 'reason_code': ('django.db.models.fields.IntegerField', [], {}),
- 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounts.WhamUser']"})
- },
- u'videos.video': {
- 'Meta': {'ordering': "['-published_at']", 'object_name': 'Video'},
- 'added_by': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounts.WhamUser']"}),
- 'country': ('django.db.models.fields.CharField', [], {'max_length': '2'}),
- 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
- 'deleted_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
- 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
- 'external_id': ('django.db.models.fields.CharField', [], {'max_length': '20'}),
- 'hosting': ('django.db.models.fields.CharField', [], {'default': "'vzaar'", 'max_length': '30'}),
- u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
- 'is_mission_winner': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
- 'is_processed': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
- 'mission': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': u"orm['missions.Mission']", 'null': 'True', 'blank': 'True'}),
- 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
- 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
- 'published_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
- 'rank': ('django.db.models.fields.IntegerField', [], {'default': '0', 'blank': 'True'}),
- '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'}),
- 'tags': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['hashtags.Hashtag']", 'symmetrical': 'False', 'blank': 'True'}),
- 'video_type': ('django.db.models.fields.IntegerField', [], {'default': '0', 'blank': 'True'}),
- 'view_count': ('django.db.models.fields.IntegerField', [], {'default': '0', 'blank': 'True'})
- },
- u'videos.videofeed': {
- 'Meta': {'object_name': 'VideoFeed'},
- 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
- 'default_icon': ('django.db.models.fields.IntegerField', [], {'default': '0', 'blank': 'True'}),
- 'endpoint_url': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
- 'icon_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
- u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'is_default': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
- 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
- 'name': ('django.db.models.fields.CharField', [], {'max_length': '30'}),
- 'order': ('django.db.models.fields.IntegerField', [], {}),
- 'version': ('django.db.models.fields.CharField', [], {'default': "'1.0'", 'max_length': '20'})
- }
- }
- complete_apps = ['videos']