提交 854b7424 编写于 作者: Y Yves Senn

`Connection#structure_dump` is no longer used. #9518

As of ccc6910c we use `mysqldump` to create the `structure.sql`.
The old `#structure_dump` code is still in AR but never used.

I removed all relevant parts from the code-base.
上级 4ce98432
## Rails 4.0.0 (unreleased) ##
* Remove `connection#structure_dump`, which is no longer used. *Yves Senn*
* Make it possible to execute migrations without a transaction even
if the database adapter supports DDL transactions.
Fixes #9483.
......
......@@ -516,11 +516,6 @@ def remove_reference(table_name, ref_name, options = {})
end
alias :remove_belongs_to :remove_reference
# Returns a string of <tt>CREATE TABLE</tt> SQL statement(s) for recreating the
# entire structure of the database.
def structure_dump
end
def dump_schema_information #:nodoc:
sm_table = ActiveRecord::Migrator.schema_migrations_table_name
......
......@@ -332,20 +332,6 @@ def empty_insert_statement_value
# SCHEMA STATEMENTS ========================================
def structure_dump #:nodoc:
if supports_views?
sql = "SHOW FULL TABLES WHERE Table_type = 'BASE TABLE'"
else
sql = "SHOW TABLES"
end
select_all(sql, 'SCHEMA').map { |table|
table.delete('Table_type')
sql = "SHOW CREATE TABLE #{quote_table_name(table.to_a.first.last)}"
exec_query(sql, 'SCHEMA').first['Create Table'] + ";\n\n"
}.join
end
# Drops the database specified on the +name+ attribute
# and creates it again using the provided +options+.
def recreate_database(name, options = {})
......
......@@ -63,11 +63,6 @@ def test_change_columns
assert_nothing_raised { @connection.rename_column(:group, :order, :values) }
end
# dump structure of table with reserved word name
def test_structure_dump
assert_nothing_raised { @connection.structure_dump }
end
# introspect table with reserved word name
def test_introspect
assert_nothing_raised { @connection.columns(:group) }
......
......@@ -70,12 +70,6 @@ def test_mysql_set_session_variable_to_default
end
end
def test_logs_name_structure_dump
@connection.structure_dump
assert_equal "SCHEMA", @connection.logged[0][1]
assert_equal "SCHEMA", @connection.logged[2][1]
end
def test_logs_name_show_variable
@connection.show_variable 'foo'
assert_equal "SCHEMA", @connection.logged[0][1]
......
......@@ -63,11 +63,6 @@ def test_change_columns
assert_nothing_raised { @connection.rename_column(:group, :order, :values) }
end
# dump structure of table with reserved word name
def test_structure_dump
assert_nothing_raised { @connection.structure_dump }
end
# introspect table with reserved word name
def test_introspect
assert_nothing_raised { @connection.columns(:group) }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册