Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract format_colspec to format column spec #26756

Merged
merged 1 commit into from Oct 11, 2016

Conversation

kamipo
Copy link
Member

@kamipo kamipo commented Oct 11, 2016

No description provided.

@rails-bot
Copy link

r? @eileencodes

(@rails-bot has picked a reviewer for you, use r? to override)

@rafaelfranca rafaelfranca merged commit 469dd36 into rails:master Oct 11, 2016
@kamipo kamipo deleted the extract_format_colspec branch October 11, 2016 01:35
yahonda added a commit to yahonda/oracle-enhanced that referenced this pull request Feb 17, 2017
Refer these changes at Rails:
  rails/rails#26756
  rails/rails#22589
  rails/rails@df84e986721
  rails/rails#27884

This commit introduces Virtual column schema dumper format changes.
yahonda added a commit to yahonda/oracle-enhanced that referenced this pull request Feb 17, 2017
Refer these changes at Rails:
  rails/rails#26756
  rails/rails#22589
  rails/rails@df84e986721
  rails/rails#27884

This commit introduces Virtual column schema dumper format change:
`:type` attribute shown next to column name.

Align changes has been introduced by rails/rails@df84e986721 .

* Before this commit:

```ruby
ActiveRecord::Schema.define(version: 0) do

  create_table "test_names", force: :cascade do |t|
    t.string  "first_name"
    t.string  "last_name"
    t.virtual "full_name",                limit: 512,                as: "\"FIRST_NAME\"||', '||\"LAST_NAME\"",                              type: :string
    t.virtual "short_name",               limit: 300,                as: "COALESCE(\"FIRST_NAME\",\"LAST_NAME\")",                           type: :string
    t.virtual "abbrev_name",              limit: 100,                as: "SUBSTR(\"FIRST_NAME\",1,50)||' '||SUBSTR(\"LAST_NAME\",1,1)||'.'", type: :string
    t.virtual "name_ratio",                                          as: "LENGTH(\"FIRST_NAME\")*10/LENGTH(\"LAST_NAME\")*10"
    t.virtual "full_name_length",                     precision: 38, as: "LENGTH(\"FIRST_NAME\"||', '||\"LAST_NAME\")",                      type: :integer
    t.virtual "field_with_leading_space", limit: 300,                as: "' '||\"FIRST_NAME\"||' '",                                         type: :string
  end

end
```

* After this commit:
```
ActiveRecord::Schema.define(version: 0) do

  create_table "test_names", force: :cascade do |t|
    t.string "first_name"
    t.string "last_name"
    t.virtual "full_name", type: :string, limit: 512, as: "\"FIRST_NAME\"||', '||\"LAST_NAME\""
    t.virtual "short_name", type: :string, limit: 300, as: "COALESCE(\"FIRST_NAME\",\"LAST_NAME\")"
    t.virtual "abbrev_name", type: :string, limit: 100, as: "SUBSTR(\"FIRST_NAME\",1,50)||' '||SUBSTR(\"LAST_NAME\",1,1)||'.'"
    t.virtual "name_ratio", as: "LENGTH(\"FIRST_NAME\")*10/LENGTH(\"LAST_NAME\")*10"
    t.virtual "full_name_length", type: :integer, precision: 38, as: "LENGTH(\"FIRST_NAME\"||', '||\"LAST_NAME\")"
    t.virtual "field_with_leading_space", type: :string, limit: 300, as: "' '||\"FIRST_NAME\"||' '"
  end

end
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants