Django

Code

Changeset 7375

Show
Ignore:
Timestamp:
03/27/08 17:07:40 (8 months ago)
Author:
ikelly
Message:

Added inline Oracle tablespace SQL for unique_together constraints.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/core/management/sql.py

    r7294 r7375  
    295295            style.SQL_KEYWORD('NULL')) 
    296296    for field_constraints in opts.unique_together: 
    297         table_output.append(style.SQL_KEYWORD('UNIQUE') + ' (%s)' % \ 
     297        constraint_output = [style.SQL_KEYWORD('UNIQUE')] 
     298        constraint_output.append('(%s)' % \ 
    298299            ", ".join([style.SQL_FIELD(qn(opts.get_field(f).column)) for f in field_constraints])) 
     300        if opts.db_tablespace and connection.features.supports_tablespaces \ 
     301               and connection.features.autoindexes_primary_keys: 
     302            constraint_output.append(connection.ops.tablespace_sql( 
     303                opts.db_tablespace, inline=True)) 
     304        table_output.append(' '.join(constraint_output)) 
    299305 
    300306    full_statement = [style.SQL_KEYWORD('CREATE TABLE') + ' ' + style.SQL_TABLE(qn(opts.db_table)) + ' (']