Ticket #1373: newfix_drop_foreignkey.diff

File newfix_drop_foreignkey.diff, 2.7 KB (added by njharman@…, 9 years ago)
  • db/backends/ado_mssql/base.py

     
    121121def get_random_function_sql():
    122122    return "RAND()"
    123123
     124def get_drop_foreignkey_sql():
     125    return "DROP CONSTRAINT"
     126
    124127OPERATOR_MAPPING = {
    125128    'exact': '= %s',
    126129    'iexact': 'LIKE %s',
  • db/backends/postgresql/base.py

     
    9898def get_random_function_sql():
    9999    return "RANDOM()"
    100100
     101def get_drop_foreignkey_sql():
     102    return "DROP CONSTRAINT"
     103
    101104# Register these custom typecasts, because Django expects dates/times to be
    102105# in Python's native (standard-library) datetime/time format, whereas psycopg
    103106# use mx.DateTime by default.
  • db/backends/sqlite3/base.py

     
    116116def get_random_function_sql():
    117117    return "RANDOM()"
    118118
     119def get_drop_foreignkey_sql():
     120    return ""
     121
    119122def _sqlite_date_trunc(lookup_type, dt):
    120123    try:
    121124        dt = util.typecast_timestamp(dt)
  • db/backends/mysql/base.py

     
    146146def get_random_function_sql():
    147147    return "RAND()"
    148148
     149def get_drop_foreignkey_sql():
     150    return "DROP FOREIGN KEY"
     151
    149152OPERATOR_MAPPING = {
    150153    'exact': '= %s',
    151154    'iexact': 'LIKE %s',
  • db/backends/dummy/base.py

     
    3333get_date_trunc_sql = complain
    3434get_limit_offset_sql = complain
    3535get_random_function_sql = complain
     36get_drop_foreignkey_sql = complain
    3637OPERATOR_MAPPING = {}
  • core/management.py

     
    290290                    output.append('%s %s %s %s;' % \
    291291                        (style.SQL_KEYWORD('ALTER TABLE'),
    292292                        style.SQL_TABLE(backend.quote_name(table)),
    293                         style.SQL_KEYWORD('DROP CONSTRAINT'),
     293                        style.SQL_KEYWORD(backend.get_drop_foreignkey_sql()),
    294294                        style.SQL_FIELD(backend.quote_name("%s_referencing_%s_%s" % (col, r_table, r_col)))))
    295295                del references_to_delete[klass]
    296296
Back to Top