Add first set of Django 1.7 app migrations
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('documents', '__first__'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='SmartLink',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('title', models.CharField(max_length=96, verbose_name='Title')),
|
||||
('dynamic_title', models.CharField(help_text='This expression will be evaluated against the current selected document.', max_length=96, verbose_name='Dynamic title', blank=True)),
|
||||
('enabled', models.BooleanField(default=True, verbose_name='Enabled')),
|
||||
('document_types', models.ManyToManyField(to='documents.DocumentType', verbose_name='Document types')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Smart link',
|
||||
'verbose_name_plural': 'Smart links',
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='SmartLinkCondition',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('inclusion', models.CharField(default='&', help_text='The inclusion is ignored for the first item.', max_length=16, choices=[('&', 'and'), ('|', 'or')])),
|
||||
('foreign_document_data', models.CharField(help_text='This represents the metadata of all other documents.', max_length=128, verbose_name='Foreign document attribute')),
|
||||
('operator', models.CharField(max_length=16, choices=[('exact', 'is equal to'), ('iexact', 'is equal to (case insensitive)'), ('contains', 'contains'), ('icontains', 'contains (case insensitive)'), ('in', 'is in'), ('gt', 'is greater than'), ('gte', 'is greater than or equal to'), ('lt', 'is less than'), ('lte', 'is less than or equal to'), ('startswith', 'starts with'), ('istartswith', 'starts with (case insensitive)'), ('endswith', 'ends with'), ('iendswith', 'ends with (case insensitive)'), ('regex', 'is in regular expression'), ('iregex', 'is in regular expression (case insensitive)')])),
|
||||
('expression', models.TextField(help_text='This expression will be evaluated against the current document.', verbose_name='Expression')),
|
||||
('negated', models.BooleanField(default=False, help_text='Inverts the logic of the operator.', verbose_name='Negated')),
|
||||
('enabled', models.BooleanField(default=True, verbose_name='Enabled')),
|
||||
('smart_link', models.ForeignKey(related_name='conditions', verbose_name='Smart link', to='linking.SmartLink')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Link condition',
|
||||
'verbose_name_plural': 'Link conditions',
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
]
|
||||
@@ -1,60 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from south.db import db
|
||||
from south.v2 import SchemaMigration
|
||||
from django.db import models
|
||||
|
||||
|
||||
class Migration(SchemaMigration):
|
||||
|
||||
def forwards(self, orm):
|
||||
# Adding model 'SmartLink'
|
||||
db.create_table(u'linking_smartlink', (
|
||||
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
|
||||
('title', self.gf('django.db.models.fields.CharField')(max_length=96)),
|
||||
('dynamic_title', self.gf('django.db.models.fields.CharField')(max_length=96, blank=True)),
|
||||
('enabled', self.gf('django.db.models.fields.BooleanField')(default=True)),
|
||||
))
|
||||
db.send_create_signal(u'linking', ['SmartLink'])
|
||||
|
||||
# Adding model 'SmartLinkCondition'
|
||||
db.create_table(u'linking_smartlinkcondition', (
|
||||
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
|
||||
('smart_link', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['linking.SmartLink'])),
|
||||
('inclusion', self.gf('django.db.models.fields.CharField')(default=u'&', max_length=16)),
|
||||
('foreign_document_data', self.gf('django.db.models.fields.CharField')(max_length=32)),
|
||||
('operator', self.gf('django.db.models.fields.CharField')(max_length=16)),
|
||||
('expression', self.gf('django.db.models.fields.TextField')()),
|
||||
('negated', self.gf('django.db.models.fields.BooleanField')(default=False)),
|
||||
('enabled', self.gf('django.db.models.fields.BooleanField')(default=True)),
|
||||
))
|
||||
db.send_create_signal(u'linking', ['SmartLinkCondition'])
|
||||
|
||||
def backwards(self, orm):
|
||||
# Deleting model 'SmartLink'
|
||||
db.delete_table(u'linking_smartlink')
|
||||
|
||||
# Deleting model 'SmartLinkCondition'
|
||||
db.delete_table(u'linking_smartlinkcondition')
|
||||
|
||||
models = {
|
||||
u'linking.smartlink': {
|
||||
'Meta': {'object_name': 'SmartLink'},
|
||||
'dynamic_title': ('django.db.models.fields.CharField', [], {'max_length': '96', 'blank': 'True'}),
|
||||
'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
|
||||
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'title': ('django.db.models.fields.CharField', [], {'max_length': '96'})
|
||||
},
|
||||
u'linking.smartlinkcondition': {
|
||||
'Meta': {'object_name': 'SmartLinkCondition'},
|
||||
'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
|
||||
'expression': ('django.db.models.fields.TextField', [], {}),
|
||||
'foreign_document_data': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
|
||||
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'inclusion': ('django.db.models.fields.CharField', [], {'default': "u'&'", 'max_length': '16'}),
|
||||
'negated': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
|
||||
'operator': ('django.db.models.fields.CharField', [], {'max_length': '16'}),
|
||||
'smart_link': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['linking.SmartLink']"})
|
||||
}
|
||||
}
|
||||
|
||||
complete_apps = ['linking']
|
||||
@@ -1,51 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from south.db import db
|
||||
from south.v2 import SchemaMigration
|
||||
from django.db import models
|
||||
|
||||
|
||||
class Migration(SchemaMigration):
|
||||
|
||||
def forwards(self, orm):
|
||||
# Adding M2M table for field document_types on 'SmartLink'
|
||||
m2m_table_name = db.shorten_name(u'linking_smartlink_document_types')
|
||||
db.create_table(m2m_table_name, (
|
||||
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
|
||||
('smartlink', models.ForeignKey(orm[u'linking.smartlink'], null=False)),
|
||||
('documenttype', models.ForeignKey(orm[u'documents.documenttype'], null=False))
|
||||
))
|
||||
db.create_unique(m2m_table_name, ['smartlink_id', 'documenttype_id'])
|
||||
|
||||
def backwards(self, orm):
|
||||
# Removing M2M table for field document_types on 'SmartLink'
|
||||
db.delete_table(db.shorten_name(u'linking_smartlink_document_types'))
|
||||
|
||||
models = {
|
||||
u'documents.documenttype': {
|
||||
'Meta': {'ordering': "['name']", 'object_name': 'DocumentType'},
|
||||
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32'}),
|
||||
'ocr': ('django.db.models.fields.BooleanField', [], {'default': 'True'})
|
||||
},
|
||||
u'linking.smartlink': {
|
||||
'Meta': {'object_name': 'SmartLink'},
|
||||
'document_types': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['documents.DocumentType']", 'symmetrical': 'False'}),
|
||||
'dynamic_title': ('django.db.models.fields.CharField', [], {'max_length': '96', 'blank': 'True'}),
|
||||
'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
|
||||
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'title': ('django.db.models.fields.CharField', [], {'max_length': '96'})
|
||||
},
|
||||
u'linking.smartlinkcondition': {
|
||||
'Meta': {'object_name': 'SmartLinkCondition'},
|
||||
'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
|
||||
'expression': ('django.db.models.fields.TextField', [], {}),
|
||||
'foreign_document_data': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
|
||||
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'inclusion': ('django.db.models.fields.CharField', [], {'default': "u'&'", 'max_length': '16'}),
|
||||
'negated': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
|
||||
'operator': ('django.db.models.fields.CharField', [], {'max_length': '16'}),
|
||||
'smart_link': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['linking.SmartLink']"})
|
||||
}
|
||||
}
|
||||
|
||||
complete_apps = ['linking']
|
||||
-47
@@ -1,47 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from south.db import db
|
||||
from south.v2 import SchemaMigration
|
||||
from django.db import models
|
||||
|
||||
|
||||
class Migration(SchemaMigration):
|
||||
|
||||
def forwards(self, orm):
|
||||
|
||||
# Changing field 'SmartLinkCondition.foreign_document_data'
|
||||
db.alter_column(u'linking_smartlinkcondition', 'foreign_document_data', self.gf('django.db.models.fields.CharField')(max_length=128))
|
||||
|
||||
def backwards(self, orm):
|
||||
|
||||
# Changing field 'SmartLinkCondition.foreign_document_data'
|
||||
db.alter_column(u'linking_smartlinkcondition', 'foreign_document_data', self.gf('django.db.models.fields.CharField')(max_length=32))
|
||||
|
||||
models = {
|
||||
u'documents.documenttype': {
|
||||
'Meta': {'ordering': "['name']", 'object_name': 'DocumentType'},
|
||||
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32'}),
|
||||
'ocr': ('django.db.models.fields.BooleanField', [], {'default': 'True'})
|
||||
},
|
||||
u'linking.smartlink': {
|
||||
'Meta': {'object_name': 'SmartLink'},
|
||||
'document_types': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['documents.DocumentType']", 'symmetrical': 'False'}),
|
||||
'dynamic_title': ('django.db.models.fields.CharField', [], {'max_length': '96', 'blank': 'True'}),
|
||||
'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
|
||||
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'title': ('django.db.models.fields.CharField', [], {'max_length': '96'})
|
||||
},
|
||||
u'linking.smartlinkcondition': {
|
||||
'Meta': {'object_name': 'SmartLinkCondition'},
|
||||
'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
|
||||
'expression': ('django.db.models.fields.TextField', [], {}),
|
||||
'foreign_document_data': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
|
||||
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'inclusion': ('django.db.models.fields.CharField', [], {'default': "u'&'", 'max_length': '16'}),
|
||||
'negated': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
|
||||
'operator': ('django.db.models.fields.CharField', [], {'max_length': '16'}),
|
||||
'smart_link': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['linking.SmartLink']"})
|
||||
}
|
||||
}
|
||||
|
||||
complete_apps = ['linking']
|
||||
Reference in New Issue
Block a user