Skip to content

Commit

Permalink
fix: migration issue
Browse files Browse the repository at this point in the history
  • Loading branch information
qasimgulzar committed Nov 5, 2024
1 parent 5a38a4c commit 6598ebd
Showing 1 changed file with 31 additions and 36 deletions.
Original file line number Diff line number Diff line change
@@ -1,22 +1,10 @@
# Generated by Django 1.11.20 on 2019-06-05 13:59


from django.conf import settings
from django.db import migrations, models, connection
import django.db.models.deletion
import simple_history.models


def get_compatible_columns():
columns = [
('grade',
models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING,
related_name='+', to='grades.PersistentSubsectionGrade')),
]
if connection.vendor == 'postgresql':
columns = [('grade_id', models.IntegerField()), ] + columns

return columns
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):
Expand All @@ -29,27 +17,34 @@ class Migration(migrations.Migration):
migrations.CreateModel(
name='HistoricalPersistentSubsectionGradeOverride',
fields=[
('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')),
('created', models.DateTimeField(blank=True, db_index=True, editable=False)),
('modified', models.DateTimeField(blank=True, db_index=True, editable=False)),
('earned_all_override', models.FloatField(blank=True, null=True)),
('possible_all_override', models.FloatField(blank=True, null=True)),
('earned_graded_override', models.FloatField(blank=True, null=True)),
('possible_graded_override', models.FloatField(blank=True, null=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)),
] + get_compatible_columns(),
options={
'ordering': ('-history_date', '-history_id'),
'get_latest_by': 'history_date',
'verbose_name': 'historical persistent subsection grade override',
},
bases=(simple_history.models.HistoricalChanges, models.Model),
('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')),
('created', models.DateTimeField(blank=True, db_index=True, editable=False)),
('modified', models.DateTimeField(blank=True, db_index=True, editable=False)),
('earned_all_override', models.FloatField(blank=True, null=True)),
('possible_all_override', models.FloatField(blank=True, null=True)),
('earned_graded_override', models.FloatField(blank=True, null=True)),
('possible_graded_override', models.FloatField(blank=True, null=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 persistent subsection grade override',
},
bases = (simple_history.models.HistoricalChanges, models.Model),
),
migrations.AddField(
model_name='historicalpersistentsubsectiongradeoverride',
name='grade',
field=models.ForeignKey(blank=True, db_constraint=False, null=True,
on_delete=django.db.models.deletion.DO_NOTHING, related_name='+',
to='grades.PersistentSubsectionGrade'),
),
]

0 comments on commit 6598ebd

Please sign in to comment.