forked from github/plane
chore: rename workspace company size to organization size (#1463)
* chore: rename workspace company size to organization size * chore: make workspace organization size as required
This commit is contained in:
parent
2f8a1dbe20
commit
8443dfc9dd
42
apiserver/plane/db/migrations/0035_auto_20230704_2225.py
Normal file
42
apiserver/plane/db/migrations/0035_auto_20230704_2225.py
Normal file
@ -0,0 +1,42 @@
|
||||
# Generated by Django 3.2.19 on 2023-07-04 16:55
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
def update_company_organization_size(apps, schema_editor):
|
||||
Model = apps.get_model("db", "Workspace")
|
||||
updated_size = []
|
||||
for obj in Model.objects.all():
|
||||
obj.organization_size = str(obj.company_size)
|
||||
updated_size.append(obj)
|
||||
|
||||
Model.objects.bulk_update(updated_size, ["organization_size"], batch_size=100)
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
("db", "0034_auto_20230628_1046"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name="workspace",
|
||||
name="organization_size",
|
||||
field=models.CharField(default="2-10", max_length=20),
|
||||
),
|
||||
migrations.RunPython(update_company_organization_size),
|
||||
migrations.AlterField(
|
||||
model_name="workspace",
|
||||
name="name",
|
||||
field=models.CharField(max_length=80, verbose_name="Workspace Name"),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="workspace",
|
||||
name="slug",
|
||||
field=models.SlugField(max_length=48, unique=True),
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name="workspace",
|
||||
name="company_size",
|
||||
),
|
||||
]
|
@ -0,0 +1,18 @@
|
||||
# Generated by Django 3.2.19 on 2023-07-05 07:59
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('db', '0035_auto_20230704_2225'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='workspace',
|
||||
name='organization_size',
|
||||
field=models.CharField(max_length=20),
|
||||
),
|
||||
]
|
@ -23,7 +23,7 @@ class Workspace(BaseModel):
|
||||
related_name="owner_workspace",
|
||||
)
|
||||
slug = models.SlugField(max_length=48, db_index=True, unique=True)
|
||||
company_size = models.PositiveIntegerField(default=10)
|
||||
organization_size = models.CharField(max_length=20)
|
||||
|
||||
def __str__(self):
|
||||
"""Return name of the Workspace"""
|
||||
|
Loading…
Reference in New Issue
Block a user