Skip to content

sponsor migrations 추가 #15

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

Merged
merged 4 commits into from
Feb 9, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/pull-request-merge-precondition.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@v2
- uses: psf/black@stable
with:
options: "--check --verbose"
options: "--check --verbose --exclude migrations"

- uses: isort/isort-action@master
with:
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
/.idea
/db.sqlite3
/sponsor/migrations
199 changes: 199 additions & 0 deletions sponsor/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
# Generated by Django 4.1.5 on 2023-02-09 13:28

import django.db.models.deletion
import sorl.thumbnail.fields
from django.conf import settings
from django.db import migrations, models

import sponsor.models


class Migration(migrations.Migration):

initial = True

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

operations = [
migrations.CreateModel(
name="SponsorLevel",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"name",
models.CharField(
blank=True, default="", help_text="후원 등급명", max_length=255
),
),
(
"desc",
models.TextField(
blank=True,
help_text="후원 혜택을 입력하면 될 거 같아요 :) 후원사가 등급을 정할 때 볼 문구입니다.",
null=True,
),
),
("visible", models.BooleanField(default=True)),
("price", models.IntegerField(default=0)),
("limit", models.IntegerField(default=0, help_text="후원사 등급 별 구좌수")),
("order", models.IntegerField(default=1)),
("created_at", models.DateTimeField(auto_now_add=True)),
("updated_at", models.DateTimeField(auto_now=True)),
],
),
migrations.CreateModel(
name="Sponsor",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"name",
models.CharField(
help_text="후원사의 이름입니다. 서비스나 회사 이름이 될 수 있습니다.", max_length=255
),
),
(
"desc",
models.TextField(
blank=True,
help_text="후원사 설명입니다. 이 설명은 국문 홈페이지에 게시됩니다.",
null=True,
),
),
(
"eng_desc",
models.TextField(
blank=True,
help_text="후원사 영문 설명입니다. 이 설명은 영문 홈페이지에 게시됩니다.",
null=True,
),
),
(
"manager_name",
models.CharField(
help_text="준비위원회와 후원과 관련된 논의를 진행할 담당자의 이름을 입력해주십시오.",
max_length=100,
),
),
(
"manager_email",
models.CharField(
help_text="입력하신 메일로 후원과 관련된 안내 메일이나 문의를 보낼 예정입니다. 후원 담당자의 이메일 주소를 입력해주십시오.",
max_length=100,
),
),
(
"business_registration_number",
models.CharField(
blank=True,
help_text="후원사 사업자 등록번호입니다. 세금 계산서 발급에 사용됩니다.",
max_length=100,
null=True,
),
),
(
"business_registration_file",
models.FileField(
blank=True,
help_text="후원사 사업자 등록증 스캔본입니다. 세금 계산서 발급에 사용됩니다.",
null=True,
upload_to=sponsor.models.registration_file_upload_to,
),
),
(
"url",
models.CharField(
blank=True,
help_text="파이콘 홈페이지에 공개되는 후원사 홈페이지 주소입니다.",
max_length=255,
null=True,
),
),
(
"logo_image",
sorl.thumbnail.fields.ImageField(
blank=True,
help_text="홈페이지에 공개되는 후원사 로고 이미지입니다.",
null=True,
upload_to=sponsor.models.logo_image_upload_to,
),
),
(
"submitted",
models.BooleanField(
default=False,
help_text="사용자가 제출했는지 여부를 저장합니다. 요청이 제출되면 준비위원회에서 검토하고 받아들일지를 결정합니다.",
),
),
(
"accepted",
models.BooleanField(
default=False,
help_text="후원사 신청이 접수되었고, 입금 대기 상태인 경우 True로 설정됩니다.",
),
),
(
"paid_at",
models.DateTimeField(
blank=True,
help_text="후원금이 입금된 일시입니다. 아직 입금되지 않았을 경우 None이 들어갑니다.",
null=True,
),
),
("created_at", models.DateTimeField(auto_now_add=True)),
("updated_at", models.DateTimeField(auto_now=True)),
(
"creator",
models.ForeignKey(
blank=True,
help_text="후원사를 등록한 유저",
null=True,
on_delete=django.db.models.deletion.CASCADE,
related_name="sponsor_creator",
to=settings.AUTH_USER_MODEL,
),
),
(
"level",
models.ForeignKey(
blank=True,
help_text="후원을 원하시는 등급을 선택해주십시오. 모두 판매된 등급은 선택할 수 없습니다.",
null=True,
on_delete=django.db.models.deletion.SET_NULL,
to="sponsor.sponsorlevel",
),
),
(
"manager_id",
models.ForeignKey(
blank=True,
help_text="후원사를 위한 추가 아이디",
null=True,
on_delete=django.db.models.deletion.CASCADE,
related_name="sponsor_temp_id",
to=settings.AUTH_USER_MODEL,
),
),
],
options={
"ordering": ["paid_at", "id"],
},
),
]
Empty file.