Skip to content

Commit

Permalink
feat(calendar): migrate calendar models
Browse files Browse the repository at this point in the history
  • Loading branch information
injoonH committed Jan 3, 2024
1 parent 4eda968 commit fd79b14
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 77 deletions.
108 changes: 57 additions & 51 deletions apps/calendar/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Generated by Django 4.2.6 on 2023-11-16 15:42
# Generated by Django 4.2.3 on 2024-01-03 07:17

import datetime

import django.db.models.deletion
import django.utils.timezone
from django.db import migrations, models

Expand All @@ -14,11 +13,43 @@ class Migration(migrations.Migration):

operations = [
migrations.CreateModel(
name="Calendar",
name="Tag",
fields=[
(
"id",
models.BigAutoField(
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"ko_name",
models.CharField(max_length=255, unique=True, verbose_name="한글 이름"),
),
(
"en_name",
models.CharField(max_length=255, unique=True, verbose_name="영어 이름"),
),
(
"color",
models.CharField(
default="#000000", max_length=7, verbose_name="HEX 코드"
),
),
],
options={
"verbose_name": "태그",
"verbose_name_plural": "태그 목록",
},
),
migrations.CreateModel(
name="Event",
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
Expand Down Expand Up @@ -49,70 +80,45 @@ class Migration(migrations.Migration):
verbose_name="삭제 시간",
),
),
("is_allday", models.BooleanField(default=False, verbose_name="하루종일")),
(
"start_at",
models.DateTimeField(
blank=True, default=None, null=True, verbose_name="시작 시간"
),
),
(
"end_at",
models.DateTimeField(
blank=True, default=None, null=True, verbose_name="종료 시간"
),
"is_all_day",
models.BooleanField(default=False, verbose_name="하루 종일"),
),
("start_at", models.DateTimeField(verbose_name="시작 시각")),
("end_at", models.DateTimeField(verbose_name="종료 시각")),
("ko_title", models.CharField(max_length=512, verbose_name="한글 제목")),
("en_title", models.CharField(max_length=512, verbose_name="영어 제목")),
(
"ko_description",
models.CharField(max_length=512, verbose_name="한글 설명"),
models.TextField(
blank=True, max_length=512, null=True, verbose_name="한글 설명"
),
),
(
"en_description",
models.CharField(max_length=512, verbose_name="영어 설명"),
),
("location", models.CharField(max_length=512, verbose_name="위치")),
(
"url",
models.URLField(
blank=True, default=None, null=True, verbose_name="포탈 링크"
models.TextField(
blank=True, max_length=512, null=True, verbose_name="영어 설명"
),
),
],
options={
"ordering": ("-created_at",),
"abstract": False,
},
),
migrations.CreateModel(
name="Tag",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
"location",
models.CharField(
blank=True, max_length=512, null=True, verbose_name="장소"
),
),
("name", models.CharField(max_length=255, unique=True)),
("color", models.CharField(default="#000000", max_length=7)),
("url", models.URLField(blank=True, null=True, verbose_name="URL")),
(
"calendar",
models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.SET_NULL,
to="calendar.calendar",
"tags",
models.ManyToManyField(
blank=True, to="calendar.tag", verbose_name="태그"
),
),
],
),
migrations.AddField(
model_name="calendar",
name="tags",
field=models.ManyToManyField(related_name="calendars", to="calendar.tag"),
options={
"verbose_name": "일정",
"verbose_name_plural": "일정 목록",
"ordering": ("-created_at",),
"abstract": False,
},
),
]
26 changes: 0 additions & 26 deletions apps/calendar/migrations/0002_alter_calendar_id_alter_tag_id.py

This file was deleted.

0 comments on commit fd79b14

Please sign in to comment.