Skip to content

Commit a918e8e

Browse files
committed
Merge pull request rails-sqlserver#700 from amatsuda/set_single_user_before_drop
SET SINGLE_USER before dropping the database
1 parent 4cf0374 commit a918e8e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/active_record/connection_adapters/sqlserver/database_tasks.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ def create_database(database, options = {})
1212

1313
def drop_database(database)
1414
name = SQLServer::Utils.extract_identifiers(database)
15+
do_execute "ALTER DATABASE #{name} SET SINGLE_USER WITH ROLLBACK IMMEDIATE"
1516
do_execute "DROP DATABASE #{name}"
1617
end
1718

0 commit comments

Comments
 (0)