This repository has been archived by the owner on Jan 19, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[bug 1196244] Replace south with Django 1.7 native migrations
- Loading branch information
Showing
124 changed files
with
549 additions
and
16,400 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,33 @@ | ||
# encoding: utf-8 | ||
import datetime | ||
from south.db import db | ||
from south.v2 import SchemaMigration | ||
from django.db import models | ||
# -*- coding: utf-8 -*- | ||
from __future__ import unicode_literals | ||
|
||
class Migration(SchemaMigration): | ||
from django.db import models, migrations | ||
import sorl.thumbnail.fields | ||
import mozillians.announcements.models | ||
|
||
def forwards(self, orm): | ||
|
||
# Adding model 'Announcement' | ||
db.create_table('announcements_announcement', ( | ||
('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)), | ||
('updated', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)), | ||
('title', self.gf('django.db.models.fields.CharField')(max_length=255)), | ||
('text', self.gf('django.db.models.fields.TextField')(max_length=750)), | ||
('image', self.gf('sorl.thumbnail.fields.ImageField')(default='', max_length=100, blank=True)), | ||
('publish_from', self.gf('django.db.models.fields.DateTimeField')()), | ||
('publish_until', self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True)), | ||
)) | ||
db.send_create_signal('announcements', ['Announcement']) | ||
|
||
class Migration(migrations.Migration): | ||
|
||
def backwards(self, orm): | ||
|
||
# Deleting model 'Announcement' | ||
db.delete_table('announcements_announcement') | ||
dependencies = [ | ||
] | ||
|
||
|
||
models = { | ||
'announcements.announcement': { | ||
'Meta': {'ordering': "['-publish_from']", 'object_name': 'Announcement'}, | ||
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), | ||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
'image': ('sorl.thumbnail.fields.ImageField', [], {'default': "''", 'max_length': '100', 'blank': 'True'}), | ||
'publish_from': ('django.db.models.fields.DateTimeField', [], {}), | ||
'publish_until': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), | ||
'text': ('django.db.models.fields.TextField', [], {'max_length': '750'}), | ||
'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}), | ||
'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}) | ||
} | ||
} | ||
|
||
complete_apps = ['announcements'] | ||
operations = [ | ||
migrations.CreateModel( | ||
name='Announcement', | ||
fields=[ | ||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), | ||
('created', models.DateTimeField(auto_now_add=True)), | ||
('updated', models.DateTimeField(auto_now=True)), | ||
('title', models.CharField(max_length=255)), | ||
('text', models.TextField(max_length=750)), | ||
('image', sorl.thumbnail.fields.ImageField(default=b'', help_text=b'60x60 pixel image recommended. Image will be rescaled automatically to a square.', upload_to=mozillians.announcements.models._calculate_image_filename, blank=True)), | ||
('publish_from', models.DateTimeField(help_text=b'Timezone is America/Los_Angeles')), | ||
('publish_until', models.DateTimeField(help_text=b'Timezone is America/Los_Angeles', null=True, blank=True)), | ||
], | ||
options={ | ||
'ordering': ['-publish_from'], | ||
'get_latest_by': 'publish_from', | ||
}, | ||
bases=(models.Model,), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,81 +1,51 @@ | ||
# encoding: utf-8 | ||
import datetime | ||
from south.db import db | ||
from south.v2 import SchemaMigration | ||
from django.db import models | ||
# -*- coding: utf-8 -*- | ||
from __future__ import unicode_literals | ||
|
||
class Migration(SchemaMigration): | ||
from django.db import models, migrations | ||
import mozillians.users.models | ||
|
||
def forwards(self, orm): | ||
|
||
# Adding model 'APIApp' | ||
db.create_table('api_apiapp', ( | ||
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), | ||
('name', self.gf('django.db.models.fields.CharField')(unique=True, max_length=100)), | ||
('description', self.gf('django.db.models.fields.TextField')()), | ||
('url', self.gf('django.db.models.fields.URLField')(default='', max_length=300, blank=True)), | ||
('owner', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])), | ||
('key', self.gf('django.db.models.fields.CharField')(default='', max_length=256, blank=True)), | ||
('is_superapp', self.gf('django.db.models.fields.BooleanField')(default=False)), | ||
('created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), | ||
)) | ||
db.send_create_signal('api', ['APIApp']) | ||
|
||
class Migration(migrations.Migration): | ||
|
||
def backwards(self, orm): | ||
|
||
# Deleting model 'APIApp' | ||
db.delete_table('api_apiapp') | ||
dependencies = [ | ||
] | ||
|
||
|
||
models = { | ||
'api.apiapp': { | ||
'Meta': {'object_name': 'APIApp'}, | ||
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), | ||
'description': ('django.db.models.fields.TextField', [], {}), | ||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
'is_superapp': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), | ||
'key': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '256', 'blank': 'True'}), | ||
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}), | ||
'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), | ||
'url': ('django.db.models.fields.URLField', [], {'default': "''", 'max_length': '300', 'blank': 'True'}) | ||
}, | ||
'auth.group': { | ||
'Meta': {'object_name': 'Group'}, | ||
'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': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) | ||
}, | ||
'auth.permission': { | ||
'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, | ||
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), | ||
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), | ||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) | ||
}, | ||
'auth.user': { | ||
'Meta': {'object_name': 'User'}, | ||
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), | ||
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), | ||
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), | ||
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), | ||
'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'}), | ||
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), | ||
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), | ||
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) | ||
}, | ||
'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'}), | ||
'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'}) | ||
} | ||
} | ||
|
||
complete_apps = ['api'] | ||
operations = [ | ||
migrations.CreateModel( | ||
name='APIApp', | ||
fields=[ | ||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), | ||
('name', models.CharField(unique=True, max_length=100)), | ||
('description', models.TextField()), | ||
('url', models.URLField(default=b'', max_length=300, blank=True)), | ||
('key', models.CharField(default=b'', help_text=b'Leave this field empty to generate a new API key.', max_length=256, blank=True)), | ||
('is_mozilla_app', models.BooleanField(default=False)), | ||
('is_active', models.BooleanField(default=False)), | ||
('created', models.DateTimeField(auto_now_add=True)), | ||
], | ||
options={ | ||
'verbose_name': 'APIv1 App', | ||
'verbose_name_plural': 'APIv1 Apps', | ||
}, | ||
bases=(models.Model,), | ||
), | ||
migrations.CreateModel( | ||
name='APIv2App', | ||
fields=[ | ||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), | ||
('enabled', models.BooleanField(default=False)), | ||
('name', models.CharField(unique=True, max_length=100)), | ||
('description', models.TextField()), | ||
('url', models.URLField(default=b'', max_length=300, blank=True)), | ||
('key', models.CharField(default=b'', help_text=b'Leave this field empty to generate a new API key.', unique=True, max_length=255, blank=True)), | ||
('privacy_level', mozillians.users.models.PrivacyField(default=4, choices=[(1, 'Privileged'), (3, 'Mozillians'), (4, 'Public')])), | ||
('created', models.DateTimeField(auto_now_add=True)), | ||
('last_used', models.DateTimeField(auto_now_add=True)), | ||
], | ||
options={ | ||
'verbose_name': 'APIv2 App', | ||
'verbose_name_plural': 'APIv2 Apps', | ||
}, | ||
bases=(models.Model,), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import unicode_literals | ||
|
||
from django.db import models, migrations | ||
from django.conf import settings | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('api', '0001_initial'), | ||
('users', '0001_initial'), | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='apiv2app', | ||
name='owner', | ||
field=models.ForeignKey(related_name='apps', to='users.UserProfile'), | ||
preserve_default=True, | ||
), | ||
migrations.AddField( | ||
model_name='apiapp', | ||
name='owner', | ||
field=models.ForeignKey(to=settings.AUTH_USER_MODEL), | ||
preserve_default=True, | ||
), | ||
] |
77 changes: 0 additions & 77 deletions
77
...pi/migrations/0002_auto__del_field_apiapp_is_superapp__add_field_apiapp_is_mozilla_app.py
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.