From bb7d8c9937970f6d9fe9f432557ccc2acfd668fe Mon Sep 17 00:00:00 2001 From: rito528 <39003544+rito528@users.noreply.github.com> Date: Sat, 16 Sep 2023 22:14:20 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20answers=E3=83=86=E3=83=BC=E3=83=96?= =?UTF-8?q?=E3=83=AB=E3=81=ABform=5Fid=E3=82=AB=E3=83=A9=E3=83=A0=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/m20230811_062425_create_answer_tables.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/server/migration/src/m20230811_062425_create_answer_tables.rs b/server/migration/src/m20230811_062425_create_answer_tables.rs index 05eca048..49428caf 100644 --- a/server/migration/src/m20230811_062425_create_answer_tables.rs +++ b/server/migration/src/m20230811_062425_create_answer_tables.rs @@ -1,3 +1,4 @@ +use crate::m20220101_000001_create_table::FormMetaDataTable; use sea_orm_migration::prelude::*; use crate::m20221211_211233_form_questions::FormQuestionsTable; @@ -20,6 +21,13 @@ impl MigrationTrait for Migration { .auto_increment() .primary_key(), ) + .col(ColumnDef::new(AnswersTable::FormId).integer().not_null()) + .foreign_key( + ForeignKey::create() + .name("fk-form-id-from-answers") + .from(AnswersTable::Answers, AnswersTable::FormId) + .to(FormMetaDataTable::FormMetaData, FormMetaDataTable::Id), + ) .col(ColumnDef::new(AnswersTable::User).uuid().not_null()) .col( ColumnDef::new(AnswersTable::Title) @@ -98,6 +106,7 @@ impl MigrationTrait for Migration { enum AnswersTable { Answers, Id, + FormId, User, Title, TimeStamp,