rsim/oracle-enhanced — pull request #256 by substars (2012-11-27 02:29:18+00:00)
Title: don't dump type for NUMBER virtual columns

Explicitly setting the type for virtual columns in schema dumps broke some of our code that worked in 1.4.0.

We have a virtual column that we expect to be able to store floating point numbers:

```
t.string :first_name
t.string :last_name
t.virtual :name_ratio, :as=>'(LENGTH(first_name)*10/LENGTH(last_name)*10)'
```

Oracle gives this column a type of NUMBER, which means it has arbitrary precision.

In 1.4.2rc1, loading this schema and then dumping it generates:

```
t.virtual "name_ratio", :as => "LENGTH(\"FIRST_NAME\")*10/LENGTH(\"LAST_NAME\")*10", :type => :decimal
```
...which generates a NUMBER(38,0) column, which means we've lost our floats. This becomes obvious if you load and then dump the dump:

```
t.virtual "name_ratio", :precision => 38, :scale => 0, :as => "LENGTH(\"FIRST_NAME\")*10/LENGTH(\"LAST_NAME\")*10", :type => :integer
```

We could change our migrations to explicitly specify precision for virtual columns, but it seems strange that the schema dumper wouldn't be idempotent.