[Rails][Heroku] Herokuã§å¼·å¶çã«db:migrateãããç´ãããã®ï¼
http://d.hatena.ne.jp/shunsuk/20110322/1300794096
ãã®ããã°ã§Herokuã®ãã¼ã¿ãã¼ã¹(æ¨æºã®postgres)ãæåããã¤ããç´ãæ¹æ³ã¨ãã¦ãmigrationã«STEPãªãã·ã§ã³ã渡ãæ¹æ³ãç´¹ä»ããã¦ãã¾ãã
migrateã«ãããªãªãã·ã§ã³ããã£ãã¨ã¯ç¥ãã¾ããã§ããã
åã¯ããã¤ã以ä¸ã®ããæ¹ã§ãã£ã¦ãã¾ãã
$ heroku pg:reset --db SHARED_DATABASE_URL --app manga-dojo-staging Resetting SHARED_DATABASE_URL (DATABASE_URL) ! WARNING: Potentially Destructive Action ! This command will affect the app: manga-dojo-staging ! To proceed, type "manga-dojo-staging" or re-run this command with --confirm manga-dojo-staging > manga-dojo-staging ... done $ heroku rake db:migrate --app manga-dojo-staging (in /app/4cf22428-1973-41f7-8768-8ffc509f1d65/home) Migrating to CreateMangas (20110220170208) == CreateMangas: migrating =================================================== -- create_table(:mangas) -> 0.0770s ....
Herokuã§ã¯Railsæ¨æºã®rake db:resetã¯ä½¿ãã¾ãããã以ä¸ã®ã³ãã³ãã§Herokuã®æ¨æºã®postgresã®DBããªã»ãããããã¨ãã§ãã¾ãã
$ heroku pg:reset --db SHARED_DATABASE_URL
å®è¡å¾ã確èªã®ããããã³ããã表示ãããã®ã§ã¢ããªåãå ¥åãã¾ããããããã¨ãªã»ãããå®è¡ããã¾ãã
ãã¨ã¯ãmigrateãæ®éã«å®è¡ããã¨OKã§ãã
ç¾å¨ã®gihyo.jpã§å¥½è©(?)é£è¼ä¸ã® "Herokuã§ä½ãFacebookã¢ããª" ã®ä¸ã§ç´¹ä»ãããã¨æã£ã¦ãããã¿ã ã£ãã®ã§ãããTipsããã§ãªããªãã¿ã¤ãã³ã°ããªãã£ãã®ã§èª¿åº¦è¯ãã£ãã§ããæ¯éãé£è¼ãèªãã§ã¿ã¦ãï¼
http://gihyo.jp/dev/serial/01/heroku
ãã£ãå°éå¾åãã¦ã®ããã°ã§ãããåã¯å æ°ã§ãã