Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

precreated migrations #13

Merged
merged 1 commit into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 4 additions & 14 deletions apps/blog/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Generated by Django 5.1.1 on 2024-11-12 14:17
# Generated by Django 5.1.1 on 2024-11-13 12:31

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


Expand All @@ -10,7 +8,6 @@ class Migration(migrations.Migration):
initial = True

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

operations = [
Expand All @@ -22,11 +19,12 @@ class Migration(migrations.Migration):
('updated_at', models.DateTimeField(auto_now=True)),
('title', models.CharField(db_index=True, max_length=120, verbose_name='title')),
('slug', models.SlugField(max_length=255, unique=True, verbose_name='slug')),
('status', models.CharField(choices=[('df', 'Draft'), ('pb', 'Published')], default='df', max_length=2, verbose_name='status')),
('description', models.CharField(blank=True, max_length=300, null=True, verbose_name='description')),
('content', models.TextField(verbose_name='content')),
('publisher_at', models.DateField(verbose_name='publisher at')),
('is_active', models.BooleanField(default=False, verbose_name='active')),
('is_active', models.BooleanField(default=True, verbose_name='active')),
('watching', models.BigIntegerField(default=0, verbose_name='watching')),
('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='posts', to=settings.AUTH_USER_MODEL)),
],
options={
'verbose_name': 'Post',
Expand All @@ -41,8 +39,6 @@ class Migration(migrations.Migration):
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('message', models.TextField(verbose_name='message')),
('post', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='post_comments', to='blog.post')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='post_comments', to=settings.AUTH_USER_MODEL)),
],
options={
'abstract': False,
Expand All @@ -52,24 +48,18 @@ class Migration(migrations.Migration):
name='PostCommentLike',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('comment', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='post_comment_likes', to='blog.postcomment')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='post_comment_likes', to=settings.AUTH_USER_MODEL)),
],
),
migrations.CreateModel(
name='PostDislike',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('post', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='post_dislikes', to='blog.post')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='post_dislikes', to=settings.AUTH_USER_MODEL)),
],
),
migrations.CreateModel(
name='PostLike',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('post', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='post_likes', to='blog.post')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='post_likes', to=settings.AUTH_USER_MODEL)),
],
),
]
63 changes: 63 additions & 0 deletions apps/blog/migrations/0002_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Generated by Django 5.1.1 on 2024-11-13 12:31

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


class Migration(migrations.Migration):

initial = True

dependencies = [
('blog', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]

operations = [
migrations.AddField(
model_name='post',
name='author',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='posts', to=settings.AUTH_USER_MODEL),
),
migrations.AddField(
model_name='postcomment',
name='post',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='post_comments', to='blog.post'),
),
migrations.AddField(
model_name='postcomment',
name='user',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='post_comments', to=settings.AUTH_USER_MODEL),
),
migrations.AddField(
model_name='postcommentlike',
name='comment',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='post_comment_likes', to='blog.postcomment'),
),
migrations.AddField(
model_name='postcommentlike',
name='user',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='post_comment_likes', to=settings.AUTH_USER_MODEL),
),
migrations.AddField(
model_name='postdislike',
name='post',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='post_dislikes', to='blog.post'),
),
migrations.AddField(
model_name='postdislike',
name='user',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='post_dislikes', to=settings.AUTH_USER_MODEL),
),
migrations.AddField(
model_name='postlike',
name='post',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='post_likes', to='blog.post'),
),
migrations.AddField(
model_name='postlike',
name='user',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='post_likes', to=settings.AUTH_USER_MODEL),
),
]
24 changes: 0 additions & 24 deletions apps/blog/migrations/0002_post_description_post_status.py

This file was deleted.

18 changes: 0 additions & 18 deletions apps/blog/migrations/0003_alter_post_description.py

This file was deleted.

18 changes: 0 additions & 18 deletions apps/blog/migrations/0004_alter_post_is_active.py

This file was deleted.

2 changes: 1 addition & 1 deletion apps/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-11-12 14:17
# Generated by Django 5.1.1 on 2024-11-13 12:31

import django.contrib.auth.models
import django.contrib.auth.validators
Expand Down
Loading