1
我有这个作为迁移:Rails不会运行这个PostgreSQL迁移,为什么?
def up
connection.execute(%q{
alter table enterprise_members
alter column sso_id
type string using cast(sso_id as string)
})
end
在哪里我只是想整数转换成字符串。但是当它运行时,它会返回:
PG::UndefinedObject: ERROR: type "string" does not exist
:
alter table enterprise_members
alter column sso_id
type string using cast(sso_id as string)
是因为我在试图施放它吗?我该如何解决?
varchar,char,text是数据库类型,“string”不是。字符数据类型可以在[手册]上找到(http://www.postgresql.org/docs/9.3/static/datatype-character.html) –