前提・実現したいこと
現在、ウェブアプリ作成のため、Xampp3.22を利用して、DBを作成しています。
phpMyAdminで作成したDBを、A5:SQL Mk-2でリバース生成してER図を作成したいと思っています。
発生している問題・エラーメッセージ
phpMyAdminで設定したFKが、A5:SQL Mk-2で作成したER図上に反映されません。
リバース生成で出来上がったER図は、リレーションが結ばれておらず、FKも存在しませんが、
これは仕様でしょうか?
また、FKを設定するためにリレーションを結ぶと、必ず主キーがFKになってしまいます。
何ら可能操作が必要でしょうか?
試したこと
ここに問題に対して試したことを記載してください。
補足情報(FW/ツールのバージョンなど)
Xammpは、3.22
phpMyAdminのみ、最新バージョンにアップデートしております。
A5:SQL Mk-2も最新バージョンです。
###追記
データベースのバージョンは、mysql --versionを使って調べました。
〇〇です!と言える知識がありませんので、以下でお許しください。
D:\xampp\mysql\bin>mysql --version mysql Ver 15.1 Distrib 10.1.28-MariaDB, for Win32 (AMD64)
以下、phpMyAdminのエクスポート機能を使って出力したcreate文です。
SQL
1-- phpMyAdmin SQL Dump 2-- version 4.8.3 3-- https://www.phpmyadmin.net/ 4-- 5-- Host: localhost 6-- Generation Time: 7-- サーバのバージョン: 10.1.28-MariaDB 8-- PHP Version: 7.1.11 9 10SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; 11SET AUTOCOMMIT = 0; 12START TRANSACTION; 13SET time_zone = "+00:00"; 14 15-- 16-- Database: `feeling_memory` 17-- 18 19-- -------------------------------------------------------- 20 21-- 22-- テーブルの構造 `feel_conditions` 23-- 24 25CREATE TABLE `feel_conditions` ( 26 `id` int(11) NOT NULL, 27 `login_informations_id` int(11) NOT NULL, 28 `target_date` date NOT NULL, 29 `season_id` int(11) NOT NULL, 30 `weather_id` int(11) NOT NULL, 31 `temperature` int(11) NOT NULL, 32 `mood_value` int(11) NOT NULL, 33 `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, 34 `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP 35) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 36 37-- 38-- テーブルのデータのダンプ `feel_conditions` 39-- 40 41INSERT INTO `feel_conditions` (`id`, `login_informations_id`, `target_date`, `season_id`, `weather_id`, `temperature`, `mood_value`, `created_at`, `updated_at`) VALUES 42(1, 1, '2018-11-06', 0, 0, 22, 5, '2018-11-06 21:56:01', '2018-11-06 21:58:24'), 43(2, 2, '2018-11-16', 0, 0, 25, 2, '2018-11-06 22:05:26', '2018-11-06 22:05:30'); 44 45-- -------------------------------------------------------- 46 47-- 48-- テーブルの構造 `login_informations` 49-- 50 51CREATE TABLE `login_informations` ( 52 `id` int(11) NOT NULL, 53 `password` varchar(255) NOT NULL, 54 `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, 55 `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP 56) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 57 58-- 59-- テーブルのデータのダンプ `login_informations` 60-- 61 62INSERT INTO `login_informations` (`id`, `password`, `created_at`, `updated_at`) VALUES 63(1, 'password', '2018-11-14 21:15:13', '2018-11-14 21:15:57'), 64(2, 'password', '2018-11-14 21:15:13', '2018-11-14 21:15:57'); 65 66-- -------------------------------------------------------- 67 68-- 69-- テーブルの構造 `seasons` 70-- 71 72CREATE TABLE `seasons` ( 73 `id` int(11) NOT NULL, 74 `current_season` int(11) NOT NULL, 75 `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, 76 `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP 77) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 78 79-- -------------------------------------------------------- 80 81-- 82-- テーブルの構造 `users` 83-- 84 85CREATE TABLE `users` ( 86 `id` int(11) NOT NULL, 87 `login_informations_id` int(11) NOT NULL, 88 `name` varchar(255) NOT NULL, 89 `birthday` date NOT NULL, 90 `sex` int(11) NOT NULL, 91 `weather_id` int(11) NOT NULL, 92 `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, 93 `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP 94) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 95 96-- -------------------------------------------------------- 97 98-- 99-- テーブルの構造 `weather` 100-- 101 102CREATE TABLE `weather` ( 103 `id` int(11) NOT NULL, 104 `current_weather` int(11) NOT NULL, 105 `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, 106 `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP 107) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 108 109-- 110-- Indexes for dumped tables 111-- 112 113-- 114-- Indexes for table `feel_conditions` 115-- 116ALTER TABLE `feel_conditions` 117 ADD PRIMARY KEY (`id`); 118 119-- 120-- Indexes for table `login_informations` 121-- 122ALTER TABLE `login_informations` 123 ADD PRIMARY KEY (`id`); 124 125-- 126-- Indexes for table `seasons` 127-- 128ALTER TABLE `seasons` 129 ADD PRIMARY KEY (`id`); 130 131-- 132-- Indexes for table `users` 133-- 134ALTER TABLE `users` 135 ADD PRIMARY KEY (`id`); 136 137-- 138-- Indexes for table `weather` 139-- 140ALTER TABLE `weather` 141 ADD PRIMARY KEY (`id`); 142COMMIT;
回答2件
あなたの回答
tips
プレビュー