{"id":6877,"date":"2020-04-13T15:00:08","date_gmt":"2020-04-13T06:00:08","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=6877"},"modified":"2020-04-10T20:31:54","modified_gmt":"2020-04-10T11:31:54","slug":"%e5%85%88%e5%8f%96%e3%82%8a%ef%bc%81laravel-8-x%e3%81%a7%e8%bf%bd%e5%8a%a0%e3%81%95%e3%82%8c%e3%82%8b%e3%80%8cschema-dump%e3%80%8d%e6%a9%9f%e8%83%bd%e3%82%92%e8%aa%bf%e3%81%b9%e3%81%a6%e3%81%bf","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=6877","title":{"rendered":"\u5148\u53d6\u308a\uff01Laravel 8.x\u3067\u8ffd\u52a0\u3055\u308c\u308b\u300cSchema Dump\u300d\u6a5f\u80fd\u3092\u8abf\u3079\u3066\u307f\u305f"},"content":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u5148\u65e5\u3082<code>Reddit<\/code>\u3067\u65e5\u8ab2\u306e\u60c5\u5831\u53ce\u96c6\u3092\u3057\u3066\u3044\u305f\u3068\u3053\u308d\u3001\u4ee5\u4e0b\u306e\u8a18\u4e8b\u3092\u767a\u898b\u3057\u307e\u3057\u305f\u3002<\/p>\n<p><strong><a href=\"https:\/\/www.reddit.com\/r\/laravel\/comments\/fwsdg7\/8x_schema_dump_by_taylorotwell\/\" target=\"_blank\" rel=\"noopener noreferrer\">[8.x] Schema Dump by taylorotwell<\/a><\/strong><\/p>\n<p>\u7c21\u5358\u306b\u8a00\u3046\u3068\u3001<code>Laravel<\/code>\u306e\u6b21\u671f\u30d0\u30fc\u30b8\u30e7\u30f3<code>8.x<\/code>\u306b\u3001<\/p>\n<p><strong style=\"font-size: 35px;\">Schema Dump<\/strong><\/p>\n<p>\u3068\u547c\u3070\u308c\u308b\u65b0\u6a5f\u80fd\u304c\u8ffd\u52a0\u3055\u308c\u308b\u3068\u306e\u3053\u3068\u3060\u3063\u305f\u306e\u3067\u3059\u304c\u3001\u3053\u306e\u6a5f\u80fd\u304c\u306a\u304b\u306a\u304b\u8208\u5473\u6df1\u304b\u3063\u305f\u306e\u3067\u3001<code>7.x<\/code>\u304c\u516c\u958b\u3055\u308c\u305f\u3070\u304b\u308a\u3067\u3059\u304c\u3001\u5148\u53d6\u308a\u3057\u3066<strong>Schema Dump\u6a5f\u80fd\u3092\u307e\u3068\u3081\u3066\u307f\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002<\/strong><\/p>\n<p>\u305c\u3072\u7686\u3055\u3093\u306e\u304a\u5f79\u306b\u7acb\u3066\u308b\u3068\u5b09\u3057\u3044\u3067\u3059\ud83d\ude0a\u2728<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3344 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_22.png\" alt=\"\" width=\"320\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_22.png 320w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_22-150x150.png 150w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_22-300x300.png 300w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_22-100x100.png 100w\" sizes=\"auto, (max-width: 320px) 100vw, 320px\" \/><\/p>\n<p style=\"text-align: center;\">\u300c\u3046\u30fc\u3093\u3001Laravel\u958b\u767a\u8005\u306f\u3084\u3063\u3071\u51c4\u3044\ud83d\ude0a\u300d<\/p>\n<h1>Schema Dump\u306f\u4f55\u304c\u3067\u304d\u308b\u306e\u304b\uff1f<\/h1>\n<p>\u65b0\u30b3\u30de\u30f3\u30c9\u3001<code>php artisan schema:dump<\/code>\u304c\u4f7f\u3048\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u3053\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068<strong>\u3059\u3067\u306b\u5b58\u5728\u3057\u3066\u3044\u308b\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u300cSchema\u30d5\u30a1\u30a4\u30eb\u300d\u3068\u3057\u3066\uff11\u3064\u306b\u307e\u3068\u3081\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/strong><\/p>\n<p>\u307e\u305f\u3001<code>php artisan schema:dump --prune<\/code> \u3092\u5b9f\u884c\u3059\u308b\u3068\u3059\u3067\u306b\u300cSchema\u30d5\u30a1\u30a4\u30eb\u300d\u306b\u307e\u3068\u3081\u3089\u308c\u305f\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u524a\u9664\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u306a\u304a\u3001<strong>Schema\u30d5\u30a1\u30a4\u30eb\u306f\u3001\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3059\u308b\u3068\u304d\u4e00\u756a\u6700\u521d\u306b\u5b9f\u884c\u3055\u308c\u307e\u3059\u304c\u3001\u3053\u308c\u306fDB\u304c\u521d\u671f\u72b6\u614b\u306e\u3068\u304d\u3060\u3051\u3067\u3059\u3002<\/strong>\u305d\u306e\u5f8c\u3001\u307e\u3060<code>Schema\u30d5\u30a1\u30a4\u30eb<\/code>\u306b\u5165\u3063\u3066\u3044\u306a\u3044\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u304c\u3042\u308c\u3070\u7d9a\u3044\u3066\u5b9f\u884c\u3055\u308c\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h1>\u3069\u306e\u3088\u3046\u306b\u3057\u3066\u5b9f\u88c5\u3055\u308c\u308b\u304b\uff1f<\/h1>\n<p><code>Schema\u30d5\u30a1\u30a4\u30eb<\/code>\u306f\u3001<code>mysqldump<\/code>\u3084<code>pgdump<\/code>\u30b3\u30de\u30f3\u30c9\u3067\u4f5c\u6210\u3055\u308c\u308b\u3088\u3046\u3067\u3059\u3002<br \/>\n\u305d\u3057\u3066\u3001\u30d5\u30a1\u30a4\u30eb\u306f\u6b21\u306e\u5834\u6240\u306b\u4fdd\u5b58\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre><strong>\/database\/schema\/\uff08DB\u306e\u30b3\u30cd\u30af\u30b7\u30e7\u30f3\u540d\uff09-schema.mysql<\/strong><\/pre>\n<h1>\u3069\u3093\u306a\u30e1\u30ea\u30c3\u30c8\u304c\u3042\u308b\u304b\uff1f<\/h1>\n<p>\u57fa\u672c\u7684\u306b\u30ed\u30fc\u30ab\u30eb\u74b0\u5883\u3067\u306e\u30e1\u30ea\u30c3\u30c8\u3092\u60f3\u5b9a\u3057\u3066\u3044\u308b\u3088\u3046\u3067\u3059\u3002<\/p>\n<p>\u307e\u305a\u3001\u30b5\u30a4\u30c8\u306e\u898f\u6a21\u304c\u5927\u304d\u304f\u306a\u3063\u3066\u304f\u308b\u3068\u901a\u5e38\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u304c\u305f\u304f\u3055\u3093\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\u304c\u3001\u3053\u308c\u3092<strong>\uff11\u3064\u306e\u30d5\u30a1\u30a4\u30eb\u306b\u307e\u3068\u3081\u308b\u3053\u3068\u304c\u3067\u304d\u3001\u3053\u308c\u306b\u3088\u308aDB\u306e\u521d\u671f\u5316\u304c\u9ad8\u901f\u306b\u306a\u308a\u307e\u3059\u3002<\/strong><\/p>\n<p>\u4f8b\u3048\u3070\u3001\u901a\u5e38\u306e\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u4f7f\u3063\u305f\u6b21\u306e\u4f8b\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<ol>\n<li>books\u30c6\u30fc\u30d6\u30eb\u3092\u3064\u304f\u308b<\/li>\n<li>books\u30c6\u30fc\u30d6\u30eb\u306b\u300ccomment\u300d\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u8ffd\u52a0\u3059\u308b<\/li>\n<li>\u3084\u3063\u3071\u308a\u300ccomment\u300d\u30d5\u30a3\u30fc\u30eb\u30c9\u306f\u4e0d\u8981\u306b\u306a\u3063\u305f\u306e\u3067\u524a\u9664\u3057\u305f<\/li>\n<\/ol>\n<p>\u3082\u3057\u3053\u306e\u4f5c\u696d\u3092\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u8ffd\u52a0\u3059\u308b\u3053\u3068\u3067\u5b9f\u88c5\u3057\u305f\u3068\u3059\u308b\u3068\u3001\uff13\u3064\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u5b9f\u884c\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u3057\u304b\u3057\u3001<strong>Schema\u30d5\u30a1\u30a4\u30eb\u306f<code>mysqldump<\/code>\u306a\u3069\u306e\u30b3\u30de\u30f3\u30c9\u3067\u4eca\u73fe\u5728\u306eDB\u69cb\u9020\u3092\u307e\u3068\u3081\u3066\u304f\u308c\u308b\u306e\u3067\u3001\uff12\u3068\uff13\u306f\u7701\u7565\u3067\u304d\u307e\u3059\u3002<\/strong><\/p>\n<p>\u307e\u305f\u3001\u5148\u307b\u3069\u3082\u66f8\u304d\u307e\u3057\u305f\u304c\u3001<code>Schema\u30d5\u30a1\u30a4\u30eb<\/code>\u306fDB\u304c\u521d\u671f\u72b6\u614b\uff08<code>migrations<\/code>\u30c6\u30fc\u30d6\u30eb\u304c\u7a7a\uff09\u306e\u3068\u304d\u3060\u3051\u5b9f\u884c\u3055\u308c\u308b\u306e\u3067\u3001<strong>\u3059\u3067\u306b\u904b\u55b6\u4e2d\u306e\u672c\u756a\u74b0\u5883\u306bSchema\u30d5\u30a1\u30a4\u30eb\u3092\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3057\u3066\u3082\u3001\u305d\u306e\u30d5\u30a1\u30a4\u30eb\u306f\u5b9f\u884c\u3055\u308c\u308b\u3053\u3068\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/strong><\/p>\n<p>\u3064\u307e\u308a\u3001\u983b\u7e41\u306bDB\u3092\u521d\u671f\u5316\u3059\u308b\u30ed\u30fc\u30ab\u30eb\u74b0\u5883\u3067\u306f\u30e1\u30ea\u30c3\u30c8\u304c\u591a\u3044\u3068\u3044\u3063\u3066\u3044\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n<p>\u306a\u304a\u3001<a href=\"https:\/\/github.com\/laravel\/framework\/pull\/32275\" target=\"_blank\" rel=\"noopener noreferrer\">GitHub\u306ePull\u30ea\u30af\u30a8\u30b9\u30c8<\/a>\u306b\u6295\u7a3f\u3055\u308c\u305f\u30b3\u30e1\u30f3\u30c8\u306b\u306f\u6b21\u306e\u3088\u3046\u306a\u3082\u306e\u304c\u3042\u308a\u307e\u3057\u305f\u306e\u3067\u3001\u7d39\u4ecb\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<blockquote><p>\uff08\u610f\u8a33\uff09<\/p>\n<p>\u305d\u306e\u6614\u3001\u672c\u756a\u74b0\u5883\u306eDB\u3092\u624b\u52d5\u3067\u5909\u66f4\u3057\u305f\u30e4\u30c4\u304c\u3044\u305f\u304b\u3089\u3001\u30ed\u30fc\u30ab\u30eb\u74b0\u5883\u3068\u540c\u671f\u3092\u3068\u308a\u305f\u304b\u3063\u305f\u3002\u305d\u3093\u306a\u3068\u304d\u3053\u306e\u6a5f\u80fd\u3067\u89e3\u6c7a\u3067\u304d\u308b\u3093\u3058\u3083\u306a\u3044\u304b\u306a\u3002<\/p><\/blockquote>\n<p>\u78ba\u304b\u306b\u3001\u3053\u3046\u8003\u3048\u308b\u3068\u672c\u756a\u74b0\u5883\u3067\u306e\u30e1\u30ea\u30c3\u30c8\u3082\u3042\u308a\u307e\u3059\u306d\ud83d\ude0a\u2728<\/p>\n<h1>\u304a\u308f\u308a\u306b<\/h1>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u4eca\u56de\u306f\u6c17\u304c\u65e9\u3044\u3067\u3059\u304c<code>Laravel 8.x<\/code>\u3067\u8ffd\u52a0\u3055\u308c\u308b\u300c<strong>Schema Dump<\/strong>\u300d\u6a5f\u80fd\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u306a\u304a\u3001\u500b\u4eba\u7684\u306b\u3053\u306e\u6a5f\u80fd\u306f\u3068\u3066\u3082\u6b53\u8fce\u3067\u3059\u3002\uff08\u30d7\u30eb\u30ea\u30af\u30a8\u30b9\u30c8\u306e\u30da\u30fc\u30b8\u306b\u601d\u308f\u305a\u300c\u3044\u3044\u306d\ud83d\udc4d\u300d\u3057\u3066\u3057\u307e\u3044\u307e\u3057\u305f\uff09<\/p>\n<p>\u3068\u3044\u3046\u306e\u3082\u3001\u3084\u306f\u308a<strong>\u30b5\u30a4\u30c8\u306e\u898f\u6a21\u304c\u5927\u304d\u304f\u306a\u3063\u3066\u304f\u308b\u3068DB\u3092\u521d\u671f\u5316\u3059\u308b\u3068\u304d\u300c\u30fb\u30fb\u30fb\u30fb\u30fb\u3046\u30fc\u3093\u3001\u307e\u3060\u7d42\u308f\u3089\u306a\u3044\ud83d\udca6\u300d\u3068\u306a\u308b\u3053\u3068\u304c\u591a\u3044\u304b\u3089\u3067\u3059\u3002<\/strong><\/p>\n<p><code>Seeder<\/code>\u3067\u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u3092\u305f\u304f\u3055\u3093\u7528\u610f\u3059\u308b\u5834\u5408\u306f\u3055\u3089\u306b\u6642\u9593\u304c\u304b\u304b\u308b\u308f\u3051\u3067\u3001\u3053\u308c\u304c\u3061\u3087\u3063\u3068\u3067\u3082\u9ad8\u901f\u5316\u3067\u304d\u308c\u3070\u5b09\u3057\u3044\u3067\u3059\u306d\u3002<\/p>\n<p>\u3061\u306a\u307f\u306b\u3001\u307e\u3060\u8a00\u53ca\u3055\u308c\u3066\u306a\u3044\u3068\u601d\u3046\u306e\u3067\u3059\u304c<code>Schema Dump<\/code>\u304c\u3053\u306e\u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u3092\u3069\u3046\u6271\u3046\u306e\u304b\u306b\u6ce8\u76ee\u3057\u3066\u3044\u307e\u3059\u3002\u300cSchema\uff08\u69cb\u9020\uff09\u300d\u3068\u3044\u3046\u540d\u524d\u3060\u3051\u3042\u3063\u3066<code>Seeder<\/code>\u306f\u30b5\u30dd\u30fc\u30c8\u5916\u306a\u306e\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\u3001<strong>\u3067\u304d\u308c\u3070<code>Seeder<\/code>\u3082\u6642\u9593\u304c\u304b\u304b\u308b\u306e\u3067\u540c\u3058\u3088\u3046\u306a\u6a5f\u80fd\u304c\u3042\u308b\u3068\u3055\u3089\u306b\u5b09\u3057\u3044\u3067\u3059\u306d\u3002<\/strong><\/p>\n<p>\u307e\u3060\u3053\u308c\u304b\u3089\u5909\u66f4\u304c\u3042\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\u3001\u3053\u306e\u6a5f\u80fd\u3092\u4f7f\u3046\u306e\u304c\u697d\u3057\u307f\u3067\u3059\u3002<\/p>\n<p>\u3067\u306f\u3067\u306f\u301c\u2757<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6067 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/03\/no_19.png\" alt=\"\" width=\"314\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/03\/no_19.png 314w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/03\/no_19-294x300.png 294w\" sizes=\"auto, (max-width: 314px) 100vw, 314px\" \/><\/p>\n<p style=\"text-align: center;\">\u300c\u305d\u306e\u6614\u306f\u3001mysqldump\u3057\u305f<br \/>\n\u30d5\u30a1\u30a4\u30eb\u3092\u3064\u304f\u3063\u3066\u521d\u671f\u5316\u3057\u3066\u307e\u3057\u305f\ud83d\ude0a\u300d<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u5148\u65e5\u3082Reddit\u3067\u65e5\u8ab2\u306e\u60c5\u5831\u53ce\u96c6\u3092\u3057\u3066\u3044\u305f\u3068\u3053\u308d\u3001\u4ee5\u4e0b\u306e\u8a18\u4e8b\u3092\u767a\u898b\u3057\u307e\u3057\u305f\u3002 [8.x] Schema Dump by taylorotwell \u7c21 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=6877\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;\u5148\u53d6\u308a\uff01Laravel 8.x\u3067\u8ffd\u52a0\u3055\u308c\u308b\u300cSchema Dump\u300d\u6a5f\u80fd\u3092\u8abf\u3079\u3066\u307f\u305f&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":6907,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[212,60],"class_list":["post-6877","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-laravel","tag-migration","tag-60"],"_links":{"self":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/6877","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6877"}],"version-history":[{"count":28,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/6877\/revisions"}],"predecessor-version":[{"id":6905,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/6877\/revisions\/6905"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/6907"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6877"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6877"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6877"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}