From 3696a4bd4fe28883103d9d11644231b1a13c58bd Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Thu, 15 Apr 2021 17:14:08 +0200 Subject: [PATCH] =?UTF-8?q?=E2=86=AA=20Create=20migration=20for=20the=20ne?= =?UTF-8?q?w=20database=20fields?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migrations/0002_auto_20210415_1453.py | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 sophon/core/migrations/0002_auto_20210415_1453.py diff --git a/sophon/core/migrations/0002_auto_20210415_1453.py b/sophon/core/migrations/0002_auto_20210415_1453.py new file mode 100644 index 0000000..1122a91 --- /dev/null +++ b/sophon/core/migrations/0002_auto_20210415_1453.py @@ -0,0 +1,33 @@ +# Generated by Django 3.2 on 2021-04-15 14:53 + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('core', '0001_initial'), + ] + + operations = [ + migrations.AddField( + model_name='project', + name='collaborators', + field=models.ManyToManyField(blank=True, help_text='The users who can edit the project.', related_name='collaborates_in', to=settings.AUTH_USER_MODEL), + ), + # No projects should be in the db before this migration is run, so this should be fine + migrations.AddField( + model_name='project', + name='owner', + field=models.ForeignKey(default=0, help_text='The user who owns the project, and has full access to it.', on_delete=django.db.models.deletion.CASCADE, to='auth.user'), + preserve_default=False, + ), + migrations.AddField( + model_name='project', + name='visibility', + field=models.CharField(choices=[('PUBLIC', '🌍 Public'), ('INTERNAL', '🏭 Internal'), ('PRIVATE', '🔒 Private')], default='INTERNAL', help_text='A setting specifying who can view the project.', max_length=16, verbose_name='Visibility'), + ), + ]