Skip to content

Commit

Permalink
Refactor: migrations
Browse files Browse the repository at this point in the history
Change migrations to be used with fresh database
  • Loading branch information
Pythonusus committed Jan 8, 2025
1 parent 93132b8 commit af888b5
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 37 deletions.
2 changes: 1 addition & 1 deletion task_manager/labels/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generated by Django 5.1.1 on 2024-12-12 10:11
# Generated by Django 5.1.1 on 2025-01-08 12:37

from django.db import migrations, models

Expand Down
6 changes: 3 additions & 3 deletions task_manager/statuses/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generated by Django 5.1.1 on 2024-12-12 10:11
# Generated by Django 5.1.1 on 2025-01-08 12:37

from django.db import migrations, models

Expand All @@ -15,8 +15,8 @@ class Migration(migrations.Migration):
name='Status',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=150, unique=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
('name', models.CharField(max_length=150, unique=True, verbose_name='Name')),
('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Created at')),
],
),
]
14 changes: 7 additions & 7 deletions task_manager/tasks/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generated by Django 5.1.1 on 2025-01-07 16:14
# Generated by Django 5.1.1 on 2025-01-08 12:55

import django.db.models.deletion
from django.conf import settings
Expand All @@ -19,12 +19,12 @@ class Migration(migrations.Migration):
name='Task',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=150, unique=True)),
('description', models.TextField(blank=True, max_length=1000, null=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
('author', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='authored_tasks', to=settings.AUTH_USER_MODEL)),
('executor', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='assigned_tasks', to=settings.AUTH_USER_MODEL)),
('status', models.ForeignKey(default=1, on_delete=django.db.models.deletion.PROTECT, related_name='tasks', to='statuses.status')),
('name', models.CharField(max_length=150, unique=True, verbose_name='Name')),
('description', models.TextField(blank=True, max_length=1000, null=True, verbose_name='Description')),
('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Created at')),
('author', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='authored_tasks', to=settings.AUTH_USER_MODEL, verbose_name='Author')),
('executor', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='assigned_tasks', to=settings.AUTH_USER_MODEL, verbose_name='Executor')),
('status', models.ForeignKey(default=1, on_delete=django.db.models.deletion.PROTECT, related_name='tasks', to='statuses.status', verbose_name='Status')),
],
),
]
6 changes: 3 additions & 3 deletions task_manager/users/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generated by Django 5.1.1 on 2024-12-01 18:43
# Generated by Django 5.1.1 on 2025-01-08 12:37

import django.contrib.auth.models
import django.contrib.auth.validators
Expand Down Expand Up @@ -27,8 +27,8 @@ class Migration(migrations.Migration):
('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
('first_name', models.CharField(max_length=150)),
('last_name', models.CharField(max_length=150)),
('first_name', models.CharField(max_length=150, verbose_name='First name')),
('last_name', models.CharField(max_length=150, verbose_name='Last name')),
('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.group', verbose_name='groups')),
('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.permission', verbose_name='user permissions')),
],
Expand Down

This file was deleted.

0 comments on commit af888b5

Please sign in to comment.