diff options
| author | 2020-06-02 21:13:01 +0100 | |
|---|---|---|
| committer | 2020-06-02 21:13:01 +0100 | |
| commit | fac0d15afade7b00e883e3f9798a846956f222cc (patch) | |
| tree | 5d0c1d5f3ceb6a0dcea73ae73e3c1341c3308da4 | |
| parent | Convert the roles field on the user model from a many-to-many field to a post... (diff) | |
Add migrations to switch user field to array
| -rw-r--r-- | pydis_site/apps/api/migrations/0053_user_roles_to_array.py | 24 | 
1 files changed, 24 insertions, 0 deletions
| diff --git a/pydis_site/apps/api/migrations/0053_user_roles_to_array.py b/pydis_site/apps/api/migrations/0053_user_roles_to_array.py new file mode 100644 index 00000000..7ff3a548 --- /dev/null +++ b/pydis_site/apps/api/migrations/0053_user_roles_to_array.py @@ -0,0 +1,24 @@ +# Generated by Django 2.2.11 on 2020-06-02 13:42 + +import django.contrib.postgres.fields +import django.core.validators +from django.db import migrations, models + + +class Migration(migrations.Migration): + +    dependencies = [ +        ('api', '0052_remove_user_avatar_hash'), +    ] + +    operations = [ +        migrations.RemoveField( +            model_name='user', +            name='roles', +        ), +        migrations.AddField( +            model_name='user', +            name='roles', +            field=django.contrib.postgres.fields.ArrayField(base_field=models.BigIntegerField(validators=[django.core.validators.MinValueValidator(limit_value=0, message='Role IDs cannot be negative.')]), default=list, help_text='IDs of roles the user has on the server', size=None), +        ), +    ] | 
