# Path: boardinghouse/operations.py
# class AddField(migrations.AddField):
#     """
#     Allow adding a field to a model from a different application.
# 
#     This enables us to add the field to contrib.admin.LogEntry that
#     stores the schema for an aware object.
#     """
#     def __init__(self, *args, **kwargs):
#         self.app_label = kwargs.pop('app_label')
#         super(AddField, self).__init__(*args, **kwargs)
# 
#     def state_forwards(self, app_label, state):
#         return super(AddField, self).state_forwards(self.app_label, state)
# 
#     def database_forwards(self, app_label, *args):
#         return super(AddField, self).database_forwards(self.app_label, *args)
# 
#     def database_backwards(self, app_label, *args):
#         return super(AddField, self).database_backwards(self.app_label, *args)


import os
import django.core.validators
import boardinghouse
from django.conf import settings
from django.db import migrations, models
from boardinghouse.operations import AddField
    from boardinghouse.receivers import drop_schemata
        # I really need to be able to ignore this dependency if django.contrib.admin
        # is not installed. Indeed, this whole migration needn't run if it isn't.
        ('admin', '0001_initial'),
        ('boardinghouse', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Schema',
            fields=[
                ('schema', models.CharField(
                    primary_key=True, serialize=False, max_length=36,
                    validators=[django.core.validators.RegexValidator(
                        regex=r'^[a-z][a-z0-9_]*$',
                        message='May only contain lowercase letters, digits and underscores. '
                                'Must start with a letter.')],
                    help_text='The internal name of the schema.<br>'
                              'May only contain lowercase letters, digits and underscores. '
                              'Must start with a letter.<br>May not be changed after creation.', unique=True)),
                ('name', models.CharField(help_text='The display name of the schema.', unique=True, max_length=128)),
                ('is_active', models.BooleanField(default=True, help_text='Use this instead of deleting schemata.')),
                ('users', models.ManyToManyField(
                    help_text='Which users may access data from this schema.',
                    related_name='schemata', to=settings.AUTH_USER_MODEL, blank=True)),
            ],
            options={
                'swappable': 'BOARDINGHOUSE_SCHEMA_MODEL',
                'verbose_name_plural': 'schemata',
            },
            bases=(boardinghouse.base.SharedSchemaMixin, models.Model),

# Path: boardinghouse/operations.py
# class AddField(migrations.AddField):
#     """
#     Allow adding a field to a model from a different application.
# 
#     This enables us to add the field to contrib.admin.LogEntry that
#     stores the schema for an aware object.
#     """
#     def __init__(self, *args, **kwargs):
#         self.app_label = kwargs.pop('app_label')
#         super(AddField, self).__init__(*args, **kwargs)
# 
#     def state_forwards(self, app_label, state):
#         return super(AddField, self).state_forwards(self.app_label, state)
# 
#     def database_forwards(self, app_label, *args):
#         return super(AddField, self).database_forwards(self.app_label, *args)
# 
#     def database_backwards(self, app_label, *args):
#         return super(AddField, self).database_backwards(self.app_label, *args)


# Path: boardinghouse/migrations/0002_patch_admin.py
import os
import django.core.validators
import boardinghouse
from django.conf import settings
from django.db import migrations, models
from boardinghouse.operations import AddField
    from boardinghouse.receivers import drop_schemata

        # I really need to be able to ignore this dependency if django.contrib.admin
        # is not installed. Indeed, this whole migration needn't run if it isn't.
        ('admin', '0001_initial'),
        ('boardinghouse', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Schema',
            fields=[
                ('schema', models.CharField(
                    primary_key=True, serialize=False, max_length=36,
                    validators=[django.core.validators.RegexValidator(
                        regex=r'^[a-z][a-z0-9_]*$',
                        message='May only contain lowercase letters, digits and underscores. '
                                'Must start with a letter.')],
                    help_text='The internal name of the schema.<br>'
                              'May only contain lowercase letters, digits and underscores. '
                              'Must start with a letter.<br>May not be changed after creation.', unique=True)),
                ('name', models.CharField(help_text='The display name of the schema.', unique=True, max_length=128)),
                ('is_active', models.BooleanField(default=True, help_text='Use this instead of deleting schemata.')),
                ('users', models.ManyToManyField(
                    help_text='Which users may access data from this schema.',
                    related_name='schemata', to=settings.AUTH_USER_MODEL, blank=True)),
            ],
            options={
                'swappable': 'BOARDINGHOUSE_SCHEMA_MODEL',
                'verbose_name_plural': 'schemata',
            },
            bases=(boardinghouse.base.SharedSchemaMixin, models.Model),

        ),