質問編集履歴
5
社内での略称A5ERをA5:SQL Mk-2と改めました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -4,13 +4,13 @@
|
|
4
4
|
|
5
5
|
現在、ウェブアプリ作成のため、Xampp3.22を利用して、DBを作成しています。
|
6
6
|
|
7
|
-
phpMyAdminで作成したDBを、A5
|
7
|
+
phpMyAdminで作成したDBを、A5:SQL Mk-2でリバース生成してER図を作成したいと思っています。
|
8
8
|
|
9
9
|
|
10
10
|
|
11
11
|
### 発生している問題・エラーメッセージ
|
12
12
|
|
13
|
-
phpMyAdminで設定したFKが、A5
|
13
|
+
phpMyAdminで設定したFKが、A5:SQL Mk-2で作成したER図上に反映されません。
|
14
14
|
|
15
15
|
リバース生成で出来上がったER図は、リレーションが結ばれておらず、FKも存在しませんが、
|
16
16
|
|
@@ -38,7 +38,7 @@
|
|
38
38
|
|
39
39
|
phpMyAdminのみ、最新バージョンにアップデートしております。
|
40
40
|
|
41
|
-
A5
|
41
|
+
A5:SQL Mk-2も最新バージョンです。
|
42
42
|
|
43
43
|
|
44
44
|
|
4
タグを追加しました。
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
3
頂いたご質問に対して回答いたしました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -39,3 +39,311 @@
|
|
39
39
|
phpMyAdminのみ、最新バージョンにアップデートしております。
|
40
40
|
|
41
41
|
A5ERも最新バージョンです。
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
###追記
|
46
|
+
|
47
|
+
データベースのバージョンは、mysql --versionを使って調べました。
|
48
|
+
|
49
|
+
〇〇です!と言える知識がありませんので、以下でお許しください。
|
50
|
+
|
51
|
+
```
|
52
|
+
|
53
|
+
D:\xampp\mysql\bin>mysql --version
|
54
|
+
|
55
|
+
mysql Ver 15.1 Distrib 10.1.28-MariaDB, for Win32 (AMD64)
|
56
|
+
|
57
|
+
```
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
以下、phpMyAdminのエクスポート機能を使って出力したcreate文です。
|
62
|
+
|
63
|
+
```SQL
|
64
|
+
|
65
|
+
-- phpMyAdmin SQL Dump
|
66
|
+
|
67
|
+
-- version 4.8.3
|
68
|
+
|
69
|
+
-- https://www.phpmyadmin.net/
|
70
|
+
|
71
|
+
--
|
72
|
+
|
73
|
+
-- Host: localhost
|
74
|
+
|
75
|
+
-- Generation Time:
|
76
|
+
|
77
|
+
-- サーバのバージョン: 10.1.28-MariaDB
|
78
|
+
|
79
|
+
-- PHP Version: 7.1.11
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
|
84
|
+
|
85
|
+
SET AUTOCOMMIT = 0;
|
86
|
+
|
87
|
+
START TRANSACTION;
|
88
|
+
|
89
|
+
SET time_zone = "+00:00";
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
--
|
94
|
+
|
95
|
+
-- Database: `feeling_memory`
|
96
|
+
|
97
|
+
--
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
-- --------------------------------------------------------
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
--
|
106
|
+
|
107
|
+
-- テーブルの構造 `feel_conditions`
|
108
|
+
|
109
|
+
--
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
CREATE TABLE `feel_conditions` (
|
114
|
+
|
115
|
+
`id` int(11) NOT NULL,
|
116
|
+
|
117
|
+
`login_informations_id` int(11) NOT NULL,
|
118
|
+
|
119
|
+
`target_date` date NOT NULL,
|
120
|
+
|
121
|
+
`season_id` int(11) NOT NULL,
|
122
|
+
|
123
|
+
`weather_id` int(11) NOT NULL,
|
124
|
+
|
125
|
+
`temperature` int(11) NOT NULL,
|
126
|
+
|
127
|
+
`mood_value` int(11) NOT NULL,
|
128
|
+
|
129
|
+
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
130
|
+
|
131
|
+
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
|
132
|
+
|
133
|
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
--
|
138
|
+
|
139
|
+
-- テーブルのデータのダンプ `feel_conditions`
|
140
|
+
|
141
|
+
--
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
INSERT INTO `feel_conditions` (`id`, `login_informations_id`, `target_date`, `season_id`, `weather_id`, `temperature`, `mood_value`, `created_at`, `updated_at`) VALUES
|
146
|
+
|
147
|
+
(1, 1, '2018-11-06', 0, 0, 22, 5, '2018-11-06 21:56:01', '2018-11-06 21:58:24'),
|
148
|
+
|
149
|
+
(2, 2, '2018-11-16', 0, 0, 25, 2, '2018-11-06 22:05:26', '2018-11-06 22:05:30');
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
-- --------------------------------------------------------
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
--
|
158
|
+
|
159
|
+
-- テーブルの構造 `login_informations`
|
160
|
+
|
161
|
+
--
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
CREATE TABLE `login_informations` (
|
166
|
+
|
167
|
+
`id` int(11) NOT NULL,
|
168
|
+
|
169
|
+
`password` varchar(255) NOT NULL,
|
170
|
+
|
171
|
+
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
172
|
+
|
173
|
+
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
|
174
|
+
|
175
|
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
--
|
180
|
+
|
181
|
+
-- テーブルのデータのダンプ `login_informations`
|
182
|
+
|
183
|
+
--
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
INSERT INTO `login_informations` (`id`, `password`, `created_at`, `updated_at`) VALUES
|
188
|
+
|
189
|
+
(1, 'password', '2018-11-14 21:15:13', '2018-11-14 21:15:57'),
|
190
|
+
|
191
|
+
(2, 'password', '2018-11-14 21:15:13', '2018-11-14 21:15:57');
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
-- --------------------------------------------------------
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
--
|
200
|
+
|
201
|
+
-- テーブルの構造 `seasons`
|
202
|
+
|
203
|
+
--
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
CREATE TABLE `seasons` (
|
208
|
+
|
209
|
+
`id` int(11) NOT NULL,
|
210
|
+
|
211
|
+
`current_season` int(11) NOT NULL,
|
212
|
+
|
213
|
+
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
214
|
+
|
215
|
+
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
|
216
|
+
|
217
|
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
-- --------------------------------------------------------
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
--
|
226
|
+
|
227
|
+
-- テーブルの構造 `users`
|
228
|
+
|
229
|
+
--
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
CREATE TABLE `users` (
|
234
|
+
|
235
|
+
`id` int(11) NOT NULL,
|
236
|
+
|
237
|
+
`login_informations_id` int(11) NOT NULL,
|
238
|
+
|
239
|
+
`name` varchar(255) NOT NULL,
|
240
|
+
|
241
|
+
`birthday` date NOT NULL,
|
242
|
+
|
243
|
+
`sex` int(11) NOT NULL,
|
244
|
+
|
245
|
+
`weather_id` int(11) NOT NULL,
|
246
|
+
|
247
|
+
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
248
|
+
|
249
|
+
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
|
250
|
+
|
251
|
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
252
|
+
|
253
|
+
|
254
|
+
|
255
|
+
-- --------------------------------------------------------
|
256
|
+
|
257
|
+
|
258
|
+
|
259
|
+
--
|
260
|
+
|
261
|
+
-- テーブルの構造 `weather`
|
262
|
+
|
263
|
+
--
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
CREATE TABLE `weather` (
|
268
|
+
|
269
|
+
`id` int(11) NOT NULL,
|
270
|
+
|
271
|
+
`current_weather` int(11) NOT NULL,
|
272
|
+
|
273
|
+
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
274
|
+
|
275
|
+
`updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP
|
276
|
+
|
277
|
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
278
|
+
|
279
|
+
|
280
|
+
|
281
|
+
--
|
282
|
+
|
283
|
+
-- Indexes for dumped tables
|
284
|
+
|
285
|
+
--
|
286
|
+
|
287
|
+
|
288
|
+
|
289
|
+
--
|
290
|
+
|
291
|
+
-- Indexes for table `feel_conditions`
|
292
|
+
|
293
|
+
--
|
294
|
+
|
295
|
+
ALTER TABLE `feel_conditions`
|
296
|
+
|
297
|
+
ADD PRIMARY KEY (`id`);
|
298
|
+
|
299
|
+
|
300
|
+
|
301
|
+
--
|
302
|
+
|
303
|
+
-- Indexes for table `login_informations`
|
304
|
+
|
305
|
+
--
|
306
|
+
|
307
|
+
ALTER TABLE `login_informations`
|
308
|
+
|
309
|
+
ADD PRIMARY KEY (`id`);
|
310
|
+
|
311
|
+
|
312
|
+
|
313
|
+
--
|
314
|
+
|
315
|
+
-- Indexes for table `seasons`
|
316
|
+
|
317
|
+
--
|
318
|
+
|
319
|
+
ALTER TABLE `seasons`
|
320
|
+
|
321
|
+
ADD PRIMARY KEY (`id`);
|
322
|
+
|
323
|
+
|
324
|
+
|
325
|
+
--
|
326
|
+
|
327
|
+
-- Indexes for table `users`
|
328
|
+
|
329
|
+
--
|
330
|
+
|
331
|
+
ALTER TABLE `users`
|
332
|
+
|
333
|
+
ADD PRIMARY KEY (`id`);
|
334
|
+
|
335
|
+
|
336
|
+
|
337
|
+
--
|
338
|
+
|
339
|
+
-- Indexes for table `weather`
|
340
|
+
|
341
|
+
--
|
342
|
+
|
343
|
+
ALTER TABLE `weather`
|
344
|
+
|
345
|
+
ADD PRIMARY KEY (`id`);
|
346
|
+
|
347
|
+
COMMIT;
|
348
|
+
|
349
|
+
```
|
2
タイトルを正しく修正しました。
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
A
|
1
|
+
phpMyAdminで作成したER図に外部キーを設定したい。
|
test
CHANGED
File without changes
|
1
初心者マークを付けました。
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|