Commit bd38fdb9 authored by John Red Medrano's avatar John Red Medrano

Merge pull request #106 in RMS/api-main-service from red-develop to RMSv2

* commit 'b3f64fda':
  pull update from gladys branch
  replace all slug on management section with code
parents 59fbdf26 b3f64fda
...@@ -9,12 +9,12 @@ from django.forms.models import model_to_dict ...@@ -9,12 +9,12 @@ from django.forms.models import model_to_dict
class UserSerializer(serializers.ModelSerializer): class UserSerializer(serializers.ModelSerializer):
def to_representation(self, instance): # department = serializers.CharField(write_only=True)
def to_representation(self, instance):
ret = super().to_representation(instance) ret = super().to_representation(instance)
ret['department'] = model_to_dict(instance.department) ret['department'] = model_to_dict(instance.department)
ret['company'] = model_to_dict(instance.department.company) ret['company'] = model_to_dict(instance.department.company)
# print(instance.application.all())
application = [data['id'] for data in instance.application.values()] application = [data['id'] for data in instance.application.values()]
ret['application'] = application ret['application'] = application
...@@ -27,7 +27,7 @@ class UserSerializer(serializers.ModelSerializer): ...@@ -27,7 +27,7 @@ class UserSerializer(serializers.ModelSerializer):
'username', 'contact_no', 'username', 'contact_no',
'email', 'default_app', 'email', 'default_app',
'user_type', 'is_active', 'user_type', 'is_active',
'doa' 'doa', 'department'
) )
......
...@@ -30,7 +30,7 @@ class UserViewSet(viewsets.ModelViewSet): ...@@ -30,7 +30,7 @@ class UserViewSet(viewsets.ModelViewSet):
queryset = User.objects.all() queryset = User.objects.all()
serializer_class = serializer.UserSerializer serializer_class = serializer.UserSerializer
pagination_class = CustomPagination pagination_class = CustomPagination
# lookup_field = 'code' lookup_field = 'code'
filter_backends = (DjangoFilterBackend, SearchFilter, OrderingFilter) filter_backends = (DjangoFilterBackend, SearchFilter, OrderingFilter)
filterset_class = UserFilterSet filterset_class = UserFilterSet
ordering_fields = '__all__' ordering_fields = '__all__'
...@@ -53,13 +53,14 @@ class UserViewSet(viewsets.ModelViewSet): ...@@ -53,13 +53,14 @@ class UserViewSet(viewsets.ModelViewSet):
password_hash = make_password(password) password_hash = make_password(password)
app = Application.objects.filter( app = Application.objects.filter(
id__in=request.data['application'] code__in=request.data['application']
) )
instance = User.objects.get( instance = User.objects.get(
id=serializer.data['id'] id=serializer.data['id']
) )
instance.application.set(app) instance.application.set(app)
User.objects.filter( User.objects.filter(
......
...@@ -19,6 +19,7 @@ class ApplicationViewSet(viewsets.ModelViewSet): ...@@ -19,6 +19,7 @@ class ApplicationViewSet(viewsets.ModelViewSet):
queryset = Application.objects.all() queryset = Application.objects.all()
serializer_class = serializer.ApplicationSerializer serializer_class = serializer.ApplicationSerializer
pagination_class = CustomPagination pagination_class = CustomPagination
lookup_field = 'code'
filter_backends = (DjangoFilterBackend, SearchFilter, OrderingFilter) filter_backends = (DjangoFilterBackend, SearchFilter, OrderingFilter)
filterset_class = ApplicationFilterSet filterset_class = ApplicationFilterSet
ordering_fields = '__all__' ordering_fields = '__all__'
......
...@@ -19,6 +19,7 @@ class CompanyViewSet(viewsets.ModelViewSet): ...@@ -19,6 +19,7 @@ class CompanyViewSet(viewsets.ModelViewSet):
queryset = Company.objects.all() queryset = Company.objects.all()
serializer_class = serializer.CompanySerializer serializer_class = serializer.CompanySerializer
pagination_class = CustomPagination pagination_class = CustomPagination
lookup_field = 'code'
filter_backends = (DjangoFilterBackend, SearchFilter, OrderingFilter) filter_backends = (DjangoFilterBackend, SearchFilter, OrderingFilter)
filterset_class = CompanyFilterSet filterset_class = CompanyFilterSet
ordering_fields = '__all__' ordering_fields = '__all__'
......
...@@ -19,6 +19,7 @@ class DepartmentViewSet(viewsets.ModelViewSet): ...@@ -19,6 +19,7 @@ class DepartmentViewSet(viewsets.ModelViewSet):
queryset = Department.objects.all() queryset = Department.objects.all()
serializer_class = serializer.DepartmentSerializer serializer_class = serializer.DepartmentSerializer
pagination_class = CustomPagination pagination_class = CustomPagination
lookup_field = 'code'
filter_backends = (DjangoFilterBackend, SearchFilter, OrderingFilter) filter_backends = (DjangoFilterBackend, SearchFilter, OrderingFilter)
filterset_class = DepartmentFilterSet filterset_class = DepartmentFilterSet
ordering_fields = '__all__' ordering_fields = '__all__'
......
...@@ -21,6 +21,7 @@ class ModuleViewSet(viewsets.ModelViewSet): ...@@ -21,6 +21,7 @@ class ModuleViewSet(viewsets.ModelViewSet):
queryset = Module.objects.order_by('application', 'parent', 'sort_id') queryset = Module.objects.order_by('application', 'parent', 'sort_id')
serializer_class = serializer.ModuleSerializer serializer_class = serializer.ModuleSerializer
pagination_class = CustomPagination pagination_class = CustomPagination
lookup_field = 'code'
filter_backends = (DjangoFilterBackend, SearchFilter, OrderingFilter) filter_backends = (DjangoFilterBackend, SearchFilter, OrderingFilter)
filterset_class = ModuleFilterSet filterset_class = ModuleFilterSet
ordering_fields = '__all__' ordering_fields = '__all__'
......
...@@ -15,6 +15,7 @@ class AdminCompanyViewSet(viewsets.ModelViewSet): ...@@ -15,6 +15,7 @@ class AdminCompanyViewSet(viewsets.ModelViewSet):
queryset = Company.objects.all() queryset = Company.objects.all()
serializer_class = AdminCompanySerializer serializer_class = AdminCompanySerializer
pagination_class = CustomPagination pagination_class = CustomPagination
lookup_field = 'code'
filter_backends = (DjangoFilterBackend, SearchFilter, OrderingFilter) filter_backends = (DjangoFilterBackend, SearchFilter, OrderingFilter)
filterset_class = CompanyFilterSet filterset_class = CompanyFilterSet
ordering_fields = '__all__' ordering_fields = '__all__'
......
...@@ -18,6 +18,7 @@ class AdminDepartmentViewSet(viewsets.ModelViewSet): ...@@ -18,6 +18,7 @@ class AdminDepartmentViewSet(viewsets.ModelViewSet):
queryset = Department.objects.all() queryset = Department.objects.all()
serializer_class = serializer.AdminDepartmentSerializer serializer_class = serializer.AdminDepartmentSerializer
pagination_class = CustomPagination pagination_class = CustomPagination
lookup_field = 'code'
filter_backends = (DjangoFilterBackend, SearchFilter, OrderingFilter) filter_backends = (DjangoFilterBackend, SearchFilter, OrderingFilter)
filterset_class = DepartmentFilterSet filterset_class = DepartmentFilterSet
ordering_fields = '__all__' ordering_fields = '__all__'
......
# Generated by Django 2.2 on 2019-09-09 15:16 # Generated by Django 2.2 on 2019-09-17 15:31
from django.conf import settings from django.conf import settings
from django.db import migrations, models from django.db import migrations, models
...@@ -26,7 +26,6 @@ class Migration(migrations.Migration): ...@@ -26,7 +26,6 @@ class Migration(migrations.Migration):
('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')), ('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')), ('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')), ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
('default_app', models.CharField(blank=True, max_length=255, null=True)),
('user_type', models.CharField(choices=[('SU', 'SU'), ('OUA', 'OUA'), ('CUA', 'CUA'), ('DUA', 'DUA'), ('USR', 'USR')], default='USR', max_length=100)), ('user_type', models.CharField(choices=[('SU', 'SU'), ('OUA', 'OUA'), ('CUA', 'CUA'), ('DUA', 'DUA'), ('USR', 'USR')], default='USR', max_length=100)),
('code', models.CharField(default='acct', max_length=255, unique=True)), ('code', models.CharField(default='acct', max_length=255, unique=True)),
('name', models.CharField(max_length=255)), ('name', models.CharField(max_length=255)),
...@@ -49,7 +48,6 @@ class Migration(migrations.Migration): ...@@ -49,7 +48,6 @@ class Migration(migrations.Migration):
('modifiedby', models.CharField(max_length=255)), ('modifiedby', models.CharField(max_length=255)),
('code', models.CharField(max_length=255, unique=True)), ('code', models.CharField(max_length=255, unique=True)),
('name', models.CharField(max_length=255, unique=True)), ('name', models.CharField(max_length=255, unique=True)),
('app_code', models.CharField(max_length=255)),
], ],
options={ options={
'db_table': 'applications', 'db_table': 'applications',
...@@ -76,13 +74,10 @@ class Migration(migrations.Migration): ...@@ -76,13 +74,10 @@ class Migration(migrations.Migration):
fields=[ fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('requested_to_template_name', models.CharField(max_length=255)), ('requested_to_template_name', models.CharField(max_length=255)),
('requested_to_template_id', models.CharField(max_length=255)),
('requested_to_objective', models.CharField(blank=True, max_length=255, null=True)), ('requested_to_objective', models.CharField(blank=True, max_length=255, null=True)),
('requested_to_target_date', models.DateTimeField(blank=True, null=True)),
('requested_to_priority', models.CharField(max_length=255)), ('requested_to_priority', models.CharField(max_length=255)),
('description', models.CharField(blank=True, max_length=255, null=True)), ('description', models.CharField(blank=True, max_length=255, null=True)),
('created', models.DateTimeField(auto_now_add=True)), ('created', models.DateTimeField(auto_now_add=True)),
('deleted_at', models.DateTimeField(blank=True, null=True)),
('form_code', models.CharField(max_length=255, unique=True)), ('form_code', models.CharField(max_length=255, unique=True)),
('cancel_date', models.DateTimeField(blank=True, null=True)), ('cancel_date', models.DateTimeField(blank=True, null=True)),
('status', models.CharField(max_length=50)), ('status', models.CharField(max_length=50)),
...@@ -90,6 +85,8 @@ class Migration(migrations.Migration): ...@@ -90,6 +85,8 @@ class Migration(migrations.Migration):
('department_desc', models.CharField(blank=True, max_length=255, null=True)), ('department_desc', models.CharField(blank=True, max_length=255, null=True)),
('requested_desc', models.CharField(blank=True, max_length=255, null=True)), ('requested_desc', models.CharField(blank=True, max_length=255, null=True)),
('old_form_code', models.CharField(blank=True, max_length=255, null=True)), ('old_form_code', models.CharField(blank=True, max_length=255, null=True)),
('requested_to_template_id', models.CharField(max_length=255)),
('requested_to_target_date', models.DateTimeField(blank=True, null=True)),
], ],
options={ options={
'db_table': 'change_request_form_headers', 'db_table': 'change_request_form_headers',
...@@ -105,7 +102,7 @@ class Migration(migrations.Migration): ...@@ -105,7 +102,7 @@ class Migration(migrations.Migration):
('modifiedby', models.CharField(max_length=255)), ('modifiedby', models.CharField(max_length=255)),
('action', models.CharField(choices=[('Add', 'Add'), ('Update', 'Update'), ('DELETED', 'DELETED')], default='Add', max_length=50)), ('action', models.CharField(choices=[('Add', 'Add'), ('Update', 'Update'), ('DELETED', 'DELETED')], default='Add', max_length=50)),
('entity', models.CharField(choices=[('CR_FRM_APPROVER', 'CR_FRM_APPROVER'), ('CR_FRM_ATTACHMENT', 'CR_FRM_ATTACHMENT'), ('CR_FRM_DETAIL', 'CR_FRM_DETAIL'), ('CR_FRM_HEADER', 'CR_FRM_HEADER'), ('CR_FRM_STAKE', 'CR_FRM_STAKE'), ('CR_TMP_APPROVER', 'CR_TMP_APPROVER'), ('CR_TMP_ATTACHMENT', 'CR_TMP_ATTACHMENT'), ('CR_TMP_DETAIL', 'CR_TMP_DETAIL'), ('CR_TMP_HEADER', 'CR_TMP_HEADER'), ('CR_TMP_STAKE', 'CR_TMP_STAKE')], default='CR_FRM_HEADER', max_length=50)), ('entity', models.CharField(choices=[('CR_FRM_APPROVER', 'CR_FRM_APPROVER'), ('CR_FRM_ATTACHMENT', 'CR_FRM_ATTACHMENT'), ('CR_FRM_DETAIL', 'CR_FRM_DETAIL'), ('CR_FRM_HEADER', 'CR_FRM_HEADER'), ('CR_FRM_STAKE', 'CR_FRM_STAKE'), ('CR_TMP_APPROVER', 'CR_TMP_APPROVER'), ('CR_TMP_ATTACHMENT', 'CR_TMP_ATTACHMENT'), ('CR_TMP_DETAIL', 'CR_TMP_DETAIL'), ('CR_TMP_HEADER', 'CR_TMP_HEADER'), ('CR_TMP_STAKE', 'CR_TMP_STAKE')], default='CR_FRM_HEADER', max_length=50)),
('form_code', models.IntegerField()), ('form_code', models.CharField(blank=True, max_length=255, null=True)),
('fromValue', models.TextField(blank=True, null=True)), ('fromValue', models.TextField(blank=True, null=True)),
('toValue', models.TextField(blank=True, null=True)), ('toValue', models.TextField(blank=True, null=True)),
], ],
...@@ -118,14 +115,14 @@ class Migration(migrations.Migration): ...@@ -118,14 +115,14 @@ class Migration(migrations.Migration):
fields=[ fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('requested_to_template_name', models.CharField(max_length=255)), ('requested_to_template_name', models.CharField(max_length=255)),
('requested_to_template_id', models.CharField(max_length=255)),
('requested_to_objective', models.CharField(blank=True, max_length=255, null=True)), ('requested_to_objective', models.CharField(blank=True, max_length=255, null=True)),
('requested_to_target_date', models.DateTimeField(blank=True, null=True)),
('requested_to_priority', models.CharField(max_length=255)), ('requested_to_priority', models.CharField(max_length=255)),
('description', models.CharField(blank=True, max_length=255, null=True)), ('description', models.CharField(blank=True, max_length=255, null=True)),
('created', models.DateTimeField(auto_now_add=True)), ('created', models.DateTimeField(auto_now_add=True)),
('deleted_at', models.DateTimeField(blank=True, null=True)),
('template_no', models.CharField(max_length=255, unique=True)), ('template_no', models.CharField(max_length=255, unique=True)),
('requested_to_template_id', models.CharField(max_length=255, unique=True)),
('requested_to_target_date', models.CharField(blank=True, max_length=10, null=True)),
('archived_at', models.DateTimeField(blank=True, null=True)),
], ],
options={ options={
'db_table': 'change_request_template_headers', 'db_table': 'change_request_template_headers',
...@@ -147,6 +144,23 @@ class Migration(migrations.Migration): ...@@ -147,6 +144,23 @@ class Migration(migrations.Migration):
'db_table': 'companies', 'db_table': 'companies',
}, },
), ),
migrations.CreateModel(
name='EmailLogs',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created', models.DateTimeField(auto_now_add=True)),
('createdby', models.CharField(max_length=255)),
('modified', models.DateTimeField(auto_now=True)),
('modifiedby', models.CharField(max_length=255)),
('template', models.CharField(max_length=255)),
('recipients', models.CharField(max_length=255)),
('content', models.TextField()),
('is_sent', models.BooleanField(default=True)),
],
options={
'db_table': 'email_logs',
},
),
migrations.CreateModel( migrations.CreateModel(
name='EntityLog', name='EntityLog',
fields=[ fields=[
...@@ -165,6 +179,21 @@ class Migration(migrations.Migration): ...@@ -165,6 +179,21 @@ class Migration(migrations.Migration):
'db_table': 'entity_logs', 'db_table': 'entity_logs',
}, },
), ),
migrations.CreateModel(
name='PasswordReset',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('email', models.EmailField(max_length=255)),
('token', models.CharField(max_length=255)),
('created_at', models.DateTimeField()),
('timeout_at', models.DateTimeField()),
('is_active', models.BooleanField(default=True)),
('code', models.CharField(max_length=50)),
],
options={
'db_table': 'password_resets',
},
),
migrations.CreateModel( migrations.CreateModel(
name='Permission', name='Permission',
fields=[ fields=[
...@@ -225,7 +254,7 @@ class Migration(migrations.Migration): ...@@ -225,7 +254,7 @@ class Migration(migrations.Migration):
('name', models.CharField(blank=True, max_length=255, null=True)), ('name', models.CharField(blank=True, max_length=255, null=True)),
('image', models.ImageField(max_length=255, null=True, upload_to='user_images/')), ('image', models.ImageField(max_length=255, null=True, upload_to='user_images/')),
('is_primary', models.BooleanField(default=True)), ('is_primary', models.BooleanField(default=True)),
('user', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='user_images', to=settings.AUTH_USER_MODEL)), ('user', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='user_images', to=settings.AUTH_USER_MODEL, to_field='code')),
], ],
options={ options={
'db_table': 'auth_user_images', 'db_table': 'auth_user_images',
...@@ -275,10 +304,10 @@ class Migration(migrations.Migration): ...@@ -275,10 +304,10 @@ class Migration(migrations.Migration):
('modifiedby', models.CharField(max_length=255)), ('modifiedby', models.CharField(max_length=255)),
('code', models.CharField(default='mod', max_length=255, unique=True)), ('code', models.CharField(default='mod', max_length=255, unique=True)),
('name', models.CharField(blank=True, max_length=255, null=True, unique=True)), ('name', models.CharField(blank=True, max_length=255, null=True, unique=True)),
('parent', models.IntegerField()), ('parent', models.IntegerField(blank=True, null=True)),
('sort_id', models.IntegerField()), ('sort_id', models.IntegerField()),
('component', models.CharField(blank=True, max_length=255, null=True)), ('component', models.CharField(blank=True, max_length=255, null=True)),
('application', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='modules', to='entities.Application')), ('application', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='modules', to='entities.Application', to_field='code')),
], ],
options={ options={
'db_table': 'modules', 'db_table': 'modules',
...@@ -294,7 +323,7 @@ class Migration(migrations.Migration): ...@@ -294,7 +323,7 @@ class Migration(migrations.Migration):
('modifiedby', models.CharField(max_length=255)), ('modifiedby', models.CharField(max_length=255)),
('code', models.CharField(default='dept', max_length=255, unique=True)), ('code', models.CharField(default='dept', max_length=255, unique=True)),
('name', models.CharField(max_length=255, unique=True)), ('name', models.CharField(max_length=255, unique=True)),
('company', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='companies', to='entities.Company')), ('company', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='companies', to='entities.Company', to_field='code')),
], ],
options={ options={
'db_table': 'departments', 'db_table': 'departments',
...@@ -306,8 +335,8 @@ class Migration(migrations.Migration): ...@@ -306,8 +335,8 @@ class Migration(migrations.Migration):
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('delegation', models.CharField(blank=True, max_length=255, null=True)), ('delegation', models.CharField(blank=True, max_length=255, null=True)),
('created', models.DateTimeField(blank=True, null=True)), ('created', models.DateTimeField(blank=True, null=True)),
('deleted_at', models.DateTimeField(blank=True, null=True)),
('code', models.CharField(max_length=255, unique=True)), ('code', models.CharField(max_length=255, unique=True)),
('archived_at', models.DateTimeField(blank=True, null=True)),
('template_no', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='tmp_stakes', to='entities.ChangeRequestTemplateHeader', to_field='template_no')), ('template_no', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='tmp_stakes', to='entities.ChangeRequestTemplateHeader', to_field='template_no')),
('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.DO_NOTHING, to=settings.AUTH_USER_MODEL, to_field='code')), ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.DO_NOTHING, to=settings.AUTH_USER_MODEL, to_field='code')),
], ],
...@@ -349,8 +378,8 @@ class Migration(migrations.Migration): ...@@ -349,8 +378,8 @@ class Migration(migrations.Migration):
('field_val', models.TextField(max_length=255)), ('field_val', models.TextField(max_length=255)),
('field_props', models.TextField(max_length=255)), ('field_props', models.TextField(max_length=255)),
('created', models.DateTimeField(blank=True, null=True)), ('created', models.DateTimeField(blank=True, null=True)),
('deleted_at', models.DateTimeField(blank=True, null=True)),
('code', models.CharField(max_length=255, unique=True)), ('code', models.CharField(max_length=255, unique=True)),
('archived_at', models.DateTimeField(blank=True, null=True)),
('template_no', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='tmp_details', to='entities.ChangeRequestTemplateHeader', to_field='template_no')), ('template_no', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='tmp_details', to='entities.ChangeRequestTemplateHeader', to_field='template_no')),
], ],
options={ options={
...@@ -367,8 +396,8 @@ class Migration(migrations.Migration): ...@@ -367,8 +396,8 @@ class Migration(migrations.Migration):
('description', models.CharField(blank=True, max_length=255, null=True)), ('description', models.CharField(blank=True, max_length=255, null=True)),
('file_upload', models.FileField(blank=True, null=True, upload_to='uploads/')), ('file_upload', models.FileField(blank=True, null=True, upload_to='uploads/')),
('created', models.DateTimeField(blank=True, null=True)), ('created', models.DateTimeField(blank=True, null=True)),
('deleted_at', models.DateTimeField(blank=True, null=True)),
('code', models.CharField(max_length=255, unique=True)), ('code', models.CharField(max_length=255, unique=True)),
('archived_at', models.DateTimeField(blank=True, null=True)),
('template_no', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='tmp_attachments', to='entities.ChangeRequestTemplateHeader', to_field='template_no')), ('template_no', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='tmp_attachments', to='entities.ChangeRequestTemplateHeader', to_field='template_no')),
('uploaded_by', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to=settings.AUTH_USER_MODEL, to_field='code')), ('uploaded_by', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to=settings.AUTH_USER_MODEL, to_field='code')),
], ],
...@@ -383,8 +412,8 @@ class Migration(migrations.Migration): ...@@ -383,8 +412,8 @@ class Migration(migrations.Migration):
('level', models.CharField(blank=True, max_length=50, null=True)), ('level', models.CharField(blank=True, max_length=50, null=True)),
('delegation', models.CharField(blank=True, max_length=50, null=True)), ('delegation', models.CharField(blank=True, max_length=50, null=True)),
('created', models.DateTimeField(blank=True, null=True)), ('created', models.DateTimeField(blank=True, null=True)),
('deleted_at', models.DateTimeField(blank=True, null=True)),
('code', models.CharField(max_length=255, unique=True)), ('code', models.CharField(max_length=255, unique=True)),
('archived_at', models.DateTimeField(blank=True, null=True)),
('template_no', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='tmp_approvers', to='entities.ChangeRequestTemplateHeader', to_field='template_no')), ('template_no', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='tmp_approvers', to='entities.ChangeRequestTemplateHeader', to_field='template_no')),
('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.DO_NOTHING, to=settings.AUTH_USER_MODEL, to_field='code')), ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.DO_NOTHING, to=settings.AUTH_USER_MODEL, to_field='code')),
], ],
...@@ -398,7 +427,6 @@ class Migration(migrations.Migration): ...@@ -398,7 +427,6 @@ class Migration(migrations.Migration):
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('delegation', models.CharField(blank=True, max_length=255, null=True)), ('delegation', models.CharField(blank=True, max_length=255, null=True)),
('created', models.DateTimeField(blank=True, null=True)), ('created', models.DateTimeField(blank=True, null=True)),
('deleted_at', models.DateTimeField(blank=True, null=True)),
('code', models.CharField(max_length=255, unique=True)), ('code', models.CharField(max_length=255, unique=True)),
('date_added', models.DateTimeField(blank=True, null=True)), ('date_added', models.DateTimeField(blank=True, null=True)),
('form_code', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='frm_stakes', to='entities.ChangeRequestFormHeader', to_field='form_code')), ('form_code', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='frm_stakes', to='entities.ChangeRequestFormHeader', to_field='form_code')),
...@@ -448,7 +476,6 @@ class Migration(migrations.Migration): ...@@ -448,7 +476,6 @@ class Migration(migrations.Migration):
('field_val', models.TextField(max_length=255)), ('field_val', models.TextField(max_length=255)),
('field_props', models.TextField(max_length=255)), ('field_props', models.TextField(max_length=255)),
('created', models.DateTimeField(blank=True, null=True)), ('created', models.DateTimeField(blank=True, null=True)),
('deleted_at', models.DateTimeField(blank=True, null=True)),
('code', models.CharField(max_length=255, unique=True)), ('code', models.CharField(max_length=255, unique=True)),
('form_code', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='frm_details', to='entities.ChangeRequestFormHeader', to_field='form_code')), ('form_code', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='frm_details', to='entities.ChangeRequestFormHeader', to_field='form_code')),
('tmp_detail', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='entities.ChangeRequestTemplateDetails', to_field='code')), ('tmp_detail', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='entities.ChangeRequestTemplateDetails', to_field='code')),
...@@ -467,7 +494,6 @@ class Migration(migrations.Migration): ...@@ -467,7 +494,6 @@ class Migration(migrations.Migration):
('description', models.CharField(blank=True, max_length=255, null=True)), ('description', models.CharField(blank=True, max_length=255, null=True)),
('file_upload', models.FileField(blank=True, null=True, upload_to='uploads/')), ('file_upload', models.FileField(blank=True, null=True, upload_to='uploads/')),
('created', models.DateTimeField(blank=True, null=True)), ('created', models.DateTimeField(blank=True, null=True)),
('deleted_at', models.DateTimeField(blank=True, null=True)),
('code', models.CharField(max_length=255, unique=True)), ('code', models.CharField(max_length=255, unique=True)),
('form_code', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='frm_attachments', to='entities.ChangeRequestFormHeader', to_field='form_code')), ('form_code', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='frm_attachments', to='entities.ChangeRequestFormHeader', to_field='form_code')),
('tmp_attach', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='entities.ChangeRequestTemplateAttachments', to_field='code')), ('tmp_attach', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='entities.ChangeRequestTemplateAttachments', to_field='code')),
...@@ -484,7 +510,6 @@ class Migration(migrations.Migration): ...@@ -484,7 +510,6 @@ class Migration(migrations.Migration):
('level', models.CharField(blank=True, max_length=50, null=True)), ('level', models.CharField(blank=True, max_length=50, null=True)),
('delegation', models.CharField(blank=True, max_length=50, null=True)), ('delegation', models.CharField(blank=True, max_length=50, null=True)),
('created', models.DateTimeField(blank=True, null=True)), ('created', models.DateTimeField(blank=True, null=True)),
('deleted_at', models.DateTimeField(blank=True, null=True)),
('code', models.CharField(max_length=255, unique=True)), ('code', models.CharField(max_length=255, unique=True)),
('remarks', models.CharField(blank=True, max_length=255, null=True)), ('remarks', models.CharField(blank=True, max_length=255, null=True)),
('action', models.CharField(blank=True, max_length=50, null=True)), ('action', models.CharField(blank=True, max_length=50, null=True)),
...@@ -506,7 +531,7 @@ class Migration(migrations.Migration): ...@@ -506,7 +531,7 @@ class Migration(migrations.Migration):
('passcode', models.CharField(max_length=255)), ('passcode', models.CharField(max_length=255)),
('timeout', models.IntegerField()), ('timeout', models.IntegerField()),
('is_active', models.BooleanField(default=False)), ('is_active', models.BooleanField(default=False)),
('user', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='auth_access_token', to=settings.AUTH_USER_MODEL)), ('user', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='auth_access_token', to=settings.AUTH_USER_MODEL, to_field='code')),
], ],
options={ options={
'db_table': 'auth_access_token', 'db_table': 'auth_access_token',
...@@ -517,15 +542,20 @@ class Migration(migrations.Migration): ...@@ -517,15 +542,20 @@ class Migration(migrations.Migration):
name='application', name='application',
field=models.ManyToManyField(to='entities.Application'), field=models.ManyToManyField(to='entities.Application'),
), ),
migrations.AddField(
model_name='user',
name='default_app',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='default_app', to='entities.Application', to_field='code'),
),
migrations.AddField( migrations.AddField(
model_name='user', model_name='user',
name='department', name='department',
field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.PROTECT, related_name='department_users', to='entities.Department'), field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='department_users', to='entities.Department', to_field='code'),
), ),
migrations.AddField( migrations.AddField(
model_name='user', model_name='user',
name='doa', name='doa',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='doa_users', to=settings.AUTH_USER_MODEL), field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='doa_users', to=settings.AUTH_USER_MODEL, to_field='code'),
), ),
migrations.AddField( migrations.AddField(
model_name='user', model_name='user',
......
# Generated by Django 2.2 on 2019-09-09 17:14
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('entities', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='application',
name='app_code',
),
]
# Generated by Django 2.2 on 2019-09-10 09:56
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('entities', '0002_remove_application_app_code'),
]
operations = [
migrations.AlterField(
model_name='changerequestformheader',
name='requested_to_template_id',
field=models.CharField(max_length=255, unique=True),
),
migrations.AlterField(
model_name='changerequesttemplateheader',
name='requested_to_template_id',
field=models.CharField(max_length=255, unique=True),
),
]
# Generated by Django 2.2 on 2019-09-10 16:10
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('entities', '0003_auto_20190910_0956'),
]
operations = [
migrations.AlterField(
model_name='module',
name='parent',
field=models.IntegerField(blank=True, null=True),
),
]
# Generated by Django 2.2 on 2019-09-10 16:56
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('entities', '0004_auto_20190910_1610'),
]
operations = [
migrations.CreateModel(
name='EmailLogs',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created', models.DateTimeField(auto_now_add=True)),
('createdby', models.CharField(max_length=255)),
('modified', models.DateTimeField(auto_now=True)),
('modifiedby', models.CharField(max_length=255)),
('template', models.CharField(max_length=255)),
('recipients', models.CharField(max_length=255)),
('content', models.TextField()),
],
options={
'abstract': False,
},
),
]
# Generated by Django 2.2 on 2019-09-10 17:02
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('entities', '0005_emaillogs'),
]
operations = [
migrations.AddField(
model_name='emaillogs',
name='is_sent',
field=models.BooleanField(default=True),
),
]
# Generated by Django 2.2 on 2019-09-11 10:26
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('entities', '0006_emaillogs_is_sent'),
]
operations = [
migrations.AlterModelTable(
name='emaillogs',
table='email_logs',
),
]
# Generated by Django 2.2 on 2019-09-11 11:02
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('entities', '0006_emaillogs_is_sent'),
]
operations = [
migrations.AlterField(
model_name='changerequestformheader',
name='requested_to_template_id',
field=models.CharField(max_length=255),
),
]
# Generated by Django 2.2 on 2019-09-11 17:15
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('entities', '0007_auto_20190911_1102'),
]
operations = [
migrations.AlterField(
model_name='changerequesthistory',
name='form_code',
field=models.CharField(blank=True, max_length=255, null=True),
),
]
# Generated by Django 2.2 on 2019-09-11 11:53
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('entities', '0007_auto_20190911_1026'),
]
operations = [
migrations.CreateModel(
name='PasswordReset',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('email', models.EmailField(max_length=255)),
('token', models.CharField(max_length=255)),
('created_at', models.DateTimeField()),
('timeout_at', models.DateTimeField()),
('is_active', models.BooleanField(default=True)),
('code', models.CharField(max_length=50)),
],
options={
'db_table': 'password_resets',
},
),
]
# Generated by Django 2.2 on 2019-09-11 18:45
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('entities', '0008_auto_20190911_1715'),
]
operations = [
migrations.RenameField(
model_name='changerequestformapprovers',
old_name='deleted_at',
new_name='archived_at',
),
migrations.RenameField(
model_name='changerequestformattachments',
old_name='deleted_at',
new_name='archived_at',
),
migrations.RenameField(
model_name='changerequestformdetails',
old_name='deleted_at',
new_name='archived_at',
),
migrations.RenameField(
model_name='changerequestformheader',
old_name='deleted_at',
new_name='archived_at',
),
migrations.RenameField(
model_name='changerequestformstakeholders',
old_name='deleted_at',
new_name='archived_at',
),
migrations.RenameField(
model_name='changerequesttemplateapprovers',
old_name='deleted_at',
new_name='archived_at',
),
migrations.RenameField(
model_name='changerequesttemplateattachments',
old_name='deleted_at',
new_name='archived_at',
),
migrations.RenameField(
model_name='changerequesttemplatedetails',
old_name='deleted_at',
new_name='archived_at',
),
migrations.RenameField(
model_name='changerequesttemplateheader',
old_name='deleted_at',
new_name='archived_at',
),
migrations.RenameField(
model_name='changerequesttemplatestakeholders',
old_name='deleted_at',
new_name='archived_at',
),
]
# Generated by Django 2.2 on 2019-09-13 11:43
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('entities', '0009_auto_20190911_1845'),
]
operations = [
migrations.RemoveField(
model_name='changerequestformapprovers',
name='archived_at',
),
migrations.RemoveField(
model_name='changerequestformattachments',
name='archived_at',
),
migrations.RemoveField(
model_name='changerequestformdetails',
name='archived_at',
),
migrations.RemoveField(
model_name='changerequestformheader',
name='archived_at',
),
migrations.RemoveField(
model_name='changerequestformstakeholders',
name='archived_at',
),
]
# Generated by Django 2.2 on 2019-09-13 15:45
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('entities', '0008_passwordreset'),
('entities', '0010_auto_20190913_1143'),
]
operations = [
]
# Generated by Django 2.2 on 2019-09-13 17:04
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('entities', '0011_merge_20190913_1545'),
]
operations = [
migrations.AlterField(
model_name='changerequesttemplateheader',
name='requested_to_target_date',
field=models.CharField(blank=True, max_length=10, null=True),
),
]
# Generated by Django 2.2 on 2019-09-17 16:20
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('entities', '0012_auto_20190913_1704'),
]
operations = [
migrations.AlterField(
model_name='changerequesthistory',
name='action',
field=models.CharField(max_length=50),
),
migrations.AlterField(
model_name='changerequesthistory',
name='entity',
field=models.CharField(max_length=50),
),
migrations.AlterField(
model_name='notification',
name='account_no',
field=models.CharField(blank=True, max_length=255, null=True),
),
migrations.AlterField(
model_name='notification',
name='app',
field=models.CharField(blank=True, max_length=255, null=True),
),
migrations.AlterField(
model_name='notification',
name='form_code',
field=models.CharField(blank=True, max_length=255, null=True),
),
migrations.AlterField(
model_name='notification',
name='sender_account_no',
field=models.CharField(blank=True, max_length=255, null=True),
),
]
...@@ -43,6 +43,7 @@ class Application(AuditClass): ...@@ -43,6 +43,7 @@ class Application(AuditClass):
class Module(AuditClass): class Module(AuditClass):
application = models.ForeignKey( application = models.ForeignKey(
Application, Application,
to_field='code',
related_name='modules', related_name='modules',
on_delete=models.PROTECT on_delete=models.PROTECT
) )
...@@ -108,6 +109,7 @@ class Department(AuditClass): ...@@ -108,6 +109,7 @@ class Department(AuditClass):
# ) # )
company = models.ForeignKey( company = models.ForeignKey(
Company, Company,
to_field='code',
related_name='companies', related_name='companies',
on_delete=models.PROTECT on_delete=models.PROTECT
) )
...@@ -204,9 +206,12 @@ class User(AbstractUser): ...@@ -204,9 +206,12 @@ class User(AbstractUser):
Application Application
) )
department = models.ForeignKey( department = models.ForeignKey(
Department, related_name='department_users', Department,
to_field='code',
related_name='department_users',
on_delete=models.PROTECT, on_delete=models.PROTECT,
default=1 blank=True,
null=True
) )
# role = models.ForeignKey( # role = models.ForeignKey(
# Role, # Role,
...@@ -214,7 +219,15 @@ class User(AbstractUser): ...@@ -214,7 +219,15 @@ class User(AbstractUser):
# on_delete=models.PROTECT, # on_delete=models.PROTECT,
# default=1 # default=1
# ) # )
default_app = models.CharField(blank=True, null=True, max_length=255) # default_app = models.CharField(blank=True, null=True, max_length=255)
default_app = models.ForeignKey(
Application,
to_field='code',
related_name='default_app',
on_delete=models.PROTECT,
blank=True,
null=True
)
user_type = models.CharField( user_type = models.CharField(
choices=[(tag.value, tag.value) for tag in enums.UserTypeEnum], choices=[(tag.value, tag.value) for tag in enums.UserTypeEnum],
default=enums.UserTypeEnum.USER.value, default=enums.UserTypeEnum.USER.value,
...@@ -233,7 +246,9 @@ class User(AbstractUser): ...@@ -233,7 +246,9 @@ class User(AbstractUser):
null=True null=True
) )
doa = models.ForeignKey( doa = models.ForeignKey(
'User', related_name='doa_users', 'User',
to_field='code',
related_name='doa_users',
on_delete=models.PROTECT, on_delete=models.PROTECT,
blank=True, blank=True,
null=True null=True
...@@ -258,6 +273,7 @@ class User(AbstractUser): ...@@ -258,6 +273,7 @@ class User(AbstractUser):
class UserImage(AuditClass): class UserImage(AuditClass):
user = models.ForeignKey( user = models.ForeignKey(
User, User,
to_field='code',
related_name='user_images', related_name='user_images',
on_delete=models.PROTECT on_delete=models.PROTECT
) )
...@@ -300,7 +316,7 @@ class AuthToken(models.Model): ...@@ -300,7 +316,7 @@ class AuthToken(models.Model):
passcode = models.CharField(max_length=255) passcode = models.CharField(max_length=255)
timeout = models.IntegerField() timeout = models.IntegerField()
is_active = models.BooleanField(default=False) is_active = models.BooleanField(default=False)
user = models.ForeignKey(User, user = models.ForeignKey(User, to_field='code',
related_name='auth_access_token', related_name='auth_access_token',
on_delete=models.PROTECT) on_delete=models.PROTECT)
...@@ -957,3 +973,4 @@ class PasswordReset(models.Model): ...@@ -957,3 +973,4 @@ class PasswordReset(models.Model):
class Meta: class Meta:
db_table = 'password_resets' db_table = 'password_resets'
...@@ -84,7 +84,7 @@ class rms: ...@@ -84,7 +84,7 @@ class rms:
elif rms.user_type(self) == rms.enums_company: elif rms.user_type(self) == rms.enums_company:
user_company = rms.user(self).department.company user_company = rms.user(self).department.company
request_department = Department.objects.filter( request_department = Department.objects.filter(
Q(id=request.data['department']) & Q(code=request.data['department']) &
Q(company=user_company) Q(company=user_company)
) )
if not request_department: if not request_department:
......
This source diff could not be displayed because it is too large. You can view the blob instead.
-- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 10.3.12-MariaDB - mariadb.org binary distribution
-- Server OS: Win64
-- HeidiSQL Version: 9.4.0.5125
-- --------------------------------------------------------
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!50503 SET NAMES utf8mb4 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-- Dumping database structure for rms_db
CREATE DATABASE IF NOT EXISTS `rms_db` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `rms_db`;
-- Dumping structure for table rms_db.applications
CREATE TABLE IF NOT EXISTS `applications` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`created` datetime(6) NOT NULL,
`createdby` varchar(255) NOT NULL,
`modified` datetime(6) NOT NULL,
`modifiedby` varchar(255) NOT NULL,
`code` varchar(255) NOT NULL,
`name` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `code` (`code`),
UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
-- Dumping data for table rms_db.applications: ~3 rows (approximately)
DELETE FROM `applications`;
/*!40000 ALTER TABLE `applications` DISABLE KEYS */;
INSERT INTO `applications` (`id`, `created`, `createdby`, `modified`, `modifiedby`, `code`, `name`) VALUES
(1, '2019-09-17 15:39:48.741506', 'superuser', '2019-09-17 15:39:48.741506', 'superuser', 'APP-20190917-0000001', 'Resource Management System'),
(2, '2019-09-17 15:39:56.650410', 'superuser', '2019-09-17 15:39:56.650410', 'superuser', 'APP-20190917-0000002', 'Change Request Management System'),
(3, '2019-09-17 15:40:12.001433', 'superuser', '2019-09-17 15:40:12.001433', 'superuser', 'APP-20190917-0000003', 'Asset Management System');
/*!40000 ALTER TABLE `applications` ENABLE KEYS */;
-- Dumping structure for table rms_db.attachments
CREATE TABLE IF NOT EXISTS `attachments` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`created` datetime(6) NOT NULL,
`createdby` varchar(255) NOT NULL,
`modified` datetime(6) NOT NULL,
`modifiedby` varchar(255) NOT NULL,
`code` varchar(255) DEFAULT NULL,
`name` varchar(255) NOT NULL,
`description` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Dumping data for table rms_db.attachments: ~0 rows (approximately)
DELETE FROM `attachments`;
/*!40000 ALTER TABLE `attachments` DISABLE KEYS */;
/*!40000 ALTER TABLE `attachments` ENABLE KEYS */;
-- Dumping structure for table rms_db.authtoken_token
CREATE TABLE IF NOT EXISTS `authtoken_token` (
`key` varchar(40) NOT NULL,
`created` datetime(6) NOT NULL,
`user_id` int(11) NOT NULL,
PRIMARY KEY (`key`),
UNIQUE KEY `user_id` (`user_id`),
CONSTRAINT `authtoken_token_user_id_35299eff_fk_auth_user_id` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Dumping data for table rms_db.authtoken_token: ~1 rows (approximately)
DELETE FROM `authtoken_token`;
/*!40000 ALTER TABLE `authtoken_token` DISABLE KEYS */;
INSERT INTO `authtoken_token` (`key`, `created`, `user_id`) VALUES
('c31a15d4793d2c8bf82230446cce9924c055f9c7', '2019-09-17 16:29:01.409868', 1);
/*!40000 ALTER TABLE `authtoken_token` ENABLE KEYS */;
-- Dumping structure for table rms_db.auth_access_token
CREATE TABLE IF NOT EXISTS `auth_access_token` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`ref` varchar(255) NOT NULL,
`token` longtext NOT NULL,
`passcode` varchar(255) NOT NULL,
`timeout` int(11) NOT NULL,
`is_active` tinyint(1) NOT NULL,
`user_id` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
KEY `auth_access_token_user_id_c480a680_fk_auth_user_code` (`user_id`),
CONSTRAINT `auth_access_token_user_id_c480a680_fk_auth_user_code` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Dumping data for table rms_db.auth_access_token: ~0 rows (approximately)
DELETE FROM `auth_access_token`;
/*!40000 ALTER TABLE `auth_access_token` DISABLE KEYS */;
/*!40000 ALTER TABLE `auth_access_token` ENABLE KEYS */;
-- Dumping structure for table rms_db.auth_group
CREATE TABLE IF NOT EXISTS `auth_group` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(150) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Dumping data for table rms_db.auth_group: ~0 rows (approximately)
DELETE FROM `auth_group`;
/*!40000 ALTER TABLE `auth_group` DISABLE KEYS */;
/*!40000 ALTER TABLE `auth_group` ENABLE KEYS */;
-- Dumping structure for table rms_db.auth_group_permissions
CREATE TABLE IF NOT EXISTS `auth_group_permissions` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`group_id` int(11) NOT NULL,
`permission_id` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `auth_group_permissions_group_id_permission_id_0cd325b0_uniq` (`group_id`,`permission_id`),
KEY `auth_group_permissio_permission_id_84c5c92e_fk_auth_perm` (`permission_id`),
CONSTRAINT `auth_group_permissio_permission_id_84c5c92e_fk_auth_perm` FOREIGN KEY (`permission_id`) REFERENCES `auth_permission` (`id`),
CONSTRAINT `auth_group_permissions_group_id_b120cbf9_fk_auth_group_id` FOREIGN KEY (`group_id`) REFERENCES `auth_group` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Dumping data for table rms_db.auth_group_permissions: ~0 rows (approximately)
DELETE FROM `auth_group_permissions`;
/*!40000 ALTER TABLE `auth_group_permissions` DISABLE KEYS */;
/*!40000 ALTER TABLE `auth_group_permissions` ENABLE KEYS */;
-- Dumping structure for table rms_db.auth_permission
CREATE TABLE IF NOT EXISTS `auth_permission` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`content_type_id` int(11) NOT NULL,
`codename` varchar(100) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `auth_permission_content_type_id_codename_01ab375a_uniq` (`content_type_id`,`codename`),
CONSTRAINT `auth_permission_content_type_id_2f476e4b_fk_django_co` FOREIGN KEY (`content_type_id`) REFERENCES `django_content_type` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=133 DEFAULT CHARSET=utf8;
-- Dumping data for table rms_db.auth_permission: ~132 rows (approximately)
DELETE FROM `auth_permission`;
/*!40000 ALTER TABLE `auth_permission` DISABLE KEYS */;
INSERT INTO `auth_permission` (`id`, `name`, `content_type_id`, `codename`) VALUES
(1, 'Can add log entry', 1, 'add_logentry'),
(2, 'Can change log entry', 1, 'change_logentry'),
(3, 'Can delete log entry', 1, 'delete_logentry'),
(4, 'Can view log entry', 1, 'view_logentry'),
(5, 'Can add permission', 2, 'add_permission'),
(6, 'Can change permission', 2, 'change_permission'),
(7, 'Can delete permission', 2, 'delete_permission'),
(8, 'Can view permission', 2, 'view_permission'),
(9, 'Can add group', 3, 'add_group'),
(10, 'Can change group', 3, 'change_group'),
(11, 'Can delete group', 3, 'delete_group'),
(12, 'Can view group', 3, 'view_group'),
(13, 'Can add content type', 4, 'add_contenttype'),
(14, 'Can change content type', 4, 'change_contenttype'),
(15, 'Can delete content type', 4, 'delete_contenttype'),
(16, 'Can view content type', 4, 'view_contenttype'),
(17, 'Can add session', 5, 'add_session'),
(18, 'Can change session', 5, 'change_session'),
(19, 'Can delete session', 5, 'delete_session'),
(20, 'Can view session', 5, 'view_session'),
(21, 'Can add Token', 6, 'add_token'),
(22, 'Can change Token', 6, 'change_token'),
(23, 'Can delete Token', 6, 'delete_token'),
(24, 'Can view Token', 6, 'view_token'),
(25, 'Can add user', 7, 'add_user'),
(26, 'Can change user', 7, 'change_user'),
(27, 'Can delete user', 7, 'delete_user'),
(28, 'Can view user', 7, 'view_user'),
(29, 'Can add application', 8, 'add_application'),
(30, 'Can change application', 8, 'change_application'),
(31, 'Can delete application', 8, 'delete_application'),
(32, 'Can view application', 8, 'view_application'),
(33, 'Can add attachment', 9, 'add_attachment'),
(34, 'Can change attachment', 9, 'change_attachment'),
(35, 'Can delete attachment', 9, 'delete_attachment'),
(36, 'Can view attachment', 9, 'view_attachment'),
(37, 'Can add change request form header', 10, 'add_changerequestformheader'),
(38, 'Can change change request form header', 10, 'change_changerequestformheader'),
(39, 'Can delete change request form header', 10, 'delete_changerequestformheader'),
(40, 'Can view change request form header', 10, 'view_changerequestformheader'),
(41, 'Can add change request history', 11, 'add_changerequesthistory'),
(42, 'Can change change request history', 11, 'change_changerequesthistory'),
(43, 'Can delete change request history', 11, 'delete_changerequesthistory'),
(44, 'Can view change request history', 11, 'view_changerequesthistory'),
(45, 'Can add change request template header', 12, 'add_changerequesttemplateheader'),
(46, 'Can change change request template header', 12, 'change_changerequesttemplateheader'),
(47, 'Can delete change request template header', 12, 'delete_changerequesttemplateheader'),
(48, 'Can view change request template header', 12, 'view_changerequesttemplateheader'),
(49, 'Can add company', 13, 'add_company'),
(50, 'Can change company', 13, 'change_company'),
(51, 'Can delete company', 13, 'delete_company'),
(52, 'Can view company', 13, 'view_company'),
(53, 'Can add email logs', 14, 'add_emaillogs'),
(54, 'Can change email logs', 14, 'change_emaillogs'),
(55, 'Can delete email logs', 14, 'delete_emaillogs'),
(56, 'Can view email logs', 14, 'view_emaillogs'),
(57, 'Can add entity log', 15, 'add_entitylog'),
(58, 'Can change entity log', 15, 'change_entitylog'),
(59, 'Can delete entity log', 15, 'delete_entitylog'),
(60, 'Can view entity log', 15, 'view_entitylog'),
(61, 'Can add password reset', 16, 'add_passwordreset'),
(62, 'Can change password reset', 16, 'change_passwordreset'),
(63, 'Can delete password reset', 16, 'delete_passwordreset'),
(64, 'Can view password reset', 16, 'view_passwordreset'),
(65, 'Can add permission', 17, 'add_permission'),
(66, 'Can change permission', 17, 'change_permission'),
(67, 'Can delete permission', 17, 'delete_permission'),
(68, 'Can view permission', 17, 'view_permission'),
(69, 'Can add role', 18, 'add_role'),
(70, 'Can change role', 18, 'change_role'),
(71, 'Can delete role', 18, 'delete_role'),
(72, 'Can view role', 18, 'view_role'),
(73, 'Can add status', 19, 'add_status'),
(74, 'Can change status', 19, 'change_status'),
(75, 'Can delete status', 19, 'delete_status'),
(76, 'Can view status', 19, 'view_status'),
(77, 'Can add user image', 20, 'add_userimage'),
(78, 'Can change user image', 20, 'change_userimage'),
(79, 'Can delete user image', 20, 'delete_userimage'),
(80, 'Can view user image', 20, 'view_userimage'),
(81, 'Can add role permission', 21, 'add_rolepermission'),
(82, 'Can change role permission', 21, 'change_rolepermission'),
(83, 'Can delete role permission', 21, 'delete_rolepermission'),
(84, 'Can view role permission', 21, 'view_rolepermission'),
(85, 'Can add notification', 22, 'add_notification'),
(86, 'Can change notification', 22, 'change_notification'),
(87, 'Can delete notification', 22, 'delete_notification'),
(88, 'Can view notification', 22, 'view_notification'),
(89, 'Can add module', 23, 'add_module'),
(90, 'Can change module', 23, 'change_module'),
(91, 'Can delete module', 23, 'delete_module'),
(92, 'Can view module', 23, 'view_module'),
(93, 'Can add department', 24, 'add_department'),
(94, 'Can change department', 24, 'change_department'),
(95, 'Can delete department', 24, 'delete_department'),
(96, 'Can view department', 24, 'view_department'),
(97, 'Can add change request template stake holders', 25, 'add_changerequesttemplatestakeholders'),
(98, 'Can change change request template stake holders', 25, 'change_changerequesttemplatestakeholders'),
(99, 'Can delete change request template stake holders', 25, 'delete_changerequesttemplatestakeholders'),
(100, 'Can view change request template stake holders', 25, 'view_changerequesttemplatestakeholders'),
(101, 'Can add change request template details', 26, 'add_changerequesttemplatedetails'),
(102, 'Can change change request template details', 26, 'change_changerequesttemplatedetails'),
(103, 'Can delete change request template details', 26, 'delete_changerequesttemplatedetails'),
(104, 'Can view change request template details', 26, 'view_changerequesttemplatedetails'),
(105, 'Can add change request template attachments', 27, 'add_changerequesttemplateattachments'),
(106, 'Can change change request template attachments', 27, 'change_changerequesttemplateattachments'),
(107, 'Can delete change request template attachments', 27, 'delete_changerequesttemplateattachments'),
(108, 'Can view change request template attachments', 27, 'view_changerequesttemplateattachments'),
(109, 'Can add change request template approvers', 28, 'add_changerequesttemplateapprovers'),
(110, 'Can change change request template approvers', 28, 'change_changerequesttemplateapprovers'),
(111, 'Can delete change request template approvers', 28, 'delete_changerequesttemplateapprovers'),
(112, 'Can view change request template approvers', 28, 'view_changerequesttemplateapprovers'),
(113, 'Can add change request form stake holders', 29, 'add_changerequestformstakeholders'),
(114, 'Can change change request form stake holders', 29, 'change_changerequestformstakeholders'),
(115, 'Can delete change request form stake holders', 29, 'delete_changerequestformstakeholders'),
(116, 'Can view change request form stake holders', 29, 'view_changerequestformstakeholders'),
(117, 'Can add change request form details', 30, 'add_changerequestformdetails'),
(118, 'Can change change request form details', 30, 'change_changerequestformdetails'),
(119, 'Can delete change request form details', 30, 'delete_changerequestformdetails'),
(120, 'Can view change request form details', 30, 'view_changerequestformdetails'),
(121, 'Can add change request form attachments', 31, 'add_changerequestformattachments'),
(122, 'Can change change request form attachments', 31, 'change_changerequestformattachments'),
(123, 'Can delete change request form attachments', 31, 'delete_changerequestformattachments'),
(124, 'Can view change request form attachments', 31, 'view_changerequestformattachments'),
(125, 'Can add change request form approvers', 32, 'add_changerequestformapprovers'),
(126, 'Can change change request form approvers', 32, 'change_changerequestformapprovers'),
(127, 'Can delete change request form approvers', 32, 'delete_changerequestformapprovers'),
(128, 'Can view change request form approvers', 32, 'view_changerequestformapprovers'),
(129, 'Can add auth token', 33, 'add_authtoken'),
(130, 'Can change auth token', 33, 'change_authtoken'),
(131, 'Can delete auth token', 33, 'delete_authtoken'),
(132, 'Can view auth token', 33, 'view_authtoken');
/*!40000 ALTER TABLE `auth_permission` ENABLE KEYS */;
-- Dumping structure for table rms_db.auth_user
CREATE TABLE IF NOT EXISTS `auth_user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`last_login` datetime(6) DEFAULT NULL,
`is_superuser` tinyint(1) NOT NULL,
`first_name` varchar(30) NOT NULL,
`last_name` varchar(150) NOT NULL,
`is_staff` tinyint(1) NOT NULL,
`is_active` tinyint(1) NOT NULL,
`date_joined` datetime(6) NOT NULL,
`user_type` varchar(100) NOT NULL,
`code` varchar(255) NOT NULL,
`name` varchar(255) NOT NULL,
`username` varchar(255) NOT NULL,
`password` varchar(255) DEFAULT NULL,
`contact_no` varchar(255) DEFAULT NULL,
`email` varchar(255) NOT NULL,
`default_app_id` varchar(255) DEFAULT NULL,
`department_id` varchar(255) DEFAULT NULL,
`doa_id` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `code` (`code`),
UNIQUE KEY `username` (`username`),
KEY `auth_user_default_app_id_410ec732_fk_applications_code` (`default_app_id`),
KEY `auth_user_department_id_ff5fa3db_fk_departments_code` (`department_id`),
KEY `auth_user_doa_id_5076b369_fk_auth_user_code` (`doa_id`),
CONSTRAINT `auth_user_default_app_id_410ec732_fk_applications_code` FOREIGN KEY (`default_app_id`) REFERENCES `applications` (`code`),
CONSTRAINT `auth_user_department_id_ff5fa3db_fk_departments_code` FOREIGN KEY (`department_id`) REFERENCES `departments` (`code`),
CONSTRAINT `auth_user_doa_id_5076b369_fk_auth_user_code` FOREIGN KEY (`doa_id`) REFERENCES `auth_user` (`code`)
) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8;
-- Dumping data for table rms_db.auth_user: ~1 rows (approximately)
DELETE FROM `auth_user`;
/*!40000 ALTER TABLE `auth_user` DISABLE KEYS */;
INSERT INTO `auth_user` (`id`, `last_login`, `is_superuser`, `first_name`, `last_name`, `is_staff`, `is_active`, `date_joined`, `user_type`, `code`, `name`, `username`, `password`, `contact_no`, `email`, `default_app_id`, `department_id`, `doa_id`) VALUES
(1, NULL, 1, '', '', 1, 1, '2019-09-17 15:37:55.209947', 'SU', 'USER-20190917-0000001', '', 'superuser', 'pbkdf2_sha256$150000$swUOdhexDkFl$pw4uYqvTZWqa6W8UDpsH7Y86RTXyMhh4K63BD+2Qyzk=', NULL, 'red@tirsolutions.com', 'APP-20190917-0000001', 'DEPARTMENT-20190917-0000001', NULL);
/*!40000 ALTER TABLE `auth_user` ENABLE KEYS */;
-- Dumping structure for table rms_db.auth_user_application
CREATE TABLE IF NOT EXISTS `auth_user_application` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`application_id` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `auth_user_application_user_id_application_id_4d89d44a_uniq` (`user_id`,`application_id`),
KEY `auth_user_application_application_id_5c17d611_fk_applications_id` (`application_id`),
CONSTRAINT `auth_user_application_application_id_5c17d611_fk_applications_id` FOREIGN KEY (`application_id`) REFERENCES `applications` (`id`),
CONSTRAINT `auth_user_application_user_id_7b07e391_fk_auth_user_id` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8;
-- Dumping data for table rms_db.auth_user_application: ~0 rows (approximately)
DELETE FROM `auth_user_application`;
/*!40000 ALTER TABLE `auth_user_application` DISABLE KEYS */;
/*!40000 ALTER TABLE `auth_user_application` ENABLE KEYS */;
-- Dumping structure for table rms_db.auth_user_groups
CREATE TABLE IF NOT EXISTS `auth_user_groups` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`group_id` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `auth_user_groups_user_id_group_id_94350c0c_uniq` (`user_id`,`group_id`),
KEY `auth_user_groups_group_id_97559544_fk_auth_group_id` (`group_id`),
CONSTRAINT `auth_user_groups_group_id_97559544_fk_auth_group_id` FOREIGN KEY (`group_id`) REFERENCES `auth_group` (`id`),
CONSTRAINT `auth_user_groups_user_id_6a12ed8b_fk_auth_user_id` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Dumping data for table rms_db.auth_user_groups: ~0 rows (approximately)
DELETE FROM `auth_user_groups`;
/*!40000 ALTER TABLE `auth_user_groups` DISABLE KEYS */;
/*!40000 ALTER TABLE `auth_user_groups` ENABLE KEYS */;
-- Dumping structure for table rms_db.auth_user_images
CREATE TABLE IF NOT EXISTS `auth_user_images` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`created` datetime(6) NOT NULL,
`createdby` varchar(255) NOT NULL,
`modified` datetime(6) NOT NULL,
`modifiedby` varchar(255) NOT NULL,
`name` varchar(255) DEFAULT NULL,
`image` varchar(255) DEFAULT NULL,
`is_primary` tinyint(1) NOT NULL,
`user_id` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
KEY `auth_user_images_user_id_7c29985d_fk_auth_user_code` (`user_id`),
CONSTRAINT `auth_user_images_user_id_7c29985d_fk_auth_user_code` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Dumping data for table rms_db.auth_user_images: ~0 rows (approximately)
DELETE FROM `auth_user_images`;
/*!40000 ALTER TABLE `auth_user_images` DISABLE KEYS */;
/*!40000 ALTER TABLE `auth_user_images` ENABLE KEYS */;
-- Dumping structure for table rms_db.auth_user_user_permissions
CREATE TABLE IF NOT EXISTS `auth_user_user_permissions` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`permission_id` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `auth_user_user_permissions_user_id_permission_id_14a6b632_uniq` (`user_id`,`permission_id`),
KEY `auth_user_user_permi_permission_id_1fbb5f2c_fk_auth_perm` (`permission_id`),
CONSTRAINT `auth_user_user_permi_permission_id_1fbb5f2c_fk_auth_perm` FOREIGN KEY (`permission_id`) REFERENCES `auth_permission` (`id`),
CONSTRAINT `auth_user_user_permissions_user_id_a95ead1b_fk_auth_user_id` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Dumping data for table rms_db.auth_user_user_permissions: ~0 rows (approximately)
DELETE FROM `auth_user_user_permissions`;
/*!40000 ALTER TABLE `auth_user_user_permissions` DISABLE KEYS */;
/*!40000 ALTER TABLE `auth_user_user_permissions` ENABLE KEYS */;
-- Dumping structure for table rms_db.change_request_form_approvers
CREATE TABLE IF NOT EXISTS `change_request_form_approvers` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`level` varchar(50) DEFAULT NULL,
`delegation` varchar(50) DEFAULT NULL,
`created` datetime(6) DEFAULT NULL,
`code` varchar(255) NOT NULL,
`remarks` varchar(255) DEFAULT NULL,
`action` varchar(50) DEFAULT NULL,
`date_sent` datetime(6) DEFAULT NULL,
`form_code_id` varchar(255) NOT NULL,
`tmp_approver_id` varchar(255) DEFAULT NULL,
`user_id` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `code` (`code`),
KEY `change_request_form__form_code_id_5dfe5c56_fk_change_re` (`form_code_id`),
KEY `change_request_form__tmp_approver_id_fff34e6d_fk_change_re` (`tmp_approver_id`),
KEY `change_request_form_approvers_user_id_3a71dffe_fk_auth_user_code` (`user_id`),
CONSTRAINT `change_request_form__form_code_id_5dfe5c56_fk_change_re` FOREIGN KEY (`form_code_id`) REFERENCES `change_request_form_headers` (`form_code`),
CONSTRAINT `change_request_form__tmp_approver_id_fff34e6d_fk_change_re` FOREIGN KEY (`tmp_approver_id`) REFERENCES `change_request_template_approvers` (`code`),
CONSTRAINT `change_request_form_approvers_user_id_3a71dffe_fk_auth_user_code` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Dumping data for table rms_db.change_request_form_approvers: ~0 rows (approximately)
DELETE FROM `change_request_form_approvers`;
/*!40000 ALTER TABLE `change_request_form_approvers` DISABLE KEYS */;
/*!40000 ALTER TABLE `change_request_form_approvers` ENABLE KEYS */;
-- Dumping structure for table rms_db.change_request_form_attachments
CREATE TABLE IF NOT EXISTS `change_request_form_attachments` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`attachment_type` varchar(255) NOT NULL,
`attachment_name` varchar(255) NOT NULL,
`file_name` varchar(255) DEFAULT NULL,
`description` varchar(255) DEFAULT NULL,
`file_upload` varchar(100) DEFAULT NULL,
`created` datetime(6) DEFAULT NULL,
`code` varchar(255) NOT NULL,
`form_code_id` varchar(255) NOT NULL,
`tmp_attach_id` varchar(255) DEFAULT NULL,
`uploaded_by_id` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `code` (`code`),
KEY `change_request_form__form_code_id_6f991ff9_fk_change_re` (`form_code_id`),
KEY `change_request_form__tmp_attach_id_14c2eae7_fk_change_re` (`tmp_attach_id`),
KEY `change_request_form__uploaded_by_id_3187c462_fk_auth_user` (`uploaded_by_id`),
CONSTRAINT `change_request_form__form_code_id_6f991ff9_fk_change_re` FOREIGN KEY (`form_code_id`) REFERENCES `change_request_form_headers` (`form_code`),
CONSTRAINT `change_request_form__tmp_attach_id_14c2eae7_fk_change_re` FOREIGN KEY (`tmp_attach_id`) REFERENCES `change_request_template_attachments` (`code`),
CONSTRAINT `change_request_form__uploaded_by_id_3187c462_fk_auth_user` FOREIGN KEY (`uploaded_by_id`) REFERENCES `auth_user` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Dumping data for table rms_db.change_request_form_attachments: ~0 rows (approximately)
DELETE FROM `change_request_form_attachments`;
/*!40000 ALTER TABLE `change_request_form_attachments` DISABLE KEYS */;
/*!40000 ALTER TABLE `change_request_form_attachments` ENABLE KEYS */;
-- Dumping structure for table rms_db.change_request_form_details
CREATE TABLE IF NOT EXISTS `change_request_form_details` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`field_idx` longtext NOT NULL,
`field_ref` longtext NOT NULL,
`field_val` longtext NOT NULL,
`field_props` longtext NOT NULL,
`created` datetime(6) DEFAULT NULL,
`code` varchar(255) NOT NULL,
`form_code_id` varchar(255) NOT NULL,
`tmp_detail_id` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `code` (`code`),
KEY `change_request_form__form_code_id_b66d4e40_fk_change_re` (`form_code_id`),
KEY `change_request_form__tmp_detail_id_315fbb6d_fk_change_re` (`tmp_detail_id`),
CONSTRAINT `change_request_form__form_code_id_b66d4e40_fk_change_re` FOREIGN KEY (`form_code_id`) REFERENCES `change_request_form_headers` (`form_code`),
CONSTRAINT `change_request_form__tmp_detail_id_315fbb6d_fk_change_re` FOREIGN KEY (`tmp_detail_id`) REFERENCES `change_request_template_details` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Dumping data for table rms_db.change_request_form_details: ~0 rows (approximately)
DELETE FROM `change_request_form_details`;
/*!40000 ALTER TABLE `change_request_form_details` DISABLE KEYS */;
/*!40000 ALTER TABLE `change_request_form_details` ENABLE KEYS */;
-- Dumping structure for table rms_db.change_request_form_headers
CREATE TABLE IF NOT EXISTS `change_request_form_headers` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`requested_to_template_name` varchar(255) NOT NULL,
`requested_to_objective` varchar(255) DEFAULT NULL,
`requested_to_priority` varchar(255) NOT NULL,
`description` varchar(255) DEFAULT NULL,
`created` datetime(6) NOT NULL,
`form_code` varchar(255) NOT NULL,
`cancel_date` datetime(6) DEFAULT NULL,
`status` varchar(50) NOT NULL,
`company_desc` varchar(255) DEFAULT NULL,
`department_desc` varchar(255) DEFAULT NULL,
`requested_desc` varchar(255) DEFAULT NULL,
`old_form_code` varchar(255) DEFAULT NULL,
`requested_to_template_id` varchar(255) NOT NULL,
`requested_to_target_date` datetime(6) DEFAULT NULL,
`requested_by_department_id` varchar(255) NOT NULL,
`requested_by_user_id` varchar(255) NOT NULL,
`requested_to_company_id` varchar(255) NOT NULL,
`requested_to_department_id` varchar(255) NOT NULL,
`requested_to_user_id` varchar(255) NOT NULL,
`template_no_id` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `form_code` (`form_code`),
KEY `change_request_form__requested_by_departm_af6aa045_fk_departmen` (`requested_by_department_id`),
KEY `change_request_form__requested_by_user_id_3287070c_fk_auth_user` (`requested_by_user_id`),
KEY `change_request_form__requested_to_company_33982877_fk_companies` (`requested_to_company_id`),
KEY `change_request_form__requested_to_departm_c5d594cd_fk_departmen` (`requested_to_department_id`),
KEY `change_request_form__requested_to_user_id_11252c8d_fk_auth_user` (`requested_to_user_id`),
KEY `change_request_form__template_no_id_20abd55c_fk_change_re` (`template_no_id`),
CONSTRAINT `change_request_form__requested_by_departm_af6aa045_fk_departmen` FOREIGN KEY (`requested_by_department_id`) REFERENCES `departments` (`code`),
CONSTRAINT `change_request_form__requested_by_user_id_3287070c_fk_auth_user` FOREIGN KEY (`requested_by_user_id`) REFERENCES `auth_user` (`code`),
CONSTRAINT `change_request_form__requested_to_company_33982877_fk_companies` FOREIGN KEY (`requested_to_company_id`) REFERENCES `companies` (`code`),
CONSTRAINT `change_request_form__requested_to_departm_c5d594cd_fk_departmen` FOREIGN KEY (`requested_to_department_id`) REFERENCES `departments` (`code`),
CONSTRAINT `change_request_form__requested_to_user_id_11252c8d_fk_auth_user` FOREIGN KEY (`requested_to_user_id`) REFERENCES `auth_user` (`code`),
CONSTRAINT `change_request_form__template_no_id_20abd55c_fk_change_re` FOREIGN KEY (`template_no_id`) REFERENCES `change_request_template_headers` (`template_no`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Dumping data for table rms_db.change_request_form_headers: ~0 rows (approximately)
DELETE FROM `change_request_form_headers`;
/*!40000 ALTER TABLE `change_request_form_headers` DISABLE KEYS */;
/*!40000 ALTER TABLE `change_request_form_headers` ENABLE KEYS */;
-- Dumping structure for table rms_db.change_request_form_stakeholders
CREATE TABLE IF NOT EXISTS `change_request_form_stakeholders` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`delegation` varchar(255) DEFAULT NULL,
`created` datetime(6) DEFAULT NULL,
`code` varchar(255) NOT NULL,
`date_added` datetime(6) DEFAULT NULL,
`form_code_id` varchar(255) NOT NULL,
`tmp_stake_id` varchar(255) DEFAULT NULL,
`user_id` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `code` (`code`),
KEY `change_request_form__form_code_id_350d3c3d_fk_change_re` (`form_code_id`),
KEY `change_request_form__tmp_stake_id_fe1f7139_fk_change_re` (`tmp_stake_id`),
KEY `change_request_form__user_id_378bdf3e_fk_auth_user` (`user_id`),
CONSTRAINT `change_request_form__form_code_id_350d3c3d_fk_change_re` FOREIGN KEY (`form_code_id`) REFERENCES `change_request_form_headers` (`form_code`),
CONSTRAINT `change_request_form__tmp_stake_id_fe1f7139_fk_change_re` FOREIGN KEY (`tmp_stake_id`) REFERENCES `change_request_template_stakeholders` (`code`),
CONSTRAINT `change_request_form__user_id_378bdf3e_fk_auth_user` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Dumping data for table rms_db.change_request_form_stakeholders: ~0 rows (approximately)
DELETE FROM `change_request_form_stakeholders`;
/*!40000 ALTER TABLE `change_request_form_stakeholders` DISABLE KEYS */;
/*!40000 ALTER TABLE `change_request_form_stakeholders` ENABLE KEYS */;
-- Dumping structure for table rms_db.change_request_history
CREATE TABLE IF NOT EXISTS `change_request_history` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`created` datetime(6) NOT NULL,
`createdby` varchar(255) NOT NULL,
`modified` datetime(6) NOT NULL,
`modifiedby` varchar(255) NOT NULL,
`action` varchar(50) NOT NULL,
`entity` varchar(50) NOT NULL,
`form_code` varchar(255) DEFAULT NULL,
`fromValue` longtext DEFAULT NULL,
`toValue` longtext DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Dumping data for table rms_db.change_request_history: ~0 rows (approximately)
DELETE FROM `change_request_history`;
/*!40000 ALTER TABLE `change_request_history` DISABLE KEYS */;
/*!40000 ALTER TABLE `change_request_history` ENABLE KEYS */;
-- Dumping structure for table rms_db.change_request_template_approvers
CREATE TABLE IF NOT EXISTS `change_request_template_approvers` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`level` varchar(50) DEFAULT NULL,
`delegation` varchar(50) DEFAULT NULL,
`created` datetime(6) DEFAULT NULL,
`code` varchar(255) NOT NULL,
`archived_at` datetime(6) DEFAULT NULL,
`template_no_id` varchar(255) NOT NULL,
`user_id` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `code` (`code`),
KEY `change_request_templ_template_no_id_fba2afd7_fk_change_re` (`template_no_id`),
KEY `change_request_templ_user_id_958c925a_fk_auth_user` (`user_id`),
CONSTRAINT `change_request_templ_template_no_id_fba2afd7_fk_change_re` FOREIGN KEY (`template_no_id`) REFERENCES `change_request_template_headers` (`template_no`),
CONSTRAINT `change_request_templ_user_id_958c925a_fk_auth_user` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Dumping data for table rms_db.change_request_template_approvers: ~0 rows (approximately)
DELETE FROM `change_request_template_approvers`;
/*!40000 ALTER TABLE `change_request_template_approvers` DISABLE KEYS */;
/*!40000 ALTER TABLE `change_request_template_approvers` ENABLE KEYS */;
-- Dumping structure for table rms_db.change_request_template_attachments
CREATE TABLE IF NOT EXISTS `change_request_template_attachments` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`attachment_type` varchar(255) NOT NULL,
`attachment_name` varchar(255) NOT NULL,
`file_name` varchar(255) DEFAULT NULL,
`description` varchar(255) DEFAULT NULL,
`file_upload` varchar(100) DEFAULT NULL,
`created` datetime(6) DEFAULT NULL,
`code` varchar(255) NOT NULL,
`archived_at` datetime(6) DEFAULT NULL,
`template_no_id` varchar(255) NOT NULL,
`uploaded_by_id` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `code` (`code`),
KEY `change_request_templ_template_no_id_d0247a80_fk_change_re` (`template_no_id`),
KEY `change_request_templ_uploaded_by_id_f9c6493a_fk_auth_user` (`uploaded_by_id`),
CONSTRAINT `change_request_templ_template_no_id_d0247a80_fk_change_re` FOREIGN KEY (`template_no_id`) REFERENCES `change_request_template_headers` (`template_no`),
CONSTRAINT `change_request_templ_uploaded_by_id_f9c6493a_fk_auth_user` FOREIGN KEY (`uploaded_by_id`) REFERENCES `auth_user` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Dumping data for table rms_db.change_request_template_attachments: ~0 rows (approximately)
DELETE FROM `change_request_template_attachments`;
/*!40000 ALTER TABLE `change_request_template_attachments` DISABLE KEYS */;
/*!40000 ALTER TABLE `change_request_template_attachments` ENABLE KEYS */;
-- Dumping structure for table rms_db.change_request_template_details
CREATE TABLE IF NOT EXISTS `change_request_template_details` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`field_idx` longtext NOT NULL,
`field_ref` longtext NOT NULL,
`field_val` longtext NOT NULL,
`field_props` longtext NOT NULL,
`created` datetime(6) DEFAULT NULL,
`code` varchar(255) NOT NULL,
`archived_at` datetime(6) DEFAULT NULL,
`template_no_id` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `code` (`code`),
KEY `change_request_templ_template_no_id_d2ba31c2_fk_change_re` (`template_no_id`),
CONSTRAINT `change_request_templ_template_no_id_d2ba31c2_fk_change_re` FOREIGN KEY (`template_no_id`) REFERENCES `change_request_template_headers` (`template_no`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Dumping data for table rms_db.change_request_template_details: ~0 rows (approximately)
DELETE FROM `change_request_template_details`;
/*!40000 ALTER TABLE `change_request_template_details` DISABLE KEYS */;
/*!40000 ALTER TABLE `change_request_template_details` ENABLE KEYS */;
-- Dumping structure for table rms_db.change_request_template_headers
CREATE TABLE IF NOT EXISTS `change_request_template_headers` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`requested_to_template_name` varchar(255) NOT NULL,
`requested_to_objective` varchar(255) DEFAULT NULL,
`requested_to_priority` varchar(255) NOT NULL,
`description` varchar(255) DEFAULT NULL,
`created` datetime(6) NOT NULL,
`template_no` varchar(255) NOT NULL,
`requested_to_template_id` varchar(255) NOT NULL,
`requested_to_target_date` varchar(10) DEFAULT NULL,
`archived_at` datetime(6) DEFAULT NULL,
`created_by_department_id` varchar(255) NOT NULL,
`created_by_user_id` varchar(255) NOT NULL,
`requested_to_company_id` varchar(255) NOT NULL,
`requested_to_department_id` varchar(255) NOT NULL,
`requested_to_user_id` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `template_no` (`template_no`),
UNIQUE KEY `requested_to_template_id` (`requested_to_template_id`),
KEY `change_request_templ_created_by_departmen_f5629a3a_fk_departmen` (`created_by_department_id`),
KEY `change_request_templ_created_by_user_id_ed6f2326_fk_auth_user` (`created_by_user_id`),
KEY `change_request_templ_requested_to_company_1063b954_fk_companies` (`requested_to_company_id`),
KEY `change_request_templ_requested_to_departm_e7b33c56_fk_departmen` (`requested_to_department_id`),
KEY `change_request_templ_requested_to_user_id_cfad98f0_fk_auth_user` (`requested_to_user_id`),
CONSTRAINT `change_request_templ_created_by_departmen_f5629a3a_fk_departmen` FOREIGN KEY (`created_by_department_id`) REFERENCES `departments` (`code`),
CONSTRAINT `change_request_templ_created_by_user_id_ed6f2326_fk_auth_user` FOREIGN KEY (`created_by_user_id`) REFERENCES `auth_user` (`code`),
CONSTRAINT `change_request_templ_requested_to_company_1063b954_fk_companies` FOREIGN KEY (`requested_to_company_id`) REFERENCES `companies` (`code`),
CONSTRAINT `change_request_templ_requested_to_departm_e7b33c56_fk_departmen` FOREIGN KEY (`requested_to_department_id`) REFERENCES `departments` (`code`),
CONSTRAINT `change_request_templ_requested_to_user_id_cfad98f0_fk_auth_user` FOREIGN KEY (`requested_to_user_id`) REFERENCES `auth_user` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Dumping data for table rms_db.change_request_template_headers: ~0 rows (approximately)
DELETE FROM `change_request_template_headers`;
/*!40000 ALTER TABLE `change_request_template_headers` DISABLE KEYS */;
/*!40000 ALTER TABLE `change_request_template_headers` ENABLE KEYS */;
-- Dumping structure for table rms_db.change_request_template_stakeholders
CREATE TABLE IF NOT EXISTS `change_request_template_stakeholders` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`delegation` varchar(255) DEFAULT NULL,
`created` datetime(6) DEFAULT NULL,
`code` varchar(255) NOT NULL,
`archived_at` datetime(6) DEFAULT NULL,
`template_no_id` varchar(255) NOT NULL,
`user_id` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `code` (`code`),
KEY `change_request_templ_template_no_id_31bc8d14_fk_change_re` (`template_no_id`),
KEY `change_request_templ_user_id_63128227_fk_auth_user` (`user_id`),
CONSTRAINT `change_request_templ_template_no_id_31bc8d14_fk_change_re` FOREIGN KEY (`template_no_id`) REFERENCES `change_request_template_headers` (`template_no`),
CONSTRAINT `change_request_templ_user_id_63128227_fk_auth_user` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Dumping data for table rms_db.change_request_template_stakeholders: ~0 rows (approximately)
DELETE FROM `change_request_template_stakeholders`;
/*!40000 ALTER TABLE `change_request_template_stakeholders` DISABLE KEYS */;
/*!40000 ALTER TABLE `change_request_template_stakeholders` ENABLE KEYS */;
-- Dumping structure for table rms_db.companies
CREATE TABLE IF NOT EXISTS `companies` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`created` datetime(6) NOT NULL,
`createdby` varchar(255) NOT NULL,
`modified` datetime(6) NOT NULL,
`modifiedby` varchar(255) NOT NULL,
`code` varchar(255) NOT NULL,
`name` varchar(255) NOT NULL,
`contact_details` longtext DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `code` (`code`),
UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
-- Dumping data for table rms_db.companies: ~2 rows (approximately)
DELETE FROM `companies`;
/*!40000 ALTER TABLE `companies` DISABLE KEYS */;
INSERT INTO `companies` (`id`, `created`, `createdby`, `modified`, `modifiedby`, `code`, `name`, `contact_details`) VALUES
(1, '2019-09-17 15:40:52.056713', 'superuser', '2019-09-17 15:40:52.056713', 'superuser', 'COMPANY-20190917-0000001', 'Oneberry', '2152509'),
(2, '2019-09-17 15:41:03.274525', 'superuser', '2019-09-17 15:41:03.274525', 'superuser', 'COMPANY-20190917-0000002', 'Total Integrated Resources', '2152509');
/*!40000 ALTER TABLE `companies` ENABLE KEYS */;
-- Dumping structure for table rms_db.departments
CREATE TABLE IF NOT EXISTS `departments` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`created` datetime(6) NOT NULL,
`createdby` varchar(255) NOT NULL,
`modified` datetime(6) NOT NULL,
`modifiedby` varchar(255) NOT NULL,
`code` varchar(255) NOT NULL,
`name` varchar(255) NOT NULL,
`company_id` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `code` (`code`),
UNIQUE KEY `name` (`name`),
KEY `departments_company_id_0d17e9ca_fk_companies_code` (`company_id`),
CONSTRAINT `departments_company_id_0d17e9ca_fk_companies_code` FOREIGN KEY (`company_id`) REFERENCES `companies` (`code`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
-- Dumping data for table rms_db.departments: ~2 rows (approximately)
DELETE FROM `departments`;
/*!40000 ALTER TABLE `departments` DISABLE KEYS */;
INSERT INTO `departments` (`id`, `created`, `createdby`, `modified`, `modifiedby`, `code`, `name`, `company_id`) VALUES
(1, '2019-09-17 15:41:37.996562', 'superuser', '2019-09-17 15:41:37.996562', 'superuser', 'DEPARTMENT-20190917-0000001', 'Business Development', 'COMPANY-20190917-0000001'),
(2, '2019-09-17 16:08:54.856557', 'superuser', '2019-09-17 16:08:54.856557', 'superuser', 'DEPARTMENT-20190917-0000002', 'Admin', 'COMPANY-20190917-0000001');
/*!40000 ALTER TABLE `departments` ENABLE KEYS */;
-- Dumping structure for table rms_db.django_admin_log
CREATE TABLE IF NOT EXISTS `django_admin_log` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`action_time` datetime(6) NOT NULL,
`object_id` longtext DEFAULT NULL,
`object_repr` varchar(200) NOT NULL,
`action_flag` smallint(5) unsigned NOT NULL,
`change_message` longtext NOT NULL,
`content_type_id` int(11) DEFAULT NULL,
`user_id` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `django_admin_log_content_type_id_c4bce8eb_fk_django_co` (`content_type_id`),
KEY `django_admin_log_user_id_c564eba6_fk_auth_user_id` (`user_id`),
CONSTRAINT `django_admin_log_content_type_id_c4bce8eb_fk_django_co` FOREIGN KEY (`content_type_id`) REFERENCES `django_content_type` (`id`),
CONSTRAINT `django_admin_log_user_id_c564eba6_fk_auth_user_id` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Dumping data for table rms_db.django_admin_log: ~0 rows (approximately)
DELETE FROM `django_admin_log`;
/*!40000 ALTER TABLE `django_admin_log` DISABLE KEYS */;
/*!40000 ALTER TABLE `django_admin_log` ENABLE KEYS */;
-- Dumping structure for table rms_db.django_content_type
CREATE TABLE IF NOT EXISTS `django_content_type` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`app_label` varchar(100) NOT NULL,
`model` varchar(100) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `django_content_type_app_label_model_76bd3d3b_uniq` (`app_label`,`model`)
) ENGINE=InnoDB AUTO_INCREMENT=34 DEFAULT CHARSET=utf8;
-- Dumping data for table rms_db.django_content_type: ~33 rows (approximately)
DELETE FROM `django_content_type`;
/*!40000 ALTER TABLE `django_content_type` DISABLE KEYS */;
INSERT INTO `django_content_type` (`id`, `app_label`, `model`) VALUES
(1, 'admin', 'logentry'),
(3, 'auth', 'group'),
(2, 'auth', 'permission'),
(6, 'authtoken', 'token'),
(4, 'contenttypes', 'contenttype'),
(8, 'entities', 'application'),
(9, 'entities', 'attachment'),
(33, 'entities', 'authtoken'),
(32, 'entities', 'changerequestformapprovers'),
(31, 'entities', 'changerequestformattachments'),
(30, 'entities', 'changerequestformdetails'),
(10, 'entities', 'changerequestformheader'),
(29, 'entities', 'changerequestformstakeholders'),
(11, 'entities', 'changerequesthistory'),
(28, 'entities', 'changerequesttemplateapprovers'),
(27, 'entities', 'changerequesttemplateattachments'),
(26, 'entities', 'changerequesttemplatedetails'),
(12, 'entities', 'changerequesttemplateheader'),
(25, 'entities', 'changerequesttemplatestakeholders'),
(13, 'entities', 'company'),
(24, 'entities', 'department'),
(14, 'entities', 'emaillogs'),
(15, 'entities', 'entitylog'),
(23, 'entities', 'module'),
(22, 'entities', 'notification'),
(16, 'entities', 'passwordreset'),
(17, 'entities', 'permission'),
(18, 'entities', 'role'),
(21, 'entities', 'rolepermission'),
(19, 'entities', 'status'),
(7, 'entities', 'user'),
(20, 'entities', 'userimage'),
(5, 'sessions', 'session');
/*!40000 ALTER TABLE `django_content_type` ENABLE KEYS */;
-- Dumping structure for table rms_db.django_migrations
CREATE TABLE IF NOT EXISTS `django_migrations` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`app` varchar(255) NOT NULL,
`name` varchar(255) NOT NULL,
`applied` datetime(6) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8;
-- Dumping data for table rms_db.django_migrations: ~20 rows (approximately)
DELETE FROM `django_migrations`;
/*!40000 ALTER TABLE `django_migrations` DISABLE KEYS */;
INSERT INTO `django_migrations` (`id`, `app`, `name`, `applied`) VALUES
(1, 'contenttypes', '0001_initial', '2019-09-17 15:31:50.300269'),
(2, 'contenttypes', '0002_remove_content_type_name', '2019-09-17 15:31:52.551495'),
(3, 'auth', '0001_initial', '2019-09-17 15:31:53.533673'),
(4, 'auth', '0002_alter_permission_name_max_length', '2019-09-17 15:31:57.173136'),
(5, 'auth', '0003_alter_user_email_max_length', '2019-09-17 15:31:57.205112'),
(6, 'auth', '0004_alter_user_username_opts', '2019-09-17 15:31:57.242138'),
(7, 'auth', '0005_alter_user_last_login_null', '2019-09-17 15:31:57.277288'),
(8, 'auth', '0006_require_contenttypes_0002', '2019-09-17 15:31:57.304290'),
(9, 'auth', '0007_alter_validators_add_error_messages', '2019-09-17 15:31:57.343379'),
(10, 'auth', '0008_alter_user_username_max_length', '2019-09-17 15:31:57.382532'),
(11, 'auth', '0009_alter_user_last_name_max_length', '2019-09-17 15:31:57.410876'),
(12, 'auth', '0010_alter_group_name_max_length', '2019-09-17 15:31:57.997953'),
(13, 'auth', '0011_update_proxy_permissions', '2019-09-17 15:31:58.017953'),
(14, 'entities', '0001_initial', '2019-09-17 15:32:06.571831'),
(15, 'admin', '0001_initial', '2019-09-17 15:32:31.765917'),
(16, 'admin', '0002_logentry_remove_auto_add', '2019-09-17 15:32:32.690742'),
(17, 'admin', '0003_logentry_add_action_flag_choices', '2019-09-17 15:32:32.738930'),
(18, 'authtoken', '0001_initial', '2019-09-17 15:32:32.936422'),
(19, 'authtoken', '0002_auto_20160226_1747', '2019-09-17 15:32:34.046297'),
(20, 'sessions', '0001_initial', '2019-09-17 15:32:34.204229');
/*!40000 ALTER TABLE `django_migrations` ENABLE KEYS */;
-- Dumping structure for table rms_db.django_session
CREATE TABLE IF NOT EXISTS `django_session` (
`session_key` varchar(40) NOT NULL,
`session_data` longtext NOT NULL,
`expire_date` datetime(6) NOT NULL,
PRIMARY KEY (`session_key`),
KEY `django_session_expire_date_a5c62663` (`expire_date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Dumping data for table rms_db.django_session: ~0 rows (approximately)
DELETE FROM `django_session`;
/*!40000 ALTER TABLE `django_session` DISABLE KEYS */;
/*!40000 ALTER TABLE `django_session` ENABLE KEYS */;
-- Dumping structure for table rms_db.email_logs
CREATE TABLE IF NOT EXISTS `email_logs` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`created` datetime(6) NOT NULL,
`createdby` varchar(255) NOT NULL,
`modified` datetime(6) NOT NULL,
`modifiedby` varchar(255) NOT NULL,
`template` varchar(255) NOT NULL,
`recipients` varchar(255) NOT NULL,
`content` longtext NOT NULL,
`is_sent` tinyint(1) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
-- Dumping data for table rms_db.email_logs: ~8 rows (approximately)
DELETE FROM `email_logs`;
/*!40000 ALTER TABLE `email_logs` DISABLE KEYS */;
INSERT INTO `email_logs` (`id`, `created`, `createdby`, `modified`, `modifiedby`, `template`, `recipients`, `content`, `is_sent`) VALUES
(1, '2019-09-17 16:02:13.373972', 'red@tirsolutions.com', '2019-09-17 16:02:13.373972', 'red@tirsolutions.com', 'RMS-NEWUSER.html', 'test@gmail.com', '<!DOCTYPE html>\n<html>\n<head>\n<title>RMS: New User Created</title>\n</head>\n<body style="font-family: arial;">\n\n<div style="max-width:100px!important;">\n<img src="https://s18.directupload.net/images/190807/wjwrxx5i.jpg"/>\n</div>\n\n<h3>Resource Management System &#40;RMS&#41;</h3>\n<h3 style="color:#888888;">New User Created</h3><br>\n\n<p>Dear Rita,</p><br>\n<p>You have been created as a new user of RMS. Please see your default login details below.</p><br>\n \n<b>Username</b><br>badba2ed11<br><br>\n<b>Password</b><br>82amFMnbPS<br><br>\n\n<p>You may change your password through the <u><a href="http://staging.rms.oneberrysystem.com/cms/profile/" style="text-decoration:underline;color:#007bff;" target="_blank">my profile</a></u> section of RMS any time.</p><br>\n \n<p>Sincerely,</p>\n<p>RMS Team</p><br><br>\n \n<p>Powered by</p>\n<img src="https://s18.directupload.net/images/190807/jaewp4nx.png" width="120px"/>\n \n</body>\n</html>', 1),
(2, '2019-09-17 16:05:26.397830', 'red@tirsolutions.com', '2019-09-17 16:05:26.397830', 'red@tirsolutions.com', 'RMS-NEWUSER.html', 'test@gmail.com', '<!DOCTYPE html>\n<html>\n<head>\n<title>RMS: New User Created</title>\n</head>\n<body style="font-family: arial;">\n\n<div style="max-width:100px!important;">\n<img src="https://s18.directupload.net/images/190807/wjwrxx5i.jpg"/>\n</div>\n\n<h3>Resource Management System &#40;RMS&#41;</h3>\n<h3 style="color:#888888;">New User Created</h3><br>\n\n<p>Dear Rita,</p><br>\n<p>You have been created as a new user of RMS. Please see your default login details below.</p><br>\n \n<b>Username</b><br>badbea2ed11<br><br>\n<b>Password</b><br>yRELLMdPyB<br><br>\n\n<p>You may change your password through the <u><a href="http://staging.rms.oneberrysystem.com/cms/profile/" style="text-decoration:underline;color:#007bff;" target="_blank">my profile</a></u> section of RMS any time.</p><br>\n \n<p>Sincerely,</p>\n<p>RMS Team</p><br><br>\n \n<p>Powered by</p>\n<img src="https://s18.directupload.net/images/190807/jaewp4nx.png" width="120px"/>\n \n</body>\n</html>', 1),
(3, '2019-09-17 16:07:30.355398', 'red@tirsolutions.com', '2019-09-17 16:07:30.355398', 'red@tirsolutions.com', 'RMS-NEWUSER.html', 'test@gmail.com', '<!DOCTYPE html>\n<html>\n<head>\n<title>RMS: New User Created</title>\n</head>\n<body style="font-family: arial;">\n\n<div style="max-width:100px!important;">\n<img src="https://s18.directupload.net/images/190807/wjwrxx5i.jpg"/>\n</div>\n\n<h3>Resource Management System &#40;RMS&#41;</h3>\n<h3 style="color:#888888;">New User Created</h3><br>\n\n<p>Dear Rita,</p><br>\n<p>You have been created as a new user of RMS. Please see your default login details below.</p><br>\n \n<b>Username</b><br>badbea2ed3311<br><br>\n<b>Password</b><br>8nDa6zRSKa<br><br>\n\n<p>You may change your password through the <u><a href="http://staging.rms.oneberrysystem.com/cms/profile/" style="text-decoration:underline;color:#007bff;" target="_blank">my profile</a></u> section of RMS any time.</p><br>\n \n<p>Sincerely,</p>\n<p>RMS Team</p><br><br>\n \n<p>Powered by</p>\n<img src="https://s18.directupload.net/images/190807/jaewp4nx.png" width="120px"/>\n \n</body>\n</html>', 1),
(4, '2019-09-17 16:08:23.683047', 'red@tirsolutions.com', '2019-09-17 16:08:23.683047', 'red@tirsolutions.com', 'RMS-NEWUSER.html', 'test@gmail.com', '<!DOCTYPE html>\n<html>\n<head>\n<title>RMS: New User Created</title>\n</head>\n<body style="font-family: arial;">\n\n<div style="max-width:100px!important;">\n<img src="https://s18.directupload.net/images/190807/wjwrxx5i.jpg"/>\n</div>\n\n<h3>Resource Management System &#40;RMS&#41;</h3>\n<h3 style="color:#888888;">New User Created</h3><br>\n\n<p>Dear Rita,</p><br>\n<p>You have been created as a new user of RMS. Please see your default login details below.</p><br>\n \n<b>Username</b><br>badbdea2ed3311<br><br>\n<b>Password</b><br>gAeHs3sTvE<br><br>\n\n<p>You may change your password through the <u><a href="http://staging.rms.oneberrysystem.com/cms/profile/" style="text-decoration:underline;color:#007bff;" target="_blank">my profile</a></u> section of RMS any time.</p><br>\n \n<p>Sincerely,</p>\n<p>RMS Team</p><br><br>\n \n<p>Powered by</p>\n<img src="https://s18.directupload.net/images/190807/jaewp4nx.png" width="120px"/>\n \n</body>\n</html>', 1),
(5, '2019-09-17 16:09:23.768337', 'red@tirsolutions.com', '2019-09-17 16:09:23.768337', 'red@tirsolutions.com', 'RMS-NEWUSER.html', 'test@gmail.com', '<!DOCTYPE html>\n<html>\n<head>\n<title>RMS: New User Created</title>\n</head>\n<body style="font-family: arial;">\n\n<div style="max-width:100px!important;">\n<img src="https://s18.directupload.net/images/190807/wjwrxx5i.jpg"/>\n</div>\n\n<h3>Resource Management System &#40;RMS&#41;</h3>\n<h3 style="color:#888888;">New User Created</h3><br>\n\n<p>Dear Rita,</p><br>\n<p>You have been created as a new user of RMS. Please see your default login details below.</p><br>\n \n<b>Username</b><br>badbdea2ced3311<br><br>\n<b>Password</b><br>mMLjraSFbv<br><br>\n\n<p>You may change your password through the <u><a href="http://staging.rms.oneberrysystem.com/cms/profile/" style="text-decoration:underline;color:#007bff;" target="_blank">my profile</a></u> section of RMS any time.</p><br>\n \n<p>Sincerely,</p>\n<p>RMS Team</p><br><br>\n \n<p>Powered by</p>\n<img src="https://s18.directupload.net/images/190807/jaewp4nx.png" width="120px"/>\n \n</body>\n</html>', 1),
(6, '2019-09-17 16:14:17.365676', 'red@tirsolutions.com', '2019-09-17 16:14:17.365676', 'red@tirsolutions.com', 'RMS-NEWUSER.html', 'test@gmail.com', '<!DOCTYPE html>\n<html>\n<head>\n<title>RMS: New User Created</title>\n</head>\n<body style="font-family: arial;">\n\n<div style="max-width:100px!important;">\n<img src="https://s18.directupload.net/images/190807/wjwrxx5i.jpg"/>\n</div>\n\n<h3>Resource Management System &#40;RMS&#41;</h3>\n<h3 style="color:#888888;">New User Created</h3><br>\n\n<p>Dear Rita,</p><br>\n<p>You have been created as a new user of RMS. Please see your default login details below.</p><br>\n \n<b>Username</b><br>badbdea2ced233311<br><br>\n<b>Password</b><br>ZwhbMBj5JF<br><br>\n\n<p>You may change your password through the <u><a href="http://staging.rms.oneberrysystem.com/cms/profile/" style="text-decoration:underline;color:#007bff;" target="_blank">my profile</a></u> section of RMS any time.</p><br>\n \n<p>Sincerely,</p>\n<p>RMS Team</p><br><br>\n \n<p>Powered by</p>\n<img src="https://s18.directupload.net/images/190807/jaewp4nx.png" width="120px"/>\n \n</body>\n</html>', 1),
(7, '2019-09-17 16:24:11.098858', 'red@tirsolutions.com', '2019-09-17 16:24:11.098858', 'red@tirsolutions.com', 'RMS-NEWUSER.html', 'test@gmail.com', '<!DOCTYPE html>\n<html>\n<head>\n<title>RMS: New User Created</title>\n</head>\n<body style="font-family: arial;">\n\n<div style="max-width:100px!important;">\n<img src="https://s18.directupload.net/images/190807/wjwrxx5i.jpg"/>\n</div>\n\n<h3>Resource Management System &#40;RMS&#41;</h3>\n<h3 style="color:#888888;">New User Created</h3><br>\n\n<p>Dear Rita,</p><br>\n<p>You have been created as a new user of RMS. Please see your default login details below.</p><br>\n \n<b>Username</b><br>badbdxea2cxc2ecd233311<br><br>\n<b>Password</b><br>vbfWcYMhNW<br><br>\n\n<p>You may change your password through the <u><a href="http://staging.rms.oneberrysystem.com/cms/profile/" style="text-decoration:underline;color:#007bff;" target="_blank">my profile</a></u> section of RMS any time.</p><br>\n \n<p>Sincerely,</p>\n<p>RMS Team</p><br><br>\n \n<p>Powered by</p>\n<img src="https://s18.directupload.net/images/190807/jaewp4nx.png" width="120px"/>\n \n</body>\n</html>', 1),
(8, '2019-09-17 16:25:20.511001', 'red@tirsolutions.com', '2019-09-17 16:25:20.511001', 'red@tirsolutions.com', 'RMS-NEWUSER.html', 'test@gmail.com', '<!DOCTYPE html>\n<html>\n<head>\n<title>RMS: New User Created</title>\n</head>\n<body style="font-family: arial;">\n\n<div style="max-width:100px!important;">\n<img src="https://s18.directupload.net/images/190807/wjwrxx5i.jpg"/>\n</div>\n\n<h3>Resource Management System &#40;RMS&#41;</h3>\n<h3 style="color:#888888;">New User Created</h3><br>\n\n<p>Dear Rita,</p><br>\n<p>You have been created as a new user of RMS. Please see your default login details below.</p><br>\n \n<b>Username</b><br>obrita<br><br>\n<b>Password</b><br>ZeeBUxA5ne<br><br>\n\n<p>You may change your password through the <u><a href="http://staging.rms.oneberrysystem.com/cms/profile/" style="text-decoration:underline;color:#007bff;" target="_blank">my profile</a></u> section of RMS any time.</p><br>\n \n<p>Sincerely,</p>\n<p>RMS Team</p><br><br>\n \n<p>Powered by</p>\n<img src="https://s18.directupload.net/images/190807/jaewp4nx.png" width="120px"/>\n \n</body>\n</html>', 1);
/*!40000 ALTER TABLE `email_logs` ENABLE KEYS */;
-- Dumping structure for table rms_db.entity_logs
CREATE TABLE IF NOT EXISTS `entity_logs` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`created` datetime(6) NOT NULL,
`createdby` varchar(255) NOT NULL,
`modified` datetime(6) NOT NULL,
`modifiedby` varchar(255) NOT NULL,
`action` varchar(50) NOT NULL,
`entity` varchar(50) NOT NULL,
`row_id` int(11) NOT NULL,
`fromValue` longtext DEFAULT NULL,
`toValue` longtext DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
-- Dumping data for table rms_db.entity_logs: ~2 rows (approximately)
DELETE FROM `entity_logs`;
/*!40000 ALTER TABLE `entity_logs` DISABLE KEYS */;
INSERT INTO `entity_logs` (`id`, `created`, `createdby`, `modified`, `modifiedby`, `action`, `entity`, `row_id`, `fromValue`, `toValue`) VALUES
(1, '2019-09-17 16:28:34.817880', 'superuser', '2019-09-17 16:28:34.817880', 'superuser', 'Update', 'USER', 26, '{\'id\': 26, \'last_login\': None, \'is_superuser\': False, \'first_name\': \'\', \'last_name\': \'\', \'is_staff\': False, \'is_active\': True, \'date_joined\': datetime.datetime(2019, 9, 17, 16, 25, 15, 339079), \'department\': \'DEPARTMENT-20190917-0000002\', \'default_app\': \'APP-20190917-0000001\', \'user_type\': \'OUA\', \'code\': \'USER-20190917-0000026\', \'name\': \'Rita\', \'username\': \'obrita\', \'password\': \'pbkdf2_sha256$150000$2TujGiKV40ow$UQDcL8Sh4Nxg00WQYUrFVgizeM+rynEAcSSXcy7Nxbk=\', \'doa\': None, \'contact_no\': \'1312313\', \'email\': \'test@gmail.com\', \'groups\': [], \'user_permissions\': [], \'application\': [<Application: Resource Management System>, <Application: Asset Management System>]}', '{\'id\': 26, \'code\': \'USER-20190917-0000026\', \'name\': \'Ritas\', \'username\': \'obrita\', \'contact_no\': \'1312313\', \'email\': \'test@gmail.com\', \'default_app\': \'APP-20190917-0000001\', \'user_type\': \'OUA\', \'is_active\': True, \'doa\': None, \'department\': {\'id\': 2, \'createdby\': \'superuser\', \'modifiedby\': \'superuser\', \'company\': \'COMPANY-20190917-0000001\', \'code\': \'DEPARTMENT-20190917-0000002\', \'name\': \'Admin\'}, \'company\': {\'id\': 1, \'createdby\': \'superuser\', \'modifiedby\': \'superuser\', \'code\': \'COMPANY-20190917-0000001\', \'name\': \'Oneberry\', \'contact_details\': \'2152509\'}, \'application\': [1, 3]}'),
(2, '2019-09-17 16:28:57.772526', 'superuser', '2019-09-17 16:28:57.772526', 'superuser', 'DELETED', 'USER', 26, '{\'id\': 26, \'last_login\': None, \'is_superuser\': False, \'first_name\': \'\', \'last_name\': \'\', \'is_staff\': False, \'is_active\': True, \'date_joined\': datetime.datetime(2019, 9, 17, 16, 25, 15, 339079), \'department\': \'DEPARTMENT-20190917-0000002\', \'default_app\': \'APP-20190917-0000001\', \'user_type\': \'OUA\', \'code\': \'USER-20190917-0000026\', \'name\': \'Ritas\', \'username\': \'obrita\', \'password\': \'pbkdf2_sha256$150000$2TujGiKV40ow$UQDcL8Sh4Nxg00WQYUrFVgizeM+rynEAcSSXcy7Nxbk=\', \'doa\': None, \'contact_no\': \'1312313\', \'email\': \'test@gmail.com\', \'groups\': [], \'user_permissions\': [], \'application\': [<Application: Resource Management System>, <Application: Asset Management System>]}', '');
/*!40000 ALTER TABLE `entity_logs` ENABLE KEYS */;
-- Dumping structure for table rms_db.modules
CREATE TABLE IF NOT EXISTS `modules` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`created` datetime(6) NOT NULL,
`createdby` varchar(255) NOT NULL,
`modified` datetime(6) NOT NULL,
`modifiedby` varchar(255) NOT NULL,
`code` varchar(255) NOT NULL,
`name` varchar(255) DEFAULT NULL,
`parent` int(11) DEFAULT NULL,
`sort_id` int(11) NOT NULL,
`component` varchar(255) DEFAULT NULL,
`application_id` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `code` (`code`),
UNIQUE KEY `name` (`name`),
KEY `modules_application_id_f285bf5b_fk_applications_code` (`application_id`),
CONSTRAINT `modules_application_id_f285bf5b_fk_applications_code` FOREIGN KEY (`application_id`) REFERENCES `applications` (`code`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
-- Dumping data for table rms_db.modules: ~5 rows (approximately)
DELETE FROM `modules`;
/*!40000 ALTER TABLE `modules` DISABLE KEYS */;
INSERT INTO `modules` (`id`, `created`, `createdby`, `modified`, `modifiedby`, `code`, `name`, `parent`, `sort_id`, `component`, `application_id`) VALUES
(1, '2019-09-17 15:48:54.990171', 'superuser', '2019-09-17 15:48:54.990171', 'superuser', 'MODULE-20190917-0000001', 'Application Management', 0, 5, NULL, 'APP-20190917-0000001'),
(2, '2019-09-17 15:49:08.878150', 'superuser', '2019-09-17 15:49:08.878150', 'superuser', 'MODULE-20190917-0000002', 'Company Management', 0, 4, NULL, 'APP-20190917-0000001'),
(3, '2019-09-17 15:51:18.350235', 'superuser', '2019-09-17 15:51:18.350235', 'superuser', 'MODULE-20190917-0000003', 'Department Management', 0, 3, NULL, 'APP-20190917-0000001'),
(4, '2019-09-17 15:51:24.082126', 'superuser', '2019-09-17 15:51:24.082126', 'superuser', 'MODULE-20190917-0000004', 'Module Management', 0, 2, NULL, 'APP-20190917-0000001'),
(5, '2019-09-17 15:51:28.199618', 'superuser', '2019-09-17 15:51:28.199618', 'superuser', 'MODULE-20190917-0000005', 'User Management', 0, 1, NULL, 'APP-20190917-0000001');
/*!40000 ALTER TABLE `modules` ENABLE KEYS */;
-- Dumping structure for table rms_db.notifications
CREATE TABLE IF NOT EXISTS `notifications` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`code` varchar(255) NOT NULL,
`notif_type` varchar(20) NOT NULL,
`message` varchar(255) DEFAULT NULL,
`is_read` tinyint(1) DEFAULT NULL,
`created` datetime(6) NOT NULL,
`modified` datetime(6) NOT NULL,
`account_no_id` varchar(255) NOT NULL,
`app_id` varchar(255) NOT NULL,
`form_code_id` varchar(255) NOT NULL,
`sender_account_no_id` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `code` (`code`),
KEY `notifications_account_no_id_ff388d8f_fk_auth_user_code` (`account_no_id`),
KEY `notifications_app_id_1b485e03_fk_applications_code` (`app_id`),
KEY `notifications_form_code_id_a2f6cde7_fk_change_re` (`form_code_id`),
KEY `notifications_sender_account_no_id_8d711c98_fk_auth_user_code` (`sender_account_no_id`),
CONSTRAINT `notifications_account_no_id_ff388d8f_fk_auth_user_code` FOREIGN KEY (`account_no_id`) REFERENCES `auth_user` (`code`),
CONSTRAINT `notifications_app_id_1b485e03_fk_applications_code` FOREIGN KEY (`app_id`) REFERENCES `applications` (`code`),
CONSTRAINT `notifications_form_code_id_a2f6cde7_fk_change_re` FOREIGN KEY (`form_code_id`) REFERENCES `change_request_form_headers` (`form_code`),
CONSTRAINT `notifications_sender_account_no_id_8d711c98_fk_auth_user_code` FOREIGN KEY (`sender_account_no_id`) REFERENCES `auth_user` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Dumping data for table rms_db.notifications: ~0 rows (approximately)
DELETE FROM `notifications`;
/*!40000 ALTER TABLE `notifications` DISABLE KEYS */;
/*!40000 ALTER TABLE `notifications` ENABLE KEYS */;
-- Dumping structure for table rms_db.password_resets
CREATE TABLE IF NOT EXISTS `password_resets` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`email` varchar(255) NOT NULL,
`token` varchar(255) NOT NULL,
`created_at` datetime(6) NOT NULL,
`timeout_at` datetime(6) NOT NULL,
`is_active` tinyint(1) NOT NULL,
`code` varchar(50) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Dumping data for table rms_db.password_resets: ~0 rows (approximately)
DELETE FROM `password_resets`;
/*!40000 ALTER TABLE `password_resets` DISABLE KEYS */;
/*!40000 ALTER TABLE `password_resets` ENABLE KEYS */;
-- Dumping structure for table rms_db.permissions
CREATE TABLE IF NOT EXISTS `permissions` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`created` datetime(6) NOT NULL,
`createdby` varchar(255) NOT NULL,
`modified` datetime(6) NOT NULL,
`modifiedby` varchar(255) NOT NULL,
`name` varchar(255) DEFAULT NULL,
`code` varchar(255) DEFAULT NULL,
`description` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `code` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Dumping data for table rms_db.permissions: ~0 rows (approximately)
DELETE FROM `permissions`;
/*!40000 ALTER TABLE `permissions` DISABLE KEYS */;
/*!40000 ALTER TABLE `permissions` ENABLE KEYS */;
-- Dumping structure for table rms_db.roles
CREATE TABLE IF NOT EXISTS `roles` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`created` datetime(6) NOT NULL,
`createdby` varchar(255) NOT NULL,
`modified` datetime(6) NOT NULL,
`modifiedby` varchar(255) NOT NULL,
`description` varchar(255) DEFAULT NULL,
`code` varchar(255) NOT NULL,
`name` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `code` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Dumping data for table rms_db.roles: ~0 rows (approximately)
DELETE FROM `roles`;
/*!40000 ALTER TABLE `roles` DISABLE KEYS */;
/*!40000 ALTER TABLE `roles` ENABLE KEYS */;
-- Dumping structure for table rms_db.role_permissions
CREATE TABLE IF NOT EXISTS `role_permissions` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`created` datetime(6) NOT NULL,
`createdby` varchar(255) NOT NULL,
`modified` datetime(6) NOT NULL,
`modifiedby` varchar(255) NOT NULL,
`permission_id` int(11) NOT NULL,
`role_id` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `role_permissions_permission_id_ad343843_fk_permissions_id` (`permission_id`),
KEY `role_permissions_role_id_216516f2_fk_roles_id` (`role_id`),
CONSTRAINT `role_permissions_permission_id_ad343843_fk_permissions_id` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`),
CONSTRAINT `role_permissions_role_id_216516f2_fk_roles_id` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Dumping data for table rms_db.role_permissions: ~0 rows (approximately)
DELETE FROM `role_permissions`;
/*!40000 ALTER TABLE `role_permissions` DISABLE KEYS */;
/*!40000 ALTER TABLE `role_permissions` ENABLE KEYS */;
-- Dumping structure for table rms_db.status_set
CREATE TABLE IF NOT EXISTS `status_set` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`created` datetime(6) NOT NULL,
`createdby` varchar(255) NOT NULL,
`modified` datetime(6) NOT NULL,
`modifiedby` varchar(255) NOT NULL,
`ref` varchar(10) NOT NULL,
`code` varchar(10) NOT NULL,
`name` varchar(10) NOT NULL,
`description` varchar(100) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `code` (`code`),
UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Dumping data for table rms_db.status_set: ~0 rows (approximately)
DELETE FROM `status_set`;
/*!40000 ALTER TABLE `status_set` DISABLE KEYS */;
/*!40000 ALTER TABLE `status_set` ENABLE KEYS */;
/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
/*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment