-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Add fields to issue_version and profile tables, and create new…
… sticky table (#6198) * chore: added fields in issue_version and profile tables and created a new sticky table * chore: removed point in issue version * chore: add imports in init --------- Co-authored-by: sainath <[email protected]>
- Loading branch information
1 parent
a8140a5
commit 6ff258c
Showing
5 changed files
with
246 additions
and
36 deletions.
There are no files selected for viewing
112 changes: 112 additions & 0 deletions
112
apiserver/plane/db/migrations/0087_remove_issueversion_description_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
# Generated by Django 4.2.17 on 2024-12-13 10:09 | ||
|
||
from django.conf import settings | ||
import django.core.validators | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import django.utils.timezone | ||
import plane.db.models.user | ||
import uuid | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('db', '0086_issueversion_alter_teampage_unique_together_and_more'), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name='issueversion', | ||
name='description', | ||
), | ||
migrations.RemoveField( | ||
model_name='issueversion', | ||
name='description_binary', | ||
), | ||
migrations.RemoveField( | ||
model_name='issueversion', | ||
name='description_html', | ||
), | ||
migrations.RemoveField( | ||
model_name='issueversion', | ||
name='description_stripped', | ||
), | ||
migrations.AddField( | ||
model_name='issueversion', | ||
name='activity', | ||
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='versions', to='db.issueactivity'), | ||
), | ||
migrations.AddField( | ||
model_name='profile', | ||
name='is_mobile_onboarded', | ||
field=models.BooleanField(default=False), | ||
), | ||
migrations.AddField( | ||
model_name='profile', | ||
name='mobile_onboarding_step', | ||
field=models.JSONField(default=plane.db.models.user.get_mobile_default_onboarding), | ||
), | ||
migrations.AddField( | ||
model_name='profile', | ||
name='mobile_timezone_auto_set', | ||
field=models.BooleanField(default=False), | ||
), | ||
migrations.AlterField( | ||
model_name='issueversion', | ||
name='owned_by', | ||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='issue_versions', to=settings.AUTH_USER_MODEL), | ||
), | ||
migrations.CreateModel( | ||
name='Sticky', | ||
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')), | ||
('deleted_at', models.DateTimeField(blank=True, null=True, verbose_name='Deleted At')), | ||
('id', models.UUIDField(db_index=True, default=uuid.uuid4, editable=False, primary_key=True, serialize=False, unique=True)), | ||
('name', models.TextField()), | ||
('description', models.JSONField(blank=True, default=dict)), | ||
('description_html', models.TextField(blank=True, default='<p></p>')), | ||
('description_stripped', models.TextField(blank=True, null=True)), | ||
('description_binary', models.BinaryField(null=True)), | ||
('logo_props', models.JSONField(default=dict)), | ||
('color', models.CharField(blank=True, max_length=255, null=True)), | ||
('background_color', models.CharField(blank=True, max_length=255, 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')), | ||
('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='stickies', 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')), | ||
('workspace', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='stickies', to='db.workspace')), | ||
], | ||
options={ | ||
'verbose_name': 'Sticky', | ||
'verbose_name_plural': 'Stickies', | ||
'db_table': 'stickies', | ||
'ordering': ('-created_at',), | ||
}, | ||
), | ||
migrations.CreateModel( | ||
name='IssueDescriptionVersion', | ||
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')), | ||
('deleted_at', models.DateTimeField(blank=True, null=True, verbose_name='Deleted At')), | ||
('id', models.UUIDField(db_index=True, default=uuid.uuid4, editable=False, primary_key=True, serialize=False, unique=True)), | ||
('description_binary', models.BinaryField(null=True)), | ||
('description_html', models.TextField(blank=True, default='<p></p>')), | ||
('description_stripped', models.TextField(blank=True, null=True)), | ||
('description_json', models.JSONField(blank=True, default=dict)), | ||
('last_saved_at', models.DateTimeField(default=django.utils.timezone.now)), | ||
('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')), | ||
('issue', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='description_versions', to='db.issue')), | ||
('owned_by', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='issue_description_versions', to=settings.AUTH_USER_MODEL)), | ||
('project', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='project_%(class)s', to='db.project')), | ||
('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')), | ||
('workspace', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='workspace_%(class)s', to='db.workspace')), | ||
], | ||
options={ | ||
'verbose_name': 'Issue Description Version', | ||
'verbose_name_plural': 'Issue Description Versions', | ||
'db_table': 'issue_description_versions', | ||
}, | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Django imports | ||
from django.conf import settings | ||
from django.db import models | ||
|
||
# Module imports | ||
from .base import BaseModel | ||
|
||
|
||
class Sticky(BaseModel): | ||
name = models.TextField() | ||
|
||
description = models.JSONField(blank=True, default=dict) | ||
description_html = models.TextField(blank=True, default="<p></p>") | ||
description_stripped = models.TextField(blank=True, null=True) | ||
description_binary = models.BinaryField(null=True) | ||
|
||
logo_props = models.JSONField(default=dict) | ||
color = models.CharField(max_length=255, blank=True, null=True) | ||
background_color = models.CharField(max_length=255, blank=True, null=True) | ||
|
||
workspace = models.ForeignKey( | ||
"db.Workspace", on_delete=models.CASCADE, related_name="stickies" | ||
) | ||
owner = models.ForeignKey( | ||
settings.AUTH_USER_MODEL, on_delete=models.CASCADE, related_name="stickies" | ||
) | ||
|
||
class Meta: | ||
verbose_name = "Sticky" | ||
verbose_name_plural = "Stickies" | ||
db_table = "stickies" | ||
ordering = ("-created_at",) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters