{"id":14229,"date":"2021-08-01T08:08:09","date_gmt":"1970-01-01T00:00:00","guid":{"rendered":"http:\/\/www.sejuku.net\/blog\/?p=14229"},"modified":"2024-05-06T11:40:04","modified_gmt":"2024-05-06T02:40:04","slug":"rails-migration%e5%ae%8c%e5%85%a8%e8%a7%a3%e8%aa%ac%ef%bc%81%e5%9f%ba%e7%a4%8e%e3%81%ae%e5%9f%ba%e7%a4%8e%e3%81%8b%e3%82%89%e7%90%86%e8%a7%a3%ef%bc%81","status":"publish","type":"post","link":"https:\/\/www.sejuku.net\/blog\/14229","title":{"rendered":"\u3010Rails\u5165\u9580\u3011\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u8a2d\u5b9a\u3059\u308brails db:migrate\u3092\u8aac\u660e\uff01"},"content":{"rendered":"<p><span style=\"color: #54a870;\"><strong>Ruby on Rails<\/strong><\/span>\uff08\u4ee5\u964d\u3001<span style=\"color: #54a870;\"><strong>rails<\/strong><\/span>\uff09\u3067Web\u30a2\u30d7\u30ea\u3092\u958b\u767a\u3057\u3066\u3044\u308b\u3068\u3001<span style=\"color: #54a870;\"><strong>bin\/rails db:migrate<\/strong><\/span>\u30b3\u30de\u30f3\u30c9\u3092\u3088\u304f\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<p>\u3057\u304b\u3057<\/p>\n<div style=\"padding: 10px 5px 10px 20px; margin-bottom: 20px; border: 2px solid #ffe4e2;\">\u30fb\u305d\u3082\u305d\u3082<span style=\"color: #54a870;\"><strong>migration<\/strong><\/span>\u3063\u3066\uff1f<br \/>\n\u30fb\u4f7f\u3044\u65b9\u304c\u3044\u307e\u3044\u3061\u5206\u304b\u3089\u306a\u3044&#8230;<br \/>\n\u30fb\u306a\u3093\u306e\u305f\u3081\u306b\u3042\u308b\u306e\uff1f<br \/>\n\u30fb\u30ed\u30fc\u30eb\u30d0\u30c3\u30af\uff08<span style=\"color: #54a870;\"><strong>rollback<\/strong><\/span>\uff09\u3068\u30c0\u30a6\u30f3\uff08<span style=\"color: #54a870;\"><strong>down<\/strong><\/span>\uff09\u306e\u9055\u3044\u304c\u7406\u89e3\u3067\u304d\u306a\u3044&#8230;\n<\/div>\n<p>\u306a\u3069\u3001\u69d8\u3005\u306a\u7591\u554f\u3084\u4e0d\u5b89\u3092\u62b1\u3048\u306a\u304c\u3089\u4f7f\u3063\u3066\u3044\u308b\u65b9\u3082\u3044\u3089\u3063\u3057\u3083\u308b\u3068\u601d\u3044\u307e\u3059\uff01<\/p>\n<p>\u305d\u3053\u3067\u4eca\u56de\u306f\u3001\u4ee5\u4e0b\u306e\u5185\u5bb9\u306b\u3064\u3044\u3066\u3001\u5b9f\u4f8b\u3092\u4ea4\u3048\u3066\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n<div style=\"padding: 10px 5px 10px 20px; margin-bottom: 20px; border: 2px solid #585858;\">\u30fbmigration\u3068\u306f<br \/>\n\u30fbmigration\u306e\u30e1\u30ea\u30c3\u30c8\u3068\u306f<br \/>\n\u30fbbin\/rails db:migrate\u30b3\u30de\u30f3\u30c9\u306e\u95a2\u9023\u30b3\u30de\u30f3\u30c9\u306e\u4f7f\u3044\u65b9\n<\/div>\n<p>\u305d\u308c\u3067\u306f\u884c\u3063\u3066\u307f\u307e\u3057\u3087\u3046\uff01<\/p>\n<h2>migration\u3068\u306f<\/h2>\n<p><span style=\"color: #339966;\"><strong>migration<\/strong><\/span>\uff08<span style=\"color: #339966;\"><strong>bin\/rails db:migrate<\/strong><\/span>\u30b3\u30de\u30f3\u30c9\uff09\u306f\u3001rails\u3067\u4f7f\u7528\u3059\u308b<span style=\"color: #ff0000;\"><strong>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u69cb\u9020\uff08\u30c6\u30fc\u30d6\u30eb\u3001\u30ab\u30e9\u30e0\uff09\u3092\u5909\u66f4\u3059\u308b\u3068\u304d\u306b\u5229\u7528\u3059\u308b\u6a5f\u80fd\u3067\u3059\u3002<\/strong><\/span><\/p>\n<p>migration\u306e\u5927\u307e\u304b\u306a\u6d41\u308c\u306f\u4ee5\u4e0b\u306e\u3068\u304a\u308a\u3067\u3059\u3002<\/p>\n<p>\uff081\uff09<span style=\"color: #54a870;\"><strong>migration\u30d5\u30a1\u30a4\u30eb<\/strong><\/span>\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<p>\uff082\uff09<span style=\"color: #54a870;\"><strong>bin\/rails db:migrate<\/strong><\/span>\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e2\u3064\u306e\u624b\u9806\u3092\u884c\u3046\u3068\u3001migration\u30d5\u30a1\u30a4\u30eb\u3067\u6307\u5b9a\u3057\u305f\u3068\u304a\u308a\u306b<span style=\"color: #254df2;\"><strong>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u69cb\u9020\u304c\u5909\u66f4\u3055\u308c\u307e\u3059\u3002<\/strong><\/span><\/p>\n<h3>migration\u306e\u30e1\u30ea\u30c3\u30c8\u3068\u306f<\/h3>\n<p>migration\u3092\u5229\u7528\u3057\u3066\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u69cb\u9020\u3092\u5909\u66f4\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30e1\u30ea\u30c3\u30c8\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<div style=\"padding: 10px 5px 10px 20px; margin-bottom: 20px; border: 2px solid #585858;\">\u30fbSQL\u6587\u3092\u66f8\u304b\u305a\u306b\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u69cb\u9020\u3092\u5909\u66f4\u3067\u304d\u308b<br \/>\n\u30fbmigration\u30d5\u30a1\u30a4\u30eb\u3092\u5171\u6709\u3059\u308b\u3053\u3068\u3067\u3001\u8907\u6570\u306e\u958b\u767a\u74b0\u5883\u3067\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u69cb\u9020\u3092\u7c21\u5358\u306b\u5171\u6709\u3067\u304d\u308b<br \/>\n\u30fb<span style=\"color: #339966;\"><strong>bin\/rails db:migrate:status<\/strong><\/span>\u30b3\u30de\u30f3\u30c9\u3067\u3001migration\u30d5\u30a1\u30a4\u30eb\u306e\u9069\u7528\u72b6\u6cc1\u3092\u78ba\u8a8d\u3067\u304d\u308b<br \/>\n\u30fb<span style=\"color: #339966;\"><strong>bin\/rails db:rollback<\/strong><\/span>\u30b3\u30de\u30f3\u30c9\u3067\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u69cb\u9020\u3092\u5c11\u3057\u524d\u306e\u72b6\u614b\u306b\u623b\u305b\u308b\n<\/div>\n<h2>migration\u3092\u7406\u89e3\u3059\u308b\u305f\u3081\u306brails\u306e\u958b\u767a\u74b0\u5883\u3092\u4f5c\u6210\u3059\u308b<\/h2>\n<p>migration\u306e\u52d5\u4f5c\u3092\u7406\u89e3\u3059\u308b\u305f\u3081\u306b\u3001rails\u306e\u958b\u767a\u74b0\u5883\u3092\u69cb\u7bc9\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>rails\u306e\u958b\u767a\u74b0\u5883\u306e\u69cb\u7bc9\u65b9\u6cd5\u306f\u3001\u4ee5\u4e0b\u306e\u8a18\u4e8b\u3067\u89e3\u8aac\u3057\u3066\u3044\u307e\u3059\u306e\u3067\u3001\u305c\u3072\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n            <a href=\"https:\/\/www.sejuku.net\/blog\/39936\" class=\"blog-card-anchor\">\n                <div class=\"blog-card\">\n                <div class=\"blog-card-content\">\n                    <div class=\"blog-card-thumbnail\">\n                    <img decoding=\"async\" class=\"blog-card-thumbnail-img\" src=\"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2017\/12\/ruby_on_rails-150x86.jpg\">\n                    <\/div>\n                    <div class=\"blog-card-title-wrap\">\n                    <div class=\"blog-card-title\">\u521d\u5fc3\u8005\u3067\u3082\u304b\u3093\u305f\u3093\uff01Ruby on Rails \u306e\u958b\u767a\u74b0\u5883\u306e\u69cb\u7bc9\u624b\u9806\uff08Mac\/Windows \u4e21\u5bfe\u5fdc\uff09<\/div>\n                    <div class=\"blog-card-update-date\">\u66f4\u65b0\u65e5\uff1a2024\u5e745\u67086\u65e5<\/div>\n                    <\/div>\n                <\/div>\n                <\/div>\n            <\/a>\n            \n<p>\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001<span style=\"color: #339966;\"><strong>app\/samurai\/migrate-demo<\/strong><\/span>\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u6210\u3057\u3066\u958b\u767a\u74b0\u5883\u3092\u69cb\u7bc9\u3057\u305f\u5834\u5408\u3092\u4f8b\u306b\u3001\u8aac\u660e\u3092\u7d9a\u3051\u307e\u3059\u3002<\/p>\n<h2>migration\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3059\u308b<\/h2>\n<p>migration\u30d5\u30a1\u30a4\u30eb\u306e\u4f5c\u6210\u65b9\u6cd5\u306b\u3064\u3044\u3066\u306f\u3001\u4ee5\u4e0b\u306e\u8a18\u4e8b\u3067\u8a73\u3057\u304f\u8aac\u660e\u3057\u3066\u3044\u307e\u3059\u306e\u3067\u3001\u305c\u3072\u3054\u89a7\u304f\u3060\u3055\u3044\uff01<\/p>\n            <a href=\"https:\/\/www.sejuku.net\/blog\/60950\" class=\"blog-card-anchor\">\n                <div class=\"blog-card\">\n                <div class=\"blog-card-content\">\n                    <div class=\"blog-card-thumbnail\">\n                    <img decoding=\"async\" class=\"blog-card-thumbnail-img\" src=\"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2018\/06\/rails_g_migration-150x86.jpg\">\n                    <\/div>\n                    <div class=\"blog-card-title-wrap\">\n                    <div class=\"blog-card-title\">\u3010Rails\u5165\u9580\u3011generate migration\u30b3\u30de\u30f3\u30c9\u306e\u5206\u304b\u308a\u3084\u3059\u3044\u307e\u3068\u3081<\/div>\n                    <div class=\"blog-card-update-date\">\u66f4\u65b0\u65e5\uff1a2024\u5e745\u67086\u65e5<\/div>\n                    <\/div>\n                <\/div>\n                <\/div>\n            <\/a>\n            \n<p>\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u30665\u3064\u306emigration\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u305f\u5834\u5408\u3092\u4f8b\u306b\u3001\u8aac\u660e\u3092\u7d9a\u3051\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true \" >bin\/rails generate migration CreateSample name:string\r\nbin\/rails generate migration AddStringColToSample\r\nbin\/rails generate migration RenameFromStringColToAddressOnSample\r\nbin\/rails generate migration RemoveAddressFromSample\r\nbin\/rails generate migration AddIntegerColToSample<\/pre>\n<p>\u4e0a\u8a18\u306e\u30b3\u30de\u30f3\u30c9\u3067\u4f5c\u6210\u3055\u308c\u305f5\u3064\u306emigration\u30d5\u30a1\u30a4\u30eb\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u7de8\u96c6\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h4>db\/migrate\/20180704015653_create_sample.rb<\/h4>\n<\/h4>\n<p>sample\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true \" >class CreateSample < ActiveRecord::Migration[5.1]\r\n  def change\r\n    create_table :samples do |t|\r\n      t.string :name\r\n    end\r\n  end\r\nend<\/pre>\n<p><span style=\"color: #f75959;\"><strong>\u203b\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306f\u5909\u66f4\u3057\u307e\u305b\u3093\u3002<\/strong><\/span><\/p>\n<h4>db\/migrate\/20180704015654_add_string_col_to_sample.rb<\/h4>\n<p>string_col\u30ab\u30e9\u30e0\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true \" >class AddStringColToSample < ActiveRecord::Migration[5.1]\r\n  def change\r\n    add_column :samples, :string_col, :string\r\n  end\r\nend<\/pre>\n<h4>db\/migrate\/20180704015655_rename_from_string_col_to_address_on_sample.rb<\/h4>\n<p>string_col\u30ab\u30e9\u30e0\u306e\u540d\u524d\u3092\u3001address\u30ab\u30e9\u30e0\u306b\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true \" >class RenameFromStringColToAddressOnSample < ActiveRecord::Migration[5.1]\r\n  def change\r\n    rename_column :samples, :string_col, :address\r\n  end\r\nend<\/pre>\n<h4>db\/migrate\/20180704015656_remove_address_from_sample.rb<\/h4>\n<p>address\u30ab\u30e9\u30e0\u3092\u524a\u9664\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true \" >class RemoveAddressFromSample < ActiveRecord::Migration[5.1]\r\n  def down\r\n    add_column :samples, :address, :string\r\n  end\r\n  def up\r\n    remove_column :samples, :address\r\n  end\r\nend<\/pre>\n<h4>db\/migrate\/20180704020017_add_integer_col_to_sample.rb<\/h4>\n<p>integer_col\u30ab\u30e9\u30e0\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true \" >class AddIntegerColToSample < ActiveRecord::Migration[5.1]\r\n  def change\r\n    add_column :samples, :integer_col, :integer\r\n  end\r\nend<\/pre>\n<h2>migration\u30d5\u30a1\u30a4\u30eb\u3092\u5b9f\u884c\u3059\u308b\uff08migrate\uff09<\/h2>\n<p>\u4f5c\u6210\u3057\u305fmigration\u30d5\u30a1\u30a4\u30eb\u3092\u5b9f\u884c\u3057\u307e\u3059\u304c\u3001\u305d\u306e\u524d\u306b\u3001\u3053\u306e\u6642\u70b9\u3067\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\uff08\u30c6\u30fc\u30d6\u30eb\uff09\u304c<span style=\"color: #f75959;\"><strong>\u4f5c\u6210\u3055\u308c\u3066\u3044\u306a\u3044\u3053\u3068\u3092\u78ba\u8a8d<\/strong><\/span>\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\uff081\uff09\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u30921\u884c\u305a\u3064\u9806\u756a\u306b\u5165\u529b\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true \" >bin\/rails dbconsole\r\n.tables<\/pre>\n<p>\u5b9f\u884c\u7d50\u679c\uff1a<br \/>\n<span style=\"color: #0000ff;\"><strong>\u8868\u793a\u306a\u3057<\/strong><\/span><\/p>\n<p>\u6b21\u306b\u3001\u3059\u3079\u3066\u306emigration\u30d5\u30a1\u30a4\u30eb\u3092\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u53cd\u6620\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\uff082\uff09\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u30921\u884c\u305a\u3064\u9806\u756a\u306b\u5165\u529b\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true \" >.exit\r\nbin\/rails db:migrate<\/pre>\n<p>\u5b9f\u884c\u7d50\u679c\uff1a<\/p>\n<pre class=\"striped:false marking:false ranges:false nums:false nums-toggle:false lang:default decode:true \" >== 20180704015653 CreateSample: migrating =====================================\r\n-- create_table(:samples)\r\n   -> 0.0041s\r\n== 20180704015653 CreateSample: migrated (0.0042s) ============================\r\n\r\n== 20180704015654 AddStringColToSample: migrating =============================\r\n-- add_column(:samples, :string_col, :string)\r\n   -> 0.0011s\r\n== 20180704015654 AddStringColToSample: migrated (0.0012s) ====================\r\n\r\n== 20180704015655 RenameFromStringColToAddressOnSample: migrating =============\r\n-- rename_column(:samples, :string_col, :address)\r\n   -> 0.0057s\r\n== 20180704015655 RenameFromStringColToAddressOnSample: migrated (0.0059s) ====\r\n\r\n== 20180704015656 RemoveAddressFromSample: migrating ==========================\r\n-- remove_column(:samples, :address)\r\n   -> 0.0054s\r\n== 20180704015656 RemoveAddressFromSample: migrated (0.0057s) =================\r\n\r\n== 20180704020017 AddIntegerColToSample: migrating ============================\r\n-- add_column(:samples, :integer_col, :integer)\r\n   -> 0.0009s\r\n== 20180704020017 AddIntegerColToSample: migrated (0.0010s) ===================<\/pre>\n<p>\u3059\u3079\u3066\u306emigration\u30d5\u30a1\u30a4\u30eb\u304c\u5b9f\u884c\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u6642\u70b9\u3067\u3001<span style=\"color: #254df2;\"><strong>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\uff08\u30c6\u30fc\u30d6\u30eb\uff09\u304c\u4f5c\u6210\u3055\u308c\u3066\u3044\u308b\u3053\u3068<\/strong><\/span>\u3068\u3001<span style=\"color: #254df2;\"><strong>\u30c6\u30fc\u30d6\u30eb\u306e\u30ab\u30e9\u30e0\u60c5\u5831<\/strong><\/span>\u3092\u78ba\u8a8d\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\uff083\uff09\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u30921\u884c\u305a\u3064\u9806\u756a\u306b\u5165\u529b\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true \" >bin\/rails dbconsole\r\n.tables<\/pre>\n<p>\u5b9f\u884c\u7d50\u679c\uff1a<\/p>\n<pre class=\"striped:false marking:false ranges:false nums:false nums-toggle:false lang:default decode:true \" >ar_internal_metadata  samples               schema_migrations<\/pre>\n<p>\uff084\uff09\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5165\u529b\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true \" >PRAGMA TABLE_INFO(samples);<\/pre>\n<p>\u5b9f\u884c\u7d50\u679c\uff1a<\/p>\n<pre class=\"striped:false marking:false ranges:false nums:false nums-toggle:false lang:default decode:true \" >0|id|integer|1||1\r\n1|name|varchar|0|NULL|0\r\n2|integer_col|integer|0||0<\/pre>\n<p>\u3053\u308c\u304c\u3059\u3079\u3066\u306emigration\u30d5\u30a1\u30a4\u30eb\u3092\u5b9f\u884c\u3057\u305f\u5834\u5408\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u69cb\u9020\u3067\u3059\u3002<\/p>\n<p>\uff085\uff09\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5165\u529b\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true \" >.exit<\/pre>\n<h3>migration\u30d5\u30a1\u30a4\u30eb\u3092\u9014\u4e2d\u307e\u3067\u53cd\u6620\u3059\u308b\uff08VERSION\uff09<\/h3>\n<p>\u4e0a\u306e\u624b\u9806\u3067\u306f\u3001\u3059\u3079\u3066\u306emigration\u30d5\u30a1\u30a4\u30eb\u304c\u53cd\u6620\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n<p>\u3053\u3053\u3067\u306f\u3001\uff08\u3059\u3079\u3066\u306emigration\u30d5\u30a1\u30a4\u30eb\u3067\u306f\u306a\u304f\uff09<span style=\"color: #254df2;\"><strong>\u9014\u4e2d\u306emigration\u30d5\u30a1\u30a4\u30eb\u307e\u3067\u306b\u9650\u5b9a\u3057\u3066\u53cd\u6620\u3059\u308b<\/strong><\/span>\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<p>bin\/rake db:migrate\u30b3\u30de\u30f3\u30c9\u306b\u3001\u300cVERSION=20180704015655\u300d\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u6307\u5b9a\u3057\u3066\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<p>\u307e\u305a\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b<span style=\"color: #54a870;\"><strong>\u300cVERSION=0\u300d<\/strong><\/span>\u3092\u6307\u5b9a\u3057\u3066\u3001\u3044\u3063\u305f\u3093\u3001\u3059\u3079\u3066\u306emigration\u30d5\u30a1\u30a4\u30eb\u3092\u672a\u53cd\u6620\u306e\u72b6\u614b\u306b\u623b\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\uff081\uff09\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5165\u529b\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true \" >bin\/rake db:migrate VERSION=0<\/pre>\n<p>\u5b9f\u884c\u7d50\u679c\uff1a<\/p>\n<pre class=\"striped:false marking:false ranges:false nums:false nums-toggle:false lang:default decode:true \" >Running via Spring preloader in process 5831\r\n== 20180704020017 AddIntegerColToSample: reverting ============================\r\n-- remove_column(:samples, :integer_col, :integer)\r\n   -> 0.0052s\r\n== 20180704020017 AddIntegerColToSample: reverted (0.0093s) ===================\r\n\r\n== 20180704015656 RemoveAddressFromSample: reverting ==========================\r\n-- add_column(:samples, :address, :string)\r\n   -> 0.0003s\r\n== 20180704015656 RemoveAddressFromSample: reverted (0.0004s) =================\r\n\r\n== 20180704015655 RenameFromStringColToAddressOnSample: reverting =============\r\n-- rename_column(:samples, :address, :string_col)\r\n   -> 0.0072s\r\n== 20180704015655 RenameFromStringColToAddressOnSample: reverted (0.0073s) ====\r\n\r\n== 20180704015654 AddStringColToSample: reverting =============================\r\n-- remove_column(:samples, :string_col, :string)\r\n   -> 0.0084s\r\n== 20180704015654 AddStringColToSample: reverted (0.0085s) ====================\r\n\r\n== 20180704015653 CreateSample: reverting =====================================\r\n-- drop_table(:samples)\r\n   -> 0.0014s\r\n== 20180704015653 CreateSample: reverted (0.0016s) ============================<\/pre>\n<p>\u6b21\u306b\u3001<span style=\"color: #54a870;\"><strong>20180704015655<\/strong><\/span>\uff08db\/migrate\/20180704015655_rename_from_string_col_to_address_on_sample.rb\uff1a<span style=\"color: #54a870;\"><strong>string_col<\/strong><\/span>\u30ab\u30e9\u30e0\u306e\u540d\u524d\u3092<span style=\"color: #54a870;\"><strong>address<\/strong><\/span>\u30ab\u30e9\u30e0\u306b\u5909\u66f4\u3059\u308b\uff09\u307e\u3067\u306emigration\u30d5\u30a1\u30a4\u30eb\u3092\u53cd\u6620\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\uff082\uff09\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5165\u529b\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true \" >bin\/rake db:migrate VERSION=20180704015655<\/pre>\n<p>\u5b9f\u884c\u7d50\u679c\uff1a<\/p>\n<pre class=\"striped:false marking:false ranges:false nums:false nums-toggle:false lang:default decode:true \" >Running via Spring preloader in process 5952\r\n== 20180704015653 CreateSample: migrating =====================================\r\n-- create_table(:samples)\r\n   -> 0.0016s\r\n== 20180704015653 CreateSample: migrated (0.0017s) ============================\r\n\r\n== 20180704015654 AddStringColToSample: migrating =============================\r\n-- add_column(:samples, :string_col, :string)\r\n   -> 0.0004s\r\n== 20180704015654 AddStringColToSample: migrated (0.0005s) ====================\r\n\r\n== 20180704015655 RenameFromStringColToAddressOnSample: migrating =============\r\n-- rename_column(:samples, :string_col, :address)\r\n   -> 0.0058s\r\n== 20180704015655 RenameFromStringColToAddressOnSample: migrated (0.0074s) ====<\/pre>\n<p>\u3053\u308c\u3067\u300120180704015655\u307e\u3067\u306emigration\u30d5\u30a1\u30a4\u30eb\u304c\u53cd\u6620\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n<p>samples\u30c6\u30fc\u30d6\u30eb\u306baddress\u30ab\u30e9\u30e0\u304c\u4f5c\u6210\u3055\u308c\u3066\u3044\u308b\u306f\u305a\u3067\u3059\u3002<\/p>\n<p>\u30c6\u30fc\u30d6\u30eb\u306e\u30ab\u30e9\u30e0\u60c5\u5831\u3092\u78ba\u8a8d\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\uff083\uff09\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u30921\u884c\u305a\u3064\u9806\u756a\u306b\u5165\u529b\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true \" >bin\/rails dbconsole\r\nPRAGMA TABLE_INFO(samples);<\/pre>\n<p>\u5b9f\u884c\u7d50\u679c\uff1a<\/p>\n<pre class=\"striped:false marking:false ranges:false nums:false nums-toggle:false lang:default decode:true \" >0|id|integer|1||1\r\n1|name|varchar|0|NULL|0\r\n2|address|varchar|0|NULL|0<\/pre>\n<p>\u78ba\u304b\u306binteger_col\u30ab\u30e9\u30e0\u3067\u306f\u306a\u304f\u3001address\u30ab\u30e9\u30e0\u304c\u3042\u308a\u307e\u3059\u306d\u3002<\/p>\n<p>\uff085\uff09\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5165\u529b\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true \" >.exit<\/pre>\n<h3>\u74b0\u5883\u3092\u6307\u5b9a\u3057\u3066\u5b9f\u884c\u3059\u308b\uff08RAILS_ENV\uff09<\/h3>\n<p>rails\u3067\u306f\u3001<span style=\"color: #54a870;\"><strong>config\/database.yml<\/strong><\/span>\u3067\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u74b0\u5883\u3092\u8a2d\u5b9a\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u3053\u3053\u307e\u3067\u306b\u8aac\u660e\u3057\u305fbin\/rails db:migrate\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001<span style=\"color: #54a870;\"><strong>development\u74b0\u5883<\/strong><\/span>\uff08db\/development.sqlite3\uff09\u306b\u5bfe\u3057\u3066migration\u30d5\u30a1\u30a4\u30eb\u304c\u5b9f\u884c\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>RAILS_ENV\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u6307\u5b9a\u3059\u308b\u3068\u3001<span style=\"color: #54a870;\"><strong>test\u74b0\u5883<\/strong><\/span>\uff08db\/test.sqlite3\uff09\u3084<span style=\"color: #54a870;\"><strong>production\u74b0\u5883<\/strong><\/span>\uff08db\/production.sqlite3\uff09\u306b\u5bfe\u3057\u3066migration\u30d5\u30a1\u30a4\u30eb\u3092\u5b9f\u884c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>test\u74b0\u5883\u306b\u5bfe\u3057\u3066\u5b9f\u884c\u3059\u308b\u5834\u5408\uff1a<\/p>\n<pre class=\"lang:ruby decode:true \" >bin\/rails db:migrate RAILS_ENV=test<\/pre>\n<p>production\u74b0\u5883\u306b\u5bfe\u3057\u3066\u5b9f\u884c\u3059\u308b\u5834\u5408\uff1a<\/p>\n<pre class=\"lang:ruby decode:true \" >bin\/rails db:migrate RAILS_ENV=production<\/pre>\n<h2>migration\u30d5\u30a1\u30a4\u30eb\u306e\u9069\u7528\u72b6\u614b\u3092\u78ba\u8a8d\u3059\u308b\uff08status\uff09<\/h2>\n<p>\u6b21\u306b\u3001migration\u30d5\u30a1\u30a4\u30eb\u306e\u9069\u7528\u72b6\u614b\u3092\u78ba\u8a8d\u3059\u308b\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u3053\u307e\u3067\u306e\u624b\u9806\u3092\u9806\u756a\u306b\u884c\u3063\u3066\u3044\u308c\u3070\u3001<span style=\"color: #254df2;\"><strong>20180704015655\u307e\u3067\u306emigration\u30d5\u30a1\u30a4\u30eb\u304c\u5b9f\u884c\u3055\u308c\u3066\u3044\u308b<\/strong><\/span>\u30cf\u30ba\u3067\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5165\u529b\u3057\u3066\u3001\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"lang:ruby decode:true \" >bin\/rake db:migrate:status<\/pre>\n<p>\u5b9f\u884c\u7d50\u679c\uff1a<\/p>\n<pre class=\"striped:false marking:false ranges:false nums:false nums-toggle:false lang:default decode:true \" >Running via Spring preloader in process 6564\r\n\r\ndatabase: \/home\/yazaki-mint\/app\/samurai\/migrate-demo\/db\/development.sqlite3\r\n\r\n Status   Migration ID    Migration Name\r\n--------------------------------------------------\r\n   up     20180704015653  Create sample\r\n   up     20180704015654  Add string col to sample\r\n   up     20180704015655  Rename from string col to address on sample\r\n  down    20180704015656  Remove address from sample\r\n  down    20180704020017  Add integer col to sample<\/pre>\n<p>Status\u6b04\u306b<span style=\"color: #254df2;\"><strong>\u300cup\u300d<\/strong><\/span>\u3068\u8868\u793a\u3055\u308c\u3066\u3044\u308bmigration\u30d5\u30a1\u30a4\u30eb\u306f\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u9069\u7528\u6e08\u307f\u3067\u3059\u3002<\/p>\n<p>\u4e00\u65b9\u3001Status\u6b04\u306b<span style=\"color: #f75959;\"><strong>\u300cdown\u300d<\/strong><\/span>\u3068\u8868\u793a\u3055\u308c\u3066\u3044\u308bmigration\u30d5\u30a1\u30a4\u30eb\u306f\u9069\u7528\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002<\/p>\n<p>\u3057\u305f\u304c\u3063\u3066\u3001\u4e0a\u306e\u5b9f\u884c\u7d50\u679c\u3067\u306f\u30015\u3064\u306emigration\u30d5\u30a1\u30a4\u30eb\u306e\u3046\u3061<span style=\"color: #254df2;\"><strong>3\u3064\u76ee\uff08Migration ID\uff1a20180704015655\uff09\u307e\u3067\u304c\u9069\u7528\u3055\u308c\u3066\u3044\u308b<\/strong><\/span>\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3059\u3002<\/p>\n<h2>\u7279\u5b9a\u306emigration\u30d5\u30a1\u30a4\u30eb\u3092\u5b9f\u884c\u3059\u308b\uff08up\/down\uff09<\/h2>\n<p>\u4ed6\u306emigration\u30d5\u30a1\u30a4\u30eb\u306e\u5b9f\u884c\u7d50\u679c\u306b\u5f71\u97ff\u3092\u53d7\u3051\u306a\u3044\u5834\u5408\u306f\u3001\u7279\u5b9a\u306emigration\u30d5\u30a1\u30a4\u30eb\u3092\u5b9f\u884c\u3057\u3066\u3082\u554f\u984c\u306a\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n<p>\u4eca\u56de\u306e\u4f8b\u3067\u306f\u30013\u3064\u76ee\u307e\u3067\u306emigration\u30d5\u30a1\u30a4\u30eb\u3092\u9069\u7528\u6e08\u307f\u306e\u3068\u304d\u306b\u30015\u3064\u76ee\uff08Migration ID\uff1a20180704020017\uff1ainteger_col\u30ab\u30e9\u30e0\u3092\u8ffd\u52a0\u3059\u308b\uff09\u3092\u9069\u7528\u3057\u305f\u308a\u3001\u5916\u3057\u305f\u308a\u3057\u3066\u3082<span style=\"color: #254df2;\"><strong>\u554f\u984c\u306a\u3044<\/strong><\/span>\u3067\u3057\u3087\u3046\u3002<\/p>\n<p>\u4e00\u65b9\u30013\u3064\u76ee\uff08Migration ID\uff1a20180704015655\uff1astring_col\u30ab\u30e9\u30e0\u306e\u540d\u524d\u3092\u3001address\u30ab\u30e9\u30e0\u306b\u5909\u66f4\u3059\u308b\uff09\u306f\u3001string_col\u30ab\u30e9\u30e0\u304c\u7121\u3044\u72b6\u614b\u3067\u5b9f\u884c\u3057\u3066\u3082\u3001\u5b9f\u884c\u3055\u308c\u307e\u305b\u3093\u3002<\/p>\n<p>3\u3064\u76ee\u306e\u3088\u3046\u306amigration\u30d5\u30a1\u30a4\u30eb\u306f\u3001\u4ed6\u306e\u30d5\u30a1\u30a4\u30eb\u306e\u5b9f\u884c\u7d50\u679c\u306b\u5f71\u97ff\u3092\u53d7\u3051\u307e\u3059\u306e\u3067\u3001<span style=\"color: #f75959;\"><strong>\u5358\u72ec\u3067\u5b9f\u884c\u3059\u308b\u3053\u3068\u306f\u907f\u3051\u307e\u3057\u3087\u3046\u3002<\/strong><\/span><\/p>\n<p>migration\u30d5\u30a1\u30a4\u30eb\u306f\u9806\u756a\u306b\u9069\u7528\u3059\u308b\u3053\u3068\u3092\u524d\u63d0\u306b\u4f5c\u6210\u3055\u308c\u308b\u3053\u3068\u304c\u591a\u3044\u305f\u3081\u3001\u5b89\u6613\u306b\u4e00\u90e8\u3060\u3051\u3092\u9069\u7528\u3057\u305f\u308a\u3001\u9006\u306b\u4e00\u90e8\u3060\u3051\u3092\u5916\u3057\u305f\u308a\u3059\u308b\u3079\u304d\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<p><span style=\"color: #ff0000; background-color: #ffff99;\"><strong>up\/down\u306f\u3001\u5f71\u97ff\u7bc4\u56f2\u3092\u5341\u5206\u306b\u691c\u8a0e\u3057\u305f\u3046\u3048\u3067\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/strong><\/span><\/p>\n<h3>migration\u30d5\u30a1\u30a4\u30eb\u306eup\u30e1\u30bd\u30c3\u30c9\u3092\u5b9f\u884c\u3059\u308b\uff08up\uff09<\/h3>\n<p>\u7279\u5b9a\u306emigration\u30d5\u30a1\u30a4\u30eb\u3060\u3051\u3092\u5b9f\u884c\u3059\u308b\u306b\u306f\u3001bin\/rails db:migrate:up\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u3053\u3067\u306f\u30015\u3064\u76ee\uff08Migration ID\uff1a20180704020017\uff1ainteger_col\u30ab\u30e9\u30e0\u3092\u8ffd\u52a0\u3059\u308b\uff09\u3060\u3051\u3092\u9069\u7528\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\uff081\uff09\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true \" >bin\/rails db:migrate:up VERSION=20180704020017<\/pre>\n<p>\u5b9f\u884c\u7d50\u679c\uff1a<\/p>\n<pre class=\"striped:false marking:false ranges:false nums:false nums-toggle:false lang:default decode:true \" >== 20180704020017 AddIntegerColToSample: migrating ============================\r\n-- add_column(:samples, :integer_col, :integer)\r\n   -> 0.0010s\r\n== 20180704020017 AddIntegerColToSample: migrated (0.0012s) ===================<\/pre>\n<p>migration\u30d5\u30a1\u30a4\u30eb\u306e\u9069\u7528\u72b6\u6cc1\u3092\u78ba\u8a8d\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\uff082\uff09\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true \" >bin\/rake db:migrate:status<\/pre>\n<p>\u5b9f\u884c\u7d50\u679c\uff1a<\/p>\n<pre class=\"striped:false marking:false ranges:false nums:false nums-toggle:false lang:default decode:true \" >Running via Spring preloader in process 6726\r\n\r\ndatabase: \/home\/yazaki-mint\/app\/samurai\/migrate-demo\/db\/development.sqlite3\r\n\r\n Status   Migration ID    Migration Name\r\n--------------------------------------------------\r\n   up     20180704015653  Create sample\r\n   up     20180704015654  Add string col to sample\r\n   up     20180704015655  Rename from string col to address on sample\r\n  down    20180704015656  Remove address from sample\r\n   up     20180704020017  Add integer col to sample<\/pre>\n<p>4\u3064\u76ee\u304c\u672a\u9069\u7528\uff08down\uff09\u306e\u307e\u307e\u30015\u3064\u76ee\uff08Migration ID\uff1a20180704020017\uff1ainteger_col\u30ab\u30e9\u30e0\u3092\u8ffd\u52a0\u3059\u308b\uff09\u304c\u9069\u7528\uff08up\uff09\u3055\u308c\u3066\u3044\u307e\u3059\u306d\u3002<\/p>\n<p>\u30c6\u30fc\u30d6\u30eb\u306e\u30ab\u30e9\u30e0\u60c5\u5831\u3092\u78ba\u8a8d\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\uff083\uff09\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u30921\u884c\u305a\u3064\u9806\u756a\u306b\u5165\u529b\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true \" >bin\/rails dbconsole\r\nPRAGMA TABLE_INFO(samples);<\/pre>\n<p>\u5b9f\u884c\u7d50\u679c\uff1a<\/p>\n<pre class=\"striped:false marking:false ranges:false nums:false nums-toggle:false lang:default decode:true \" >0|id|integer|1||1\r\n1|name|varchar|0|NULL|0\r\n2|address|varchar|0|NULL|0\r\n3|integer_col|integer|0||0<\/pre>\n<p>\u78ba\u304b\u306b<span style=\"color: #254df2;\"><strong>address\u30ab\u30e9\u30e0\u3068integer_col\u30ab\u30e9\u30e0\u306e\u4e21\u65b9\u304c\u3042\u308a\u307e\u3059\u306d\u3002<\/strong><\/span><\/p>\n<p>\uff084\uff09\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5165\u529b\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true \" >.exit<\/pre>\n<h3>migration\u30d5\u30a1\u30a4\u30eb\u306edown\u30e1\u30bd\u30c3\u30c9\u3092\u5b9f\u884c\u3059\u308b\uff08down\uff09<\/h3>\n<p>\u4eca\u5ea6\u306f\u30015\u3064\u76ee\uff08Migration ID\uff1a20180704020017\uff1ainteger_col\u30ab\u30e9\u30e0\u3092\u8ffd\u52a0\u3059\u308b\uff09\u3060\u3051\u3092\u5916\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u7279\u5b9a\u306emigration\u30d5\u30a1\u30a4\u30eb\u3060\u3051\u3092\u5916\u3059\u306b\u306f\u3001bin\/rails db:migrate:down\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<p>\uff081\uff09\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true \" >bin\/rails db:migrate:down VERSION=20180704020017<\/pre>\n<p>\u5b9f\u884c\u7d50\u679c\uff1a<\/p>\n<pre class=\"striped:false marking:false ranges:false nums:false nums-toggle:false lang:default decode:true \" >== 20180704020017 AddIntegerColToSample: reverting ============================\r\n-- remove_column(:samples, :integer_col, :integer)\r\n   -> 0.0060s\r\n== 20180704020017 AddIntegerColToSample: reverted (0.0078s) ===================<\/pre>\n<p>migration\u30d5\u30a1\u30a4\u30eb\u306e\u9069\u7528\u72b6\u6cc1\u3092\u78ba\u8a8d\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\uff082\uff09\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true \" >bin\/rake db:migrate:status<\/pre>\n<p>\u5b9f\u884c\u7d50\u679c\uff1a<\/p>\n<pre class=\"striped:false marking:false ranges:false nums:false nums-toggle:false lang:default decode:true \" >Running via Spring preloader in process 6860\r\n\r\ndatabase: \/home\/yazaki-mint\/app\/samurai\/migrate-demo\/db\/development.sqlite3\r\n\r\n Status   Migration ID    Migration Name\r\n--------------------------------------------------\r\n   up     20180704015653  Create sample\r\n   up     20180704015654  Add string col to sample\r\n   up     20180704015655  Rename from string col to address on sample\r\n  down    20180704015656  Remove address from sample\r\n  down    20180704020017  Add integer col to sample<\/pre>\n<p>5\u3064\u76ee\uff08Migration ID\uff1a20180704020017\uff1ainteger_col\u30ab\u30e9\u30e0\u3092\u8ffd\u52a0\u3059\u308b\uff09\u304c\u5916\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n<p>\u30c6\u30fc\u30d6\u30eb\u306e\u30ab\u30e9\u30e0\u60c5\u5831\u3092\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\uff083\uff09\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u30921\u884c\u305a\u3064\u9806\u756a\u306b\u5165\u529b\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true \" >bin\/rails dbconsole\r\nPRAGMA TABLE_INFO(samples);<\/pre>\n<p>\u5b9f\u884c\u7d50\u679c\uff1a<\/p>\n<pre class=\"striped:false marking:false ranges:false nums:false nums-toggle:false lang:default decode:true \" >0|id|integer|1||1\r\n1|name|varchar|0|NULL|0\r\n2|address|varchar|0|NULL|0<\/pre>\n<p><span style=\"color: #254df2;\"><strong>address\u30ab\u30e9\u30e0\u306f\u3042\u308a\u307e\u3059\u304c\u3001integer_col\u30ab\u30e9\u30e0\u304c\u524a\u9664\u3055\u308c\u3066\u3044\u307e\u3059\u3002<br \/>\n<\/strong><\/span><br \/>\n\uff084\uff09\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5165\u529b\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true \" >.exit<\/pre>\n<h2>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u4e00\u5ea6\u524a\u9664\u3057\u3066\u521d\u671f\u5316\u3059\u308b\uff08reset\uff09<\/h2>\n<p>migration\u30d5\u30a1\u30a4\u30eb\u304c\u5897\u3048\u3066\u304d\u305f\u308a\u3001up\/down\u3067\u7de8\u96c6\u3059\u308b\u3053\u3068\u304c\u591a\u304f\u306a\u3063\u305f\u3068\u304d\u306f\u3001<span style=\"color: #54a870;\"><strong>\u518d\u73fe\u6027<\/strong><\/span>\uff08\u51aa\u7b49\u6027\uff1a\u3079\u304d\u3068\u3046\u305b\u3044\uff09\u3092\u78ba\u8a8d\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u518d\u73fe\u6027\u3092\u78ba\u8a8d\u3059\u308b\u305f\u3081\u306b\u306f\u3001<span style=\"color: #254df2;\"><strong>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u4e00\u5ea6\u524a\u9664\u3057\u3066\u304b\u3089\u3001\u3059\u3079\u3066\u306emigration\u30d5\u30a1\u30a4\u30eb\u3092\u9069\u7528\u3057\u3066\u3001\u5b9f\u884c\u7d50\u679c\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/strong><\/span><\/p>\n<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u4e00\u5ea6\u524a\u9664\u3057\u305f\u308a\u518d\u9069\u7528\u3057\u305f\u308a\u3068\u3044\u3063\u305f\u4f5c\u696d\u304c\u5927\u5909\u305d\u3046\u306a\u30a4\u30e1\u30fc\u30b8\u3067\u3059\u304c\u3001rails\u3067\u306fbin\/rails db:migrate:reset\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3060\u3051\u3067\u3059\u3002<\/p>\n<p>\uff081\uff09\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5165\u529b\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true \" >bin\/rails db:migrate:reset<\/pre>\n<p>\u5b9f\u884c\u7d50\u679c\uff1a<\/p>\n<pre class=\"striped:false marking:false ranges:false nums:false nums-toggle:false lang:default decode:true \" >Running via Spring preloader in process 6963\r\nDropped database 'db\/development.sqlite3'\r\nDropped database 'db\/test.sqlite3'\r\nCreated database 'db\/development.sqlite3'\r\nCreated database 'db\/test.sqlite3'\r\n== 20180704015653 CreateSample: migrating =====================================\r\n-- create_table(:samples)\r\n   -> 0.0007s\r\n== 20180704015653 CreateSample: migrated (0.0008s) ============================\r\n\r\n== 20180704015654 AddStringColToSample: migrating =============================\r\n-- add_column(:samples, :string_col, :string)\r\n   -> 0.0007s\r\n== 20180704015654 AddStringColToSample: migrated (0.0008s) ====================\r\n\r\n== 20180704015655 RenameFromStringColToAddressOnSample: migrating =============\r\n-- rename_column(:samples, :string_col, :address)\r\n   -> 0.0161s\r\n== 20180704015655 RenameFromStringColToAddressOnSample: migrated (0.0162s) ====\r\n\r\n== 20180704015656 RemoveAddressFromSample: migrating ==========================\r\n-- remove_column(:samples, :address)\r\n   -> 0.0079s\r\n== 20180704015656 RemoveAddressFromSample: migrated (0.0081s) =================\r\n\r\n== 20180704020017 AddIntegerColToSample: migrating ============================\r\n-- add_column(:samples, :integer_col, :integer)\r\n   -> 0.0004s\r\n== 20180704020017 AddIntegerColToSample: migrated (0.0004s) ===================<\/pre>\n<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u69cb\u9020\u304c\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u308b\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<p>\u305c\u3072\u78ba\u8a8d\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"striped:false marking:false ranges:false nums:false nums-toggle:false lang:default decode:true \" >0|id|integer|1||1\r\n1|name|varchar|0|NULL|0\r\n2|integer_col|integer|0||0<\/pre>\n<h2>\u30ed\u30fc\u30eb\u30d0\u30c3\u30af\u3059\u308b\uff08rollback\uff09<\/h2>\n<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u69cb\u9020\u3092\u524d\u306e\u72b6\u614b\u306b\u623b\u3059\u3053\u3068\u3092\u3001<span style=\"color: #339966;\"><strong>\u30ed\u30fc\u30eb\u30d0\u30c3\u30af\u3059\u308b<\/strong><\/span>\u3068\u8a00\u3044\u307e\u3059\u3002<\/p>\n<p>migration\u3092\u5229\u7528\u3057\u3066\u3044\u308c\u3070\u3001bin\/rails db:rollback\u3092\u4f7f\u7528\u3059\u308b\u3060\u3051\u3067\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u69cb\u9020\u3092\u4e00\u3064\u524d\u306e\u72b6\u614b\u306b\u623b\u305b\u307e\u3059\u3002<\/p>\n<p>migration\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u305f\u3068\u304d\u306b\u3001bin\/rails db:migrate\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u5fc5\u8981\u304c\u3042\u3063\u305f\u3088\u3046\u306b\u3001\u30ed\u30fc\u30eb\u30d0\u30c3\u30af\u3059\u308b\u3068\u304d\u3082\u5c02\u7528\u30b3\u30de\u30f3\u30c9\uff08bin\/rails db:rollback\u30b3\u30de\u30f3\u30c9\uff09\u3092\u5b9f\u884c\u3059\u308b\u3068\u8a00\u3046\u308f\u3051\u3067\u3059\u3002<\/p>\n<p>\u306a\u304a\u3001\u4e0d\u8981\u306b\u601d\u3048\u308bmigratoin\u30d5\u30a1\u30a4\u30eb\u306f\u30ed\u30fc\u30eb\u30d0\u30c3\u30af\u306b\u4f7f\u7528\u3055\u308c\u307e\u3059\u306e\u3067\u3001<span style=\"color: #f75959;\"><strong>\u30ed\u30fc\u30eb\u30d0\u30c3\u30af\u304c\u5b8c\u4e86\u3057\u305f\u3089\u524a\u9664\u3057\u307e\u3057\u3087\u3046\u3002<\/strong><\/span><\/p>\n<p>\uff081\uff09\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true \" >bin\/rails db:rollback<\/pre>\n<pre class=\"striped:false marking:false ranges:false nums:false nums-toggle:false lang:default decode:true \" >== 20180704020017 AddIntegerColToSample: reverting ============================\r\n-- remove_column(:samples, :integer_col, :integer)\r\n   -> 0.0049s\r\n== 20180704020017 AddIntegerColToSample: reverted (0.0069s) ===================<\/pre>\n<p>migration\u30d5\u30a1\u30a4\u30eb\u306e\u9069\u7528\u72b6\u6cc1\u3092\u78ba\u8a8d\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\uff082\uff09\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true \" >bin\/rake db:migrate:status<\/pre>\n<p>\u5b9f\u884c\u7d50\u679c\uff1a<\/p>\n<pre class=\"striped:false marking:false ranges:false nums:false nums-toggle:false lang:default decode:true \" >Running via Spring preloader in process 7092\r\n\r\ndatabase: \/home\/yazaki-mint\/app\/samurai\/migrate-demo\/db\/development.sqlite3\r\n\r\n Status   Migration ID    Migration Name\r\n--------------------------------------------------\r\n   up     20180704015653  Create sample\r\n   up     20180704015654  Add string col to sample\r\n   up     20180704015655  Rename from string col to address on sample\r\n   up     20180704015656  Remove address from sample\r\n  down    20180704020017  Add integer col to sample<\/pre>\n<h2>\u307e\u3068\u3081<\/h2>\n<p>\u4eca\u56de\u306f\u3001<span style=\"color: #54a870;\"><strong>migration\uff08bin\/rails db:migrate\u30b3\u30de\u30f3\u30c9\uff09<\/strong><\/span>\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>migration\u306f\u3001<span style=\"color: #0000ff;\"><strong>SQL\u6587\u3092\u66f8\u304b\u305a\u306b\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u69cb\u9020\u3092\u5909\u66f4\u3057\u305f\u308a\u3001\u5143\u306b\u623b\u3057\u305f\u308a\u3067\u304d\u308b<\/strong><\/span>\u3001\u975e\u5e38\u306b\u4fbf\u5229\u306a\u6a5f\u80fd\u3067\u3042\u308b\u3053\u3068\u304c\u308f\u304b\u3063\u3066\u3044\u305f\u3060\u3051\u305f\u3067\u3057\u3087\u3046\u304b\uff1f<\/p>\n<p>\u305c\u3072\u3053\u306e\u8a18\u4e8b\u3092\u53c2\u8003\u306b\u4f7f\u3063\u3066\u307f\u3066\u304f\u3060\u3055\u3044\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ruby on Rails\uff08\u4ee5\u964d\u3001rails\uff09\u3067Web\u30a2\u30d7\u30ea\u3092\u958b\u767a\u3057\u3066\u3044\u308b\u3068\u3001bin\/rails db:migrate\u30b3\u30de\u30f3\u30c9\u3092\u3088\u304f\u4f7f\u3044\u307e\u3059\u3002 \u3057\u304b\u3057 \u30fb\u305d\u3082\u305d\u3082migration\u3063\u3066\uff1f \u30fb\u4f7f\u3044\u65b9\u304c\u3044\u307e\u3044\u3061\u5206\u304b\u3089\u306a\u3044&#038;# [&hellip;]<\/p>\n","protected":false},"author":16433,"featured_media":62247,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"swell_btn_cv_data":"","footnotes":""},"categories":[2352],"tags":[],"class_list":["post-14229","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ruby-study"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>\u3010Rails\u5165\u9580\u3011\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u8a2d\u5b9a\u3059\u308brails db:migrate\u3092\u8aac\u660e\uff01 | \u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0<\/title>\n<meta name=\"description\" content=\"\u3053\u306e\u8a18\u4e8b\u3067\u306f\u300c \u3010Rails\u5165\u9580\u3011\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u8a2d\u5b9a\u3059\u308brails db:migrate\u3092\u8aac\u660e\uff01 \u300d\u306b\u3064\u3044\u3066\u3001\u8ab0\u3067\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u306b\u89e3\u8aac\u3057\u307e\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3092\u8aad\u3081\u3070\u3001\u3042\u306a\u305f\u306e\u60a9\u307f\u304c\u89e3\u6c7a\u3059\u308b\u3060\u3051\u3058\u3083\u306a\u304f\u3001\u65b0\u305f\u306a\u6c17\u4ed8\u304d\u3082\u767a\u898b\u3067\u304d\u308b\u3053\u3068\u3067\u3057\u3087\u3046\u3002\u304a\u60a9\u307f\u306e\u65b9\u306f\u305c\u3072\u3054\u4e00\u8aad\u304f\u3060\u3055\u3044\u3002\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.sejuku.net\/blog\/14229\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u3010Rails\u5165\u9580\u3011\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u8a2d\u5b9a\u3059\u308brails db:migrate\u3092\u8aac\u660e\uff01 | \u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0\" \/>\n<meta property=\"og:description\" content=\"\u3053\u306e\u8a18\u4e8b\u3067\u306f\u300c \u3010Rails\u5165\u9580\u3011\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u8a2d\u5b9a\u3059\u308brails db:migrate\u3092\u8aac\u660e\uff01 \u300d\u306b\u3064\u3044\u3066\u3001\u8ab0\u3067\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u306b\u89e3\u8aac\u3057\u307e\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3092\u8aad\u3081\u3070\u3001\u3042\u306a\u305f\u306e\u60a9\u307f\u304c\u89e3\u6c7a\u3059\u308b\u3060\u3051\u3058\u3083\u306a\u304f\u3001\u65b0\u305f\u306a\u6c17\u4ed8\u304d\u3082\u767a\u898b\u3067\u304d\u308b\u3053\u3068\u3067\u3057\u3087\u3046\u3002\u304a\u60a9\u307f\u306e\u65b9\u306f\u305c\u3072\u3054\u4e00\u8aad\u304f\u3060\u3055\u3044\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sejuku.net\/blog\/14229\" \/>\n<meta property=\"og:site_name\" content=\"\u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/sejuku2013\" \/>\n<meta property=\"article:published_time\" content=\"1970-01-01T00:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-05-06T02:40:04+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2018\/07\/rails_db_migrate1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"700\" \/>\n\t<meta property=\"og:image:height\" content=\"400\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"\u4f8d\u30c6\u30c3\u30af\u7de8\u96c6\u90e8\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@samuraijuku\" \/>\n<meta name=\"twitter:site\" content=\"@samuraijuku\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/14229#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/14229\"},\"author\":{\"name\":\"\u4f8d\u30c6\u30c3\u30af\u7de8\u96c6\u90e8\",\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/#\\\/schema\\\/person\\\/d20c57b59dba15001519a8a671183095\"},\"headline\":\"\u3010Rails\u5165\u9580\u3011\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u8a2d\u5b9a\u3059\u308brails db:migrate\u3092\u8aac\u660e\uff01\",\"datePublished\":\"1970-01-01T00:00:00+00:00\",\"dateModified\":\"2024-05-06T02:40:04+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/14229\"},\"wordCount\":306,\"publisher\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/14229#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/07\\\/rails_db_migrate1.jpg\",\"articleSection\":[\"Ruby\u5b66\u7fd2\"],\"inLanguage\":\"ja\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/14229\",\"url\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/14229\",\"name\":\"\u3010Rails\u5165\u9580\u3011\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u8a2d\u5b9a\u3059\u308brails db:migrate\u3092\u8aac\u660e\uff01 | \u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/14229#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/14229#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/07\\\/rails_db_migrate1.jpg\",\"datePublished\":\"1970-01-01T00:00:00+00:00\",\"dateModified\":\"2024-05-06T02:40:04+00:00\",\"description\":\"\u3053\u306e\u8a18\u4e8b\u3067\u306f\u300c \u3010Rails\u5165\u9580\u3011\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u8a2d\u5b9a\u3059\u308brails db:migrate\u3092\u8aac\u660e\uff01 \u300d\u306b\u3064\u3044\u3066\u3001\u8ab0\u3067\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u306b\u89e3\u8aac\u3057\u307e\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3092\u8aad\u3081\u3070\u3001\u3042\u306a\u305f\u306e\u60a9\u307f\u304c\u89e3\u6c7a\u3059\u308b\u3060\u3051\u3058\u3083\u306a\u304f\u3001\u65b0\u305f\u306a\u6c17\u4ed8\u304d\u3082\u767a\u898b\u3067\u304d\u308b\u3053\u3068\u3067\u3057\u3087\u3046\u3002\u304a\u60a9\u307f\u306e\u65b9\u306f\u305c\u3072\u3054\u4e00\u8aad\u304f\u3060\u3055\u3044\u3002\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/14229#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/14229\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/14229#primaryimage\",\"url\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/07\\\/rails_db_migrate1.jpg\",\"contentUrl\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/07\\\/rails_db_migrate1.jpg\",\"width\":700,\"height\":400},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/14229#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u3010Rails\u5165\u9580\u3011\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u8a2d\u5b9a\u3059\u308brails db:migrate\u3092\u8aac\u660e\uff01\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/\",\"name\":\"\u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0\",\"description\":\"\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u5b66\u7fd2\u306e\u3059\u3079\u3066\u304c\u30b3\u30b3\u306b\u3002\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ja\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/#organization\",\"name\":\"\u682a\u5f0f\u4f1a\u793eSAMURAI\",\"url\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/logo.png\",\"contentUrl\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/logo.png\",\"width\":600,\"height\":600,\"caption\":\"\u682a\u5f0f\u4f1a\u793eSAMURAI\"},\"image\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/sejuku2013\",\"https:\\\/\\\/x.com\\\/samuraijuku\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCCFOQO5aDK0xXam4cUQXT8g\\\/featured\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/#\\\/schema\\\/person\\\/d20c57b59dba15001519a8a671183095\",\"name\":\"\u4f8d\u30c6\u30c3\u30af\u7de8\u96c6\u90e8\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d91ed20aaa7f873a0f4f35586561303460c1e3864746dddb6ebe0fb093c1952d?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d91ed20aaa7f873a0f4f35586561303460c1e3864746dddb6ebe0fb093c1952d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d91ed20aaa7f873a0f4f35586561303460c1e3864746dddb6ebe0fb093c1952d?s=96&d=mm&r=g\",\"caption\":\"\u4f8d\u30c6\u30c3\u30af\u7de8\u96c6\u90e8\"},\"description\":\"\u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u587e\u306f\u300c\u4eba\u751f\u3092\u5909\u3048\u308b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u5b66\u7fd2\u300d\u3092\u30b3\u30f3\u30bb\u30f3\u30d7\u30c8\u306b\u3001\u904e\u53bb\u591a\u304f\u306e\u30d5\u30ea\u30fc\u30e9\u30f3\u30b9\u30a8\u30f3\u30b8\u30cb\u30a2\u3092\u8f29\u51fa\u3057\u305f\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30b9\u30af\u30fc\u30eb\u3067\u3059\u3002\u4f8d\u30c6\u30c3\u30af\u7de8\u96c6\u90e8\u3067\u306f\u6280\u8853\u7cfb\u30b3\u30f3\u30c6\u30f3\u30c4\u3092\u4e2d\u5fc3\u306b\u6709\u7528\u306a\u60c5\u5831\u3092\u767a\u4fe1\u3057\u3066\u3044\u304d\u307e\u3059\u3002\",\"url\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/author\\\/samurai-tech\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u3010Rails\u5165\u9580\u3011\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u8a2d\u5b9a\u3059\u308brails db:migrate\u3092\u8aac\u660e\uff01 | \u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0","description":"\u3053\u306e\u8a18\u4e8b\u3067\u306f\u300c \u3010Rails\u5165\u9580\u3011\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u8a2d\u5b9a\u3059\u308brails db:migrate\u3092\u8aac\u660e\uff01 \u300d\u306b\u3064\u3044\u3066\u3001\u8ab0\u3067\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u306b\u89e3\u8aac\u3057\u307e\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3092\u8aad\u3081\u3070\u3001\u3042\u306a\u305f\u306e\u60a9\u307f\u304c\u89e3\u6c7a\u3059\u308b\u3060\u3051\u3058\u3083\u306a\u304f\u3001\u65b0\u305f\u306a\u6c17\u4ed8\u304d\u3082\u767a\u898b\u3067\u304d\u308b\u3053\u3068\u3067\u3057\u3087\u3046\u3002\u304a\u60a9\u307f\u306e\u65b9\u306f\u305c\u3072\u3054\u4e00\u8aad\u304f\u3060\u3055\u3044\u3002","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.sejuku.net\/blog\/14229","og_locale":"ja_JP","og_type":"article","og_title":"\u3010Rails\u5165\u9580\u3011\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u8a2d\u5b9a\u3059\u308brails db:migrate\u3092\u8aac\u660e\uff01 | \u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0","og_description":"\u3053\u306e\u8a18\u4e8b\u3067\u306f\u300c \u3010Rails\u5165\u9580\u3011\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u8a2d\u5b9a\u3059\u308brails db:migrate\u3092\u8aac\u660e\uff01 \u300d\u306b\u3064\u3044\u3066\u3001\u8ab0\u3067\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u306b\u89e3\u8aac\u3057\u307e\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3092\u8aad\u3081\u3070\u3001\u3042\u306a\u305f\u306e\u60a9\u307f\u304c\u89e3\u6c7a\u3059\u308b\u3060\u3051\u3058\u3083\u306a\u304f\u3001\u65b0\u305f\u306a\u6c17\u4ed8\u304d\u3082\u767a\u898b\u3067\u304d\u308b\u3053\u3068\u3067\u3057\u3087\u3046\u3002\u304a\u60a9\u307f\u306e\u65b9\u306f\u305c\u3072\u3054\u4e00\u8aad\u304f\u3060\u3055\u3044\u3002","og_url":"https:\/\/www.sejuku.net\/blog\/14229","og_site_name":"\u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0","article_publisher":"https:\/\/www.facebook.com\/sejuku2013","article_published_time":"1970-01-01T00:00:00+00:00","article_modified_time":"2024-05-06T02:40:04+00:00","og_image":[{"width":700,"height":400,"url":"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2018\/07\/rails_db_migrate1.jpg","type":"image\/jpeg"}],"author":"\u4f8d\u30c6\u30c3\u30af\u7de8\u96c6\u90e8","twitter_card":"summary_large_image","twitter_creator":"@samuraijuku","twitter_site":"@samuraijuku","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.sejuku.net\/blog\/14229#article","isPartOf":{"@id":"https:\/\/www.sejuku.net\/blog\/14229"},"author":{"name":"\u4f8d\u30c6\u30c3\u30af\u7de8\u96c6\u90e8","@id":"https:\/\/www.sejuku.net\/blog\/#\/schema\/person\/d20c57b59dba15001519a8a671183095"},"headline":"\u3010Rails\u5165\u9580\u3011\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u8a2d\u5b9a\u3059\u308brails db:migrate\u3092\u8aac\u660e\uff01","datePublished":"1970-01-01T00:00:00+00:00","dateModified":"2024-05-06T02:40:04+00:00","mainEntityOfPage":{"@id":"https:\/\/www.sejuku.net\/blog\/14229"},"wordCount":306,"publisher":{"@id":"https:\/\/www.sejuku.net\/blog\/#organization"},"image":{"@id":"https:\/\/www.sejuku.net\/blog\/14229#primaryimage"},"thumbnailUrl":"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2018\/07\/rails_db_migrate1.jpg","articleSection":["Ruby\u5b66\u7fd2"],"inLanguage":"ja"},{"@type":"WebPage","@id":"https:\/\/www.sejuku.net\/blog\/14229","url":"https:\/\/www.sejuku.net\/blog\/14229","name":"\u3010Rails\u5165\u9580\u3011\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u8a2d\u5b9a\u3059\u308brails db:migrate\u3092\u8aac\u660e\uff01 | \u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0","isPartOf":{"@id":"https:\/\/www.sejuku.net\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.sejuku.net\/blog\/14229#primaryimage"},"image":{"@id":"https:\/\/www.sejuku.net\/blog\/14229#primaryimage"},"thumbnailUrl":"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2018\/07\/rails_db_migrate1.jpg","datePublished":"1970-01-01T00:00:00+00:00","dateModified":"2024-05-06T02:40:04+00:00","description":"\u3053\u306e\u8a18\u4e8b\u3067\u306f\u300c \u3010Rails\u5165\u9580\u3011\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u8a2d\u5b9a\u3059\u308brails db:migrate\u3092\u8aac\u660e\uff01 \u300d\u306b\u3064\u3044\u3066\u3001\u8ab0\u3067\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u306b\u89e3\u8aac\u3057\u307e\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3092\u8aad\u3081\u3070\u3001\u3042\u306a\u305f\u306e\u60a9\u307f\u304c\u89e3\u6c7a\u3059\u308b\u3060\u3051\u3058\u3083\u306a\u304f\u3001\u65b0\u305f\u306a\u6c17\u4ed8\u304d\u3082\u767a\u898b\u3067\u304d\u308b\u3053\u3068\u3067\u3057\u3087\u3046\u3002\u304a\u60a9\u307f\u306e\u65b9\u306f\u305c\u3072\u3054\u4e00\u8aad\u304f\u3060\u3055\u3044\u3002","breadcrumb":{"@id":"https:\/\/www.sejuku.net\/blog\/14229#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sejuku.net\/blog\/14229"]}]},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.sejuku.net\/blog\/14229#primaryimage","url":"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2018\/07\/rails_db_migrate1.jpg","contentUrl":"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2018\/07\/rails_db_migrate1.jpg","width":700,"height":400},{"@type":"BreadcrumbList","@id":"https:\/\/www.sejuku.net\/blog\/14229#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sejuku.net\/blog\/"},{"@type":"ListItem","position":2,"name":"\u3010Rails\u5165\u9580\u3011\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u8a2d\u5b9a\u3059\u308brails db:migrate\u3092\u8aac\u660e\uff01"}]},{"@type":"WebSite","@id":"https:\/\/www.sejuku.net\/blog\/#website","url":"https:\/\/www.sejuku.net\/blog\/","name":"\u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0","description":"\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u5b66\u7fd2\u306e\u3059\u3079\u3066\u304c\u30b3\u30b3\u306b\u3002","publisher":{"@id":"https:\/\/www.sejuku.net\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.sejuku.net\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ja"},{"@type":"Organization","@id":"https:\/\/www.sejuku.net\/blog\/#organization","name":"\u682a\u5f0f\u4f1a\u793eSAMURAI","url":"https:\/\/www.sejuku.net\/blog\/","logo":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.sejuku.net\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2023\/07\/logo.png","contentUrl":"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2023\/07\/logo.png","width":600,"height":600,"caption":"\u682a\u5f0f\u4f1a\u793eSAMURAI"},"image":{"@id":"https:\/\/www.sejuku.net\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/sejuku2013","https:\/\/x.com\/samuraijuku","https:\/\/www.youtube.com\/channel\/UCCFOQO5aDK0xXam4cUQXT8g\/featured"]},{"@type":"Person","@id":"https:\/\/www.sejuku.net\/blog\/#\/schema\/person\/d20c57b59dba15001519a8a671183095","name":"\u4f8d\u30c6\u30c3\u30af\u7de8\u96c6\u90e8","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/secure.gravatar.com\/avatar\/d91ed20aaa7f873a0f4f35586561303460c1e3864746dddb6ebe0fb093c1952d?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/d91ed20aaa7f873a0f4f35586561303460c1e3864746dddb6ebe0fb093c1952d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d91ed20aaa7f873a0f4f35586561303460c1e3864746dddb6ebe0fb093c1952d?s=96&d=mm&r=g","caption":"\u4f8d\u30c6\u30c3\u30af\u7de8\u96c6\u90e8"},"description":"\u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u587e\u306f\u300c\u4eba\u751f\u3092\u5909\u3048\u308b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u5b66\u7fd2\u300d\u3092\u30b3\u30f3\u30bb\u30f3\u30d7\u30c8\u306b\u3001\u904e\u53bb\u591a\u304f\u306e\u30d5\u30ea\u30fc\u30e9\u30f3\u30b9\u30a8\u30f3\u30b8\u30cb\u30a2\u3092\u8f29\u51fa\u3057\u305f\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30b9\u30af\u30fc\u30eb\u3067\u3059\u3002\u4f8d\u30c6\u30c3\u30af\u7de8\u96c6\u90e8\u3067\u306f\u6280\u8853\u7cfb\u30b3\u30f3\u30c6\u30f3\u30c4\u3092\u4e2d\u5fc3\u306b\u6709\u7528\u306a\u60c5\u5831\u3092\u767a\u4fe1\u3057\u3066\u3044\u304d\u307e\u3059\u3002","url":"https:\/\/www.sejuku.net\/blog\/author\/samurai-tech"}]}},"_links":{"self":[{"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/posts\/14229","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/users\/16433"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/comments?post=14229"}],"version-history":[{"count":0,"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/posts\/14229\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/media\/62247"}],"wp:attachment":[{"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/media?parent=14229"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/categories?post=14229"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/tags?post=14229"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}