Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.vscode
.pytest_cache
venv
migrations
__pycache__
node_modules
dist
Expand Down
25 changes: 25 additions & 0 deletions comments/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Generated by Django 3.2.5 on 2022-08-23 10:28

from django.db import migrations, models


class Migration(migrations.Migration):

initial = True

dependencies = [
]

operations = [
migrations.CreateModel(
name='Comment',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('body', models.CharField(max_length=255)),
('created_at', models.DateTimeField(auto_now_add=True)),
],
options={
'ordering': ['-created_at'],
},
),
]
29 changes: 29 additions & 0 deletions comments/migrations/0002_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Generated by Django 3.2.5 on 2022-08-23 10:28

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


class Migration(migrations.Migration):

initial = True

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

operations = [
migrations.AddField(
model_name='comment',
name='author',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='comments', to=settings.AUTH_USER_MODEL),
),
migrations.AddField(
model_name='comment',
name='post',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='comments', to='posts.post'),
),
]
Empty file added comments/migrations/__init__.py
Empty file.
41 changes: 41 additions & 0 deletions posts/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Generated by Django 3.2.5 on 2022-08-23 10:28

from django.db import migrations, models


class Migration(migrations.Migration):

initial = True

dependencies = [
]

operations = [
migrations.CreateModel(
name='Post',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=150, unique=True)),
('slug', models.SlugField(allow_unicode=True, max_length=150, unique=True)),
('thumbnail', models.ImageField(upload_to='thumbnails')),
('body', models.TextField()),
('read_time', models.IntegerField(blank=True, null=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
('edited_at', models.DateTimeField(auto_now=True)),
('is_public', models.BooleanField(default=False)),
],
options={
'ordering': ['-created_at'],
},
),
migrations.CreateModel(
name='Tag',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=20, unique=True)),
],
options={
'ordering': ['name'],
},
),
]
28 changes: 28 additions & 0 deletions posts/migrations/0002_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Generated by Django 3.2.5 on 2022-08-23 10:28

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


class Migration(migrations.Migration):

initial = True

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

operations = [
migrations.AddField(
model_name='post',
name='author',
field=models.ForeignKey(on_delete=django.db.models.deletion.RESTRICT, related_name='posts', to=settings.AUTH_USER_MODEL),
),
migrations.AddField(
model_name='post',
name='tags',
field=models.ManyToManyField(to='posts.Tag'),
),
]
Empty file added posts/migrations/__init__.py
Empty file.
39 changes: 39 additions & 0 deletions users/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Generated by Django 3.2.5 on 2022-08-23 10:28

from django.db import migrations, models


class Migration(migrations.Migration):

initial = True

dependencies = [
('auth', '0012_alter_user_first_name_max_length'),
]

operations = [
migrations.CreateModel(
name='User',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('password', models.CharField(max_length=128, verbose_name='password')),
('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
('username', models.CharField(max_length=150, unique=True)),
('email', models.EmailField(max_length=254, unique=True)),
('first_name', models.CharField(blank=True, max_length=150, null=True)),
('last_name', models.CharField(blank=True, max_length=150, null=True)),
('avatar', models.ImageField(default='avatars/default.png', upload_to='avatars')),
('title', models.CharField(blank=True, max_length=50)),
('created_at', models.DateTimeField(auto_now_add=True)),
('is_staff', models.BooleanField(default=False)),
('is_verified', models.BooleanField(default=False)),
('is_active', models.BooleanField(default=True)),
('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')),
],
options={
'ordering': ['-created_at'],
},
),
]
Empty file added users/migrations/__init__.py
Empty file.