Changeset 5136
- Timestamp:
- 05/02/07 11:30:00 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/boulder-oracle-sprint/django/core/management.py
r5135 r5136 372 372 style.SQL_FIELD(truncate_name(r_name, backend.get_max_name_length())))) 373 373 del references_to_delete[model] 374 if hasattr(backend, 'get_drop_sequence'):374 if model._meta.has_auto_field and hasattr(backend, 'get_drop_sequence'): 375 375 output.append(backend.get_drop_sequence(model._meta.db_table)) 376 376 django/branches/boulder-oracle-sprint/django/db/backends/oracle/base.py
r5079 r5136 96 96 args = [(':arg%d' % i) for i in range(len(params))] 97 97 query = query % tuple(args) 98 # cx_Oracle cannot execute a query with the closing ';' 99 if query.endswith(';'): 98 # cx_Oracle wants no trailing ';' for SQL statements. For PL/SQL, it 99 # it does want a trailing ';' but not a trailing '/'. However, these 100 # characters must be included in the original query in case the query 101 # is being passed to SQL*Plus. 102 if query.endswith(';') or query.endswith('/'): 100 103 query = query[:-1] 101 104 return query, params … … 186 189 BEGIN 187 190 SELECT %s.nextval INTO :new.id FROM dual; 188 END;\n""" % (tr_name, quote_name(table), sq_name) 191 END; 192 /""" % (tr_name, quote_name(table), sq_name) 189 193 return sequence_sql, trigger_sql 190 194 … … 209 213 END IF; 210 214 COMMIT; 211 END;\n""" 215 END; 216 /""" 212 217 213 218 def get_sql_flush(style, tables, sequences):
