Skip to content

Commit

Permalink
Prefer to place a table options before force: :cascade
Browse files Browse the repository at this point in the history
Oracle enhanced adapter implements table comments options
Refer rails/rails#28005 and rsim#1439
  • Loading branch information
yahonda committed Aug 29, 2017
1 parent 8259fdb commit ff41e5c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,12 @@ def table(table, stream)
tbl.print ", id: false"
end

tbl.print ", force: :cascade"

table_options = @connection.table_options(table)
if table_options.present?
tbl.print ", #{format_options(table_options)}"
end

tbl.puts " do |t|"
tbl.puts ", force: :cascade do |t|"

# then dump all non-primary key columns
columns.each do |column|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ class ::TestName < ActiveRecord::Base

it "should dump table comments" do
output = dump_table_schema "test_table_comments"
expect(output).to match(/comment: "this is a \\"table comment\\"!"/)
expect(output).to match(/create_table "test_table_comments", comment: "this is a \\"table comment\\"!", force: :cascade do \|t\|$/)
end
end

Expand Down

0 comments on commit ff41e5c

Please sign in to comment.