/satchmo/apps/product/modules/configurable/migrations/0001_split.py
https://bitbucket.org/bookrepublic/satchmo · Python · 115 lines · 107 code · 7 blank · 1 comment · 0 complexity · 35e4e615af0231537151c48d5a96c0f1 MD5 · raw file
- # encoding: utf-8
- from south.db import db
- from south.v2 import SchemaMigration
- class Migration(SchemaMigration):
- depends_on = (
- ('product', '0010_add_discountable_categories'),
- )
- needed_by = (
- ('product', '0011_split_products'),
- )
- def forwards(self, orm):
- db.rename_table('product_configurableproduct', 'configurable_configurableproduct')
- db.rename_table('product_configurableproduct_option_group', 'configurable_configurableproduct_option_group')
- db.rename_table('product_productvariation', 'configurable_productvariation')
- db.rename_table('product_productvariation_options', 'configurable_productvariation_options')
- def backwards(self, orm):
- db.rename_table('configurable_configurableproduct', 'product_configurableproduct')
- db.rename_table('configurable_configurableproduct_option_group', 'product_configurableproduct_option_group')
- db.rename_table('configurable_productvariation', 'product_productvariation')
- db.rename_table('configurable_productvariation_options', 'product_productvariation_options')
- models = {
- 'configurable.configurableproduct': {
- 'Meta': {'object_name': 'ConfigurableProduct'},
- 'create_subs': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
- 'option_group': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['product.OptionGroup']", 'blank': 'True'}),
- 'product': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['product.Product']", 'unique': 'True', 'primary_key': 'True'})
- },
- 'configurable.productvariation': {
- 'Meta': {'object_name': 'ProductVariation'},
- 'options': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['product.Option']"}),
- 'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['configurable.ConfigurableProduct']"}),
- 'product': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['product.Product']", 'unique': 'True', 'primary_key': 'True'})
- },
- 'product.category': {
- 'Meta': {'unique_together': "(('site', 'slug'),)", 'object_name': 'Category'},
- 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
- 'meta': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
- 'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
- 'ordering': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
- 'parent': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'child'", 'blank': 'True', 'null': 'True', 'to': "orm['product.Category']"}),
- 'related_categories': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'related_categories'", 'blank': 'True', 'null': 'True', 'to': "orm['product.Category']"}),
- 'site': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['sites.Site']"}),
- 'slug': ('django.db.models.fields.SlugField', [], {'db_index': 'True', 'max_length': '50', 'blank': 'True'})
- },
- 'product.option': {
- 'Meta': {'unique_together': "(('option_group', 'value'),)", 'object_name': 'Option'},
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
- 'option_group': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['product.OptionGroup']"}),
- 'price_change': ('satchmo_utils.fields.CurrencyField', [], {'null': 'True', 'max_digits': '14', 'decimal_places': '6', 'blank': 'True'}),
- 'sort_order': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
- 'value': ('django.db.models.fields.CharField', [], {'max_length': '50'})
- },
- 'product.optiongroup': {
- 'Meta': {'object_name': 'OptionGroup'},
- 'description': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
- 'site': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['sites.Site']"}),
- 'sort_order': ('django.db.models.fields.IntegerField', [], {'default': '0'})
- },
- 'product.product': {
- 'Meta': {'unique_together': "(('site', 'sku'), ('site', 'slug'))", 'object_name': 'Product'},
- 'active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
- 'also_purchased': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'also_products'", 'blank': 'True', 'null': 'True', 'to': "orm['product.Product']"}),
- 'category': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['product.Category']", 'blank': 'True'}),
- 'date_added': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
- 'description': ('django.db.models.fields.TextField', [], {'default': "''", 'blank': 'True'}),
- 'featured': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
- 'height': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '6', 'decimal_places': '2', 'blank': 'True'}),
- 'height_units': ('django.db.models.fields.CharField', [], {'max_length': '3', 'null': 'True', 'blank': 'True'}),
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'items_in_stock': ('django.db.models.fields.DecimalField', [], {'default': "'0'", 'max_digits': '18', 'decimal_places': '6'}),
- 'length': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '6', 'decimal_places': '2', 'blank': 'True'}),
- 'length_units': ('django.db.models.fields.CharField', [], {'max_length': '3', 'null': 'True', 'blank': 'True'}),
- 'meta': ('django.db.models.fields.TextField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
- 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
- 'ordering': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
- 'related_items': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'related_products'", 'blank': 'True', 'null': 'True', 'to': "orm['product.Product']"}),
- 'shipclass': ('django.db.models.fields.CharField', [], {'default': "'DEFAULT'", 'max_length': '10'}),
- 'short_description': ('django.db.models.fields.TextField', [], {'default': "''", 'max_length': '200', 'blank': 'True'}),
- 'site': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['sites.Site']"}),
- 'sku': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
- 'slug': ('django.db.models.fields.SlugField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}),
- 'taxClass': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['product.TaxClass']", 'null': 'True', 'blank': 'True'}),
- 'taxable': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
- 'total_sold': ('django.db.models.fields.DecimalField', [], {'default': "'0'", 'max_digits': '18', 'decimal_places': '6'}),
- 'weight': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '8', 'decimal_places': '2', 'blank': 'True'}),
- 'weight_units': ('django.db.models.fields.CharField', [], {'max_length': '3', 'null': 'True', 'blank': 'True'}),
- 'width': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '6', 'decimal_places': '2', 'blank': 'True'}),
- 'width_units': ('django.db.models.fields.CharField', [], {'max_length': '3', 'null': 'True', 'blank': 'True'})
- },
- 'product.taxclass': {
- 'Meta': {'object_name': 'TaxClass'},
- 'description': ('django.db.models.fields.CharField', [], {'max_length': '30'}),
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'title': ('django.db.models.fields.CharField', [], {'max_length': '20'})
- },
- 'sites.site': {
- 'Meta': {'object_name': 'Site', 'db_table': "'django_site'"},
- 'domain': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
- }
- }
- complete_apps = ['configurable']