aboutsummaryrefslogtreecommitdiffstats
path: root/api/migrations
diff options
context:
space:
mode:
Diffstat (limited to 'api/migrations')
-rw-r--r--api/migrations/0004_role.py23
-rw-r--r--api/migrations/0005_user.py38
2 files changed, 61 insertions, 0 deletions
diff --git a/api/migrations/0004_role.py b/api/migrations/0004_role.py
new file mode 100644
index 00000000..0a6b6c43
--- /dev/null
+++ b/api/migrations/0004_role.py
@@ -0,0 +1,23 @@
+# Generated by Django 2.1 on 2018-09-01 19:54
+
+import django.core.validators
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('api', '0003_offtopicchannelname'),
+ ]
+
+ operations = [
+ migrations.CreateModel(
+ name='Role',
+ fields=[
+ ('id', models.BigIntegerField(help_text="The role's ID, taken from Discord.", primary_key=True, serialize=False, validators=[django.core.validators.MinValueValidator(limit_value=0, message='Role IDs cannot be negative.')])),
+ ('name', models.CharField(help_text="The role's name, taken from Discord.", max_length=100)),
+ ('colour', models.IntegerField(help_text='The integer value of the colour of this role from Discord.', validators=[django.core.validators.MinValueValidator(limit_value=0, message='Colour hex cannot be negative.')])),
+ ('permissions', models.IntegerField(help_text='The integer value of the permission bitset of this role from Discord.', validators=[django.core.validators.MinValueValidator(limit_value=0, message='Role permissions cannot be negative.'), django.core.validators.MaxValueValidator(limit_value=8589934592, message='Role permission bitset exceeds value of having all permissions')])),
+ ],
+ ),
+ ]
diff --git a/api/migrations/0005_user.py b/api/migrations/0005_user.py
new file mode 100644
index 00000000..a771119c
--- /dev/null
+++ b/api/migrations/0005_user.py
@@ -0,0 +1,38 @@
+# Generated by Django 2.1 on 2018-09-01 20:02
+
+import django.core.validators
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('api', '0004_role'),
+ ]
+
+ operations = [
+ migrations.CreateModel(
+ name='Member',
+ fields=[
+ ('id', models.BigIntegerField(help_text='The ID of this user, taken from Discord.', primary_key=True, serialize=False, validators=[django.core.validators.MinValueValidator(limit_value=0, message='User IDs cannot be negative.')])),
+ ('name', models.CharField(help_text='The username, taken from Discord.', max_length=32)),
+ ('discriminator', models.PositiveSmallIntegerField(help_text='The discriminator of this user, taken from Discord.', validators=[django.core.validators.MaxValueValidator(limit_value=9999, message='Discriminators may not exceed `9999`.')])),
+ ('avatar_hash', models.CharField(help_text="The user's avatar hash, taken from Discord. Null if the user does not have any custom avatar.", max_length=100, null=True)),
+ ],
+ ),
+ migrations.AlterField(
+ model_name='role',
+ name='id',
+ field=models.BigIntegerField(help_text='The role ID, taken from Discord.', primary_key=True, serialize=False, validators=[django.core.validators.MinValueValidator(limit_value=0, message='Role IDs cannot be negative.')]),
+ ),
+ migrations.AlterField(
+ model_name='role',
+ name='name',
+ field=models.CharField(help_text='The role name, taken from Discord.', max_length=100),
+ ),
+ migrations.AddField(
+ model_name='member',
+ name='roles',
+ field=models.ManyToManyField(help_text='Any roles this user has on our server.', to='api.Role'),
+ ),
+ ]