Source

dvd-collection / collection / migrations / 0002_auto__add_director__add_field_movie_last_watched__add_field_movie_year.py

# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models


class Migration(SchemaMigration):

    def forwards(self, orm):
        # Adding model 'Director'
        db.create_table(u'collection_director', (
            (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('name', self.gf('django.db.models.fields.CharField')(unique=True, max_length=40)),
            ('slug', self.gf('django.db.models.fields.SlugField')(max_length=50)),
        ))
        db.send_create_signal(u'collection', ['Director'])

        # Adding field 'Movie.last_watched'
        db.add_column(u'collection_movie', 'last_watched',
                      self.gf('django.db.models.fields.DateField')(null=True, blank=True),
                      keep_default=False)

        # Adding field 'Movie.year'
        db.add_column(u'collection_movie', 'year',
                      self.gf('django.db.models.fields.PositiveSmallIntegerField')(null=True, blank=True),
                      keep_default=False)

        # Adding field 'Movie.released'
        db.add_column(u'collection_movie', 'released',
                      self.gf('django.db.models.fields.DateField')(null=True, blank=True),
                      keep_default=False)

        # Adding field 'Movie.length'
        db.add_column(u'collection_movie', 'length',
                      self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True),
                      keep_default=False)

        # Adding field 'Movie.director'
        db.add_column(u'collection_movie', 'director',
                      self.gf('django.db.models.fields.related.ForeignKey')(to=orm['collection.Director'], null=True, blank=True),
                      keep_default=False)

        # Adding field 'Movie.plot'
        db.add_column(u'collection_movie', 'plot',
                      self.gf('django.db.models.fields.TextField')(default='', blank=True),
                      keep_default=False)

        # Adding field 'Movie.imdb_rating'
        db.add_column(u'collection_movie', 'imdb_rating',
                      self.gf('django.db.models.fields.PositiveSmallIntegerField')(null=True, blank=True),
                      keep_default=False)


        # Changing field 'Movie.poster'
        db.alter_column(u'collection_movie', 'poster', self.gf('django.db.models.fields.URLField')(max_length=200, null=True))

        # Changing field 'Movie.imdb'
        db.alter_column(u'collection_movie', 'imdb', self.gf('django.db.models.fields.CharField')(max_length=20, null=True))

    def backwards(self, orm):
        # Deleting model 'Director'
        db.delete_table(u'collection_director')

        # Deleting field 'Movie.last_watched'
        db.delete_column(u'collection_movie', 'last_watched')

        # Deleting field 'Movie.year'
        db.delete_column(u'collection_movie', 'year')

        # Deleting field 'Movie.released'
        db.delete_column(u'collection_movie', 'released')

        # Deleting field 'Movie.length'
        db.delete_column(u'collection_movie', 'length')

        # Deleting field 'Movie.director'
        db.delete_column(u'collection_movie', 'director_id')

        # Deleting field 'Movie.plot'
        db.delete_column(u'collection_movie', 'plot')

        # Deleting field 'Movie.imdb_rating'
        db.delete_column(u'collection_movie', 'imdb_rating')


        # Changing field 'Movie.poster'
        db.alter_column(u'collection_movie', 'poster', self.gf('django.db.models.fields.files.ImageField')(max_length=100, null=True))

        # Changing field 'Movie.imdb'
        db.alter_column(u'collection_movie', 'imdb', self.gf('django.db.models.fields.IntegerField')(null=True))

    models = {
        u'collection.director': {
            'Meta': {'object_name': 'Director'},
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '40'}),
            'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50'})
        },
        u'collection.genre': {
            'Meta': {'object_name': 'Genre'},
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20'}),
            'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50'})
        },
        u'collection.movie': {
            'Meta': {'object_name': 'Movie'},
            'added_on': ('django.db.models.fields.DateField', [], {'auto_now_add': 'True', 'blank': 'True'}),
            'director': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['collection.Director']", 'null': 'True', 'blank': 'True'}),
            'format': ('django.db.models.fields.PositiveSmallIntegerField', [], {}),
            'genre': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['collection.Genre']"}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'imdb': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'}),
            'imdb_rating': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True', 'blank': 'True'}),
            'last_watched': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
            'length': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
            'market_price': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '5', 'decimal_places': '2', 'blank': 'True'}),
            'plot': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            'poster': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
            'purchase_price': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '5', 'decimal_places': '2', 'blank': 'True'}),
            'rating': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True', 'blank': 'True'}),
            'released': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
            'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50'}),
            'title': ('django.db.models.fields.CharField', [], {'max_length': '40'}),
            'watched': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
            'year': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True', 'blank': 'True'}),
            'youtube': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'})
        }
    }

    complete_apps = ['collection']
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.