~lifeless/python-oops-tools/prune

« back to all changes in this revision

Viewing changes to src/oopstools/oops/migrations/0014_auto__add_prefixgroup__add_field_prefix_group.py

  • Committer: Robert Collins
  • Date: 2011-10-13 20:18:51 UTC
  • Revision ID: robertc@robertcollins.net-20111013201851-ym8jmdhoeol3p83s
Export of cruft-deleted tree.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright 2005-2011 Canonical Ltd.  All rights reserved.
 
2
#
 
3
# This program is free software: you can redistribute it and/or modify
 
4
# it under the terms of the GNU Affero General Public License as published by
 
5
# the Free Software Foundation, either version 3 of the License, or
 
6
# (at your option) any later version.
 
7
#
 
8
# This program is distributed in the hope that it will be useful,
 
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
# GNU Affero General Public License for more details.
 
12
#
 
13
# You should have received a copy of the GNU Affero General Public License
 
14
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
15
 
 
16
# encoding: utf-8
 
17
import datetime
 
18
from south.db import db
 
19
from south.v2 import SchemaMigration
 
20
from django.db import models
 
21
 
 
22
class Migration(SchemaMigration):
 
23
    
 
24
    def forwards(self, orm):
 
25
        
 
26
        # Adding model 'PrefixGroup'
 
27
        db.create_table('oops_prefixgroup', (
 
28
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
 
29
            ('value', self.gf('django.db.models.fields.CharField')(unique=True, max_length=50)),
 
30
        ))
 
31
        db.send_create_signal('oops', ['PrefixGroup'])
 
32
 
 
33
        # Adding field 'Prefix.group'
 
34
        db.add_column('oops_prefix', 'group', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['oops.PrefixGroup'], null=True), keep_default=False)
 
35
    
 
36
    
 
37
    def backwards(self, orm):
 
38
        
 
39
        # Deleting model 'PrefixGroup'
 
40
        db.delete_table('oops_prefixgroup')
 
41
 
 
42
        # Deleting field 'Prefix.group'
 
43
        db.delete_column('oops_prefix', 'group_id')
 
44
    
 
45
    
 
46
    models = {
 
47
        'oops.appinstance': {
 
48
            'Meta': {'object_name': 'AppInstance'},
 
49
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
 
50
            'title': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '50'})
 
51
        },
 
52
        'oops.classification': {
 
53
            'Meta': {'object_name': 'Classification'},
 
54
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
 
55
            'title': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'})
 
56
        },
 
57
        'oops.dboopsrootdirectory': {
 
58
            'Meta': {'object_name': 'DBOopsRootDirectory'},
 
59
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
 
60
            'last_date': ('django.db.models.fields.DateField', [], {'null': 'True'}),
 
61
            'last_oops': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True'}),
 
62
            'root_dir': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '200'})
 
63
        },
 
64
        'oops.infestation': {
 
65
            'Meta': {'unique_together': "(('exception_type', 'exception_value'),)", 'object_name': 'Infestation'},
 
66
            'bug': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True'}),
 
67
            'exception_type': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
 
68
            'exception_value': ('django.db.models.fields.CharField', [], {'max_length': '1000'}),
 
69
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
 
70
        },
 
71
        'oops.oops': {
 
72
            'Meta': {'object_name': 'Oops'},
 
73
            'appinstance': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['oops.AppInstance']"}),
 
74
            'classification': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['oops.Classification']", 'null': 'True'}),
 
75
            'date': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}),
 
76
            'duration': ('django.db.models.fields.FloatField', [], {'null': 'True'}),
 
77
            'http_method': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True'}),
 
78
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
 
79
            'informational': ('django.db.models.fields.NullBooleanField', [], {'null': 'True'}),
 
80
            'is_bot': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'db_index': 'True'}),
 
81
            'is_local_referrer': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'db_index': 'True'}),
 
82
            'most_expensive_statement': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'db_index': 'True'}),
 
83
            'oopsid': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '200'}),
 
84
            'oopsinfestation': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['oops.Infestation']"}),
 
85
            'pageid': ('django.db.models.fields.CharField', [], {'max_length': '500'}),
 
86
            'pathname': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '200'}),
 
87
            'prefix': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['oops.Prefix']"}),
 
88
            'referrer': ('django.db.models.fields.URLField', [], {'max_length': '500', 'null': 'True'}),
 
89
            'statements_count': ('django.db.models.fields.PositiveIntegerField', [], {}),
 
90
            'time_is_estimate': ('django.db.models.fields.NullBooleanField', [], {'null': 'True'}),
 
91
            'total_time': ('django.db.models.fields.PositiveIntegerField', [], {}),
 
92
            'url': ('django.db.models.fields.URLField', [], {'max_length': '500', 'null': 'True', 'db_index': 'True'}),
 
93
            'user_agent': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True'})
 
94
        },
 
95
        'oops.prefix': {
 
96
            'Meta': {'object_name': 'Prefix'},
 
97
            'appinstance': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['oops.AppInstance']"}),
 
98
            'group': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['oops.PrefixGroup']", 'null': 'True'}),
 
99
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
 
100
            'value': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20'})
 
101
        },
 
102
        'oops.prefixgroup': {
 
103
            'Meta': {'object_name': 'PrefixGroup'},
 
104
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
 
105
            'value': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '50'})
 
106
        },
 
107
        'oops.project': {
 
108
            'Meta': {'object_name': 'Project'},
 
109
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
 
110
            'title': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '200'})
 
111
        },
 
112
    }
 
113
    
 
114
    complete_apps = ['oops']