euscanwww: South migration for keeping data for the new accounts app
Signed-off-by: volpino <fox91@anche.no>
This commit is contained in:
parent
7ed088e705
commit
6296f4c0f3
@ -1,89 +1,17 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
import datetime
|
|
||||||
from south.db import db
|
|
||||||
from south.v2 import SchemaMigration
|
from south.v2 import SchemaMigration
|
||||||
from django.db import models
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(SchemaMigration):
|
class Migration(SchemaMigration):
|
||||||
|
depends_on = (
|
||||||
|
('euscan_accounts', '0001_initial'),
|
||||||
|
)
|
||||||
|
|
||||||
def forwards(self, orm):
|
def forwards(self, orm):
|
||||||
# Deleting model 'UserProfile'
|
pass
|
||||||
db.delete_table('djeuscan_userprofile')
|
|
||||||
|
|
||||||
# Removing M2M table for field overlays on 'UserProfile'
|
|
||||||
db.delete_table('djeuscan_userprofile_overlays')
|
|
||||||
|
|
||||||
# Removing M2M table for field maintainers on 'UserProfile'
|
|
||||||
db.delete_table('djeuscan_userprofile_maintainers')
|
|
||||||
|
|
||||||
# Removing M2M table for field packages on 'UserProfile'
|
|
||||||
db.delete_table('djeuscan_userprofile_packages')
|
|
||||||
|
|
||||||
# Removing M2M table for field herds on 'UserProfile'
|
|
||||||
db.delete_table('djeuscan_userprofile_herds')
|
|
||||||
|
|
||||||
# Removing M2M table for field categories on 'UserProfile'
|
|
||||||
db.delete_table('djeuscan_userprofile_categories')
|
|
||||||
|
|
||||||
def backwards(self, orm):
|
def backwards(self, orm):
|
||||||
# Adding model 'UserProfile'
|
pass
|
||||||
db.create_table('djeuscan_userprofile', (
|
|
||||||
('feed_upstream_info', self.gf('django.db.models.fields.BooleanField')(default=True)),
|
|
||||||
('feed_ignore_pre_if_stable', self.gf('django.db.models.fields.BooleanField')(default=False)),
|
|
||||||
('feed_ignore_pre', self.gf('django.db.models.fields.BooleanField')(default=False)),
|
|
||||||
('email_every', self.gf('django.db.models.fields.IntegerField')(default=1)),
|
|
||||||
('user', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['auth.User'], unique=True)),
|
|
||||||
('feed_portage_info', self.gf('django.db.models.fields.BooleanField')(default=False)),
|
|
||||||
('feed_show_removals', self.gf('django.db.models.fields.BooleanField')(default=True)),
|
|
||||||
('last_email', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
|
|
||||||
('feed_show_adds', self.gf('django.db.models.fields.BooleanField')(default=True)),
|
|
||||||
('email_ignore_pre_if_stable', self.gf('django.db.models.fields.BooleanField')(default=False)),
|
|
||||||
('email_activated', self.gf('django.db.models.fields.BooleanField')(default=True)),
|
|
||||||
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
|
|
||||||
('email_ignore_pre', self.gf('django.db.models.fields.BooleanField')(default=False)),
|
|
||||||
))
|
|
||||||
db.send_create_signal('djeuscan', ['UserProfile'])
|
|
||||||
|
|
||||||
# Adding M2M table for field overlays on 'UserProfile'
|
|
||||||
db.create_table('djeuscan_userprofile_overlays', (
|
|
||||||
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
|
|
||||||
('userprofile', models.ForeignKey(orm['djeuscan.userprofile'], null=False)),
|
|
||||||
('overlay', models.ForeignKey(orm['djeuscan.overlay'], null=False))
|
|
||||||
))
|
|
||||||
db.create_unique('djeuscan_userprofile_overlays', ['userprofile_id', 'overlay_id'])
|
|
||||||
|
|
||||||
# Adding M2M table for field maintainers on 'UserProfile'
|
|
||||||
db.create_table('djeuscan_userprofile_maintainers', (
|
|
||||||
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
|
|
||||||
('userprofile', models.ForeignKey(orm['djeuscan.userprofile'], null=False)),
|
|
||||||
('maintainer', models.ForeignKey(orm['djeuscan.maintainer'], null=False))
|
|
||||||
))
|
|
||||||
db.create_unique('djeuscan_userprofile_maintainers', ['userprofile_id', 'maintainer_id'])
|
|
||||||
|
|
||||||
# Adding M2M table for field packages on 'UserProfile'
|
|
||||||
db.create_table('djeuscan_userprofile_packages', (
|
|
||||||
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
|
|
||||||
('userprofile', models.ForeignKey(orm['djeuscan.userprofile'], null=False)),
|
|
||||||
('package', models.ForeignKey(orm['djeuscan.package'], null=False))
|
|
||||||
))
|
|
||||||
db.create_unique('djeuscan_userprofile_packages', ['userprofile_id', 'package_id'])
|
|
||||||
|
|
||||||
# Adding M2M table for field herds on 'UserProfile'
|
|
||||||
db.create_table('djeuscan_userprofile_herds', (
|
|
||||||
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
|
|
||||||
('userprofile', models.ForeignKey(orm['djeuscan.userprofile'], null=False)),
|
|
||||||
('herd', models.ForeignKey(orm['djeuscan.herd'], null=False))
|
|
||||||
))
|
|
||||||
db.create_unique('djeuscan_userprofile_herds', ['userprofile_id', 'herd_id'])
|
|
||||||
|
|
||||||
# Adding M2M table for field categories on 'UserProfile'
|
|
||||||
db.create_table('djeuscan_userprofile_categories', (
|
|
||||||
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
|
|
||||||
('userprofile', models.ForeignKey(orm['djeuscan.userprofile'], null=False)),
|
|
||||||
('category', models.ForeignKey(orm['djeuscan.category'], null=False))
|
|
||||||
))
|
|
||||||
db.create_unique('djeuscan_userprofile_categories', ['userprofile_id', 'category_id'])
|
|
||||||
|
|
||||||
models = {
|
models = {
|
||||||
'auth.group': {
|
'auth.group': {
|
||||||
|
@ -1,89 +1,44 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
import datetime
|
|
||||||
from south.db import db
|
from south.db import db
|
||||||
from south.v2 import SchemaMigration
|
from south.v2 import SchemaMigration
|
||||||
from django.db import models
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(SchemaMigration):
|
class Migration(SchemaMigration):
|
||||||
|
|
||||||
def forwards(self, orm):
|
def forwards(self, orm):
|
||||||
# Adding model 'UserProfile'
|
db.rename_table('djeuscan_userprofile',
|
||||||
db.create_table('euscan_accounts_userprofile', (
|
'euscan_accounts_userprofile')
|
||||||
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
|
db.rename_table('djeuscan_userprofile_overlays',
|
||||||
('user', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['auth.User'], unique=True)),
|
'euscan_accounts_userprofile_overlays')
|
||||||
('feed_upstream_info', self.gf('django.db.models.fields.BooleanField')(default=True)),
|
db.rename_table('djeuscan_userprofile_maintainers',
|
||||||
('feed_portage_info', self.gf('django.db.models.fields.BooleanField')(default=False)),
|
'euscan_accounts_userprofile_maintainers')
|
||||||
('feed_show_adds', self.gf('django.db.models.fields.BooleanField')(default=True)),
|
db.rename_table('djeuscan_userprofile_packages',
|
||||||
('feed_show_removals', self.gf('django.db.models.fields.BooleanField')(default=True)),
|
'euscan_accounts_userprofile_packages')
|
||||||
('feed_ignore_pre', self.gf('django.db.models.fields.BooleanField')(default=False)),
|
db.rename_table('djeuscan_userprofile_herds',
|
||||||
('feed_ignore_pre_if_stable', self.gf('django.db.models.fields.BooleanField')(default=False)),
|
'euscan_accounts_userprofile_herds')
|
||||||
('email_activated', self.gf('django.db.models.fields.BooleanField')(default=True)),
|
db.rename_table('djeuscan_userprofile_categories',
|
||||||
('email_every', self.gf('django.db.models.fields.IntegerField')(default=1)),
|
'euscan_accounts_userprofile_categories')
|
||||||
('email_ignore_pre', self.gf('django.db.models.fields.BooleanField')(default=False)),
|
|
||||||
('email_ignore_pre_if_stable', self.gf('django.db.models.fields.BooleanField')(default=False)),
|
|
||||||
('last_email', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
|
|
||||||
))
|
|
||||||
db.send_create_signal('euscan_accounts', ['UserProfile'])
|
|
||||||
|
|
||||||
# Adding M2M table for field herds on 'UserProfile'
|
if not db.dry_run:
|
||||||
db.create_table('euscan_accounts_userprofile_herds', (
|
# For permissions to work properly after migrating
|
||||||
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
|
orm['contenttypes.contenttype'].objects.filter(
|
||||||
('userprofile', models.ForeignKey(orm['euscan_accounts.userprofile'], null=False)),
|
app_label='djeuscan', model='userprofile'
|
||||||
('herd', models.ForeignKey(orm['djeuscan.herd'], null=False))
|
).update(app_label='euscan_accounts')
|
||||||
))
|
|
||||||
db.create_unique('euscan_accounts_userprofile_herds', ['userprofile_id', 'herd_id'])
|
|
||||||
|
|
||||||
# Adding M2M table for field maintainers on 'UserProfile'
|
|
||||||
db.create_table('euscan_accounts_userprofile_maintainers', (
|
|
||||||
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
|
|
||||||
('userprofile', models.ForeignKey(orm['euscan_accounts.userprofile'], null=False)),
|
|
||||||
('maintainer', models.ForeignKey(orm['djeuscan.maintainer'], null=False))
|
|
||||||
))
|
|
||||||
db.create_unique('euscan_accounts_userprofile_maintainers', ['userprofile_id', 'maintainer_id'])
|
|
||||||
|
|
||||||
# Adding M2M table for field packages on 'UserProfile'
|
|
||||||
db.create_table('euscan_accounts_userprofile_packages', (
|
|
||||||
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
|
|
||||||
('userprofile', models.ForeignKey(orm['euscan_accounts.userprofile'], null=False)),
|
|
||||||
('package', models.ForeignKey(orm['djeuscan.package'], null=False))
|
|
||||||
))
|
|
||||||
db.create_unique('euscan_accounts_userprofile_packages', ['userprofile_id', 'package_id'])
|
|
||||||
|
|
||||||
# Adding M2M table for field categories on 'UserProfile'
|
|
||||||
db.create_table('euscan_accounts_userprofile_categories', (
|
|
||||||
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
|
|
||||||
('userprofile', models.ForeignKey(orm['euscan_accounts.userprofile'], null=False)),
|
|
||||||
('category', models.ForeignKey(orm['djeuscan.category'], null=False))
|
|
||||||
))
|
|
||||||
db.create_unique('euscan_accounts_userprofile_categories', ['userprofile_id', 'category_id'])
|
|
||||||
|
|
||||||
# Adding M2M table for field overlays on 'UserProfile'
|
|
||||||
db.create_table('euscan_accounts_userprofile_overlays', (
|
|
||||||
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
|
|
||||||
('userprofile', models.ForeignKey(orm['euscan_accounts.userprofile'], null=False)),
|
|
||||||
('overlay', models.ForeignKey(orm['djeuscan.overlay'], null=False))
|
|
||||||
))
|
|
||||||
db.create_unique('euscan_accounts_userprofile_overlays', ['userprofile_id', 'overlay_id'])
|
|
||||||
|
|
||||||
def backwards(self, orm):
|
def backwards(self, orm):
|
||||||
# Deleting model 'UserProfile'
|
db.rename_table('euscan_accounts_userprofile',
|
||||||
db.delete_table('euscan_accounts_userprofile')
|
'djeuscan_userprofile')
|
||||||
|
db.rename_table('euscan_accounts_userprofile_overlays',
|
||||||
|
'djeuscan_userprofile_overlays')
|
||||||
|
db.rename_table('euscan_accounts_userprofile_maintainers',
|
||||||
|
'djeuscan_userprofile_maintainers')
|
||||||
|
db.rename_table('euscan_accounts_userprofile_packages',
|
||||||
|
'djeuscan_userprofile_packages')
|
||||||
|
db.rename_table('euscan_accounts_userprofile_herds',
|
||||||
|
'djeuscan_userprofile_herds')
|
||||||
|
db.rename_table('euscan_accounts_userprofile_categories',
|
||||||
|
'djeuscan_userprofile_categories')
|
||||||
|
|
||||||
# Removing M2M table for field herds on 'UserProfile'
|
|
||||||
db.delete_table('euscan_accounts_userprofile_herds')
|
|
||||||
|
|
||||||
# Removing M2M table for field maintainers on 'UserProfile'
|
|
||||||
db.delete_table('euscan_accounts_userprofile_maintainers')
|
|
||||||
|
|
||||||
# Removing M2M table for field packages on 'UserProfile'
|
|
||||||
db.delete_table('euscan_accounts_userprofile_packages')
|
|
||||||
|
|
||||||
# Removing M2M table for field categories on 'UserProfile'
|
|
||||||
db.delete_table('euscan_accounts_userprofile_categories')
|
|
||||||
|
|
||||||
# Removing M2M table for field overlays on 'UserProfile'
|
|
||||||
db.delete_table('euscan_accounts_userprofile_overlays')
|
|
||||||
|
|
||||||
models = {
|
models = {
|
||||||
'auth.group': {
|
'auth.group': {
|
||||||
|
Loading…
Reference in New Issue
Block a user