Skip to content

Commit

Permalink
Merge pull request #61 from openimis/develop
Browse files Browse the repository at this point in the history
MERGING RELEASE branches
  • Loading branch information
delcroip authored May 16, 2023
2 parents cce0b76 + 71081dd commit fae6e21
Show file tree
Hide file tree
Showing 3 changed files with 285 additions and 12 deletions.
212 changes: 212 additions & 0 deletions insuree/migrations/0014_add_missing_fields_to_django_scheme.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,212 @@
# Generated by Django 3.2.18 on 2023-05-11 08:46

import core.fields
import datetime
from django.db import migrations, models
import django.db.models.deletion
import uuid


class Migration(migrations.Migration):

dependencies = [
('location', '0013_auto_20230317_1534'),
('policy', '0004_add_medical_oficer_reading_rights'),
('insuree', '0013_auto_20211103_1023'),
]

operations = [
migrations.RenameField(
model_name='confirmationtype',
old_name='altlanguage',
new_name='alt_language',
),
migrations.RenameField(
model_name='confirmationtype',
old_name='sortorder',
new_name='sort_order',
),
migrations.RenameField(
model_name='education',
old_name='altlanguage',
new_name='alt_language',
),
migrations.RenameField(
model_name='education',
old_name='sortorder',
new_name='sort_order',
),
migrations.RenameField(
model_name='family',
old_name='audituser_id',
new_name='audit_user_id',
),
migrations.RenameField(
model_name='profession',
old_name='altlanguage',
new_name='alt_language',
),
migrations.RenameField(
model_name='profession',
old_name='sortorder',
new_name='sort_order',
),
migrations.RenameField(
model_name='relation',
old_name='altlanguage',
new_name='alt_language',
),
migrations.RenameField(
model_name='relation',
old_name='sortorder',
new_name='sort_order',
),
migrations.RemoveField(
model_name='insuree',
name='row_id',
),
migrations.RemoveField(
model_name='insureephoto',
name='insuree_id',
),
migrations.AddField(
model_name='family',
name='confirmation_type',
field=models.ForeignKey(blank=True, db_column='ConfirmationType', null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='families', to='insuree.confirmationtype'),
),
migrations.AddField(
model_name='family',
name='family_type',
field=models.ForeignKey(blank=True, db_column='FamilyType', null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='families', to='insuree.familytype'),
),
migrations.AddField(
model_name='family',
name='head_insuree',
field=models.OneToOneField(db_column='InsureeID', default=None, on_delete=django.db.models.deletion.DO_NOTHING, related_name='head_of', to='insuree.insuree'),
preserve_default=False,
),
migrations.AddField(
model_name='family',
name='json_ext',
field=models.JSONField(blank=True, db_column='JsonExt', null=True),
),
migrations.AddField(
model_name='family',
name='location',
field=models.ForeignKey(blank=True, db_column='LocationId', null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='location.location'),
),
migrations.AddField(
model_name='family',
name='uuid',
field=models.CharField(db_column='FamilyUUID', default=uuid.uuid4, max_length=36, unique=True),
),
migrations.AddField(
model_name='insuree',
name='education',
field=models.ForeignKey(blank=True, db_column='Education', null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='insurees', to='insuree.education'),
),
migrations.AddField(
model_name='insuree',
name='family',
field=models.ForeignKey(blank=True, db_column='FamilyID', null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='members', to='insuree.family'),
),
migrations.AddField(
model_name='insuree',
name='gender',
field=models.ForeignKey(blank=True, db_column='Gender', null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='insurees', to='insuree.gender'),
),
migrations.AddField(
model_name='insuree',
name='health_facility',
field=models.ForeignKey(blank=True, db_column='HFID', null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='insurees', to='location.healthfacility'),
),
migrations.AddField(
model_name='insuree',
name='json_ext',
field=models.JSONField(blank=True, db_column='JsonExt', null=True),
),
migrations.AddField(
model_name='insuree',
name='photo',
field=models.OneToOneField(blank=True, db_column='PhotoID', null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='insuree.insureephoto'),
),
migrations.AddField(
model_name='insuree',
name='profession',
field=models.ForeignKey(blank=True, db_column='Profession', null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='insurees', to='insuree.profession'),
),
migrations.AddField(
model_name='insuree',
name='relationship',
field=models.ForeignKey(blank=True, db_column='Relationship', null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='insurees', to='insuree.relation'),
),
migrations.AddField(
model_name='insuree',
name='type_of_id',
field=models.ForeignKey(blank=True, db_column='TypeOfId', null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='insuree.identificationtype'),
),
migrations.AddField(
model_name='insuree',
name='uuid',
field=models.CharField(db_column='InsureeUUID', default=uuid.uuid4, max_length=36, unique=True),
),
migrations.AddField(
model_name='insureephoto',
name='insuree',
field=models.ForeignKey(blank=True, db_column='InsureeID', null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='photos', to='insuree.insuree'),
),
migrations.AddField(
model_name='insureepolicy',
name='insuree',
field=models.ForeignKey(db_column='InsureeID', default=None, on_delete=django.db.models.deletion.DO_NOTHING, related_name='insuree_policies', to='insuree.insuree'),
preserve_default=False,
),
migrations.AddField(
model_name='insureepolicy',
name='policy',
field=models.ForeignKey(db_column='PolicyId', default=None, on_delete=django.db.models.deletion.DO_NOTHING, related_name='insuree_policies', to='policy.policy'),
preserve_default=False,
),
migrations.AddField(
model_name='policyrenewaldetail',
name='insuree',
field=models.ForeignKey(db_column='InsureeID', default=None, on_delete=django.db.models.deletion.DO_NOTHING, related_name='policy_renewal_details', to='insuree.insuree'),
preserve_default=False,
),
migrations.AddField(
model_name='policyrenewaldetail',
name='policy_renewal',
field=models.ForeignKey(db_column='RenewalID', default=None, on_delete=django.db.models.deletion.DO_NOTHING, related_name='details', to='policy.policyrenewal'),
preserve_default=False,
),
migrations.AlterField(
model_name='family',
name='validity_from',
field=core.fields.DateTimeField(db_column='ValidityFrom', default=datetime.datetime.now),
),
migrations.AlterField(
model_name='insuree',
name='current_village',
field=models.ForeignKey(blank=True, db_column='CurrentVillage', null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='location.location'),
),
migrations.AlterField(
model_name='insuree',
name='validity_from',
field=core.fields.DateTimeField(db_column='ValidityFrom', default=datetime.datetime.now),
),
migrations.AlterField(
model_name='insureephoto',
name='folder',
field=models.CharField(blank=True, db_column='PhotoFolder', max_length=255, null=True),
),
migrations.AlterField(
model_name='insureephoto',
name='validity_from',
field=core.fields.DateTimeField(db_column='ValidityFrom', default=datetime.datetime.now),
),
migrations.AlterField(
model_name='insureepolicy',
name='validity_from',
field=core.fields.DateTimeField(db_column='ValidityFrom', default=datetime.datetime.now),
),
]
61 changes: 61 additions & 0 deletions insuree/migrations/0015_set_managed_to_true_in_all_models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Generated by Django 3.2.18 on 2023-05-11 14:53

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('insuree', '0014_add_missing_fields_to_django_scheme'),
]

operations = [
migrations.AlterModelOptions(
name='confirmationtype',
options={'managed': True},
),
migrations.AlterModelOptions(
name='education',
options={'managed': True},
),
migrations.AlterModelOptions(
name='family',
options={'managed': True},
),
migrations.AlterModelOptions(
name='familytype',
options={'managed': True},
),
migrations.AlterModelOptions(
name='gender',
options={'managed': True},
),
migrations.AlterModelOptions(
name='identificationtype',
options={'managed': True},
),
migrations.AlterModelOptions(
name='insuree',
options={'managed': True},
),
migrations.AlterModelOptions(
name='insureephoto',
options={'managed': True},
),
migrations.AlterModelOptions(
name='insureepolicy',
options={'managed': True},
),
migrations.AlterModelOptions(
name='policyrenewaldetail',
options={'managed': True},
),
migrations.AlterModelOptions(
name='profession',
options={'managed': True},
),
migrations.AlterModelOptions(
name='relation',
options={'managed': True},
),
]
24 changes: 12 additions & 12 deletions insuree/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Gender(models.Model):
db_column='SortOrder', blank=True, null=True)

class Meta:
managed = False
managed = True
db_table = 'tblGender'


Expand Down Expand Up @@ -52,7 +52,7 @@ def full_file_path(self):
return os.path.join(InsureeConfig.insuree_photos_root_path, self.folder, self.filename)

class Meta:
managed = False
managed = True
db_table = 'tblPhotos'


Expand All @@ -66,7 +66,7 @@ class FamilyType(models.Model):
db_column='AltLanguage', max_length=50, blank=True, null=True)

class Meta:
managed = False
managed = True
db_table = 'tblFamilyTypes'


Expand All @@ -81,7 +81,7 @@ class ConfirmationType(models.Model):
db_column='AltLanguage', max_length=50, blank=True, null=True)

class Meta:
managed = False
managed = True
db_table = 'tblConfirmationTypes'


Expand Down Expand Up @@ -143,7 +143,7 @@ def get_queryset(cls, queryset, user):
return queryset

class Meta:
managed = False
managed = True
db_table = 'tblFamilies'


Expand All @@ -156,7 +156,7 @@ class Profession(models.Model):
db_column='AltLanguage', max_length=50, blank=True, null=True)

class Meta:
managed = False
managed = True
db_table = 'tblProfessions'


Expand All @@ -169,7 +169,7 @@ class Education(models.Model):
db_column='AltLanguage', max_length=50, blank=True, null=True)

class Meta:
managed = False
managed = True
db_table = 'tblEducations'


Expand All @@ -180,7 +180,7 @@ class IdentificationType(models.Model):
sort_order = models.IntegerField(db_column='SortOrder', blank=True, null=True) # Field name made lowercase.

class Meta:
managed = False
managed = True
db_table = 'tblIdentificationTypes'


Expand All @@ -193,7 +193,7 @@ class Relation(models.Model):
db_column='AltLanguage', max_length=50, blank=True, null=True)

class Meta:
managed = False
managed = True
db_table = 'tblRelations'


Expand Down Expand Up @@ -295,7 +295,7 @@ def get_queryset(cls, queryset, user):
return queryset

class Meta:
managed = False
managed = True
db_table = 'tblInsuree'


Expand Down Expand Up @@ -336,7 +336,7 @@ def get_queryset(cls, queryset, user):
return queryset

class Meta:
managed = False
managed = True
db_table = 'tblInsureePolicy'


Expand Down Expand Up @@ -373,5 +373,5 @@ class PolicyRenewalDetail(core_models.VersionedModel):
audit_user_id = models.IntegerField(db_column='AuditCreateUser', null=True, blank=True)

class Meta:
managed = False
managed = True
db_table = 'tblPolicyRenewalDetails'

0 comments on commit fae6e21

Please sign in to comment.