-1
導軌分貝:遷移 給出錯誤:= 類型 「email_must_be_company_email」 不存在..PostgreSQL中,添加約束誤差
遷移文件是............
class AddEmailConstraintToUsers < ActiveRecord::Migration
def up
execute %{
ALTER TABLE users
ADD CONTRAINT ***email_must_be_company_email***
CHECK (email ~* '^[^@][email protected]\\.com' )
}
end
def down
execute %{
ALTER TABLE users
DROP CONTRAINT ***email_must_be_company_email***
}
end
end