{"id":118,"date":"2014-10-13T13:47:42","date_gmt":"2014-10-13T08:47:42","guid":{"rendered":"http:\/\/developer.uz\/blog\/?p=118"},"modified":"2014-10-13T13:50:00","modified_gmt":"2014-10-13T08:50:00","slug":"migrate-yii","status":"publish","type":"post","link":"https:\/\/developer.uz\/blog\/migrate-yii\/","title":{"rendered":"\u041c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0432 Yii: \u043f\u043e\u0448\u0430\u0433\u043e\u0432\u0430\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f"},"content":{"rendered":"<p>\u041c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 &#8212; \u044d\u0442\u043e \u043d\u0435\u0437\u0430\u043c\u0435\u043d\u0438\u043c\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043f\u0440\u0438 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u0435 \u043d\u0430\u0434 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c. \u041a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043c\u0435\u043d\u044f\u0435\u0442 \u0447\u0442\u043e-\u0442\u043e \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u0411\u0414. \u041e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u043c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0435-\u0436\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u0441\u0432\u043e\u0435\u0439 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0431\u0430\u0437\u0435. \u041a\u0430\u043a\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043d\u0443\u0436\u043d\u043e \u0432\u043d\u0435\u0441\u0442\u0438? \u041a\u0430\u043a\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u044f \u0443\u0436\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u043b \u0432 \u0441\u0432\u043e\u0435\u0439 \u0431\u0430\u0437\u0435? \u0413\u0434\u0435 \u043d\u0430\u0439\u0442\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f, \u0447\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u043b \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u0411\u0414 \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442? \u0412\u0441\u044e \u0433\u043e\u043b\u043e\u0432\u043d\u0443\u044e \u0431\u043e\u043b\u044c \u043d\u0430 \u0441\u0435\u0431\u044f \u0432\u043e\u0437\u044c\u043c\u0435\u0442 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0439. \u0410 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438\u043c \u043f\u0440\u043e\u0449\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e. \u0413\u043b\u0430\u0432\u043d\u043e\u0435 \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438, \u0443\u0447\u0430\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438\u0441\u044c \u0438\u043c. <\/p>\n<ul>\n<li><strong>\u0428\u0430\u0433 1: \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u043a\u043e\u043d\u043d\u0435\u043a\u0442 \u043a \u0411\u0414<\/strong> &#8212; \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u0441\u044f \u0438\u0437 \u043a\u043e\u043d\u0441\u043e\u043b\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c protected\/config\/console.php , \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0432 \u0442\u0430\u043c \u043a\u043e\u043d\u043d\u0435\u043a\u0442 \u043a \u0431\u0430\u0437\u0435 \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 db\n<pre class=\"brush: php; title: \u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u043d\u0444\u0438\u0433\u0430; notranslate\" title=\"\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u043d\u0444\u0438\u0433\u0430\">\r\n'components'=&gt;array(\r\n\t\t'db'=&gt;array(\r\n\t\t\t'connectionString' =&gt; 'mysql:host=localhost;dbname=mydb',\r\n\t\t\t'emulatePrepare' =&gt; true,\r\n\t\t\t'username' =&gt; 'myuser',\r\n\t\t\t'password' =&gt; 'mypass',\r\n\t\t\t'charset' =&gt; 'utf8',\r\n\t\t),\r\n<\/pre>\n<p>\u041d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u0442\u043e, \u0447\u0442\u043e \u0434\u043b\u044f \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0439 \u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0439 \u043a\u043e\u043d\u043d\u0435\u043a\u0442 &#8212; \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0438\u0434\u0435\u044f! \u041c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0431\u0430\u0437\u0435 \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0442 \u0438\u043c\u0435\u043d\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u043e\u043c \u043a\u043e\u043d\u043d\u0435\u043a\u0442\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u0411\u0414. \u042d\u0442\u043e \u0432 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043c\u0435\u0440\u0435 \u0437\u0430\u0449\u0438\u0442\u0438\u0442 \u0431\u0430\u0437\u0443 \u0432 \u0441\u043b\u0443\u0447\u0430\u0438 \u043d\u0435\u0441\u0430\u043d\u043a\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0438\u0437 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.\n<\/li>\n<li><strong>\u0428\u0430\u0433 2: \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438<\/strong>. \u0423\u0434\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u044c\u0442\u0435\u0441\u044c \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0443 \u0432\u0430\u0441 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u0430\u043f\u043a\u0430  protected\/migrations \u0438 \u043e\u043d\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438. \u041f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0432 \u043f\u0430\u043f\u043a\u0443  protected \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0443\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nphp yiic migrate create &lt;name&gt;\r\n<\/pre>\n<p>yiic &#8212; \u044d\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b \u0432 \u043f\u0430\u043f\u043a\u0435 protected. \u0412\u043c\u0435\u0441\u0442\u043e &#171;name&#187; \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0438\u043c\u044f \u0434\u043b\u044f \u0441\u0432\u043e\u0435\u0439 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438. \u0412\u044b\u0431\u0438\u0440\u0430\u0439\u0442\u0435 \u0438\u043c\u044f, \u0433\u043e\u0432\u043e\u0440\u044f\u0449\u0435\u0435 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442 \u0432 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 &#171;create_my_table&#187; \u0438\u043b\u0438 &#171;add_name_in_user_table&#187;. \u0420\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u043d\u044b\u043c\u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u0430\u043c\u0438 \u0434\u043b\u044f \u0438\u043c\u0435\u043d\u0438 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043b\u0430\u0442\u0438\u043d\u0441\u043a\u0438\u0435 \u0431\u0443\u043a\u0432\u044b \u0438 \u0437\u043d\u0430\u043a \u043f\u043e\u0434\u0447\u0435\u0440\u043a\u0438\u0432\u0430\u043d\u0438\u044f. \u0412 \u0441\u043b\u0443\u0447\u0430\u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432 \u043f\u0430\u043f\u043a\u0435 protected\/migrations \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u043d\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0435\u0433\u043e \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u0432\u0435\u0440\u0441\u0438\u0439, \u0447\u0442\u043e\u0431\u044b \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0442\u043e\u0436\u0435 \u0435\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438.\n<\/li>\n<li><strong>\u0428\u0430\u0433 3: \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0432 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438<\/strong>. \u041f\u043e\u0441\u043b\u0435 \u043f\u0440\u043e\u0448\u043b\u043e\u0433\u043e \u0448\u0430\u0433\u0430 \u0443 \u0432\u0430\u0441 \u0432 \u043f\u0430\u043f\u043a\u0435 protected\/migrations \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u043a\u043b\u0430\u0441\u0441 \u0432\u0440\u043e\u0434\u0435 \u044d\u0442\u043e\u0433\u043e:\n<pre class=\"brush: php; title: \u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043b\u0430\u0441\u0441\u0430 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438; notranslate\" title=\"\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043b\u0430\u0441\u0441\u0430 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438\">\r\nClass m141013_082754_my_migrate extends CDbMigration\r\n{\r\n\tpublic function up()\r\n\t{\r\n\t}\r\n\r\n\tpublic function down()\r\n\t{\r\n\t\techo &quot;m141013_082754_my_migrate does not support migration down.\\n&quot;;\r\n\t\treturn false;\r\n\t}\r\n}\r\n<\/pre>\n<p>\u0412 \u043a\u043b\u0430\u0441\u0441\u0435 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0434\u0432\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u0430: up &#8212; \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438, \u0430 down &#8212; \u0432 \u0441\u043b\u0443\u0447\u0430\u0438 \u043e\u0442\u043a\u0430\u0442\u0430. \u0415\u0441\u043b\u0438 \u043e\u0442\u043a\u0430\u0442 \u043d\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u0435\u0442, \u043c\u0435\u0442\u043e\u0434 down \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u0435\u0440\u043d\u0443\u0442\u044c false<br \/>\n\u041f\u0438\u0448\u0435\u043c \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0435, \u0442\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043f\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044e \u0411\u0414, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0445\u043e\u0442\u0435\u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c. \u0414\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b: execute, insert, update, delete, createTable, renameTable, dropTable, truncateTable, addColumn, dropColumn, renameColumn, createIndex \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 CDbMigration. <\/p>\n<pre class=\"brush: php; title: \u041f\u0440\u0438\u043c\u0435\u0440 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b; notranslate\" title=\"\u041f\u0440\u0438\u043c\u0435\u0440 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b\">\r\npublic function up()\r\n\t{\r\n        $this-&gt;createTable('orders', array(\r\n            'id'           =&gt; 'pk',\r\n            'user_id'      =&gt; 'integer unsigned NOT NULL',\r\n            'order_number' =&gt; 'string',\r\n            'summa'        =&gt; 'money',\r\n            'status'       =&gt; 'integer',\r\n            'date_create'  =&gt; 'datetime',\r\n            'last_status_change'=&gt; 'datetime',\r\n        ));\r\n\t}\r\n\r\n\tpublic function down()\r\n\t{\r\n        $this-&gt;dropTable('orders');\r\n\t\treturn true;\r\n\t}\r\n<\/pre>\n<p>\u0414\u0443\u043c\u0430\u044e \u0432\u044b \u0437\u0430\u043c\u0435\u0442\u0438\u043b\u0438, \u0447\u0442\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0442\u0438\u043f\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430 SQL. \u042d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0439 \u043c\u043e\u0433 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0430 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0442\u0438\u043f\u0430\u0445 \u0431\u0430\u0437 \u0434\u0430\u043d\u043d\u044b\u0445. \u0412 Yii \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0442\u0438\u043f\u044b \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u044b:<\/p>\n<pre class=\"brush: plain; title: \u0434\u043b\u044f Mysql; notranslate\" title=\"\u0434\u043b\u044f Mysql\">\r\n\t'pk' =&gt; 'int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY',\r\n\t'string' =&gt; 'varchar(255)',\r\n\t'text' =&gt; 'text',\r\n\t'integer' =&gt; 'int(11)',\r\n\t'float' =&gt; 'float',\r\n\t'decimal' =&gt; 'decimal',\r\n\t'datetime' =&gt; 'datetime',\r\n\t'timestamp' =&gt; 'timestamp',\r\n\t'time' =&gt; 'time',\r\n\t'date' =&gt; 'date',\r\n\t'binary' =&gt; 'blob',\r\n\t'boolean' =&gt; 'tinyint(1)',\r\n\t'money' =&gt; 'decimal(19,4)',\r\n<\/pre>\n<p>\u041f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u043c\u044b \u043f\u0438\u0448\u0435\u043c &#187; &#8216;id&#8217; => &#8216;pk&#8217;,&#187; \u0438 \u0442\u043e\u0433\u0434\u0430 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0441\u0430\u043c \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442, \u0447\u0442\u043e \u0434\u043b\u044f Mysql \u044d\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u0430\u043a &#8216;int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY&#8217;, \u0430 \u0434\u043b\u044f Pgsql \u043a\u0430\u043a &#8216;serial NOT NULL PRIMARY KEY&#8217;. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u043e\u043b\u044f, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0432 \u0441\u0445\u0435\u043c\u0435, \u0432\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0434\u0443\u043c\u0430\u0442\u044c \u043e\u0431 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u0432\u0430\u0448\u0438\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 \u0441 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430\u043c\u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0411\u0414.\n<\/li>\n<li><strong>\u0428\u0430\u0433 4: \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044e<\/strong>. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nphp yiic migrate\r\n<\/pre>\n<\/li>\n<\/ul>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0441\u043b\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u0432\u0435\u0436\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0441 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f, \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u044d\u0442\u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0434\u043b\u044f \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0431\u0430\u0437\u044b. \u0421\u043e\u0433\u043b\u0430\u0441\u0438\u0442\u0435\u0441\u044c &#8212; \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e \u0438 \u043b\u0435\u0433\u043a\u043e.<br \/>\n\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u043a\u0430\u0442\u0438\u0442\u044c \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044e \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nphp yiic migrate down\r\n<\/pre>\n<p>\u0417\u0430 \u0440\u0430\u043c\u043a\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u043e\u0441\u0442\u0430\u043b\u0438\u0441\u044c \u0442\u0430\u043a\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043a\u0430\u043a redo, migrate to, mark \u0438 \u0434\u0440\u0443\u0433\u0438\u0435. \u0422\u0430\u043a \u0436\u0435 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u043d\u0435 \u0440\u0430\u0441\u043a\u0440\u044b\u0442\u0430 \u0442\u0435\u043c\u0430 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0439 \u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 safeUp safeDown. \u041d\u043e \u0442\u043e, \u0447\u0442\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0443\u0436\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0447\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044f\u043c\u0438 \u0438 \u043f\u043e\u043d\u044f\u0442\u044c, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0436\u0435 \u043e\u043d\u0438 \u0443\u0434\u043e\u0431\u043d\u044b.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 &#8212; \u044d\u0442\u043e \u043d\u0435\u0437\u0430\u043c\u0435\u043d\u0438\u043c\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043f\u0440\u0438 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u0435 \u043d\u0430\u0434 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c. \u041a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043c\u0435\u043d\u044f\u0435\u0442 \u0447\u0442\u043e-\u0442\u043e \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u0411\u0414. \u041e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u043c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0435-\u0436\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u0441\u0432\u043e\u0435\u0439 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0431\u0430\u0437\u0435. \u041a\u0430\u043a\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043d\u0443\u0436\u043d\u043e \u0432\u043d\u0435\u0441\u0442\u0438? \u041a\u0430\u043a\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u044f \u0443\u0436\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u043b \u0432 \u0441\u0432\u043e\u0435\u0439 \u0431\u0430\u0437\u0435? \u0413\u0434\u0435 \u043d\u0430\u0439\u0442\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f, \u0447\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u043b \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u0411\u0414 \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442? \u0412\u0441\u044e \u0433\u043e\u043b\u043e\u0432\u043d\u0443\u044e \u0431\u043e\u043b\u044c \u043d\u0430 \u0441\u0435\u0431\u044f \u0432\u043e\u0437\u044c\u043c\u0435\u0442 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[9],"tags":[12],"_links":{"self":[{"href":"https:\/\/developer.uz\/blog\/wp-json\/wp\/v2\/posts\/118"}],"collection":[{"href":"https:\/\/developer.uz\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developer.uz\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developer.uz\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.uz\/blog\/wp-json\/wp\/v2\/comments?post=118"}],"version-history":[{"count":4,"href":"https:\/\/developer.uz\/blog\/wp-json\/wp\/v2\/posts\/118\/revisions"}],"predecessor-version":[{"id":122,"href":"https:\/\/developer.uz\/blog\/wp-json\/wp\/v2\/posts\/118\/revisions\/122"}],"wp:attachment":[{"href":"https:\/\/developer.uz\/blog\/wp-json\/wp\/v2\/media?parent=118"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.uz\/blog\/wp-json\/wp\/v2\/categories?post=118"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.uz\/blog\/wp-json\/wp\/v2\/tags?post=118"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}