Browse Source

#3 修正

main
みてるぞ 2 months ago
parent
commit
df935542b0
3 changed files with 5 additions and 4 deletions
  1. +1
    -0
      .gitignore
  2. +1
    -1
      migrations/2024_12_02_005300_create_tables.py
  3. +3
    -3
      migrations/2024_12_02_005500_create_answered_flags.py

+ 1
- 0
.gitignore View File

@@ -0,0 +1 @@
__pycache__

+ 1
- 1
migrations/2024_12_02_005300_create_tables.py View File

@@ -1,6 +1,6 @@
from __future__ import annotations from __future__ import annotations


from ..config import CONFIG
from config import CONFIG
from eloquent import DatabaseManager, Schema from eloquent import DatabaseManager, Schema


DB = DatabaseManager (CONFIG) DB = DatabaseManager (CONFIG)


+ 3
- 3
migrations/2024_12_02_005500_create_answered_flags.py View File

@@ -1,6 +1,6 @@
from __future__ import annotations from __future__ import annotations


from ..config import CONFIG
from config import CONFIG
from eloquent import DatabaseManager, Schema from eloquent import DatabaseManager, Schema


DB = DatabaseManager (CONFIG) DB = DatabaseManager (CONFIG)
@@ -20,8 +20,8 @@ def create_answered_flags (
table.unsigned_big_integer ('answer_id').comment ('回答') table.unsigned_big_integer ('answer_id').comment ('回答')
table.integer ('platform').comment ('プラットフォーム区分') table.integer ('platform').comment ('プラットフォーム区分')
table.boolean ('answered').default (False).comment ('回答済') table.boolean ('answered').default (False).comment ('回答済')
table.unique (['answered_id', 'platform'])
table.foreign ('answered_id').references ('id').on ('answers').on_update ('cascade').on_delete ('cascade')
table.unique (['answer_id', 'platform'])
table.foreign ('answer_id').references ('id').on ('answers').on_update ('cascade').on_delete ('cascade')




def drop_answered_column_in_answers ( def drop_answered_column_in_answers (


Loading…
Cancel
Save