

{"id":1472,"date":"2020-06-10T01:15:01","date_gmt":"2020-06-09T16:15:01","guid":{"rendered":"https:\/\/curecode.jp\/tech\/?p=1472"},"modified":"2020-06-10T01:15:01","modified_gmt":"2020-06-09T16:15:01","slug":"laravel-db-seed-sqlstate-42s02-base-table-or-view-not-found-1146","status":"publish","type":"post","link":"https:\/\/curecode.jp\/tech\/laravel-db-seed-sqlstate-42s02-base-table-or-view-not-found-1146\/","title":{"rendered":"Laravel \u306e php artisan db:seed \u3067 SQLSTATE[42S02]: Base table or view not found: 1146 Table \u30a8\u30e9\u30fc\u304c\u767a\u751f"},"content":{"rendered":"<p>\n  Laravel \u306e <code>php artisan db:seed<\/code> \u3092 Amazon RDS \u306e\u74b0\u5883\u3067\u5b9f\u884c\u3059\u308b\u3068\u3001\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f\u3002\n<\/p>\n<pre><code class=\"bash\">\r\n   Illuminate\\Database\\QueryException  : SQLSTATE[42S02]: Base table or view not found: 1146 Table '{db_name}.Groups' doesn't exist (SQL: insert into `Groups` ...\r\n<\/code><\/pre>\n<p>\n  Groups \u30c6\u30fc\u30d6\u30eb\u304c\u5b58\u5728\u3057\u306a\u3044\u3068\u3044\u3046\u30a8\u30e9\u30fc\u3067\u3059\u3002\u3082\u3061\u308d\u3093 migration \u3067\u306f groups \u30c6\u30fc\u30d6\u30eb\u306f\u4f5c\u6210\u3057\u3066\u3044\u3066\u3001<code>show tables<\/code> \u3067\u5b58\u5728\u3057\u3066\u3044\u308b\u306e\u304c\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002\n<\/p>\n<p>\n \u3000\u539f\u56e0\u306f seeder \u30d5\u30a1\u30a4\u30eb\u306e\u4e2d\u3067\n<\/p>\n<pre><code class=\"php\">\r\nclass GroupsTableSeeder extends Seeder\r\n{\r\n    public function run()\r\n    {\r\n        DB::table('Groups')->insert([\r\n            [\r\n                'id' => 1,\r\n...\r\n<\/code><\/pre>\n<p>\n  \u3068\u66f8\u3044\u3066\u3044\u308b\u30c6\u30fc\u30d6\u30eb\u540d\u306e\u5148\u982d\u304c\u5927\u6587\u5b57\u3067\u59cb\u307e\u3063\u3066\u3044\u305f\u3053\u3068\u3067\u3057\u305f\u3002 &#8216;Groups&#8217; \u3092 &#8216;groups&#8217; \u306b\u66f8\u304d\u63db\u3048\u308b\u3053\u3068\u3067\u30a8\u30e9\u30fc\u304c\u51fa\u306a\u304f\u306a\u308a\u307e\u3057\u305f\u3002\n<\/p>\n<p>\n  \u7406\u7531\u306f Laravel \u3068\u306f\u95a2\u4fc2\u306a\u304f\u3001MySQL \u304c UNIX \u3067\u306f\u30c6\u30fc\u30d6\u30eb\u306e\u5927\u6587\u5b57\u30fb\u5c0f\u6587\u5b57\u306f\u533a\u5225\u3055\u308c Windows \u3084 macOS (\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u306b\u3088\u308b) \u3060\u3068\u533a\u5225\u3055\u308c\u306a\u3044\u3068\u3044\u3046\u9055\u3044\u304c\u3042\u308b\u305f\u3081\u3067\u3057\u305f\u3002\u958b\u767a\u74b0\u5883\u3067\u306f\u30a8\u30e9\u30fc\u306b\u306f\u306a\u3089\u306a\u304b\u3063\u305f\u306e\u3067\u3001\u306a\u304b\u306a\u304b\u6c17\u3065\u304d\u306b\u304f\u3044\u3068\u3053\u308d\u3067\u3059\u3002\n<\/p>\n<h3>IT\u30a8\u30f3\u30b8\u30cb\u30a2\u52df\u96c6\u4e2d\uff01<\/h3>\n<p>\u30ad\u30e5\u30a2\u30b3\u30fc\u30c9\u682a\u5f0f\u4f1a\u793e\u306fIT\u30a8\u30f3\u30b8\u30cb\u30a2\u3092\u52df\u96c6\u3057\u3066\u304a\u308a\u307e\u3059\u3002\u5c11\u4eba\u6570\u306e\u8077\u5834\u306a\u306e\u3067\u3001\u4e0a\u6d41\u30fb\u4e0b\u6d41\u3084\u30b5\u30fc\u30d0\u30fc\u30fb\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u5bfe\u5fdc\u306e\u57a3\u6839\u306a\u304f\u3001\u3042\u306a\u305f\u306e\u5f37\u307f\u3092\u6d3b\u304b\u3057\u306a\u304c\u3089 \u3044\u308d\u3044\u308d\u306a\u3053\u3068\u306b\u30c1\u30e3\u30ec\u30f3\u30b8\u53ef\u80fd\u3067\u3059\u3002\u30a8\u30f3\u30b8\u30cb\u30a2\u3068\u3057\u3066\u306e\u672a\u7d4c\u9a13\u306e\u65b9\u3001\u7d4c\u9a13\u304c\u5c11\u306a\u3044\u65b9\u3082\u6b53\u8fce\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u4e0b\u8a18\u3088\u308aIT\u30a8\u30f3\u30b8\u30cb\u30a2\u52df\u96c6\u306e\u63a1\u7528\u60c5\u5831\u3092\u3054\u89a7\u3044\u305f\u3060\u3051\u307e\u3059\u3002<\/p>\n<div class=\"curecode_recruit_bn\">\n\t\t\t\t<a href=\"https:\/\/curecode.jp\/recruit\/itengineer\/\" target=\"_blank\" rel=\"noopener noreferrer\"><br \/>\n\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/curecode.jp\/tech\/wp-content\/themes\/tech\/images\/it_recruit.png?20241220\" alt=\"\u4e8b\u696d\u62e1\u5927\u306b\u4f34\u3044\u65b0\u3057\u3044\u9818\u57df\u306b\u4e00\u7dd2\u306b\u53d6\u308a\u7d44\u3093\u3067\u3044\u304f\u30e1\u30f3\u30d0\u30fc\u3092\u52df\u96c6\u3057\u307e\u3059\u3002\"  width=\"500\" height=\"180\"\/><br \/>\n\t\t\t\t<\/a>\n\t\t<\/div>\n<h3>\u30ad\u30e5\u30a2\u30b3\u30fc\u30c9\u516c\u5f0f\u30a4\u30f3\u30b9\u30bf\u30b0\u30e9\u30e0<\/h3>\n<p>\u30ad\u30e5\u30a2\u30b3\u30fc\u30c9\u682a\u5f0f\u4f1a\u793e\u306e\u65b0\u30b5\u30fc\u30d3\u30b9\u60c5\u5831\u3084\u3001\u30aa\u30d5\u30a3\u30b9\u30e9\u30a4\u30d5\u306e\u7d20\u6575\u306a\u77ac\u9593\u307e\u3067\u3002\u79c1\u305f\u3061\u306e\u65e5\u3005\u306e\u55b6\u307f\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<div class=\"curecode_recruit_bn\">\n\t\t\t\t<a href=\"https:\/\/www.instagram.com\/curecode\/\" target=\"_blank\" rel=\"noopener noreferrer\"><br \/>\n\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/curecode.jp\/tech\/wp-content\/themes\/tech\/images\/insta_bn.png?20241220\" alt=\"\u4e8b\u696d\u62e1\u5927\u306b\u4f34\u3044\u65b0\u3057\u3044\u9818\u57df\u306b\u4e00\u7dd2\u306b\u53d6\u308a\u7d44\u3093\u3067\u3044\u304f\u30e1\u30f3\u30d0\u30fc\u3092\u52df\u96c6\u3057\u307e\u3059\u3002\"  width=\"500\" height=\"180\"\/><br \/>\n\t\t\t\t<\/a>\n\t\t<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Laravel \u306e php artisan db:seed \u3092 Amazon RDS \u306e\u74b0\u5883\u3067\u5b9f\u884c\u3059 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":593,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[84],"tags":[162,71,92],"class_list":["post-1472","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mysql","tag-laravel","tag-mysql","tag-php"],"_links":{"self":[{"href":"https:\/\/curecode.jp\/tech\/wp-json\/wp\/v2\/posts\/1472","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/curecode.jp\/tech\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/curecode.jp\/tech\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/curecode.jp\/tech\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/curecode.jp\/tech\/wp-json\/wp\/v2\/comments?post=1472"}],"version-history":[{"count":1,"href":"https:\/\/curecode.jp\/tech\/wp-json\/wp\/v2\/posts\/1472\/revisions"}],"predecessor-version":[{"id":1473,"href":"https:\/\/curecode.jp\/tech\/wp-json\/wp\/v2\/posts\/1472\/revisions\/1473"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/curecode.jp\/tech\/wp-json\/wp\/v2\/media\/593"}],"wp:attachment":[{"href":"https:\/\/curecode.jp\/tech\/wp-json\/wp\/v2\/media?parent=1472"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/curecode.jp\/tech\/wp-json\/wp\/v2\/categories?post=1472"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/curecode.jp\/tech\/wp-json\/wp\/v2\/tags?post=1472"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}