# データベースダイアグラム

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com/ja-jp/help/clion/llms.txt).

> **TL;DR**
> データベース   ツールウィンドウでデータベースオブジェクトを右クリックし、  `ダイアグラム | ダイアグラムの表示`  を選択します。

Procedure: データベースツールおよび SQL プラグインを有効化

この機能は、CLion にデフォルトでバンドルされ有効化されている データベースツールおよび SQL プラグインに依存しています。 関連機能が利用できない場合は、プラグインを無効化していないことを確認してください。

1. `Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `⌘ Comma` (Xcode), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (ReSharper), `⌘ Comma` (ReSharper (macOS)), `Ctrl+Alt+S` (QtCreator), `⌘ Comma` (QtCreator (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS)) を押して設定を開き、  `プラグイン`  を選択します。

2. データベースツールおよび SQL  プラグインを見つけて   有効化   をクリックします。

Procedure: ダイアグラムプラグインを有効化

この機能は、CLion にデフォルトでバンドルされ有効化されているダイアグラムプラグインに依存しています。 関連機能が利用できない場合は、プラグインを無効化していないことを確認してください。

1. `Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `⌘ Comma` (Xcode), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (ReSharper), `⌘ Comma` (ReSharper (macOS)), `Ctrl+Alt+S` (QtCreator), `⌘ Comma` (QtCreator (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS)) を押して設定を開き、  `プラグイン`  を選択します。

2. ダイアグラム プラグインを探して、   有効化   をクリックします。

> **Note:**
> CLion では、データベースダイアグラムのみ作成できます。 現時点ではクラスダイアグラムはサポートされていません。対応する [チケット](https://youtrack.jetbrains.com/issue/OC-1038)をご参照ください。

データベースダイアグラムは、データベースの構造とデータベースオブジェクト間の関係をグラフィカルに示します。 データソース、スキーマ、テーブルのダイアグラムを生成できます。 データベースオブジェクト間の関係を作成するには、 [主](primary-keys.html)キーと [外部](foreign-keys.html)キーの使用を検討してください。

生成されたダイアグラムは、UML と PNG の 2 つの形式で保存できます。 UML 形式は、CLion 用に特別に開発された内部フォーマットです。 他の製品ではサポートされていません。 作成したダイアグラムを共有したい場合は、PNG の使用を検討してください。

また、実行計画を構築することもできます。 実行計画は、データベース内のデータにアクセスするために使用される一連のステップです。 実行計画の作成の詳細については、 [クエリプランを可視化](query-execution-plan.html#visualize_query_plan)を参照してください。

Procedure: データベースオブジェクトのダイアグラムを生成する

* データベース   ツールウィンドウで、データベースオブジェクトを右クリックし、  `ダイアグラム | ダイアグラムの表示`  を選択します。

![データベースオブジェクトのダイアグラムを生成する](https://resources.jetbrains.com/help/img/idea/2026.3/create_diagram_for_schema.png)

![データベースオブジェクトのダイアグラムを生成する](https://resources.jetbrains.com/help/img/idea/2026.3/create_diagram_for_database.png)

Procedure: ダイアグラムに表を追加する

生成されたデータベースダイアグラムに、さらにテーブルを追加できます。

* データベース   ツールウィンドウで、ダイアグラムに追加したいテーブルをダイアグラム領域にドラッグします。

[Video](https://resources.jetbrains.com/help/img/idea/2026.3/add_table_to_db_diagram.mp4)

## ダイアグラムの表示と管理

Procedure: パンとズーム

* ダイアグラムをパンおよびズームするには、垂直スクロールにはタッチパッド、スクロールバー、またはマウスホイールを使用し、水平スクロールには `Shift` (Windows), `Shift` (macOS), `Shift` (IntelliJ IDEA Classic (macOS)), `Shift` (macOS System Shortcuts), `Shift` (XWin), `Shift` (GNOME), `Shift` (KDE), `Shift` (Emacs), `Shift` (Sublime Text), `Shift` (Sublime Text (macOS)), `Shift` (Xcode), `Shift` (Visual Studio), `Shift` (Visual Studio (macOS)), `Shift` (ReSharper), `Shift` (ReSharper (macOS)), `Shift` (QtCreator), `Shift` (QtCreator (macOS)), `Shift` (NetBeans), `Shift` (Eclipse), `Shift` (Eclipse (macOS)) + マウスホイールを使用します。 `Shift` (Windows), `Shift` (macOS), `Shift` (IntelliJ IDEA Classic (macOS)), `Shift` (macOS System Shortcuts), `Shift` (XWin), `Shift` (GNOME), `Shift` (KDE), `Shift` (Emacs), `Shift` (Sublime Text), `Shift` (Sublime Text (macOS)), `Shift` (Xcode), `Shift` (Visual Studio), `Shift` (Visual Studio (macOS)), `Shift` (ReSharper), `Shift` (ReSharper (macOS)), `Shift` (QtCreator), `Shift` (QtCreator (macOS)), `Shift` (NetBeans), `Shift` (Eclipse), `Shift` (Eclipse (macOS)) + マウスホイールを使用してズームすることもできます。

* 拡大鏡ツールを使用するには、 `Alt` (Windows), `Alt` (macOS), `Alt` (IntelliJ IDEA Classic (macOS)), `Alt` (macOS System Shortcuts), `Alt` (XWin), `Alt` (GNOME), `Alt` (KDE), `Alt` (Emacs), `Alt` (Sublime Text), `Alt` (Sublime Text (macOS)), `Alt` (Xcode), `Alt` (Visual Studio), `Alt` (Visual Studio (macOS)), `Alt` (ReSharper), `Alt` (ReSharper (macOS)), `Alt` (QtCreator), `Alt` (QtCreator (macOS)), `Alt` (NetBeans), `Alt` (Eclipse), `Alt` (Eclipse (macOS)) キーを押し続けてダイアグラム内の目的の領域にカーソルを合わせます。 マウスホイールを使って、拡大鏡ツール内のダイアグラム領域をさらに拡大できます。

![拡大鏡ツール](https://resources.jetbrains.com/help/img/idea/2026.3/db_magn_tool.png)

Procedure: 列コメントを有効にする

1. ダイアグラムを生成します。 ダイアグラムの生成の詳細については、「 [データベースオブジェクトのダイアグラムを生成する](#db_diagrams)」を参照してください。

2. コメント   ボタン ( ![「コメント」ボタン](https://resources.jetbrains.com/help/img/idea/2026.3/app.general.balloon.svg)) をクリックします。

![列コメントを有効にする](https://resources.jetbrains.com/help/img/idea/2026.3/db_enable_column_comments.png)

Procedure: ダイアグラムオブジェクトに色を適用する

1. データベース   ツールウィンドウで、オブジェクトを右クリックし、   色の設定…   を選択します。

2. 色を選択し、   OK   をクリックします。   リフレッシュ   ボタン () をクリックして、ダイアグラムをリフレッシュして色を適用します。

![テーブルカラーの表示](https://resources.jetbrains.com/help/img/idea/2026.3/display_of_table_colors.png)

Procedure: ダイアグラムの要素を見つける

ダイアグラム上で要素を見つけるには、次の手順を実行します。

1. `Ctrl+F` (Windows), `⌘ F` (macOS), `⌘ F` (IntelliJ IDEA Classic (macOS)), `⌘ F` (macOS System Shortcuts), `Ctrl+F` (XWin), `Ctrl+F` (GNOME), `Ctrl+F` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+F` (Sublime Text), `⌘ F` (Sublime Text (macOS)), `⌘ F` (Xcode), `Ctrl+F` (Visual Studio), `⌘ F` (Visual Studio (macOS)), `Ctrl+F` (ReSharper), `⌘ F` (ReSharper (macOS)), `Ctrl+F` (QtCreator), `⌘ F` (QtCreator (macOS)), `Ctrl+F` (NetBeans), `Ctrl+F` (Eclipse), `Ctrl+F` (Eclipse (macOS)) を押すと、   ダイアグラムの要素   ポップアップウィンドウが開きます。

2. 要素の名前を入力し始め、それを選択して、 `Enter` (Windows), `⏎` (macOS), `⏎` (IntelliJ IDEA Classic (macOS)), `⏎` (macOS System Shortcuts), `Enter` (XWin), `Enter` (GNOME), `Enter` (KDE), `Enter` (Emacs), `Enter` (Sublime Text), `⏎` (Sublime Text (macOS)), `⏎` (Xcode), `Enter` (Visual Studio), `⏎` (Visual Studio (macOS)), `Enter` (ReSharper), `⏎` (ReSharper (macOS)), `Enter` (QtCreator), `⏎` (QtCreator (macOS)), `Enter` (NetBeans), `Enter` (Eclipse), `⏎` (Eclipse (macOS)) を押します。

![ダイアグラム要素を見つける](https://resources.jetbrains.com/help/img/idea/2026.3/db_diagrams_find_element.png)

Procedure: ダイアグラムへの変更を元に戻す

ダイアグラムの外観に対する一部の変更を元に戻すことができます。

* 変更を元に戻すには、ダイアグラムエディター内をクリックして `Ctrl+Z` (Windows), `⌘ Z` (macOS), `⌘ Z` (IntelliJ IDEA Classic (macOS)), `⌘ Z` (macOS System Shortcuts), `Ctrl+Z` (XWin), `Ctrl+Z` (GNOME), `Ctrl+Z` (KDE), `Ctrl+Shift+Minus` (Emacs), `Ctrl+Z` (Sublime Text), `⌘ Z` (Sublime Text (macOS)), `⌘ Z` (Xcode), `Ctrl+Z` (Visual Studio), `⌘ Z` (Visual Studio (macOS)), `Ctrl+Z` (ReSharper), `⌘ Z` (ReSharper (macOS)), `Ctrl+Z` (QtCreator), `⌘ Z` (QtCreator (macOS)), `Ctrl+Z` (NetBeans), `Ctrl+Z` (Eclipse), `⌘ Z` (Eclipse (macOS)) を押すか、メインメニューから  `編集｜元に戻す`  を選択します。

ダイアグラムへの変更を元に戻しても、   変更   ダイアログを通じてデータベースにすでに適用された変更は元に戻りません。

[Video](https://resources.jetbrains.com/help/img/idea/2026.3/db_diagrams_undo_action.mp4)

## ダイアグラムのエクスポート

CLion では、ダイアグラムをさまざまなフォーマットでファイルやクリップボードにエクスポートしたり、Web エディターで開いたりできます。 ダイアグラムを印刷してイメージとして保存することもできます。 これを行うには、ダイアグラムのコンテキストメニューで対応するアクションを使用します。

Procedure: Web エディターでダイアグラムを開く

* Web ブラウザーでダイアグラムをサードパーティエディターにエクスポートするには、ダイアグラムを右クリックし、  `ダイアグラムのエクスポート | Web エディターで開く`  に移動してエディターを選択します。

または、ダイアグラムツールバーの   ダイアグラムのエクスポート   ボタン ( ![ダイアグラムのエクスポートアイコン](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.general.export.svg)) をクリックし、対応するサブメニューでエディターを選択します。

サポートされているエディターは次のとおりです：

* [yEd ライブ (英語)](https://www.yworks.com/yed-live/)

* [diagrams.net(英語)](https://app.diagrams.net)

* [Graphviz オンライン (英語)](https://dreampuf.github.io/GraphvizOnline/)

* [位置指定付き Graphviz オンライン (英語)](https://dreampuf.github.io/GraphvizOnline/)

* [Mermaid ライブ (英語)](https://mermaid.live/)

* [PlantUML Web サーバー (英語)](http://www.plantuml.com/)

![コンテキストメニューを使用して Web エディターでダイアグラムを開く](https://resources.jetbrains.com/help/img/idea/2026.3/db_database_diagrams_open_in_web_editors.png)

Procedure: ダイアグラムをクリップボードにコピーする

* ダイアグラムをクリップボードにコピーするには、ダイアグラムを右クリックし、  `ダイアグラムのエクスポート | クリップボードにコピー`  に移動して、形式を選択します。

または、ダイアグラムツールバーの   ダイアグラムのエクスポート   ボタン ( ![ダイアグラムのエクスポートアイコン](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.general.export.svg)) をクリックし、対応するサブメニューで形式を選択します。

サポートされているフォーマットは次のとおりです：

* Mermaid ``` classDiagram direction BT class actor { varchar(45) first_name varchar(45) last_name timestamp last_update smallint unsigned actor_id } class node19 { smallint unsigned actor_id varchar(45) first_name varchar(45) last_name timestamp last_update blob column_nameimg } class actor_info { smallint unsigned actor_id varchar(45) first_name varchar(45) last_name text film_info } class address { varchar(50) address varchar(50) address2 varchar(20) district smallint unsigned city_id varchar(10) postal_code varchar(20) phone timestamp last_update smallint unsigned address_id } class category { varchar(25) name timestamp last_update tinyint unsigned category_id } class city { varchar(50) city smallint unsigned country_id timestamp last_update smallint unsigned city_id } class country { varchar(50) country timestamp last_update smallint unsigned country_id } class customer { tinyint unsigned store_id varchar(45) first_name varchar(45) last_name varchar(50) email smallint unsigned address_id tinyint(1) active datetime create_date timestamp last_update smallint unsigned customer_id } class customer_list { smallint unsigned ID varchar(91) name varchar(50) address varchar(10) zip code varchar(20) phone varchar(50) city varchar(50) country varchar(6) notes tinyint unsigned SID } class film { varchar(255) title text description year release_year tinyint unsigned language_id tinyint unsigned original_language_id tinyint unsigned rental_duration decimal(4,2) rental_rate smallint unsigned length decimal(5,2) replacement_cost enum('g', 'pg', 'pg-13', 'r', 'nc-17') rating set('trailers', 'commentaries', 'deleted scenes', 'behind the scenes') special_features timestamp last_update smallint unsigned film_id } class film_actor { timestamp last_update smallint unsigned actor_id smallint unsigned film_id } class film_category { timestamp last_update smallint unsigned film_id tinyint unsigned category_id } class film_text { varchar(255) title text description smallint film_id } class inventory { smallint unsigned film_id tinyint unsigned store_id timestamp last_update mediumint unsigned inventory_id } class language { char(20) name timestamp last_update tinyint unsigned language_id } class payment { smallint unsigned customer_id tinyint unsigned staff_id int rental_id decimal(5,2) amount datetime payment_date timestamp last_update smallint unsigned payment_id } class pet { varchar(150) pet varchar(150) name varchar(150) owner } class rental { datetime rental_date mediumint unsigned inventory_id smallint unsigned customer_id datetime return_date tinyint unsigned staff_id timestamp last_update int rental_id } class sales_by_film_category { varchar(25) category decimal(27,2) total_sales } class sales_by_store { varchar(101) store varchar(91) manager decimal(27,2) total_sales } class staff { varchar(45) first_name varchar(45) last_name smallint unsigned address_id blob picture varchar(50) email tinyint unsigned store_id tinyint(1) active varchar(16) username varchar(40) password timestamp last_update tinyint unsigned staff_id } class staff_list { tinyint unsigned ID varchar(91) name varchar(50) address varchar(10) zip code varchar(20) phone varchar(50) city varchar(50) country tinyint unsigned SID } class store { tinyint unsigned manager_staff_id smallint unsigned address_id timestamp last_update tinyint unsigned store_id } address --> city : city_id city --> country : country_id customer --> address : address_id customer --> store : store_id film --> language : original_language_id:language_id film --> language : language_id film_actor --> actor : actor_id film_actor --> film : film_id film_category --> category : category_id film_category --> film : film_id inventory --> film : film_id inventory --> store : store_id payment --> customer : customer_id payment --> rental : rental_id payment --> staff : staff_id rental --> customer : customer_id rental --> inventory : inventory_id rental --> staff : staff_id staff --> address : address_id staff --> store : store_id store --> address : address_id store --> staff : manager_staff_id:staff_id ```

* PlantUML ``` @startuml !theme plain top to bottom direction skinparam linetype ortho class actor { first_name: varchar(45) last_name: varchar(45) last_update: timestamp actor_id: smallint unsigned } class node16 as "actor_1 /* backup table */" { actor_id: smallint unsigned first_name: varchar(45) last_name: varchar(45) last_update: timestamp column_nameimg: blob } class actor_info { actor_id: smallint unsigned first_name: varchar(45) last_name: varchar(45) film_info: text } class address { address: varchar(50) address2: varchar(50) district: varchar(20) city_id: smallint unsigned postal_code: varchar(10) phone: varchar(20) last_update: timestamp address_id: smallint unsigned } class category { name: varchar(25) last_update: timestamp category_id: tinyint unsigned } class city { city: varchar(50) country_id: smallint unsigned last_update: timestamp city_id: smallint unsigned } class country { country: varchar(50) last_update: timestamp country_id: smallint unsigned } class customer { store_id: tinyint unsigned first_name: varchar(45) last_name: varchar(45) email: varchar(50) address_id: smallint unsigned active: tinyint(1) create_date: datetime last_update: timestamp customer_id: smallint unsigned } class customer_list { ID: smallint unsigned name: varchar(91) address: varchar(50) zip code: varchar(10) phone: varchar(20) city: varchar(50) country: varchar(50) notes: varchar(6) SID: tinyint unsigned } class film { title: varchar(255) description: text release_year: year language_id: tinyint unsigned original_language_id: tinyint unsigned rental_duration: tinyint unsigned rental_rate: decimal(4,2) length: smallint unsigned replacement_cost: decimal(5,2) rating: enum('g', 'pg', 'pg-13', 'r', 'nc-17') special_features: set('trailers', 'commentaries', 'deleted scenes', 'behind the scenes') last_update: timestamp film_id: smallint unsigned } class film_actor { last_update: timestamp actor_id: smallint unsigned film_id: smallint unsigned } class film_category { last_update: timestamp film_id: smallint unsigned category_id: tinyint unsigned } class film_text { title: varchar(255) description: text film_id: smallint } class inventory { film_id: smallint unsigned store_id: tinyint unsigned last_update: timestamp inventory_id: mediumint unsigned } class language { name: char(20) last_update: timestamp language_id: tinyint unsigned } class payment { customer_id: smallint unsigned staff_id: tinyint unsigned rental_id: int amount: decimal(5,2) payment_date: datetime last_update: timestamp payment_id: smallint unsigned } class pet { pet: varchar(150) name: varchar(150) owner: varchar(150) } class rental { rental_date: datetime inventory_id: mediumint unsigned customer_id: smallint unsigned return_date: datetime staff_id: tinyint unsigned last_update: timestamp rental_id: int } class sales_by_film_category { category: varchar(25) total_sales: decimal(27,2) } class sales_by_store { store: varchar(101) manager: varchar(91) total_sales: decimal(27,2) } class staff { first_name: varchar(45) last_name: varchar(45) address_id: smallint unsigned picture: blob email: varchar(50) store_id: tinyint unsigned active: tinyint(1) username: varchar(16) password: varchar(40) last_update: timestamp staff_id: tinyint unsigned } class staff_list { ID: tinyint unsigned name: varchar(91) address: varchar(50) zip code: varchar(10) phone: varchar(20) city: varchar(50) country: varchar(50) SID: tinyint unsigned } class store { manager_staff_id: tinyint unsigned address_id: smallint unsigned last_update: timestamp store_id: tinyint unsigned } address -[#595959,plain]-^ city : "city_id" city -[#595959,plain]-^ country : "country_id" customer -[#595959,plain]-^ address : "address_id" customer -[#595959,plain]-^ store : "store_id" film -[#595959,plain]-^ language : "language_id" film -[#595959,plain]-^ language : "original_language_id:language_id" film_actor -[#595959,plain]-^ actor : "actor_id" film_actor -[#595959,plain]-^ film : "film_id" film_category -[#595959,plain]-^ category : "category_id" film_category -[#595959,plain]-^ film : "film_id" inventory -[#595959,plain]-^ film : "film_id" inventory -[#595959,plain]-^ store : "store_id" payment -[#595959,plain]-^ customer : "customer_id" payment -[#595959,plain]-^ rental : "rental_id" payment -[#595959,plain]-^ staff : "staff_id" rental -[#595959,plain]-^ customer : "customer_id" rental -[#595959,plain]-^ inventory : "inventory_id" rental -[#595959,plain]-^ staff : "staff_id" staff -[#595959,plain]-^ address : "address_id" staff -[#595959,plain]-^ store : "store_id" store -[#595959,plain]-^ address : "address_id" store -[#595959,plain]-^ staff : "manager_staff_id:staff_id" @enduml ```

* Graphviz DOT ``` digraph "sakila" { splines = ortho; fontname = "Inconsolata"; node [colorscheme = ylgnbu4]; edge [colorscheme = dark28, dir = both]; actor [shape = record, label = "{ actor | first_name : varchar(45)\l last_name : varchar(45)\l last_update : timestamp\l| actor_id : smallint unsigned\l }"]; "actor_1 /* backup table */" [shape = record, label = "{ actor_1 /* backup table */ | actor_id : smallint unsigned\l first_name : varchar(45)\l last_name : varchar(45)\l last_update : timestamp\l column_nameimg : blob\l }"]; actor_info [shape = record, label = "{ actor_info | actor_id : smallint unsigned\l first_name : varchar(45)\l last_name : varchar(45)\l film_info : text\l }"]; address [shape = record, label = "{ address | address : varchar(50)\l address2 : varchar(50)\l district : varchar(20)\l city_id : smallint unsigned\l postal_code : varchar(10)\l phone : varchar(20)\l last_update : timestamp\l| address_id : smallint unsigned\l }"]; category [shape = record, label = "{ category | name : varchar(25)\l last_update : timestamp\l| category_id : tinyint unsigned\l }"]; city [shape = record, label = "{ city | city : varchar(50)\l country_id : smallint unsigned\l last_update : timestamp\l| city_id : smallint unsigned\l }"]; country [shape = record, label = "{ country | country : varchar(50)\l last_update : timestamp\l| country_id : smallint unsigned\l }"]; customer [shape = record, label = "{ customer | store_id : tinyint unsigned\l first_name : varchar(45)\l last_name : varchar(45)\l email : varchar(50)\l address_id : smallint unsigned\l active : tinyint(1)\l create_date : datetime\l last_update : timestamp\l| customer_id : smallint unsigned\l }"]; customer_list [shape = record, label = "{ customer_list | ID : smallint unsigned\l name : varchar(91)\l address : varchar(50)\l zip code : varchar(10)\l phone : varchar(20)\l city : varchar(50)\l country : varchar(50)\l notes : varchar(6)\l SID : tinyint unsigned\l }"]; film [shape = record, label = "{ film | title : varchar(255)\l description : text\l release_year : year\l language_id : tinyint unsigned\l original_language_id : tinyint unsigned\l rental_duration : tinyint unsigned\l rental_rate : decimal(4,2)\l length : smallint unsigned\l replacement_cost : decimal(5,2)\l rating : enum('g', 'pg', 'pg-13', 'r', 'nc-17')\l special_features : set('trailers', 'commentaries', 'deleted scenes', 'behind the scenes')\l last_update : timestamp\l| film_id : smallint unsigned\l }"]; film_actor [shape = record, label = "{ film_actor | last_update : timestamp\l| actor_id : smallint unsigned\l film_id : smallint unsigned\l }"]; film_category [shape = record, label = "{ film_category | last_update : timestamp\l| film_id : smallint unsigned\l category_id : tinyint unsigned\l }"]; film_text [shape = record, label = "{ film_text | title : varchar(255)\l description : text\l| film_id : smallint\l }"]; inventory [shape = record, label = "{ inventory | film_id : smallint unsigned\l store_id : tinyint unsigned\l last_update : timestamp\l| inventory_id : mediumint unsigned\l }"]; language [shape = record, label = "{ language | name : char(20)\l last_update : timestamp\l| language_id : tinyint unsigned\l }"]; payment [shape = record, label = "{ payment | customer_id : smallint unsigned\l staff_id : tinyint unsigned\l rental_id : int\l amount : decimal(5,2)\l payment_date : datetime\l last_update : timestamp\l| payment_id : smallint unsigned\l }"]; pet [shape = record, label = "{ pet | pet : varchar(150)\l name : varchar(150)\l owner : varchar(150)\l }"]; rental [shape = record, label = "{ rental | rental_date : datetime\l inventory_id : mediumint unsigned\l customer_id : smallint unsigned\l return_date : datetime\l staff_id : tinyint unsigned\l last_update : timestamp\l| rental_id : int\l }"]; sales_by_film_category [shape = record, label = "{ sales_by_film_category | category : varchar(25)\l total_sales : decimal(27,2)\l }"]; sales_by_store [shape = record, label = "{ sales_by_store | store : varchar(101)\l manager : varchar(91)\l total_sales : decimal(27,2)\l }"]; staff [shape = record, label = "{ staff | first_name : varchar(45)\l last_name : varchar(45)\l address_id : smallint unsigned\l picture : blob\l email : varchar(50)\l store_id : tinyint unsigned\l active : tinyint(1)\l username : varchar(16)\l password : varchar(40)\l last_update : timestamp\l| staff_id : tinyint unsigned\l }"]; staff_list [shape = record, label = "{ staff_list | ID : tinyint unsigned\l name : varchar(91)\l address : varchar(50)\l zip code : varchar(10)\l phone : varchar(20)\l city : varchar(50)\l country : varchar(50)\l SID : tinyint unsigned\l }"]; store [shape = record, label = "{ store | manager_staff_id : tinyint unsigned\l address_id : smallint unsigned\l last_update : timestamp\l| store_id : tinyint unsigned\l }"]; address -> city [color = "#595959", style = solid , arrowtail = none , arrowhead = normal , taillabel = "", label = "city_id", headlabel = ""]; city -> country [color = "#595959", style = solid , arrowtail = none , arrowhead = normal , taillabel = "", label = "country_id", headlabel = ""]; customer -> address [color = "#595959", style = solid , arrowtail = none , arrowhead = normal , taillabel = "", label = "address_id", headlabel = ""]; customer -> store [color = "#595959", style = solid , arrowtail = none , arrowhead = normal , taillabel = "", label = "store_id", headlabel = ""]; film -> language [color = "#595959", style = solid , arrowtail = none , arrowhead = normal , taillabel = "", label = "language_id", headlabel = ""]; film -> language [color = "#595959", style = solid , arrowtail = none , arrowhead = normal , taillabel = "", label = "original_language_id:language_id", headlabel = ""]; film_actor -> actor [color = "#595959", style = solid , arrowtail = none , arrowhead = normal , taillabel = "", label = "actor_id", headlabel = ""]; film_actor -> film [color = "#595959", style = solid , arrowtail = none , arrowhead = normal , taillabel = "", label = "film_id", headlabel = ""]; film_category -> category [color = "#595959", style = solid , arrowtail = none , arrowhead = normal , taillabel = "", label = "category_id", headlabel = ""]; film_category -> film [color = "#595959", style = solid , arrowtail = none , arrowhead = normal , taillabel = "", label = "film_id", headlabel = ""]; inventory -> film [color = "#595959", style = solid , arrowtail = none , arrowhead = normal , taillabel = "", label = "film_id", headlabel = ""]; inventory -> store [color = "#595959", style = solid , arrowtail = none , arrowhead = normal , taillabel = "", label = "store_id", headlabel = ""]; payment -> customer [color = "#595959", style = solid , arrowtail = none , arrowhead = normal , taillabel = "", label = "customer_id", headlabel = ""]; payment -> rental [color = "#595959", style = solid , arrowtail = none , arrowhead = normal , taillabel = "", label = "rental_id", headlabel = ""]; payment -> staff [color = "#595959", style = solid , arrowtail = none , arrowhead = normal , taillabel = "", label = "staff_id", headlabel = ""]; rental -> customer [color = "#595959", style = solid , arrowtail = none , arrowhead = normal , taillabel = "", label = "customer_id", headlabel = ""]; rental -> inventory [color = "#595959", style = solid , arrowtail = none , arrowhead = normal , taillabel = "", label = "inventory_id", headlabel = ""]; rental -> staff [color = "#595959", style = solid , arrowtail = none , arrowhead = normal , taillabel = "", label = "staff_id", headlabel = ""]; staff -> address [color = "#595959", style = solid , arrowtail = none , arrowhead = normal , taillabel = "", label = "address_id", headlabel = ""]; staff -> store [color = "#595959", style = solid , arrowtail = none , arrowhead = normal , taillabel = "", label = "store_id", headlabel = ""]; store -> address [color = "#595959", style = solid , arrowtail = none , arrowhead = normal , taillabel = "", label = "address_id", headlabel = ""]; store -> staff [color = "#595959", style = solid , arrowtail = none , arrowhead = normal , taillabel = "", label = "manager_staff_id:staff_id", headlabel = ""]; } ```

* Graphviz DOT とポジション ``` digraph "sakila" { splines = ortho; fontname = "Inconsolata"; node [colorscheme = ylgnbu4]; edge [colorscheme = dark28, dir = both]; actor [shape = record, pos = "4.333,20.917!" , label = "{ actor | first_name : varchar(45)\l last_name : varchar(45)\l last_update : timestamp\l| actor_id : smallint unsigned\l }"]; "actor_1 /* backup table */" [shape = record, pos = "-4.111,4.681!" , label = "{ actor_1 /* backup table */ | actor_id : smallint unsigned\l first_name : varchar(45)\l last_name : varchar(45)\l last_update : timestamp\l column_nameimg : blob\l }"]; actor_info [shape = record, pos = "-0.611,4.681!" , label = "{ actor_info | actor_id : smallint unsigned\l first_name : varchar(45)\l last_name : varchar(45)\l film_info : text\l }"]; address [shape = record, pos = "-2.564,26.375!" , label = "{ address | address : varchar(50)\l address2 : varchar(50)\l district : varchar(20)\l city_id : smallint unsigned\l postal_code : varchar(10)\l phone : varchar(20)\l last_update : timestamp\l| address_id : smallint unsigned\l }"]; category [shape = record, pos = "15.972,20.750!" , label = "{ category | name : varchar(25)\l last_update : timestamp\l| category_id : tinyint unsigned\l }"]; city [shape = record, pos = "-2.550,28.972!" , label = "{ city | city : varchar(50)\l country_id : smallint unsigned\l last_update : timestamp\l| city_id : smallint unsigned\l }"]; country [shape = record, pos = "-2.550,31.236!" , label = "{ country | country : varchar(50)\l last_update : timestamp\l| country_id : smallint unsigned\l }"]; customer [shape = record, pos = "-0.681,16.458!" , label = "{ customer | store_id : tinyint unsigned\l first_name : varchar(45)\l last_name : varchar(45)\l email : varchar(50)\l address_id : smallint unsigned\l active : tinyint(1)\l create_date : datetime\l last_update : timestamp\l| customer_id : smallint unsigned\l }"]; customer_list [shape = record, pos = "19.694,31.236!" , label = "{ customer_list | ID : smallint unsigned\l name : varchar(91)\l address : varchar(50)\l zip code : varchar(10)\l phone : varchar(20)\l city : varchar(50)\l country : varchar(50)\l notes : varchar(6)\l SID : tinyint unsigned\l }"]; film [shape = record, pos = "7.486,22.417!" , label = "{ film | title : varchar(255)\l description : text\l release_year : year\l language_id : tinyint unsigned\l original_language_id : tinyint unsigned\l rental_duration : tinyint unsigned\l rental_rate : decimal(4,2)\l length : smallint unsigned\l replacement_cost : decimal(5,2)\l rating : enum('g', 'pg', 'pg-13', 'r', 'nc-17')\l special_features : set('trailers', 'commentaries', 'deleted scenes', 'behind the scenes')\l last_update : timestamp\l| film_id : smallint unsigned\l }"]; film_actor [shape = record, pos = "9.174,15.458!" , label = "{ film_actor | last_update : timestamp\l| actor_id : smallint unsigned\l film_id : smallint unsigned\l }"]; film_category [shape = record, pos = "14.592,15.458!" , label = "{ film_category | last_update : timestamp\l| film_id : smallint unsigned\l category_id : tinyint unsigned\l }"]; film_text [shape = record, pos = "2.889,4.681!" , label = "{ film_text | title : varchar(255)\l description : text\l| film_id : smallint\l }"]; inventory [shape = record, pos = "2.889,15.625!" , label = "{ inventory | film_id : smallint unsigned\l store_id : tinyint unsigned\l last_update : timestamp\l| inventory_id : mediumint unsigned\l }"]; language [shape = record, pos = "10.731,25.542!" , label = "{ language | name : char(20)\l last_update : timestamp\l| language_id : tinyint unsigned\l }"]; payment [shape = record, pos = "-1.459,8.208!" , label = "{ payment | customer_id : smallint unsigned\l staff_id : tinyint unsigned\l rental_id : int\l amount : decimal(5,2)\l payment_date : datetime\l last_update : timestamp\l| payment_id : smallint unsigned\l }"]; pet [shape = record, pos = "9.028,4.681!" , label = "{ pet | pet : varchar(150)\l name : varchar(150)\l owner : varchar(150)\l }"]; rental [shape = record, pos = "1.321,11.833!" , label = "{ rental | rental_date : datetime\l inventory_id : mediumint unsigned\l customer_id : smallint unsigned\l return_date : datetime\l staff_id : tinyint unsigned\l last_update : timestamp\l| rental_id : int\l }"]; sales_by_film_category [shape = record, pos = "11.917,4.681!" , label = "{ sales_by_film_category | category : varchar(25)\l total_sales : decimal(27,2)\l }"]; sales_by_store [shape = record, pos = "5.583,4.681!" , label = "{ sales_by_store | store : varchar(101)\l manager : varchar(91)\l total_sales : decimal(27,2)\l }"]; staff [shape = record, pos = "-4.111,16.792!" , label = "{ staff | first_name : varchar(45)\l last_name : varchar(45)\l address_id : smallint unsigned\l picture : blob\l email : varchar(50)\l store_id : tinyint unsigned\l active : tinyint(1)\l username : varchar(16)\l password : varchar(40)\l last_update : timestamp\l| staff_id : tinyint unsigned\l }"]; staff_list [shape = record, pos = "22.666,31.236!" , label = "{ staff_list | ID : tinyint unsigned\l name : varchar(91)\l address : varchar(50)\l zip code : varchar(10)\l phone : varchar(20)\l city : varchar(50)\l country : varchar(50)\l SID : tinyint unsigned\l }"]; store [shape = record, pos = "-2.638,20.917!" , label = "{ store | manager_staff_id : tinyint unsigned\l address_id : smallint unsigned\l last_update : timestamp\l| store_id : tinyint unsigned\l }"]; address -> city [color = "#595959", style = solid , arrowtail = none , arrowhead = normal , taillabel = "", label = "city_id", headlabel = ""]; city -> country [color = "#595959", style = solid , arrowtail = none , arrowhead = normal , taillabel = "", label = "country_id", headlabel = ""]; customer -> address [color = "#595959", style = solid , arrowtail = none , arrowhead = normal , taillabel = "", label = "address_id", headlabel = ""]; customer -> store [color = "#595959", style = solid , arrowtail = none , arrowhead = normal , taillabel = "", label = "store_id", headlabel = ""]; film -> language [color = "#595959", style = solid , arrowtail = none , arrowhead = normal , taillabel = "", label = "language_id", headlabel = ""]; film -> language [color = "#595959", style = solid , arrowtail = none , arrowhead = normal , taillabel = "", label = "original_language_id:language_id", headlabel = ""]; film_actor -> actor [color = "#595959", style = solid , arrowtail = none , arrowhead = normal , taillabel = "", label = "actor_id", headlabel = ""]; film_actor -> film [color = "#595959", style = solid , arrowtail = none , arrowhead = normal , taillabel = "", label = "film_id", headlabel = ""]; film_category -> category [color = "#595959", style = solid , arrowtail = none , arrowhead = normal , taillabel = "", label = "category_id", headlabel = ""]; film_category -> film [color = "#595959", style = solid , arrowtail = none , arrowhead = normal , taillabel = "", label = "film_id", headlabel = ""]; inventory -> film [color = "#595959", style = solid , arrowtail = none , arrowhead = normal , taillabel = "", label = "film_id", headlabel = ""]; inventory -> store [color = "#595959", style = solid , arrowtail = none , arrowhead = normal , taillabel = "", label = "store_id", headlabel = ""]; payment -> customer [color = "#595959", style = solid , arrowtail = none , arrowhead = normal , taillabel = "", label = "customer_id", headlabel = ""]; payment -> rental [color = "#595959", style = solid , arrowtail = none , arrowhead = normal , taillabel = "", label = "rental_id", headlabel = ""]; payment -> staff [color = "#595959", style = solid , arrowtail = none , arrowhead = normal , taillabel = "", label = "staff_id", headlabel = ""]; rental -> customer [color = "#595959", style = solid , arrowtail = none , arrowhead = normal , taillabel = "", label = "customer_id", headlabel = ""]; rental -> inventory [color = "#595959", style = solid , arrowtail = none , arrowhead = normal , taillabel = "", label = "inventory_id", headlabel = ""]; rental -> staff [color = "#595959", style = solid , arrowtail = none , arrowhead = normal , taillabel = "", label = "staff_id", headlabel = ""]; staff -> address [color = "#595959", style = solid , arrowtail = none , arrowhead = normal , taillabel = "", label = "address_id", headlabel = ""]; staff -> store [color = "#595959", style = solid , arrowtail = none , arrowhead = normal , taillabel = "", label = "store_id", headlabel = ""]; store -> address [color = "#595959", style = solid , arrowtail = none , arrowhead = normal , taillabel = "", label = "address_id", headlabel = ""]; store -> staff [color = "#595959", style = solid , arrowtail = none , arrowhead = normal , taillabel = "", label = "manager_staff_id:staff_id", headlabel = ""]; } ```

![コンテキストメニューからダイアグラムをクリップボードにコピー](https://resources.jetbrains.com/help/img/idea/2026.3/db_database_diagrams_copy_to_clipboard.png)

Procedure: ダイアグラムをファイルにエクスポートする

* ダイアグラムをファイルにエクスポートするには、ダイアグラムを右クリックし、  `ダイアグラムのエクスポート | ファイルへエクスポート`  に移動して、形式を選択します。

または、ダイアグラムツールバーの   ダイアグラムのエクスポート   ボタン ( ![ダイアグラムのエクスポートアイコン](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.general.export.svg)) をクリックし、対応するサブメニューで形式を選択します。

サポートされているフォーマットは次のとおりです：

* YEd `.graphml`

* JGraph `.drawio`

* Graphviz `.dot`

* Graphviz `.dot` とポジション

* Mermaid `.md`

* PlantUML

* IDEA `.uml` : UML 形式は、CLion のみがサポートする内部フォーマットです。 保存したダイアグラムを開くには、UML ファイルをエディターにドラッグします。 UML ファイルのスコープは元のプロジェクトに限定されていることに注意してください。 UML ファイルは、作成されたプロジェクト内でのみ開いて使用できます。

![コンテキストメニューからダイアグラムをファイルにエクスポート](https://resources.jetbrains.com/help/img/idea/2026.3/db_database_diagrams_export_to_files.png)

Procedure: ダイアグラムを PNG 形式のイメージとしてエクスポート

* ダイアグラムを PNG 形式のイメージとしてエクスポートするには、ダイアグラムを右クリックして  `ダイアグラムのエクスポート | 画像にエクスポート…`  を選択します。

または、ダイアグラムツールバーの   ダイアグラムのエクスポート   ボタン ( ![ダイアグラムのエクスポートアイコン](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.general.export.svg)) をクリックし、   画像へエクスポート…   を選択します。

## リファレンス

### アイコン

ダイアグラム内の列の可能なアイコンの組み合わせは次のとおりです：

|  アイコン  |  外部キー  |  主キー  |  インデックス付き  |  非 null  |
| --- | --- | --- | --- | --- |
|  ![カラム](https://resources.jetbrains.com/help/img/idea/2026.3/database-plugin.icons.expui.column.svg)  |  |  |  |  |
|  ![外部キーを持つ列](https://resources.jetbrains.com/help/img/idea/2026.3/database-plugin.icons.expui.columnBlueKey.svg)  |  ![外部キーがある](https://resources.jetbrains.com/help/img/idea/2026.3/app.actions.checked.svg)  |  |  |  |
|  ![主キーを持つ列](https://resources.jetbrains.com/help/img/idea/2026.3/database-plugin.icons.expui.columnGoldKey.svg)  |  |  ![主キーがある](https://resources.jetbrains.com/help/img/idea/2026.3/app.actions.checked.svg)  |  |  |
|  ![インデックス付き列](https://resources.jetbrains.com/help/img/idea/2026.3/database-plugin.icons.expui.columnIndex.svg)  |  |  |  ![インデックス付き](https://resources.jetbrains.com/help/img/idea/2026.3/app.actions.checked.svg)  |  |
|  ![NULL 値を受け入れない列](https://resources.jetbrains.com/help/img/idea/2026.3/database-plugin.icons.expui.columnDot.svg)  |  |  |  |  ![NOT NULL 制約がある](https://resources.jetbrains.com/help/img/idea/2026.3/app.actions.checked.svg)  |
|  ![NULL 値を受け入れないインデックス付き列](https://resources.jetbrains.com/help/img/idea/2026.3/database-plugin.icons.expui.columnDotIndex.svg)  |  |  |  ![インデックス付き](https://resources.jetbrains.com/help/img/idea/2026.3/app.actions.checked.svg)  |  ![NOT NULL 制約がある](https://resources.jetbrains.com/help/img/idea/2026.3/app.actions.checked.svg)  |
|  ![NULL 値を受け入れない主キーと外部キーを持つインデックス付き列](https://resources.jetbrains.com/help/img/idea/2026.3/database-plugin.icons.expui.columnGoldBlueKeyDotIndex.svg)  |  ![外部キーがある](https://resources.jetbrains.com/help/img/idea/2026.3/app.actions.checked.svg)  |  ![主キーがある](https://resources.jetbrains.com/help/img/idea/2026.3/app.actions.checked.svg)  |  ![インデックス付き](https://resources.jetbrains.com/help/img/idea/2026.3/app.actions.checked.svg)  |  ![NOT NULL 制約がある](https://resources.jetbrains.com/help/img/idea/2026.3/app.actions.checked.svg)  |
|  ![主キーと外部キーを持つインデックス付き列](https://resources.jetbrains.com/help/img/idea/2026.3/database-plugin.icons.expui.columnGoldBlueKeyIndex.svg)  |  ![外部キーがある](https://resources.jetbrains.com/help/img/idea/2026.3/app.actions.checked.svg)  |  ![主キーがある](https://resources.jetbrains.com/help/img/idea/2026.3/app.actions.checked.svg)  |  ![インデックス付き](https://resources.jetbrains.com/help/img/idea/2026.3/app.actions.checked.svg)  |  |
|  ![NULL 値を受け入れない主キーと外部キーを持つ列](https://resources.jetbrains.com/help/img/idea/2026.3/database-plugin.icons.expui.columnGoldBlueKeyDot.svg)  |  ![外部キーがある](https://resources.jetbrains.com/help/img/idea/2026.3/app.actions.checked.svg)  |  ![主キーがある](https://resources.jetbrains.com/help/img/idea/2026.3/app.actions.checked.svg)  |  |  ![NOT NULL 制約がある](https://resources.jetbrains.com/help/img/idea/2026.3/app.actions.checked.svg)  |
|  ![主キーと外部キーを持つ列](https://resources.jetbrains.com/help/img/idea/2026.3/database-plugin.icons.expui.columnGoldBlueKey.svg)  |  ![外部キーがある](https://resources.jetbrains.com/help/img/idea/2026.3/app.actions.checked.svg)  |  ![主キーがある](https://resources.jetbrains.com/help/img/idea/2026.3/app.actions.checked.svg)  |  |  |
|  ![NULL 値を受け入れない外部キーを持つインデックス付き列](https://resources.jetbrains.com/help/img/idea/2026.3/database-plugin.icons.expui.columnBlueKeyDotIndex.svg)  |  ![外部キーがある](https://resources.jetbrains.com/help/img/idea/2026.3/app.actions.checked.svg)  |  |  ![インデックス付き](https://resources.jetbrains.com/help/img/idea/2026.3/app.actions.checked.svg)  |  ![NOT NULL 制約がある](https://resources.jetbrains.com/help/img/idea/2026.3/app.actions.checked.svg)  |
|  ![NULL 値を受け入れない外部キーを持つ列](https://resources.jetbrains.com/help/img/idea/2026.3/database-plugin.icons.expui.columnBlueKeyDot.svg)  |  ![外部キーがある](https://resources.jetbrains.com/help/img/idea/2026.3/app.actions.checked.svg)  |  |  |  ![NOT NULL 制約がある](https://resources.jetbrains.com/help/img/idea/2026.3/app.actions.checked.svg)  |
|  ![NULL 値を受け入れる外部キーを持つインデックス付き列](https://resources.jetbrains.com/help/img/idea/2026.3/database-plugin.icons.expui.columnBlueKeyIndex.svg)  |  ![外部キーがある](https://resources.jetbrains.com/help/img/idea/2026.3/app.actions.checked.svg)  |  |  ![インデックス付き](https://resources.jetbrains.com/help/img/idea/2026.3/app.actions.checked.svg)  |  |
|  ![NULL 値を受け入れない主キーを持つインデックス付き列](https://resources.jetbrains.com/help/img/idea/2026.3/database-plugin.icons.expui.columnGoldKeyDotIndex.svg)  |  |  ![主キーがある](https://resources.jetbrains.com/help/img/idea/2026.3/app.actions.checked.svg)  |  ![インデックス付き](https://resources.jetbrains.com/help/img/idea/2026.3/app.actions.checked.svg)  |  ![NOT NULL 制約がある](https://resources.jetbrains.com/help/img/idea/2026.3/app.actions.checked.svg)  |
|  ![NULL 値を受け入れない主キーを持つ列](https://resources.jetbrains.com/help/img/idea/2026.3/database-plugin.icons.expui.columnGoldKeyDot.svg)  |  |  ![主キーがある](https://resources.jetbrains.com/help/img/idea/2026.3/app.actions.checked.svg)  |  |  ![NOT NULL 制約がある](https://resources.jetbrains.com/help/img/idea/2026.3/app.actions.checked.svg)  |
|  ![主キーを持つインデックス付き列](https://resources.jetbrains.com/help/img/idea/2026.3/database-plugin.icons.expui.columnGoldKeyIndex.svg)  |  |  ![主キーがある](https://resources.jetbrains.com/help/img/idea/2026.3/app.actions.checked.svg)  |  ![インデックス付き](https://resources.jetbrains.com/help/img/idea/2026.3/app.actions.checked.svg)  |  |

### ダイアグラムの構成設定

ダイアグラムのデフォルト表示設定とレイアウトを構成するには、 `Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `⌘ Comma` (Xcode), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (ReSharper), `⌘ Comma` (ReSharper (macOS)), `Ctrl+Alt+S` (QtCreator), `⌘ Comma` (QtCreator (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS)) を押して設定を開き、  `ツール | ダイアグラム`  に移動します。 .

![ダイアグラムメニュー](https://resources.jetbrains.com/help/img/idea/2026.3/database_diagrams_settings.png)

#### コンテンツペイン

ダイアグラムに表示する要素の横にあるチェックボックスを選択します。

|  項目  |  説明  |
| --- | --- |
|    差分を表示    |
|  詳細  |  このチェックボックスが選択されている場合、指定されたすべての要素の詳細がリビジョンの UML クラスダイアグラムに表示されます。 このチェックボックスが選択されていない場合、ノード要素のみがダイアグラムに含まれます。  |
|    DB ダイアグラム    |
|  キー列  |     ダイアグラムが開いたときに表示する主キー列については、このチェックボックスを選択します。       エディターでダイアグラムを表示するときは、ツールバーの ![「キー列」ボタン](https://resources.jetbrains.com/help/img/idea/2026.3/database-plugin.icons.colGoldKey.svg) を使用して対応する列を表示または非表示にします。     |
|  列  |     ダイアグラムが開いたときに主キー列以外の列を表示するには、このチェックボックスを選択します。       エディターでダイアグラムを表示するときは、ツールバーの ![「列」ボタン](https://resources.jetbrains.com/help/img/idea/2026.3/database-plugin.icons.col.svg) を使用して対応する列を表示または非表示にします。     |

> **Note:**
> このペインには、インストール済みおよび有効化されているプラグインによって、さらに多くのノードが表示されます。

#### コントロール

|  項目  |  説明  |
| --- | --- |
|  デフォルトレイアウト  |    デフォルトレイアウト   リストから希望のレイアウトを選択します。 新しく作成したダイアグラムのノード要素は、選択したレイアウトに従って配置されます。  |
|  デフォルトスコープ  |    デフォルトスコープ   リストからスコープを選択します。 スコープを指定すると、不要な階層をダイアグラムに表示するのを避けることができます。   設定   ( `Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `⌘ Comma` (Xcode), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (ReSharper), `⌘ Comma` (ReSharper (macOS)), `Ctrl+Alt+S` (QtCreator), `⌘ Comma` (QtCreator (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS))) ダイアログの [スコープページ](settings-scopes.html)で、プロジェクトのスコープを定義できます。  |
|  レイアウト後の内容に合わせる  |  このチェックボックスを選択すると、ダイアグラムのコンテキストメニューで選択したレイアウトを適用した後、すべてのダイアグラム要素が現在のダイアグラム領域に収まるようにサイズが変更されます。 ダイアグラムでは、 ![フィットコンテンツアイコン](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.image.fitContent.svg) ツールバーボタンを使用します。  |
|  新しい要素が追加されたときに再レイアウトする  |  このチェックボックスをオンにすると、新しい要素を追加した後で自動的にダイアグラムのレイアウトが実行されます。  |

### ツールバーとコンテキストメニュー

ダイアグラムエディターのツールバーを使用してアクションにすばやくアクセスし、コンテキストメニューで表示中のダイアグラムを管理できます。

#### ツールバー

|  項目  |  説明  |
| --- | --- |
|  ![「キー列」ボタン](https://resources.jetbrains.com/help/img/idea/2026.3/database-plugin.icons.expui.columnGoldKey.svg)  |  (データベースを操作する場合に使用できます。) このボタンをクリックすると、ダイアグラムに主キー列が表示されます。  |
|  ![「列」ボタン](https://resources.jetbrains.com/help/img/idea/2026.3/database-plugin.icons.expui.column.svg)  |     （データベースを操作する場合に使用可能）次の表示を切り替えます：        * データベースオブジェクトの視覚化の場合: ダイアグラムの主キー列以外の列を表示または非表示にします。    * クエリマップの場合: クエリ属性を表示または非表示にします。 これらの属性には、行数、インデックス名、クエリに関するその他の追加情報を指定できます。    |
|  ![「仮想外部キー」ボタン](https://resources.jetbrains.com/help/img/idea/2026.3/database-plugin.icons.expui.virtualForeignKey.svg)  |  (データベースを操作する場合に使用できます。) このボタンをクリックして、ダイアグラム内の仮想外部キーを表示または非表示にします。  |
|  ![コメントボタン](https://resources.jetbrains.com/help/img/idea/2026.3/app.general.balloon.svg)  |  (データベースを操作する場合に使用できます。) このボタンをクリックして、ダイアグラム内のコメントを表示または非表示にします。  |
|  ![拡大](https://resources.jetbrains.com/help/img/idea/2026.3/app.general.zoomIn.svg)  |  このアイコンをクリックすると、ダイアグラムの縮尺が拡大します。 または、 `NumPad+` (Windows), `NumPad+` (macOS), `NumPad+` (IntelliJ IDEA Classic (macOS)), `NumPad+` (macOS System Shortcuts), `NumPad+` (XWin), `NumPad+` (GNOME), `NumPad+` (KDE), `NumPad+` (Emacs), `NumPad+` (Sublime Text), `NumPad+` (Sublime Text (macOS)), `NumPad+` (Xcode), `NumPad+` (Visual Studio), `NumPad+` (Visual Studio (macOS)), `NumPad+` (ReSharper), `NumPad+` (ReSharper (macOS)), `NumPad+` (QtCreator), `NumPad+` (QtCreator (macOS)), `NumPad+` (NetBeans), `NumPad+` (Eclipse), `NumPad+` (Eclipse (macOS))を押します。  |
|  ![縮小](https://resources.jetbrains.com/help/img/idea/2026.3/app.general.zoomOut.svg)  |  このアイコンをクリックすると、ダイアグラムの縮尺が縮小します。 または、 `NumPad-` (Windows), `NumPad-` (macOS), `NumPad-` (IntelliJ IDEA Classic (macOS)), `NumPad-` (macOS System Shortcuts), `NumPad-` (XWin), `NumPad-` (GNOME), `NumPad-` (KDE), `NumPad-` (Emacs), `NumPad-` (Sublime Text), `NumPad-` (Sublime Text (macOS)), `NumPad-` (Xcode), `NumPad-` (Visual Studio), `NumPad-` (Visual Studio (macOS)), `NumPad-` (ReSharper), `NumPad-` (ReSharper (macOS)), `NumPad-` (QtCreator), `NumPad-` (QtCreator (macOS)), `NumPad-` (NetBeans), `NumPad-` (Eclipse), `NumPad-` (Eclipse (macOS))を押します。  |
|  ![実際のサイズ](https://resources.jetbrains.com/help/img/idea/2026.3/app.graph.actualZoom.svg)  |  このアイコンをクリックすると、ダイアグラムの実際のサイズに戻ります。  |
|  ![内容に合わせる](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.image.fitContent.svg)  |  このアイコンをクリックして、内容を現在のダイアグラムのサイズに合わせます。  |
|  ![現在のレイアウトを適用](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.graph.graphLayout.svg)  |  このアイコンをクリックして、ダイアグラムのコンテキストメニューの   レイアウト   ノードから選択した現在のレイアウトを適用します。  |
|  ![ルートエッジ](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.actions.moveToButton.svg)  |  このアイコンをクリックして、ダイアグラムをウィンドウの端に合わせて拡大縮小します。  |
|  ![ダイアグラムをクリップボードにコピー](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.general.copy.svg)  |  このアイコンをクリックして、ダイアグラムをクリップボードにコピーします。  |
|  ![選択範囲をクリップボードにコピー](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.actions.inSelection.svg)  |  このアイコンをクリックしてからマウスで任意のダイアグラム領域を選択すると、選択した領域がクリップボードにコピーされます。  |
|  ![ダイアグラムのエクスポート](https://resources.jetbrains.com/help/img/idea/2026.3/app.expui.general.export.svg)  |     このアイコンをクリックすると、サードパーティ製ツールと互換性のあるさまざまなフォーマットを使ってダイアグラムをファイルや画像にエクスポートしたり、ブラウザーでダイアグラムを開いたりできます。      ![ダイアグラムのエクスポート](https://resources.jetbrains.com/help/img/idea/2026.3/export_diagram.png)    次のオプションを選択して構成できます：        * ![Web エディターで開く](https://resources.jetbrains.com/help/img/idea/2026.3/app.runConfigurations.web_app.svg) : このボタンをクリックして、ダイアグラムをエクスポートできるサードパーティのエディターを選択します。    * ![ダイアグラムをクリップボードにコピー](https://resources.jetbrains.com/help/img/idea/2026.3/app.expui.general.copy.svg) : このボタンをクリックして、使用可能な形式の 1 つを使用してダイアグラムをクリップボードに保存します。    * ![ダイアグラムを保存](https://resources.jetbrains.com/help/img/idea/2026.3/app.expui.general.save.svg) : このボタンをクリックして、現在のダイアグラムをファイルとして保存します。 リストから使用可能な形式の 1 つを使用できます。    * ![画像を保存](https://resources.jetbrains.com/help/img/idea/2026.3/markdown.icons.imageGutter.svg) : このボタンをクリックして、現在のダイアグラムを PNG 形式で保存します。    * ![印刷](https://resources.jetbrains.com/help/img/idea/2026.3/app.expui.general.print.svg) : このボタンをクリックして、ダイアグラムを印刷します。    |
|  ![データモデルの更新](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.general.refresh.svg)  |  このボタンをクリックして、ダイアグラム全体をリフレッシュします。  |
|  ![ダイアグラムの設定を開く](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.general.settings.svg)  |  このボタンをクリックして [ダイアグラムの設定](null)を開き、追加のオプションを構成できます。  |

#### コンテキストメニュー

以下の表には、ツールバーから利用できないコマンドが含まれています。

|  項目  |  説明  |
| --- | --- |
|  選択した要素のアクション  |  このオプションを使用して、ダイアグラム内の選択した要素に適用されるアクションのリストを開きます。 アクションを選択して、要素のコピー、そのソースへの移動、その使用箇所の検索、   移動   アクションやさまざまな Git アクションの使用などを行うことができます。  |
|  コンテンツ  |  このオプションを使用して、新しい要素の追加、依存関係の表示、ダイアグラム内の要素の並べ替えなどに役立つアクションのリストを開きます。     * 新規 （ `Alt+Insert` (Windows), `⌘ N` (macOS), `⌃ N` (IntelliJ IDEA Classic (macOS)), `⌘ N` (macOS System Shortcuts), `Alt+Insert` (XWin), `Alt+Insert` (GNOME), `Alt+Insert` (KDE), `Alt+Insert` (Emacs), `Alt+Insert` (Sublime Text), `⌘ N` (Sublime Text (macOS)), `⌘ N` (Xcode), `Alt+Insert` (Visual Studio), `⌘ ⌃ N` (Visual Studio (macOS)), `Alt+Insert` (ReSharper), `⌘ ⌃ N` (ReSharper (macOS)), `Alt+Insert` (QtCreator), `Alt+Insert` (QtCreator (macOS)), `Alt+Insert` (NetBeans), `Alt+Insert` (Eclipse), `⌘ N` (Eclipse (macOS)) ）: 新しいノード要素またはメンバーを作成するには、このコマンドを選択します。    * カテゴリの表示 : このコマンドを選択して、選択したコード要素をクラスノードに表示します。 例: フィールド を選択して、クラス内のすべてのフィールド要素を表示できます。    |
|  削除  |  選択したダイアグラムを削除します。  |
|  グラフの分析  |  このノードを使用して、ダイアグラムを分析するコマンドの 1 つを選択します。 グラフの特性を確認したり、グラフの焦点を変更したり、グラフの中心性を測定したりすることができます。  |
|  レイアウト  |  サブメニューから目的のダイアグラムレイアウトを選択します。  |
|  振る舞い  |  このオプションを使用して、グリッドに対する要素の整列、選択したノードの構造ビューの表示、レイアウト後のコンテンツのフィッティングなど、ダイアグラムの動作に関連するコマンドを選択します。  |
|  ダイアグラムのエクスポート  |  このオプションを使用して、サードパーティのツールと互換性のあるさまざまな形式を使用して [ダイアグラムをファイル、イメージにエクスポートする](#export)か、ブラウザーでダイアグラムを開きます。  |

