django-orchestra/orchestra/contrib/issues/migrations/0001_initial.py

77 lines
4.4 KiB
Python
Raw Normal View History

2015-04-08 14:41:09 +00:00
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import orchestra.models.fields
2015-04-29 13:55:22 +00:00
from django.conf import settings
2015-04-08 14:41:09 +00:00
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='Message',
fields=[
2015-04-29 13:55:22 +00:00
('id', models.AutoField(auto_created=True, primary_key=True, verbose_name='ID', serialize=False)),
('author_name', models.CharField(verbose_name='author name', max_length=256, blank=True)),
2015-04-08 14:41:09 +00:00
('content', models.TextField(verbose_name='content')),
('created_on', models.DateTimeField(verbose_name='created on', auto_now_add=True)),
2015-04-29 13:55:22 +00:00
('author', models.ForeignKey(related_name='ticket_messages', to=settings.AUTH_USER_MODEL, verbose_name='author')),
2015-04-08 14:41:09 +00:00
],
options={
'get_latest_by': 'id',
},
),
migrations.CreateModel(
name='Queue',
fields=[
2015-04-29 13:55:22 +00:00
('id', models.AutoField(auto_created=True, primary_key=True, verbose_name='ID', serialize=False)),
('name', models.CharField(unique=True, verbose_name='name', max_length=128)),
('verbose_name', models.CharField(verbose_name='verbose_name', max_length=128, blank=True)),
('default', models.BooleanField(default=False, verbose_name='default')),
('notify', orchestra.models.fields.MultiSelectField(choices=[('SUPPORT', 'Support tickets'), ('ADMIN', 'Administrative'), ('BILLING', 'Billing'), ('TECH', 'Technical'), ('ADDS', 'Announcements'), ('EMERGENCY', 'Emergency contact')], help_text='Contacts to notify by email', verbose_name='notify', blank=True, default=('SUPPORT', 'ADMIN', 'BILLING', 'TECH', 'ADDS', 'EMERGENCY'), max_length=256)),
2015-04-08 14:41:09 +00:00
],
),
migrations.CreateModel(
name='Ticket',
fields=[
2015-04-29 13:55:22 +00:00
('id', models.AutoField(auto_created=True, primary_key=True, verbose_name='ID', serialize=False)),
('creator_name', models.CharField(verbose_name='creator name', max_length=256, blank=True)),
2015-04-08 14:41:09 +00:00
('subject', models.CharField(verbose_name='subject', max_length=256)),
('description', models.TextField(verbose_name='description')),
2015-04-29 13:55:22 +00:00
('priority', models.CharField(choices=[('HIGH', 'High'), ('MEDIUM', 'Medium'), ('LOW', 'Low')], default='MEDIUM', max_length=32, verbose_name='priority')),
('state', models.CharField(choices=[('NEW', 'New'), ('IN_PROGRESS', 'In Progress'), ('RESOLVED', 'Resolved'), ('FEEDBACK', 'Feedback'), ('REJECTED', 'Rejected'), ('CLOSED', 'Closed')], default='NEW', max_length=32, verbose_name='state')),
2015-04-08 14:41:09 +00:00
('created_at', models.DateTimeField(verbose_name='created', auto_now_add=True)),
('updated_at', models.DateTimeField(verbose_name='modified', auto_now=True)),
2015-04-29 13:55:22 +00:00
('cc', models.TextField(help_text='emails to send a carbon copy to', verbose_name='CC', blank=True)),
('creator', models.ForeignKey(null=True, related_name='tickets_created', to=settings.AUTH_USER_MODEL, verbose_name='created by')),
('owner', models.ForeignKey(null=True, related_name='tickets_owned', blank=True, to=settings.AUTH_USER_MODEL, verbose_name='assigned to')),
('queue', models.ForeignKey(null=True, related_name='tickets', blank=True, to='issues.Queue')),
2015-04-08 14:41:09 +00:00
],
options={
'ordering': ['-updated_at'],
},
),
migrations.CreateModel(
name='TicketTracker',
fields=[
2015-04-29 13:55:22 +00:00
('id', models.AutoField(auto_created=True, primary_key=True, verbose_name='ID', serialize=False)),
('ticket', models.ForeignKey(related_name='trackers', to='issues.Ticket', verbose_name='ticket')),
('user', models.ForeignKey(related_name='ticket_trackers', to=settings.AUTH_USER_MODEL, verbose_name='user')),
2015-04-08 14:41:09 +00:00
],
),
migrations.AddField(
model_name='message',
name='ticket',
2015-04-29 13:55:22 +00:00
field=models.ForeignKey(related_name='messages', to='issues.Ticket', verbose_name='ticket'),
2015-04-08 14:41:09 +00:00
),
migrations.AlterUniqueTogether(
name='tickettracker',
unique_together=set([('ticket', 'user')]),
),
]