Skip to content

Commit

Permalink
Add migrations for internal tasks #114, will be wiped out in #130 whe…
Browse files Browse the repository at this point in the history
…n user handling will change
  • Loading branch information
KrzysztofMadejski committed Aug 21, 2019
1 parent c58ca8c commit b99d8c9
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 0 deletions.
56 changes: 56 additions & 0 deletions moonsheep/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Generated by Django 2.2.3 on 2019-07-25 04:36

from django.conf import settings
import django.contrib.auth.backends
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import moonsheep.models


class Migration(migrations.Migration):

initial = True

dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]

operations = [
migrations.CreateModel(
name='Entry',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('data', moonsheep.models.JSONField()),
],
bases=(models.Model, django.contrib.auth.backends.ModelBackend),
),
migrations.CreateModel(
name='Task',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('type', models.CharField(max_length=255, verbose_name='Type')),
('params', moonsheep.models.JSONField(blank=True)),
('priority', models.DecimalField(decimal_places=2, max_digits=3, validators=[django.core.validators.MaxValueValidator(1.0), django.core.validators.MinValueValidator(0.0)])),
('state', models.CharField(choices=[('open', 'open'), ('dirty', 'dirty'), ('checked', 'checked'), ('manual', 'manual')], max_length=10)),
],
),
migrations.AddConstraint(
model_name='task',
constraint=models.UniqueConstraint(fields=('type', 'params'), name='unique_type_params'),
),
migrations.AddField(
model_name='entry',
name='task',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='moonsheep.Task'),
),
migrations.AddField(
model_name='entry',
name='user',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
),
migrations.AddConstraint(
model_name='entry',
constraint=models.UniqueConstraint(fields=('task', 'user'), name='unique_task_user'),
),
]
24 changes: 24 additions & 0 deletions moonsheep/migrations/0002_auto_20190821_1258.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Generated by Django 2.2.3 on 2019-08-21 12:58

import django.core.validators
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('moonsheep', '0001_initial'),
]

operations = [
migrations.AlterField(
model_name='task',
name='priority',
field=models.DecimalField(decimal_places=2, default=1.0, max_digits=3, validators=[django.core.validators.MaxValueValidator(1.0), django.core.validators.MinValueValidator(0.0)]),
),
migrations.AlterField(
model_name='task',
name='state',
field=models.CharField(choices=[('open', 'open'), ('dirty', 'dirty'), ('checked', 'checked'), ('manual', 'manual')], default='open', max_length=10),
),
]
20 changes: 20 additions & 0 deletions moonsheep/migrations/0003_auto_20190821_1501.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Generated by Django 2.2.3 on 2019-08-21 15:01

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('moonsheep', '0002_auto_20190821_1258'),
]

operations = [
migrations.AlterField(
model_name='entry',
name='user',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
),
]
Empty file.

0 comments on commit b99d8c9

Please sign in to comment.