|
@@ -21,7 +21,6 @@ def main ( |
|
|
create_answers () |
|
|
create_answers () |
|
|
create_users () |
|
|
create_users () |
|
|
create_query_answer_histories () |
|
|
create_query_answer_histories () |
|
|
add_constraints_to_answers () |
|
|
|
|
|
add_constraints_to_query_answer_histories () |
|
|
add_constraints_to_query_answer_histories () |
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -51,12 +50,6 @@ def create_answers ( |
|
|
table.boolean ('answered').default (False).comment ('回答済') |
|
|
table.boolean ('answered').default (False).comment ('回答済') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def add_constraints_to_answers ( |
|
|
|
|
|
) -> None: |
|
|
|
|
|
with SCHEMA.table ('answers') as table: |
|
|
|
|
|
table.foreign ('query_id').references ('id').on ('queries').on_update ('cascade').on_delete ('restrict') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def create_users ( |
|
|
def create_users ( |
|
|
) -> None: |
|
|
) -> None: |
|
|
with SCHEMA.create ('users') as table: |
|
|
with SCHEMA.create ('users') as table: |
|
|