{"id":715,"date":"2016-12-15T09:17:55","date_gmt":"2016-12-15T00:17:55","guid":{"rendered":"http:\/\/www.shiro8.net\/blog\/?p=715"},"modified":"2021-05-07T15:53:03","modified_gmt":"2021-05-07T06:53:03","slug":"%e3%80%90ec-cube3%e3%80%91%e7%8b%ac%e8%87%aa%e3%83%97%e3%83%a9%e3%82%b0%e3%82%a4%e3%83%b3%e3%81%a7%e3%83%86%e3%83%bc%e3%83%96%e3%83%ab%e4%bd%9c%e6%88%90%ef%bc%86%e3%83%87%e3%83%bc%e3%82%bf%e6%8a%95","status":"publish","type":"post","link":"https:\/\/www.shiro8.net\/blog\/eccube_report\/715.html","title":{"rendered":"\u3010EC-CUBE3\u3011\u72ec\u81ea\u30d7\u30e9\u30b0\u30a4\u30f3\u3067\u30c6\u30fc\u30d6\u30eb\u4f5c\u6210\uff06\u30c7\u30fc\u30bf\u6295\u5165\u3092\u3059\u308b\u65b9\u6cd5\u3002"},"content":{"rendered":"<p>\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u81ea\u4f5c\u3059\u308b\u969b\u3001\u3069\u3046\u3057\u3066\u3082\u907f\u3051\u3066\u901a\u308c\u306a\u3044\u306e\u304c\u65b0\u3057\u3044\u30c6\u30fc\u30d6\u30eb\u306e\u4f5c\u6210\u304b\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n\u305f\u3060\u3001\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3059\u308b\u3060\u3051\u3042\u308c\u3070\u3001Symfony2\u306eMigration\u3092\u5229\u7528\u3057\u3066\u3001<br \/>\nup\u30e1\u30bd\u30c3\u30c9\u306bcreate table\u306e\u8a18\u8ff0\u3092\u3059\u308c\u3070\u826f\u3044\u306e\u3067\u3059\u304c\u3001<br \/>\n\u305d\u306e\u307e\u307e\u540c\u3058\u30d5\u30a1\u30a4\u30eb\u3067\u30c7\u30fc\u30bf\u3092\u6295\u5165\u3057\u3088\u3046\u3068\u3059\u308b\u3068\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3059\u3002<br \/>\n\u4f8b\u3048\u3070\u3001\u540d\u79f0\u3068\u30b9\u30c6\u30fc\u30bf\u30b9\u3092\u6301\u3064\u30c6\u30fc\u30d6\u30eb\u3092\u65b0\u898f\u4f5c\u6210\u3059\u308b\u5834\u5408\u3001<br \/>\n\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u8a18\u8ff0\u3092\u884c\u3046\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>class Version20161207000000 extends AbstractMigration<br \/>\n{<br \/>\n    public function up(Schema $schema)<br \/>\n    {<br \/>\n        $this-&gt;createPluginTable($schema);<br \/>\n    }<\/p>\n<p>    public function down(Schema $schema)<br \/>\n    {<br \/>\n        $schema-&gt;dropTable(&#8216;plg_shiro8_now_order_config&#8217;);<br \/>\n    }<\/p>\n<p>    protected function createPluginTable(Schema $schema)<br \/>\n    {<br \/>\n    \t$table = $schema-&gt;createTable(&#8220;plg_shiro8_hogehoge_config&#8221;);<br \/>\n        $table-&gt;addColumn(&#8216;id&#8217;, &#8216;integer&#8217;, array(<br \/>\n            &#8216;autoincrement&#8217; =&gt; true,<br \/>\n            &#8216;notnull&#8217; =&gt; true,<br \/>\n        ));<br \/>\n        $table-&gt;addColumn(&#8216;name&#8217;, &#8216;text&#8217;, array(&#8216;notnull&#8217; =&gt; true));<br \/>\n        $table-&gt;addColumn(&#8216;status_flg&#8217;, &#8216;smallint&#8217;, array(<br \/>\n            &#8216;notnull&#8217; =&gt; true,<br \/>\n            &#8216;unsigned&#8217; =&gt; false,<br \/>\n            &#8216;default&#8217; =&gt; 0,<br \/>\n        ));<br \/>\n        $table-&gt;addColumn(&#8216;rank&#8217;, &#8216;integer&#8217;, array(<br \/>\n            &#8216;notnull&#8217; =&gt; true,<br \/>\n            &#8216;unsigned&#8217; =&gt; false,<br \/>\n            &#8216;default&#8217; =&gt; 1,<br \/>\n        ));<br \/>\n        $table-&gt;addColumn(&#8216;del_flg&#8217;, &#8216;smallint&#8217;, array(<br \/>\n            &#8216;notnull&#8217; =&gt; true,<br \/>\n            &#8216;unsigned&#8217; =&gt; false,<br \/>\n            &#8216;default&#8217; =&gt; 0,<br \/>\n        ));<br \/>\n        $table-&gt;addColumn(&#8216;create_date&#8217;, &#8216;datetime&#8217;, array(<br \/>\n            &#8216;notnull&#8217; =&gt; true,<br \/>\n            &#8216;unsigned&#8217; =&gt; false,<br \/>\n        ));<br \/>\n        $table-&gt;addColumn(&#8216;update_date&#8217;, &#8216;datetime&#8217;, array(<br \/>\n            &#8216;notnull&#8217; =&gt; true,<br \/>\n            &#8216;unsigned&#8217; =&gt; false,<br \/>\n        ));<br \/>\n        $table-&gt;setPrimaryKey(array(&#8216;id&#8217;));<\/p>\n<p>    }<br \/>\n}\n<\/p>\n<p>\u3053\u308c\u3067\u65b0\u3057\u304fplg_shiro8_hogehoge_config\u30c6\u30fc\u30d6\u30eb\u304c\u4f5c\u3089\u308c\u308b\u306e\u3067\u3059\u304c\u3001<\/p>\n<p>$table-&gt;setPrimaryKey(array(&#8216;id&#8217;));<\/p>\n<p>\u306e\u5f8c\u308d\u306b\u3001\u30c7\u30fc\u30bf\u3092\u8ffd\u52a0\u3059\u308b\u70ba\u306einsert\u6587\u3092\u8ffd\u8a18\u3059\u308b\u3068\u30a8\u30e9\u30fc\u304c\u8d77\u304d\u307e\u3059\u3002<\/p>\n<p>        $this-&gt;addSql(&#8220;INSERT INTO plg_shiro8_hogehoge_config (creator_id, name, visible_flg, rank, del_flg, create_date, update_date) VALUES (1, &#8216;\u5546\u54c1\u753b\u50cf&#8217;, 1, 3, 0, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);&#8221;);<br \/>\n        $this-&gt;addSql(&#8220;INSERT INTO plg_shiro8_hogehoge_config (creator_id, name, visible_flg, rank, del_flg, create_date, update_date) VALUES (1, &#8216;\u5546\u54c1\u540d&#8217;, 1, 2, 0, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);&#8221;);<br \/>\n        $this-&gt;addSql(&#8220;INSERT INTO plg_shiro8_hogehoge_config (creator_id, name, visible_flg, rank, del_flg, create_date, update_date) VALUES (1, &#8216;\u58f2\u4e0a\u65e5\u6642&#8217;, 1, 1, 0, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);&#8221;);\n<\/p>\n<p>\u3053\u308c\u306f\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u5185\u3067\u30c7\u30fc\u30bf\u3092\u8ffd\u52a0\u3057\u3088\u3046\u3068\u3057\u305f\u6642\u306b\u306f\u3001<br \/>\n\u307e\u3060plg_shiro8_hogehoge_config\u30c6\u30fc\u30d6\u30eb\u304c\u5b58\u5728\u3057\u3066\u3044\u306a\u3044\u4e8b\u304c\u539f\u56e0\u306e\u3088\u3046\u3067\u3059\u3002<br \/>\n\u8a73\u7d30\u306f\u3088\u304f\u5206\u304b\u3089\u306a\u304b\u3063\u305f\u306e\u3067\u3059\u304c\u3001SQL\u304c\u5b9f\u884c\u3055\u308c\u308b\u9806\u756a\u306b\u30eb\u30fc\u30eb\u304c\u3042\u308a\u305d\u3046\u3067\u3059\u3002<\/p>\n<p>\u305d\u3053\u3067SQL\u306e\u5b9f\u884c\u306b\u533a\u5207\u308a\u3092\u3064\u3051\u308b\u70ba\u3001insert\u6587\u306e\u8a18\u8ff0\u306e\u307f\u5225\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u30d5\u30a1\u30a4\u30eb\u306b\u5206\u3051\u3066\u3001<br \/>\n\u9806\u756a\u306b\u5b9f\u884c\u3055\u305b\u308b\u3053\u3068\u3067\u5bfe\u5fdc\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001create tabel\u306e\u5b9f\u884c\u3092\u8a18\u8ff0\u3059\u308b\u30d5\u30a1\u30a4\u30eb\u306f\u3001\u300cVersion20161207000000.php\u300d\u3068\u547d\u540d\u3057\u3001<br \/>\ninsert\u306e\u5b9f\u884c\u3092\u8a18\u8ff0\u3059\u308b\u30d5\u30a1\u30a4\u30eb\u306f\u3001\u300cVersion20161208000000.php\u300d\u3068\u3057\u307e\u3059\u3002<\/p>\n<p>class Version20161208000000 extends AbstractMigration<br \/>\n{<br \/>\n    public function up(Schema $schema)<br \/>\n    {<br \/>\n        $this-&gt;addSql(&#8220;INSERT INTO plg_shiro8_hogehoge_config (creator_id, name, visible_flg, rank, del_flg, create_date, update_date) VALUES (1, &#8216;\u5546\u54c1\u753b\u50cf&#8217;, 1, 3, 0, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);&#8221;);<br \/>\n        $this-&gt;addSql(&#8220;INSERT INTO plg_shiro8_hogehoge_config (creator_id, name, visible_flg, rank, del_flg, create_date, update_date) VALUES (1, &#8216;\u5546\u54c1\u540d&#8217;, 1, 2, 0, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);&#8221;);<br \/>\n        $this-&gt;addSql(&#8220;INSERT INTO plg_shiro8_hogehoge_config (creator_id, name, visible_flg, rank, del_flg, create_date, update_date) VALUES (1, &#8216;\u58f2\u4e0a\u65e5\u6642&#8217;, 1, 1, 0, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);&#8221;);<\/p>\n<p>    }<\/p>\n<p>    public function down(Schema $schema)<br \/>\n    {<\/p>\n<p>    }<\/p>\n<p>}\n<\/p>\n<p>\u3053\u3046\u3059\u308b\u4e8b\u306b\u3088\u3063\u3066\u3001\u30d7\u30e9\u30b0\u30a4\u30f3\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6642\u306b<br \/>\nVersion20161207000000 \u2192 Version20161208000000 \u3068\u9806\u756a\u306b\u5b9f\u884c\u3055\u308c\u3001<br \/>\n\u7121\u4e8b\u3001\u30c6\u30fc\u30d6\u30eb\u306b\u521d\u671f\u30c7\u30fc\u30bf\u3092\u6295\u5165\u3059\u308b\u4e8b\u304c\u51fa\u6765\u307e\u3059\u3002<br \/>\n\u3061\u306a\u307f\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6642\u306b\u4e00\u6c17\u306b\u51e6\u7406\u3092\u8d70\u3089\u305b\u308b\u305f\u3081\u306b\u3001\u305d\u308c\u305e\u308c\u306e\u30d5\u30a1\u30a4\u30eb\u540d\u306eyyyymmdd\u306e\u90e8\u5206\u306f<br \/>\n\u904e\u53bb\u306e\u65e5\u4ed8\u306b\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u305d\u3046\u3067\u3059\u3002<\/p>\n<p>\u4ee5\u4e0a\u3001ECCUBE3\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u958b\u767a\u6642\u306b\u60a9\u3093\u3067\u3001\u89e3\u6c7a\u3057\u305f\u4e8b\u306e1\u3064\u3001<br \/>\n\u72ec\u81ea\u30d7\u30e9\u30b0\u30a4\u30f3\u3067\u30c6\u30fc\u30d6\u30eb\u4f5c\u6210\uff06\u30c7\u30fc\u30bf\u6295\u5165\u3092\u3059\u308b\u65b9\u6cd5\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u81ea\u4f5c\u3059\u308b\u969b\u3001\u3069\u3046\u3057\u3066\u3082\u907f\u3051\u3066\u901a\u308c\u306a\u3044\u306e\u304c\u65b0\u3057\u3044\u30c6\u30fc\u30d6\u30eb\u306e\u4f5c\u6210\u304b\u3068\u601d\u3044\u307e\u3059\u3002 \u305f\u3060\u3001\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3059\u308b\u3060\u3051\u3042\u308c\u3070\u3001Symfony2\u306eMigration&#8230;  <a class=\"more-link\" href=\"https:\/\/www.shiro8.net\/blog\/eccube_report\/715.html\" title=\"Read \u3010EC-CUBE3\u3011\u72ec\u81ea\u30d7\u30e9\u30b0\u30a4\u30f3\u3067\u30c6\u30fc\u30d6\u30eb\u4f5c\u6210\uff06\u30c7\u30fc\u30bf\u6295\u5165\u3092\u3059\u308b\u65b9\u6cd5\u3002\">\u3082\u3063\u3068\u8aad\u3080 &raquo;<\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[16,18,36,52],"class_list":{"0":"post-715","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-eccube_report","7":"tag-ec-cube","8":"tag-ec-cube3","9":"tag-36","10":"tag-52"},"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.shiro8.net\/blog\/wp-json\/wp\/v2\/posts\/715","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.shiro8.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.shiro8.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.shiro8.net\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.shiro8.net\/blog\/wp-json\/wp\/v2\/comments?post=715"}],"version-history":[{"count":2,"href":"https:\/\/www.shiro8.net\/blog\/wp-json\/wp\/v2\/posts\/715\/revisions"}],"predecessor-version":[{"id":3697,"href":"https:\/\/www.shiro8.net\/blog\/wp-json\/wp\/v2\/posts\/715\/revisions\/3697"}],"wp:attachment":[{"href":"https:\/\/www.shiro8.net\/blog\/wp-json\/wp\/v2\/media?parent=715"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shiro8.net\/blog\/wp-json\/wp\/v2\/categories?post=715"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shiro8.net\/blog\/wp-json\/wp\/v2\/tags?post=715"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}