Closed shhwan closed 3 years ago
確認ありがとうございます。 以下修正しました。
日本語化
mysql> select * from posting;
+----+-----------+--------+--------+-----------------------+------------------------+---------------------+----------+----------------------------+----------------------------+
| id | PetName | PetSex | PetAge | PetInfo | Detail | LostDate | Address | CreatedDate | UpdateDate |
+----+-----------+--------+--------+-----------------------+------------------------+---------------------+----------+----------------------------+----------------------------+
| 1 | パンダ | 男 | 7 | とてもかわいい | とてもかわいい2 | 2021-12-09 00:00:00 | hogehoge | 2021-10-31 16:27:36.065145 | 2021-10-31 16:27:36.065145 |
+----+-----------+--------+--------+-----------------------+------------------------+---------------------+----------+----------------------------+----------------------------+
1 row in set (0.00 sec)
Auto IncrementとDummyデータ関連修正 http://localhost:3000/dummy 2回接続後の確認になります。
mysql> select * from posting;
+----+-----------+--------+--------+-----------------------+------------------------+---------------------+----------+----------------------------+----------------------------+
| id | PetName | PetSex | PetAge | PetInfo | Detail | LostDate | Address | CreatedDate | UpdateDate |
+----+-----------+--------+--------+-----------------------+------------------------+---------------------+----------+----------------------------+----------------------------+
| 1 | パンダ | 男 | 7 | とてもかわいい | とてもかわいい2 | 2021-12-09 00:00:00 | hogehoge | 2021-10-31 16:27:36.065145 | 2021-10-31 16:27:36.065145 |
| 2 | パンダ | 男 | 7 | とてもかわいい | とてもかわいい2 | 2021-12-09 00:00:00 | hogehoge | 2021-10-31 16:30:08.718118 | 2021-10-31 16:30:08.718118 |
+----+-----------+--------+--------+-----------------------+------------------------+---------------------+----------+----------------------------+----------------------------+
2 rows in set (0.00 sec)
mysql> select * from user; +----+----------+------------------+-----------+ | id | Password | MailAddress | postingId | +----+----------+------------------+-----------+ | 1 | 1234 | hoge@example.com | 1 | | 2 | 1234 | hoge@example.com | 2 | +----+----------+------------------+-----------+ 2 rows in set (0.00 sec)
mysql> select * from location_info; +----+-----+-----+-----------+ | id | lat | lng | postingId | +----+-----+-----+-----------+ | 1 | 123 | 456 | 1 | | 2 | 123 | 456 | 2 | +----+-----+-----+-----------+ 2 rows in set (0.01 sec)
mysql> select * from contents; +----+----------------+----------------+-----------+ | id | imageUrl | videoUrl | postingId | +----+----------------+----------------+-----------+ | 1 | dummyImage.com | dummyVideo.com | 1 | | 2 | dummyImage.com | dummyVideo.com | 2 | +----+----------------+----------------+-----------+ 2 rows in set (0.00 sec)
contentsのimageUrl/videoUrlはAPIの方進みながら修正します。
posting tableのIDをForeign Keyとして他のテーブルではpostingIdでrelationをとってます。
あと、https://github.com/copetit/whereareyou/pull/6#pullrequestreview-793669446 これのすぐ反映されないところですが npm run startになっていたため、start:devに変えました。 https://github.com/copetit/whereareyou/pull/6/commits/dfeb60f48836e2cff0be96d90989379e8832eb28
これで、コンテナもWatchモードになるため、修正がすぐ反映されます。
MongoDB -> MysqlDB
Docker Compose up
Check DB