Skip to content

Commit e2c3c5f

Browse files
committed
Remove pre-quoted table name. Dont do this.
1 parent 2f5882f commit e2c3c5f

File tree

4 files changed

+1
-14
lines changed

4 files changed

+1
-14
lines changed

lib/active_record/connection_adapters/sqlserver/schema_statements.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def drop_table(table_name, options = {})
2525
do_execute "DELETE FROM #{quote_table_name(fktable)} WHERE #{quote_column_name(fkcolmn)} IN ( SELECT #{quote_column_name(pkcolmn)} FROM #{quote_table_name(pktable)} )"
2626
end
2727
end
28-
if options[:if_exists] && @version_year != 2016
28+
if options[:if_exists] && @version_year < 2016
2929
execute "IF EXISTS(SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = #{quote(table_name)}) DROP TABLE #{quote_table_name(table_name)}"
3030
else
3131
super

test/cases/specific_schema_test_sqlserver.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,6 @@ class SpecificSchemaTestSQLServer < ActiveRecord::TestCase
99
SSTestDollarTableName.limit(20).offset(1)
1010
end
1111

12-
it 'handle dot table names' do
13-
SSTestDotTableName.create! name: 'test'
14-
SSTestDotTableName.limit(20).offset(1)
15-
SSTestDotTableName.where(name: 'test').first.must_be :present?
16-
end
17-
1812
it 'models can use tinyint pk tables' do
1913
obj = SSTestTinyintPk.create! name: '1'
2014
['Fixnum', 'Integer'].must_include obj.id.class.name

test/models/sqlserver/dot_table_name.rb

Lines changed: 0 additions & 3 deletions
This file was deleted.

test/schema/sqlserver_specific_schema.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,6 @@
6464
t.uuid :uuid_nil_default, default: nil
6565
end
6666

67-
create_table '[some.Name]', force: true do |t|
68-
t.varchar :name
69-
end
70-
7167
create_table 'sst_my$strange_table', force: true do |t|
7268
t.string :name
7369
end

0 commit comments

Comments
 (0)