Commit 84d8197b authored by fred's avatar fred

add south to support future model changes

parent 83b48bfa
# -*- 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 'Category'
db.create_table(u'emissions_category', (
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('title', self.gf('django.db.models.fields.CharField')(max_length=50)),
))
db.send_create_signal(u'emissions', ['Category'])
# Adding model 'Emission'
db.create_table(u'emissions_emission', (
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('title', self.gf('django.db.models.fields.CharField')(max_length=50)),
('slug', self.gf('django.db.models.fields.SlugField')(max_length=50)),
('description', self.gf('ckeditor.fields.RichTextField')(null=True, blank=True)),
('text', self.gf('ckeditor.fields.RichTextField')(null=True)),
('archived', self.gf('django.db.models.fields.BooleanField')(default=False)),
))
db.send_create_signal(u'emissions', ['Emission'])
# Adding M2M table for field categories on 'Emission'
m2m_table_name = db.shorten_name(u'emissions_emission_categories')
db.create_table(m2m_table_name, (
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
('emission', models.ForeignKey(orm[u'emissions.emission'], null=False)),
('category', models.ForeignKey(orm[u'emissions.category'], null=False))
))
db.create_unique(m2m_table_name, ['emission_id', 'category_id'])
# Adding model 'Schedule'
db.create_table(u'emissions_schedule', (
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('emission', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['emissions.Emission'])),
('datetime', self.gf('django.db.models.fields.DateTimeField')()),
('rerun', self.gf('django.db.models.fields.BooleanField')(default=False)),
))
db.send_create_signal(u'emissions', ['Schedule'])
# Adding model 'Episode'
db.create_table(u'emissions_episode', (
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('emission', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['emissions.Emission'])),
('title', self.gf('django.db.models.fields.CharField')(max_length=50)),
('slug', self.gf('django.db.models.fields.SlugField')(max_length=50)),
('description', self.gf('ckeditor.fields.RichTextField')(null=True, blank=True)),
('text', self.gf('ckeditor.fields.RichTextField')(null=True)),
))
db.send_create_signal(u'emissions', ['Episode'])
# Adding model 'Diffusion'
db.create_table(u'emissions_diffusion', (
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('episode', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['emissions.Episode'])),
('datetime', self.gf('django.db.models.fields.DateTimeField')()),
))
db.send_create_signal(u'emissions', ['Diffusion'])
# Adding model 'SoundFile'
db.create_table(u'emissions_soundfile', (
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('episode', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['emissions.Episode'])),
('file', self.gf('django.db.models.fields.files.FileField')(max_length=250)),
('podcastable', self.gf('django.db.models.fields.BooleanField')(default=False)),
('fragment', self.gf('django.db.models.fields.BooleanField')(default=False)),
('title', self.gf('django.db.models.fields.CharField')(max_length=50)),
))
db.send_create_signal(u'emissions', ['SoundFile'])
def backwards(self, orm):
# Deleting model 'Category'
db.delete_table(u'emissions_category')
# Deleting model 'Emission'
db.delete_table(u'emissions_emission')
# Removing M2M table for field categories on 'Emission'
db.delete_table(db.shorten_name(u'emissions_emission_categories'))
# Deleting model 'Schedule'
db.delete_table(u'emissions_schedule')
# Deleting model 'Episode'
db.delete_table(u'emissions_episode')
# Deleting model 'Diffusion'
db.delete_table(u'emissions_diffusion')
# Deleting model 'SoundFile'
db.delete_table(u'emissions_soundfile')
models = {
u'emissions.category': {
'Meta': {'object_name': 'Category'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'title': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
u'emissions.diffusion': {
'Meta': {'object_name': 'Diffusion'},
'datetime': ('django.db.models.fields.DateTimeField', [], {}),
'episode': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['emissions.Episode']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
},
u'emissions.emission': {
'Meta': {'object_name': 'Emission'},
'archived': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'categories': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['emissions.Category']", 'symmetrical': 'False'}),
'description': ('ckeditor.fields.RichTextField', [], {'null': 'True', 'blank': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50'}),
'text': ('ckeditor.fields.RichTextField', [], {'null': 'True'}),
'title': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
u'emissions.episode': {
'Meta': {'object_name': 'Episode'},
'description': ('ckeditor.fields.RichTextField', [], {'null': 'True', 'blank': 'True'}),
'emission': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['emissions.Emission']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50'}),
'text': ('ckeditor.fields.RichTextField', [], {'null': 'True'}),
'title': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
u'emissions.schedule': {
'Meta': {'object_name': 'Schedule'},
'datetime': ('django.db.models.fields.DateTimeField', [], {}),
'emission': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['emissions.Emission']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'rerun': ('django.db.models.fields.BooleanField', [], {'default': 'False'})
},
u'emissions.soundfile': {
'Meta': {'object_name': 'SoundFile'},
'episode': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['emissions.Episode']"}),
'file': ('django.db.models.fields.files.FileField', [], {'max_length': '250'}),
'fragment': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'podcastable': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'title': ('django.db.models.fields.CharField', [], {'max_length': '50'})
}
}
complete_apps = ['emissions']
\ No newline at end of file
......@@ -122,6 +122,7 @@ INSTALLED_APPS = (
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'south',
'ckeditor',
'haystack',
'panikdb.emissions',
......
Django<1.6
south>=0.8,<0.9
django-ckeditor
git+https://github.com/toastdriven/django-haystack.git
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment