Skip to content

Commit

Permalink
chore: update migration files
Browse files Browse the repository at this point in the history
  • Loading branch information
moonlitgrace committed Dec 13, 2024
1 parent 94d793b commit 2f8e66d
Show file tree
Hide file tree
Showing 6 changed files with 127 additions and 205 deletions.
4 changes: 2 additions & 2 deletions backend/apps/comment/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generated by Django 5.1.4 on 2024-12-13 10:36
# Generated by Django 5.1.4 on 2024-12-13 11:43

import django.contrib.postgres.indexes
import django.db.models.deletion
Expand Down Expand Up @@ -27,11 +27,11 @@ class Migration(migrations.Migration):
verbose_name='ID',
),
),
('path', django_ltree.fields.PathField(unique=True)),
(
'created_at',
models.DateTimeField(auto_now_add=True, verbose_name='create at'),
),
('path', django_ltree.fields.PathField(unique=True)),
('content', models.TextField(verbose_name='content')),
(
'downvotes',
Expand Down
162 changes: 124 additions & 38 deletions backend/apps/quiblet/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Generated by Django 5.1.4 on 2024-12-11 05:30
# Generated by Django 5.1.4 on 2024-12-13 11:43

import django.db.models.deletion
import django.db.models.functions.text
import dynamic_filenames
import shortuuid.django_fields
from django.db import migrations, models
Expand All @@ -9,45 +11,12 @@ class Migration(migrations.Migration):

initial = True

dependencies = []
dependencies = [
('comment', '0001_initial'),
('user', '0003_alter_profile_username'),
]

operations = [
migrations.CreateModel(
name='Quib',
fields=[
(
'created_at',
models.DateTimeField(auto_now_add=True, verbose_name='create at'),
),
('is_public', models.BooleanField(default=True, verbose_name='is public')),
(
'id',
shortuuid.django_fields.ShortUUIDField(
alphabet='abcdefghijklmnopqrstuvwxyz0123456789',
editable=False,
length=7,
max_length=7,
prefix='',
primary_key=True,
serialize=False,
verbose_name='id',
),
),
('title', models.CharField(max_length=255, verbose_name='title')),
(
'slug',
models.SlugField(
blank=True, editable=False, max_length=25, verbose_name='slug'
),
),
('content', models.TextField(verbose_name='content')),
],
options={
'verbose_name': 'Quib',
'verbose_name_plural': 'Quibs',
'ordering': ['-created_at'],
},
),
migrations.CreateModel(
name='Quiblet',
fields=[
Expand Down Expand Up @@ -89,11 +58,128 @@ class Migration(migrations.Migration):
verbose_name='cover',
),
),
(
'members',
models.ManyToManyField(
blank=True,
related_name='joined_quiblets',
to='user.profile',
verbose_name='members',
),
),
(
'rangers',
models.ManyToManyField(
blank=True,
related_name='ranged_quiblets',
to='user.profile',
verbose_name='rangers',
),
),
],
options={
'verbose_name': 'Quiblet',
'verbose_name_plural': 'Quiblets',
'ordering': ['-created_at'],
},
),
migrations.CreateModel(
name='Quib',
fields=[
(
'created_at',
models.DateTimeField(auto_now_add=True, verbose_name='create at'),
),
('is_public', models.BooleanField(default=True, verbose_name='is public')),
(
'id',
shortuuid.django_fields.ShortUUIDField(
alphabet='abcdefghijklmnopqrstuvwxyz0123456789',
editable=False,
length=7,
max_length=7,
prefix='',
primary_key=True,
serialize=False,
verbose_name='id',
),
),
('title', models.CharField(max_length=255, verbose_name='title')),
(
'slug',
models.SlugField(
blank=True, editable=False, max_length=25, verbose_name='slug'
),
),
('content', models.TextField(verbose_name='content')),
(
'cover',
models.ImageField(
blank=True,
null=True,
upload_to=dynamic_filenames.FilePattern(
filename_pattern='cover/{uuid:s}{ext}'
),
verbose_name='cover',
),
),
(
'comments',
models.ManyToManyField(
blank=True,
related_name='comments',
to='comment.comment',
verbose_name='comments',
),
),
(
'downvotes',
models.ManyToManyField(
blank=True,
related_name='downvoted_quibs',
to='user.profile',
verbose_name='downvotes',
),
),
(
'quibber',
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name='quibs',
to='user.profile',
verbose_name='quibber',
),
),
(
'upvotes',
models.ManyToManyField(
blank=True,
related_name='upvoted_quibs',
to='user.profile',
verbose_name='upvotes',
),
),
(
'quiblet',
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name='quibs',
to='quiblet.quiblet',
verbose_name='quiblet',
),
),
],
options={
'verbose_name': 'Quib',
'verbose_name_plural': 'Quibs',
'ordering': ['-created_at'],
},
),
migrations.AddConstraint(
model_name='quiblet',
constraint=models.UniqueConstraint(
django.db.models.functions.text.Lower('name'),
name='unique_quiblet_name_case_insensitive',
),
),
]
85 changes: 0 additions & 85 deletions backend/apps/quiblet/migrations/0002_initial.py

This file was deleted.

26 changes: 0 additions & 26 deletions backend/apps/quiblet/migrations/0003_quib_cover.py

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion backend/apps/quiblet/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

cover_file_pattern = FilePattern(filename_pattern="cover/{uuid:s}{ext}")

# models
# Create your models here.


class Quiblet(AvatarMixin, CreatedAtMixin, IsPublicMixin):
Expand Down

0 comments on commit 2f8e66d

Please sign in to comment.