Skip to content

Commit

Permalink
Merge pull request #103 from edx/diana/squash-migrations
Browse files Browse the repository at this point in the history
Squash migrations.
  • Loading branch information
dianakhuang authored Apr 10, 2020
2 parents 6a53563 + c389e6d commit 6e092b5
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 1 deletion.
2 changes: 1 addition & 1 deletion organizations/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""
edx-organizations app initialization module
"""
__version__ = '5.0.0' # pragma: no cover
__version__ = '5.1.0' # pragma: no cover
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Generated by Django 2.2.12 on 2020-04-10 08:58

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import model_utils.fields
import simple_history.models


class Migration(migrations.Migration):

replaces = [('organizations', '0001_initial'), ('organizations', '0002_auto_20170117_1434'), ('organizations', '0003_auto_20170221_1138'), ('organizations', '0004_auto_20170413_2315'), ('organizations', '0005_auto_20171116_0640'), ('organizations', '0006_auto_20171207_0259'), ('organizations', '0007_historicalorganization')]

initial = True

dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]

operations = [
migrations.CreateModel(
name='Organization',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
('name', models.CharField(db_index=True, max_length=255)),
('short_name', models.CharField(db_index=True, help_text='Please do not use spaces or special characters. Only allowed special characters are period (.), hyphen (-) and underscore (_).', max_length=255, verbose_name='Short Name')),
('description', models.TextField(blank=True, null=True)),
('logo', models.ImageField(blank=True, help_text='Please add only .PNG files for logo images. This logo will be used on certificates.', max_length=255, null=True, upload_to='organization_logos')),
('active', models.BooleanField(default=True)),
],
options={
'abstract': False,
},
),
migrations.CreateModel(
name='OrganizationCourse',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
('course_id', models.CharField(db_index=True, max_length=255, verbose_name='Course ID')),
('active', models.BooleanField(default=True)),
('organization', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='organizations.Organization')),
],
options={
'verbose_name': 'Link Course',
'verbose_name_plural': 'Link Courses',
'unique_together': {('course_id', 'organization')},
},
),
migrations.CreateModel(
name='HistoricalOrganization',
fields=[
('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')),
('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
('name', models.CharField(db_index=True, max_length=255)),
('short_name', models.CharField(db_index=True, help_text='Please do not use spaces or special characters. Only allowed special characters are period (.), hyphen (-) and underscore (_).', max_length=255, verbose_name='Short Name')),
('description', models.TextField(blank=True, null=True)),
('logo', models.TextField(blank=True, help_text='Please add only .PNG files for logo images. This logo will be used on certificates.', max_length=255, null=True)),
('active', models.BooleanField(default=True)),
('history_id', models.AutoField(primary_key=True, serialize=False)),
('history_date', models.DateTimeField()),
('history_change_reason', models.CharField(max_length=100, null=True)),
('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)),
('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
],
options={
'ordering': ('-history_date', '-history_id'),
'get_latest_by': 'history_date',
'verbose_name': 'historical organization',
},
bases=(simple_history.models.HistoricalChanges, models.Model),
),
]
14 changes: 14 additions & 0 deletions test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,17 @@
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination',
'DATETIME_FORMAT': '%Y-%m-%dT%H:%M:%SZ'
}

# Django requires this for admin usage.
TEMPLATES = [
{
"BACKEND": "django.template.backends.django.DjangoTemplates",
"APP_DIRS": True,
"OPTIONS": {
"context_processors": {
"django.contrib.auth.context_processors.auth", # this is required for admin
"django.contrib.messages.context_processors.messages",
}
}
},
]

0 comments on commit 6e092b5

Please sign in to comment.