Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- 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 'SubscriptionInterval'
- db.add_column('resources_subscriptioninterval', 'content_type', self.gf('django.db.models.fields.related.ForeignKey')(default=1, to=orm['contenttypes.ContentType']), keep_default=False)
- db.add_column('resources_subscriptioninterval', 'object_id', self.gf('django.db.models.fields.PositiveIntegerField')(default=1),
- keep_default=False)
- # Adding unique constraint on 'SubscriptionInterval', fields ['content_type', 'object_id', 'datetime_subscribed', 'datetime_unsubscribed']
- db.create_unique('resources_subscriptioninterval', ['content_type_id', 'object_id', 'datetime_subscribed', 'datetime_unsubscribed'])
- # Adding model 'BaseReport'
- db.create_table('resources_basereport', (
- ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
- ('resource_subscription', self.gf('django.db.models.fields.related.ForeignKey')(related_name='reports', db_column='yandex_account_subscription_id', to=orm['resources.ResourceSubscription'])),
- ('position', self.gf('django.db.models.fields.IntegerField')()),
- ('search_depth', self.gf('django.db.models.fields.IntegerField')()),
- ('datestamp', self.gf('django.db.models.fields.DateField')()),
- ))
- db.send_create_signal('resources', ['BaseReport'])
- # Adding field 'ViewEntry.content_type'
- db.add_column('monitoringengine_ui_viewentry', 'content_type',
- self.gf('django.db.models.fields.related.ForeignKey')(default=1, to=orm['contenttypes.ContentType']),
- keep_default=False)
- # Adding field 'ViewEntry.object_id'
- db.add_column('monitoringengine_ui_viewentry', 'object_id',
- self.gf('django.db.models.fields.PositiveIntegerField')(default=1),
- keep_default=False)
- # Adding M2M table for field google_regions on 'Resource'
- db.create_table('monitoringengine_ui_resource_google_regions', (
- ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
- ('resource', models.ForeignKey(orm['resources.resource'], null=False)),
- ('googleregion', models.ForeignKey(orm['queries.googleregion'], null=False))
- ))
- db.create_unique('monitoringengine_ui_resource_google_regions', ['resource_id', 'googleregion_id'])
- def backwards(self, orm):
- # Removing unique constraint on 'SubscriptionInterval', fields ['content_type', 'object_id', 'datetime_subscribed', 'datetime_unsubscribed']
- db.delete_unique('resources_subscriptioninterval', ['content_type_id', 'object_id', 'datetime_subscribed', 'datetime_unsubscribed'])
- # Deleting model 'SubscriptionInterval'
- db.delete_table('resources_subscriptioninterval')
- # Deleting model 'BaseReport'
- db.delete_table('resources_basereport')
- # Deleting field 'ViewEntry.content_type'
- db.delete_column('monitoringengine_ui_viewentry', 'content_type_id')
- # Deleting field 'ViewEntry.object_id'
- db.delete_column('monitoringengine_ui_viewentry', 'object_id')
- # Adding field 'Resource.is_active'
- db.add_column('monitoringengine_ui_resource', 'is_active',
- self.gf('django.db.models.fields.BooleanField')(default=False),
- keep_default=False)
- # Deleting field 'Resource.deactivation_date'
- db.delete_column('monitoringengine_ui_resource', 'deactivation_date')
- # Removing M2M table for field google_regions on 'Resource'
- db.delete_table('monitoringengine_ui_resource_google_regions')
- models = {
- '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'})
- },
- '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'})
- },
- 'monitoringengine_ui.objectpermission': {
- 'Meta': {'unique_together': "(('perm_type', 'content_type', 'object_id'),)", 'object_name': 'ObjectPermission'},
- 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {}),
- 'perm_type': ('django.db.models.fields.CharField', [], {'max_length': '10'}),
- 'permission': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'object_permission'", 'unique': 'True', 'to': "orm['auth.Permission']"})
- },
- 'queries.basesubscription': {
- 'Meta': {'object_name': 'BaseSubscription'},
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'query': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'subscriptions'", 'to': "orm['queries.Query']"}),
- 'region': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'subscriptions'", 'db_column': "'yandex_region_id'", 'to': "orm['queries.YandexRegion']"})
- },
- 'queries.googleregion': {
- 'Meta': {'object_name': 'GoogleRegion', 'db_table': "'google_regions'", 'managed': 'False'},
- 'gname': ('django.db.models.fields.IntegerField', [], {}),
- 'gurl': ('django.db.models.fields.CharField', [], {'max_length': '250'}),
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'name': ('django.db.models.fields.CharField', [], {'max_length': '250'})
- },
- 'queries.googlesubscription': {
- 'Meta': {'managed': 'False', 'object_name': 'GoogleSubscription', 'db_table': "'google_subscriptions'", '_ormbases': ['queries.BaseSubscription']},
- 'basesubscription_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['queries.BaseSubscription']", 'unique': 'True', 'primary_key': 'True'})
- },
- 'queries.query': {
- 'Meta': {'object_name': 'Query', 'db_table': "'queries'", 'managed': 'False'},
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'querystring': ('django.db.models.fields.CharField', [], {'max_length': '250'})
- },
- 'queries.yandexregion': {
- 'Meta': {'object_name': 'YandexRegion', 'db_table': "'yandex_regions'", 'managed': 'False'},
- 'code': ('django.db.models.fields.IntegerField', [], {}),
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'name': ('django.db.models.fields.CharField', [], {'max_length': '250'})
- },
- 'queries.yandexsubscription': {
- 'Meta': {'managed': 'False', 'object_name': 'YandexSubscription', 'db_table': "'yandex_subscriptions'", '_ormbases': ['queries.BaseSubscription']},
- 'basesubscription_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['queries.BaseSubscription']", 'unique': 'True', 'primary_key': 'True'})
- },
- 'resources.account': {
- 'Meta': {'object_name': 'Account', 'db_table': "'monitoringengine_ui_account'"},
- 'account_type': ('django.db.models.fields.CharField', [], {'max_length': '30'}),
- 'address': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
- 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75'}),
- 'fio': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True'}),
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'inn': ('django.db.models.fields.CharField', [], {'max_length': '12', 'null': 'True'}),
- 'kpp': ('django.db.models.fields.CharField', [], {'max_length': '9', 'null': 'True'}),
- 'max_subscriptions_number': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
- 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
- 'org_full_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}),
- 'org_short_title': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True'}),
- 'phone': ('django.db.models.fields.CharField', [], {'max_length': '15'})
- },
- 'resources.basereport': {
- 'Meta': {'ordering': "['datestamp']", 'object_name': 'BaseReport'},
- 'datestamp': ('django.db.models.fields.DateField', [], {}),
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'position': ('django.db.models.fields.IntegerField', [], {}),
- 'resource_subscription': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'reports'", 'db_column': "'yandex_account_subscription_id'", 'to': "orm['resources.ResourceSubscription']"}),
- 'search_depth': ('django.db.models.fields.IntegerField', [], {})
- },
- 'resources.fixeddate': {
- 'Meta': {'object_name': 'FixedDate', 'db_table': "'monitoringengine_ui_fixeddate'"},
- 'date': ('django.db.models.fields.DateField', [], {}),
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'view': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'fixed_dates'", 'symmetrical': 'False', 'to': "orm['resources.View']"})
- },
- 'resources.googlereport': {
- 'Meta': {'ordering': "['datestamp']", 'managed': 'False', 'object_name': 'GoogleReport', 'db_table': "'google_reports'", '_ormbases': ['resources.BaseReport']},
- 'basereport_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['resources.BaseReport']", 'unique': 'True', 'primary_key': 'True'})
- },
- 'resources.googleresourcesubscription': {
- 'Meta': {'object_name': 'GoogleResourceSubscription', 'db_table': "'google_accounts_subscriptions'", 'managed': 'False'},
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'resource': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'google_resource_subscriptions'", 'to': "orm['resources.Resource']"}),
- 'search_depth': ('django.db.models.fields.IntegerField', [], {}),
- 'subdomain_include': ('resources.models.SubdomainIncludeField', [], {}),
- 'subscription': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'resource_subscriptions'", 'db_column': "'yandex_subscription_id'", 'to': "orm['queries.GoogleSubscription']"}),
- 'visible': ('django.db.models.fields.BooleanField', [], {'default': 'False'})
- },
- 'resources.report': {
- 'Meta': {'ordering': "['datestamp']", 'managed': 'False', 'object_name': 'Report', 'db_table': "'yandex_reports'", '_ormbases': ['resources.BaseReport']},
- 'basereport_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['resources.BaseReport']", 'unique': 'True', 'primary_key': 'True'})
- },
- 'resources.resource': {
- 'Meta': {'object_name': 'Resource', 'db_table': "'monitoringengine_ui_resource'"},
- 'account': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'resources'", 'to': "orm['resources.Account']"}),
- 'bing': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
- 'deactivation_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
- 'google': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
- 'google_regions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['queries.GoogleRegion']", 'symmetrical': 'False'}),
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
- 'note': ('django.db.models.fields.CharField', [], {'max_length': '250'}),
- 'regions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['queries.YandexRegion']", 'symmetrical': 'False'}),
- 'search_depth': ('django.db.models.fields.IntegerField', [], {'default': '200'}),
- 'subdomain_include': ('resources.models.SubdomainIncludeField', [], {}),
- 'time_zone': ('django.db.models.fields.IntegerField', [], {}),
- 'website': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'resources'", 'to': "orm['resources.Website']"}),
- 'yandex': ('django.db.models.fields.BooleanField', [], {'default': 'False'})
- },
- 'resources.resourcesubscription': {
- 'Meta': {'object_name': 'ResourceSubscription', 'db_table': "'yandex_accounts_subscriptions'", 'managed': 'False'},
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'resource': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'resource_subscriptions'", 'to': "orm['resources.Resource']"}),
- 'search_depth': ('django.db.models.fields.IntegerField', [], {}),
- 'subdomain_include': ('resources.models.SubdomainIncludeField', [], {}),
- 'subscription': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'resource_subscriptions'", 'db_column': "'yandex_subscription_id'", 'to': "orm['queries.YandexSubscription']"}),
- 'visible': ('django.db.models.fields.BooleanField', [], {'default': 'False'})
- },
- 'resources.subscriptioninterval': {
- 'Meta': {'unique_together': "(('content_type', 'object_id', 'datetime_subscribed', 'datetime_unsubscribed'),)", 'object_name': 'SubscriptionInterval'},
- 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
- 'datetime_subscribed': ('django.db.models.fields.DateTimeField', [], {}),
- 'datetime_unsubscribed': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {}),
- 'resource_subscription': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'subscription_intervals'", 'to': "orm['resources.ResourceSubscription']"})
- },
- 'resources.view': {
- 'Meta': {'object_name': 'View', 'db_table': "'monitoringengine_ui_view'"},
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'last_changed': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
- 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
- 'resource': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'views'", 'to': "orm['resources.Resource']"})
- },
- 'resources.viewentry': {
- 'Meta': {'ordering': "['sorting_order']", 'object_name': 'ViewEntry', 'db_table': "'monitoringengine_ui_viewentry'"},
- 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {}),
- 'sorting_order': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
- 'subscription': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['resources.ResourceSubscription']"}),
- 'view': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'entries'", 'to': "orm['resources.View']"})
- },
- 'resources.website': {
- 'Meta': {'object_name': 'Website', 'db_table': "'websites'", 'managed': 'False'},
- 'hostname': ('django.db.models.fields.CharField', [], {'max_length': '250'}),
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
- }
- }
- complete_apps = ['resources']
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement