diff options
author | kennyj <kennyj@gmail.com> | 2013-06-05 20:54:11 +0900 |
---|---|---|
committer | kennyj <kennyj@gmail.com> | 2013-06-05 21:16:50 +0900 |
commit | 6b16b2f0f3f3a6800640024f729b862c05d1aa2d (patch) | |
tree | ad0dfa3f950f49d2df3c33a39b60317d27c30b17 /activerecord | |
parent | 42d0d1832f3354dbbd61163c2bb9a7a50227d98b (diff) | |
download | rails-6b16b2f0f3f3a6800640024f729b862c05d1aa2d.tar.gz rails-6b16b2f0f3f3a6800640024f729b862c05d1aa2d.tar.bz2 rails-6b16b2f0f3f3a6800640024f729b862c05d1aa2d.zip |
Remove SqlseverDatabaseTasks was deprecated, because this was provided by 3rd-party.
Diffstat (limited to 'activerecord')
3 files changed, 0 insertions, 136 deletions
diff --git a/activerecord/lib/active_record/tasks/database_tasks.rb b/activerecord/lib/active_record/tasks/database_tasks.rb index 45a1f7838a..6fc8db0bfe 100644 --- a/activerecord/lib/active_record/tasks/database_tasks.rb +++ b/activerecord/lib/active_record/tasks/database_tasks.rb @@ -51,7 +51,6 @@ module ActiveRecord register_task(/sqlite/, ActiveRecord::Tasks::SQLiteDatabaseTasks) register_task(/firebird/, ActiveRecord::Tasks::FirebirdDatabaseTasks) - register_task(/sqlserver/, ActiveRecord::Tasks::SqlserverDatabaseTasks) def current_config(options = {}) options.reverse_merge! :env => env diff --git a/activerecord/lib/active_record/tasks/sqlserver_database_tasks.rb b/activerecord/lib/active_record/tasks/sqlserver_database_tasks.rb deleted file mode 100644 index c718ee03a8..0000000000 --- a/activerecord/lib/active_record/tasks/sqlserver_database_tasks.rb +++ /dev/null @@ -1,48 +0,0 @@ -require 'shellwords' - -module ActiveRecord - module Tasks # :nodoc: - class SqlserverDatabaseTasks # :nodoc: - delegate :connection, :establish_connection, to: ActiveRecord::Base - - def initialize(configuration) - ActiveSupport::Deprecation.warn "This database tasks were deprecated, because this tasks should be served by the 3rd party adapter." - @configuration = configuration - end - - def create - $stderr.puts 'sorry, your database adapter is not supported yet, feel free to submit a patch' - end - - def drop - $stderr.puts 'sorry, your database adapter is not supported yet, feel free to submit a patch' - end - - def purge - test = configuration.deep_dup - test_database = test['database'] - test['database'] = 'master' - establish_connection(test) - connection.recreate_database!(test_database) - end - - def charset - $stderr.puts 'sorry, your database adapter is not supported yet, feel free to submit a patch' - end - - def structure_dump(filename) - Kernel.system("smoscript -s #{configuration['host']} -d #{configuration['database']} -u #{configuration['username']} -p #{configuration['password']} -f #{filename} -A -U") - end - - def structure_load(filename) - Kernel.system("sqlcmd -S #{configuration['host']} -d #{configuration['database']} -U #{configuration['username']} -P #{configuration['password']} -i #{filename}") - end - - private - - def configuration - @configuration - end - end - end -end diff --git a/activerecord/test/cases/tasks/sqlserver_rake_test.rb b/activerecord/test/cases/tasks/sqlserver_rake_test.rb deleted file mode 100644 index 0f1264b8ce..0000000000 --- a/activerecord/test/cases/tasks/sqlserver_rake_test.rb +++ /dev/null @@ -1,87 +0,0 @@ -require 'cases/helper' - -module ActiveRecord - module SqlserverSetupper - def setup - @database = 'db.sqlserver' - @connection = stub :connection - @configuration = { - 'adapter' => 'sqlserver', - 'database' => @database, - 'host' => 'localhost', - 'username' => 'username', - 'password' => 'password', - } - ActiveRecord::Base.stubs(:connection).returns(@connection) - ActiveRecord::Base.stubs(:establish_connection).returns(true) - - @tasks = Class.new(ActiveRecord::Tasks::SqlserverDatabaseTasks) do - def initialize(configuration) - ActiveSupport::Deprecation.silence { super } - end - end - ActiveRecord::Tasks::DatabaseTasks.stubs(:class_for_adapter).returns(@tasks) unless defined? ActiveRecord::ConnectionAdapters::SQLServerAdapter - end - end - - class SqlserverDBCreateTest < ActiveRecord::TestCase - include SqlserverSetupper - - def test_db_retrieves_create - message = capture(:stderr) do - ActiveRecord::Tasks::DatabaseTasks.create @configuration - end - assert_match(/not supported/, message) - end - end - - class SqlserverDBDropTest < ActiveRecord::TestCase - include SqlserverSetupper - - def test_db_retrieves_drop - message = capture(:stderr) do - ActiveRecord::Tasks::DatabaseTasks.drop @configuration - end - assert_match(/not supported/, message) - end - end - - class SqlserverDBCharsetAndCollationTest < ActiveRecord::TestCase - include SqlserverSetupper - - def test_db_retrieves_collation - assert_raise NoMethodError do - ActiveRecord::Tasks::DatabaseTasks.collation @configuration - end - end - - def test_db_retrieves_charset - message = capture(:stderr) do - ActiveRecord::Tasks::DatabaseTasks.charset @configuration - end - assert_match(/not supported/, message) - end - end - - class SqlserverStructureDumpTest < ActiveRecord::TestCase - include SqlserverSetupper - - def test_structure_dump - filename = "sqlserver.sql" - Kernel.expects(:system).with("smoscript -s localhost -d #{@database} -u username -p password -f #{filename} -A -U") - - ActiveRecord::Tasks::DatabaseTasks.structure_dump(@configuration, filename) - end - end - - class SqlserverStructureLoadTest < ActiveRecord::TestCase - include SqlserverSetupper - - def test_structure_load - filename = "sqlserver.sql" - Kernel.expects(:system).with("sqlcmd -S localhost -d #{@database} -U username -P password -i #{filename}") - - ActiveRecord::Tasks::DatabaseTasks.structure_load(@configuration, filename) - end - end -end |