Skip to content

Commit

Permalink
Update create_table_from_entity's foreign key name (SeaQL/sea-orm#417)
Browse files Browse the repository at this point in the history
  • Loading branch information
billy1624 committed Jan 31, 2022
1 parent a9e8149 commit 1cf4cd3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions SeaORM/docs/04-generate-database-schema/01-create-table.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ assert_eq!(
)
.foreign_key(
ForeignKeyCreateStatement::new()
.name("fk-cake_filling_price-cake_filling")
.name("fk-cake_filling_price-cake_id-filling_id")
.from_tbl(CakeFillingPrice)
.from_col(cake_filling_price::Column::CakeId)
.from_col(cake_filling_price::Column::FillingId)
Expand Down Expand Up @@ -71,7 +71,7 @@ To further illustrate it, we will show the SQL statement as string below.
r#""filling_id" integer NOT NULL,"#,
r#""price" decimal NOT NULL,"#,
r#"CONSTRAINT "pk-cake_filling_price" PRIMARY KEY ("cake_id", "filling_id"),"#,
r#"CONSTRAINT "fk-cake_filling_price-cake_filling" FOREIGN KEY ("cake_id", "filling_id") REFERENCES "cake_filling" ("cake_id", "filling_id")"#,
r#"CONSTRAINT "fk-cake_filling_price-cake_id-filling_id" FOREIGN KEY ("cake_id", "filling_id") REFERENCES "cake_filling" ("cake_id", "filling_id")"#,
r#")"#,
]
.join(" ")
Expand All @@ -96,7 +96,7 @@ To further illustrate it, we will show the SQL statement as string below.
"`filling_id` int NOT NULL,",
"`price` decimal NOT NULL,",
"PRIMARY KEY `pk-cake_filling_price` (`cake_id`, `filling_id`),",
"CONSTRAINT `fk-cake_filling_price-cake_filling` FOREIGN KEY (`cake_id`, `filling_id`) REFERENCES `cake_filling` (`cake_id`, `filling_id`)",
"CONSTRAINT `fk-cake_filling_price-cake_id-filling_id` FOREIGN KEY (`cake_id`, `filling_id`) REFERENCES `cake_filling` (`cake_id`, `filling_id`)",
")",
]
.join(" ")
Expand Down

0 comments on commit 1cf4cd3

Please sign in to comment.