From 59c0de9b57848617f0caa2c8c25cc022b9b08e09 Mon Sep 17 00:00:00 2001 From: Sai Tharun <65693649+saitharunsai@users.noreply.github.com> Date: Mon, 19 Jun 2023 08:23:44 +0530 Subject: [PATCH] :hammer: updated missing migration file (#1321) Co-authored-by: saitharunsai --- .gitignore | 1 + .../db/migrations/0033_auto_20230618_2125.py | 83 +++++++++++++++++++ apiserver/plane/settings/local.py | 4 +- apiserver/plane/settings/staging.py | 4 +- 4 files changed, 88 insertions(+), 4 deletions(-) create mode 100644 apiserver/plane/db/migrations/0033_auto_20230618_2125.py diff --git a/.gitignore b/.gitignore index 3562ab0b3..921881df4 100644 --- a/.gitignore +++ b/.gitignore @@ -43,6 +43,7 @@ yarn-error.log* ## Django ## venv +.venv *.pyc staticfiles mediafiles diff --git a/apiserver/plane/db/migrations/0033_auto_20230618_2125.py b/apiserver/plane/db/migrations/0033_auto_20230618_2125.py new file mode 100644 index 000000000..8eb2eda62 --- /dev/null +++ b/apiserver/plane/db/migrations/0033_auto_20230618_2125.py @@ -0,0 +1,83 @@ +# Generated by Django 3.2.19 on 2023-06-18 15:55 + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion +import uuid + + +class Migration(migrations.Migration): + + dependencies = [ + ('db', '0032_auto_20230520_2015'), + ] + + operations = [ + migrations.CreateModel( + name='Inbox', + 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)), + ('name', models.CharField(max_length=255)), + ('description', models.TextField(blank=True, verbose_name='Inbox Description')), + ('is_default', models.BooleanField(default=False)), + ('view_props', models.JSONField(default=dict)), + ('created_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='inbox_created_by', to=settings.AUTH_USER_MODEL, verbose_name='Created By')), + ], + options={ + 'verbose_name': 'Inbox', + 'verbose_name_plural': 'Inboxes', + 'db_table': 'inboxes', + 'ordering': ('name',), + }, + ), + migrations.AddField( + model_name='project', + name='inbox_view', + field=models.BooleanField(default=False), + ), + migrations.CreateModel( + name='InboxIssue', + 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)), + ('status', models.IntegerField(choices=[(-2, 'Pending'), (-1, 'Rejected'), (0, 'Snoozed'), (1, 'Accepted'), (2, 'Duplicate')], default=-2)), + ('snoozed_till', models.DateTimeField(null=True)), + ('source', models.TextField(blank=True, null=True)), + ('created_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='inboxissue_created_by', to=settings.AUTH_USER_MODEL, verbose_name='Created By')), + ('duplicate_to', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='inbox_duplicate', to='db.issue')), + ('inbox', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='issue_inbox', to='db.inbox')), + ('issue', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='issue_inbox', to='db.issue')), + ('project', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='project_inboxissue', to='db.project')), + ('updated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='inboxissue_updated_by', to=settings.AUTH_USER_MODEL, verbose_name='Last Modified By')), + ('workspace', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='workspace_inboxissue', to='db.workspace')), + ], + options={ + 'verbose_name': 'InboxIssue', + 'verbose_name_plural': 'InboxIssues', + 'db_table': 'inbox_issues', + 'ordering': ('-created_at',), + }, + ), + migrations.AddField( + model_name='inbox', + name='project', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='project_inbox', to='db.project'), + ), + migrations.AddField( + model_name='inbox', + name='updated_by', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='inbox_updated_by', to=settings.AUTH_USER_MODEL, verbose_name='Last Modified By'), + ), + migrations.AddField( + model_name='inbox', + name='workspace', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='workspace_inbox', to='db.workspace'), + ), + migrations.AlterUniqueTogether( + name='inbox', + unique_together={('name', 'project')}, + ), + ] diff --git a/apiserver/plane/settings/local.py b/apiserver/plane/settings/local.py index 3a3a3d9a3..c7d8b1bdf 100644 --- a/apiserver/plane/settings/local.py +++ b/apiserver/plane/settings/local.py @@ -18,10 +18,10 @@ EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend" DATABASES = { "default": { "ENGINE": "django.db.backends.postgresql_psycopg2", - "NAME": "plane", + "NAME": os.environ.get("PGUSER", "plane"), "USER": "", "PASSWORD": "", - "HOST": "", + "HOST": os.environ.get("PGHOST", "localhost"), } } diff --git a/apiserver/plane/settings/staging.py b/apiserver/plane/settings/staging.py index 851ad77f2..2dab632f1 100644 --- a/apiserver/plane/settings/staging.py +++ b/apiserver/plane/settings/staging.py @@ -16,10 +16,10 @@ DEBUG = True DATABASES = { "default": { "ENGINE": "django.db.backends.postgresql_psycopg2", - "NAME": "plane", + "NAME": os.environ.get("PGUSER", "plane"), "USER": "", "PASSWORD": "", - "HOST": "", + "HOST": os.environ.get("PGHOST", "localhost"), } }