* dev: remove default user * dev: initiate licensing * dev: remove migration file 0046 * feat: self hosted licensing initialize * dev: instance licenses * dev: change license response structure * dev: add default properties and issue mention migration * dev: reset migrations * dev: instance configuration * dev: instance configuration migration * dev: update instance configuration model to take null and empty values * dev: instance configuration variables * dev: set default values * dev: update instance configuration load * dev: email configuration settings moved to database * dev: instance configuration on instance bootup * dev: auto instance registration script * dev: instance admin * dev: enable instance configuration and instance admin roles * dev: instance owner fix * dev: instance configuration values * dev: fix instance permissions and serializer * dev: fix email senders * dev: remove deprecated variables * dev: fix current site domain registration * dev: update cors setup and local settings * dev: migrate instance registration and configuration to manage commands * dev: check email validity * dev: update script to use manage command * dev: default bucket creation script * dev: instance admin routes and initial set of screens * dev: admin api to check if the current user is admin * dev: instance admin unique constraints * dev: check magic link login * dev: fix email sending for ssl * dev: create instance activation route if the instance is not activated during startup * dev: removed DJANGO_SETTINGS_MODULE from environment files and deleted auto bucket create script * dev: environment configuration for backend * dev: fix access token variable error * feat: Instance Admin Panel: General Settings (#2792) --------- Co-authored-by: pablohashescobar <nikhilschacko@gmail.com> Co-authored-by: Prateek Shourya <prateekshourya29@gmail.com>
83 lines
5.1 KiB
Python
83 lines
5.1 KiB
Python
# Generated by Django 4.2.5 on 2023-11-15 14:22
|
|
|
|
from django.conf import settings
|
|
from django.db import migrations, models
|
|
import django.db.models.deletion
|
|
import uuid
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
initial = True
|
|
|
|
dependencies = [
|
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name='Instance',
|
|
fields=[
|
|
('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Created At')),
|
|
('updated_at', models.DateTimeField(auto_now=True, verbose_name='Last Modified At')),
|
|
('id', models.UUIDField(db_index=True, default=uuid.uuid4, editable=False, primary_key=True, serialize=False, unique=True)),
|
|
('instance_name', models.CharField(max_length=255)),
|
|
('whitelist_emails', models.TextField(blank=True, null=True)),
|
|
('instance_id', models.CharField(max_length=25, unique=True)),
|
|
('license_key', models.CharField(blank=True, max_length=256, null=True)),
|
|
('api_key', models.CharField(max_length=16)),
|
|
('version', models.CharField(max_length=10)),
|
|
('primary_email', models.CharField(max_length=256)),
|
|
('last_checked_at', models.DateTimeField()),
|
|
('namespace', models.CharField(blank=True, max_length=50, null=True)),
|
|
('is_telemetry_enabled', models.BooleanField(default=True)),
|
|
('is_support_required', models.BooleanField(default=True)),
|
|
('created_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(class)s_created_by', to=settings.AUTH_USER_MODEL, verbose_name='Created By')),
|
|
('primary_owner', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='instance_primary_owner', to=settings.AUTH_USER_MODEL)),
|
|
('updated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(class)s_updated_by', to=settings.AUTH_USER_MODEL, verbose_name='Last Modified By')),
|
|
],
|
|
options={
|
|
'verbose_name': 'Instance',
|
|
'verbose_name_plural': 'Instances',
|
|
'db_table': 'instances',
|
|
'ordering': ('-created_at',),
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='InstanceConfiguration',
|
|
fields=[
|
|
('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Created At')),
|
|
('updated_at', models.DateTimeField(auto_now=True, verbose_name='Last Modified At')),
|
|
('id', models.UUIDField(db_index=True, default=uuid.uuid4, editable=False, primary_key=True, serialize=False, unique=True)),
|
|
('key', models.CharField(max_length=100, unique=True)),
|
|
('value', models.TextField(blank=True, default=None, null=True)),
|
|
('created_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(class)s_created_by', to=settings.AUTH_USER_MODEL, verbose_name='Created By')),
|
|
('updated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(class)s_updated_by', to=settings.AUTH_USER_MODEL, verbose_name='Last Modified By')),
|
|
],
|
|
options={
|
|
'verbose_name': 'Instance Configuration',
|
|
'verbose_name_plural': 'Instance Configurations',
|
|
'db_table': 'instance_configurations',
|
|
'ordering': ('-created_at',),
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='InstanceAdmin',
|
|
fields=[
|
|
('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Created At')),
|
|
('updated_at', models.DateTimeField(auto_now=True, verbose_name='Last Modified At')),
|
|
('id', models.UUIDField(db_index=True, default=uuid.uuid4, editable=False, primary_key=True, serialize=False, unique=True)),
|
|
('role', models.PositiveIntegerField(choices=[(20, 'Owner'), (15, 'Admin')], default=15)),
|
|
('created_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(class)s_created_by', to=settings.AUTH_USER_MODEL, verbose_name='Created By')),
|
|
('instance', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='admins', to='license.instance')),
|
|
('updated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(class)s_updated_by', to=settings.AUTH_USER_MODEL, verbose_name='Last Modified By')),
|
|
('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='instance_owner', to=settings.AUTH_USER_MODEL)),
|
|
],
|
|
options={
|
|
'verbose_name': 'Instance Admin',
|
|
'verbose_name_plural': 'Instance Admins',
|
|
'db_table': 'instance_admins',
|
|
'ordering': ('-created_at',),
|
|
},
|
|
),
|
|
]
|