Commit ef5861b4 by David Ormsbee

Switch to using migrations.

Using an older version of migrations to match edx-platform.
parent 5abd4f7e
[
{
"pk": 1,
"model": "edxval.profile",
"fields": {
"width": 1920,
"profile_name": "youtube",
"extension": "mp4",
"height": 1080
}
},
{
"pk": 2,
"model": "edxval.profile",
"fields": {
"width": 1280,
"profile_name": "desktop_mp4",
"extension": "mp4",
"height": 720
}
},
{
"pk": 3,
"model": "edxval.profile",
"fields": {
"width": 1280,
"profile_name": "desktop_webm",
"extension": "webm",
"height": 720
}
},
{
"pk": 4,
"model": "edxval.profile",
"fields": {
"width": 960,
"profile_name": "mobile_high",
"extension": "mp4",
"height": 540
}
},
{
"pk": 5,
"model": "edxval.profile",
"fields": {
"width": 640,
"profile_name": "mobile_low",
"extension": "mp4",
"height": 360
}
}
]
\ No newline at end of file
# -*- 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 'Profile'
db.create_table('edxval_profile', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('profile_name', self.gf('django.db.models.fields.CharField')(unique=True, max_length=50)),
('extension', self.gf('django.db.models.fields.CharField')(max_length=10)),
('width', self.gf('django.db.models.fields.PositiveIntegerField')()),
('height', self.gf('django.db.models.fields.PositiveIntegerField')()),
))
db.send_create_signal('edxval', ['Profile'])
# Adding model 'Video'
db.create_table('edxval_video', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('edx_video_id', self.gf('django.db.models.fields.CharField')(unique=True, max_length=50)),
('client_video_id', self.gf('django.db.models.fields.CharField')(max_length=255, db_index=True)),
('duration', self.gf('django.db.models.fields.FloatField')()),
))
db.send_create_signal('edxval', ['Video'])
# Adding model 'CourseVideos'
db.create_table('edxval_coursevideos', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('course_id', self.gf('django.db.models.fields.CharField')(max_length=255)),
('video', self.gf('django.db.models.fields.related.ForeignKey')(related_name='courses', to=orm['edxval.Video'])),
))
db.send_create_signal('edxval', ['CourseVideos'])
# Adding unique constraint on 'CourseVideos', fields ['course_id', 'video']
db.create_unique('edxval_coursevideos', ['course_id', 'video_id'])
# Adding model 'EncodedVideo'
db.create_table('edxval_encodedvideo', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
('modified', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)),
('url', self.gf('django.db.models.fields.URLField')(max_length=200)),
('file_size', self.gf('django.db.models.fields.PositiveIntegerField')()),
('bitrate', self.gf('django.db.models.fields.PositiveIntegerField')()),
('profile', self.gf('django.db.models.fields.related.ForeignKey')(related_name='+', to=orm['edxval.Profile'])),
('video', self.gf('django.db.models.fields.related.ForeignKey')(related_name='encoded_videos', to=orm['edxval.Video'])),
))
db.send_create_signal('edxval', ['EncodedVideo'])
# Adding model 'Subtitle'
db.create_table('edxval_subtitle', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
('modified', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)),
('video', self.gf('django.db.models.fields.related.ForeignKey')(related_name='subtitles', to=orm['edxval.Video'])),
('fmt', self.gf('django.db.models.fields.CharField')(max_length=20, db_index=True)),
('language', self.gf('django.db.models.fields.CharField')(max_length=8, db_index=True)),
('content', self.gf('django.db.models.fields.TextField')(default='')),
))
db.send_create_signal('edxval', ['Subtitle'])
def backwards(self, orm):
# Removing unique constraint on 'CourseVideos', fields ['course_id', 'video']
db.delete_unique('edxval_coursevideos', ['course_id', 'video_id'])
# Deleting model 'Profile'
db.delete_table('edxval_profile')
# Deleting model 'Video'
db.delete_table('edxval_video')
# Deleting model 'CourseVideos'
db.delete_table('edxval_coursevideos')
# Deleting model 'EncodedVideo'
db.delete_table('edxval_encodedvideo')
# Deleting model 'Subtitle'
db.delete_table('edxval_subtitle')
models = {
'edxval.coursevideos': {
'Meta': {'unique_together': "(('course_id', 'video'),)", 'object_name': 'CourseVideos'},
'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'video': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'courses'", 'to': "orm['edxval.Video']"})
},
'edxval.encodedvideo': {
'Meta': {'object_name': 'EncodedVideo'},
'bitrate': ('django.db.models.fields.PositiveIntegerField', [], {}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'file_size': ('django.db.models.fields.PositiveIntegerField', [], {}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'profile': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['edxval.Profile']"}),
'url': ('django.db.models.fields.URLField', [], {'max_length': '200'}),
'video': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'encoded_videos'", 'to': "orm['edxval.Video']"})
},
'edxval.profile': {
'Meta': {'object_name': 'Profile'},
'extension': ('django.db.models.fields.CharField', [], {'max_length': '10'}),
'height': ('django.db.models.fields.PositiveIntegerField', [], {}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'profile_name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '50'}),
'width': ('django.db.models.fields.PositiveIntegerField', [], {})
},
'edxval.subtitle': {
'Meta': {'object_name': 'Subtitle'},
'content': ('django.db.models.fields.TextField', [], {'default': "''"}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'fmt': ('django.db.models.fields.CharField', [], {'max_length': '20', 'db_index': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'language': ('django.db.models.fields.CharField', [], {'max_length': '8', 'db_index': 'True'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'video': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'subtitles'", 'to': "orm['edxval.Video']"})
},
'edxval.video': {
'Meta': {'object_name': 'Video'},
'client_video_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}),
'duration': ('django.db.models.fields.FloatField', [], {}),
'edx_video_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '50'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
}
}
complete_apps = ['edxval']
\ No newline at end of file
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
"Write your forwards methods here."
orm.Profile.objects.bulk_create([
orm.Profile(profile_name="desktop_mp4", width=1280, height= 720, extension="mp4"),
orm.Profile(profile_name="desktop_webm", width=1280, height= 720, extension="webm"),
orm.Profile(profile_name="mobile_high", width= 960, height= 540, extension="mp4"),
orm.Profile(profile_name="mobile_low", width= 640, height= 360, extension="mp4"),
orm.Profile(profile_name="youtube", width=1920, height=1080, extension="mp4"),
])
# Note: Remember to use orm['appname.ModelName'] rather than "from appname.models..."
def backwards(self, orm):
"Write your backwards methods here."
orm.Profile.objects.filter(
profile_name__in=["desktop_mp4", "desktop_webm", "mobile_high", "mobile_low", "youtube"]
).delete()
models = {
'edxval.coursevideos': {
'Meta': {'unique_together': "(('course_id', 'video'),)", 'object_name': 'CourseVideos'},
'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'video': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'courses'", 'to': "orm['edxval.Video']"})
},
'edxval.encodedvideo': {
'Meta': {'object_name': 'EncodedVideo'},
'bitrate': ('django.db.models.fields.PositiveIntegerField', [], {}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'file_size': ('django.db.models.fields.PositiveIntegerField', [], {}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'profile': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['edxval.Profile']"}),
'url': ('django.db.models.fields.URLField', [], {'max_length': '200'}),
'video': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'encoded_videos'", 'to': "orm['edxval.Video']"})
},
'edxval.profile': {
'Meta': {'object_name': 'Profile'},
'extension': ('django.db.models.fields.CharField', [], {'max_length': '10'}),
'height': ('django.db.models.fields.PositiveIntegerField', [], {}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'profile_name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '50'}),
'width': ('django.db.models.fields.PositiveIntegerField', [], {})
},
'edxval.subtitle': {
'Meta': {'object_name': 'Subtitle'},
'content': ('django.db.models.fields.TextField', [], {'default': "''"}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'fmt': ('django.db.models.fields.CharField', [], {'max_length': '20', 'db_index': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'language': ('django.db.models.fields.CharField', [], {'max_length': '8', 'db_index': 'True'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'video': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'subtitles'", 'to': "orm['edxval.Video']"})
},
'edxval.video': {
'Meta': {'object_name': 'Video'},
'client_video_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}),
'duration': ('django.db.models.fields.FloatField', [], {}),
'edx_video_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '50'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
}
}
complete_apps = ['edxval']
symmetrical = True
......@@ -121,14 +121,21 @@ INSTALLED_APPS = (
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'edxval',
'django_nose',
'rest_framework',
# Uncomment the next line to enable the admin:
'django.contrib.admin',
'debug_toolbar'
# Uncomment the next line to enable admin documentation:
# 'django.contrib.admindocs',
# Third Party
'south',
'django_nose',
'rest_framework',
'debug_toolbar',
# Our App
'edxval',
)
TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
......
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