Source

dvd-collection / collection / migrations / 0001_initial.py

Full commit
# -*- 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 'Genre'
        db.create_table(u'collection_genre', (
            (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('name', self.gf('django.db.models.fields.CharField')(unique=True, max_length=20)),
            ('slug', self.gf('django.db.models.fields.SlugField')(max_length=50)),
        ))
        db.send_create_signal(u'collection', ['Genre'])

        # Adding model 'Movie'
        db.create_table(u'collection_movie', (
            (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('title', self.gf('django.db.models.fields.CharField')(max_length=40)),
            ('slug', self.gf('django.db.models.fields.SlugField')(max_length=50)),
            ('added_on', self.gf('django.db.models.fields.DateField')(auto_now_add=True, blank=True)),
            ('format', self.gf('django.db.models.fields.PositiveSmallIntegerField')()),
            ('genre', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['collection.Genre'])),
            ('rating', self.gf('django.db.models.fields.PositiveSmallIntegerField')(null=True, blank=True)),
            ('watched', self.gf('django.db.models.fields.PositiveIntegerField')(default=0)),
            ('purchase_price', self.gf('django.db.models.fields.DecimalField')(null=True, max_digits=5, decimal_places=2, blank=True)),
            ('market_price', self.gf('django.db.models.fields.DecimalField')(null=True, max_digits=5, decimal_places=2, blank=True)),
            ('imdb', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)),
            ('youtube', self.gf('django.db.models.fields.CharField')(max_length=30, null=True, blank=True)),
            ('poster', self.gf('django.db.models.fields.files.ImageField')(max_length=100, null=True, blank=True)),
        ))
        db.send_create_signal(u'collection', ['Movie'])


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

        # Deleting model 'Movie'
        db.delete_table(u'collection_movie')


    models = {
        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'}),
            '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.IntegerField', [], {'null': 'True', 'blank': 'True'}),
            'market_price': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '5', 'decimal_places': '2', 'blank': 'True'}),
            'poster': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', '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'}),
            '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'}),
            'youtube': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'})
        }
    }

    complete_apps = ['collection']