我在 Rails 的 PostgreSQL 数据库中有一个字段类型为字符串。我想将其转换为文本字段。我正在运行 rails 迁移以更改字段类型。我有什么需要注意的吗?这会导致数据丢失吗?
class ChangeNotesToBeTextInSlots < ActiveRecord::Migration[5.1]
def change
change_column :slots, :notes, :text
end
end
我在 Rails 的 PostgreSQL 数据库中有一个字段类型为字符串。我想将其转换为文本字段。我正在运行 rails 迁移以更改字段类型。我有什么需要注意的吗?这会导致数据丢失吗?
class ChangeNotesToBeTextInSlots < ActiveRecord::Migration[5.1]
def change
change_column :slots, :notes, :text
end
end