HerokuでJustOneDBを使用しているアプリケーションで「heroku run rake db:migrate」を実行したところ、下記のエラーになりました。
== AddColumnShowRangeToPages: migrating ======================================
-- add_column(:pages, :show_range, :string, {:default=>"private"})
rake aborted!
An error has occurred, this and all later migrations canceled:
PG::Error: ERROR: not supported by JustOne
: ALTER TABLE "pages" ADD COLUMN "show_range" character varying(255) DEFAULT 'private'
マイグレーションファイル:
class AddColumnShowRangeToPages < ActiveRecord::Migration
def change
add_column :pages, :show_range, :string, default: "private"
end
end
下記のリファレンスのALTER TABLEの項目に「It is not possible to add or drop a column」とあるので、サポートしていないという事なのだとは思うのですが、通常のRDBの運用として、ALTER TABLEでのADD COLUMNが発生しないという事は有り得ないと思うので、何か代替のカラム追加方法があるのでしょうか?
ALTER TABLE、ADD COLUMNについてのJustOneDBの方針や、その他のカラム追加方法をご存じの方がいれば教えて貰いたいです。
http://www.justonedb.com/wp-content/uploads/2012/02/JustOneDB-Heroku-Reference-February2012.pdf
ALTER TABLE
Alters a table definition. Operates as standard PostgreSQL except
for the following differences in release 1.0
It is not possible to change a table’s schema
It is not possible to add or drop a column
It is not possible to alter a column data type
SET STATISTICS is ignored
Storage parameters are ignored
Triggers cannot be enabled or disabled
Clustering is not supported
OIDs are not supported
Inheritance is not supported
It is not possible to change the tablespace