File tree Expand file tree Collapse file tree 2 files changed +20
-4
lines changed
Expand file tree Collapse file tree 2 files changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -380,6 +380,21 @@ def quote_name(self, name):
380380 """
381381 if name .startswith ('[' ) and name .endswith (']' ):
382382 return name # Quoting once is enough.
383+
384+ # Handle schema.table names properly
385+ if '.' in name and not (name .startswith ('[' ) and name .endswith (']' )):
386+ parts = name .split ('.' )
387+ if len (parts ) == 2 :
388+ schema , table = parts
389+ # Only split if both parts are meaningful (not empty)
390+ if schema and table :
391+ # Quote each part separately if they aren't already quoted
392+ if not (schema .startswith ('[' ) and schema .endswith (']' )):
393+ schema = '[%s]' % schema
394+ if not (table .startswith ('[' ) and table .endswith (']' )):
395+ table = '[%s]' % table
396+ return '%s.%s' % (schema , table )
397+
383398 return '[%s]' % name
384399
385400 def random_function_sql (self ):
Original file line number Diff line number Diff line change 330330 'foreign_object.test_tuple_lookups.TupleLookupsTests.test_tuple_in_subquery' ,
331331 'foreign_object.test_agnostic_order_trimjoin.TestLookupQuery.test_deep_mixed_backward' ,
332332
333- # Migration data persistence - exclude entire module due to table name with spaces issue
334- 'migration_test_data_persistence' ,
335- 'migration_test_data_persistence.tests' ,
336- 'migration_test_data_persistence.tests.MigrationDataPersistenceClassSetup' ,
333+ # Migration data persistence tests - FIXED: table name with spaces issue resolved
334+ # Fixed by improving quote_name method to handle schema.table names properly
335+ # 'migration_test_data_persistence.tests.MigrationDataPersistenceTestCase.test_persistence',
336+ # 'migration_test_data_persistence.tests.MigrationDataPersistenceClassSetup.test_data_available_in_class_setup',
337+ # 'migration_test_data_persistence.tests.MigrationDataNormalPersistenceTestCase.test_persistence',
337338
338339 # Multi-column foreign key tests with tuple lookups - also affected by SQL Server limitations
339340 # TODO: Fix tuple lookup generation for multi-column FKs
You can’t perform that action at this time.
0 commit comments