LoginSignup
0
0

More than 5 years have passed since last update.

Angularで作るER DIAGRAM TOOL - 第十三回 many-to-manyのリレーション作成の実装

Posted at

(1)many-to-manyのリレーションシップ作成機能

/src/app/service/data.service.ts
https://github.com/dog-ears/er-diagram-tool/commit/b9911a0a182ff33d0dc910910baad7dc71c11cea#diff-ae990bb302f27e60323deb45d6746b17

・addManyToManyRelation()の中身を実装

・新しくできるpivotモデルの名前は、
source_model.name + target_model.name
または、
target_model.name + source_model.nameとなります。
※どちらが先に来るかは、昇順で決まります。

また、pivotモデルは、
[source_model.name]_id と [target_model.name]_idという名前の2つのschemaを持ちます。

cap13_1.jpg

これで、many-to-manyリレーションシップの実装も完了しました。
次回は、Export JSON を実装します。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0