'Tests that going from a PostiveIntegerField to an IntegerField drops
the constraint on the database.'

@skipUnless(db.has_check_constraints, 'Only    applies    to    databases    that    support    CHECK    constraints.')
def test_alter_constraints(self):

    db.create_table('test_alterc', [('num', models.PositiveIntegerField())])
    db.execute_deferred_sql()
    db.execute('INSERT    INTO    test_alterc    (num)    VALUES    (1)')
    db.execute('INSERT    INTO    test_alterc    (num)    VALUES    (2)')
    db.commit_transaction()
    db.start_transaction()
    try:
        db.execute('INSERT    INTO    test_alterc    (num)    VALUES    (-3)')
    except:
        db.rollback_transaction()
    else:
        self.fail('Could    insert    a    negative    integer    into    a    PositiveIntegerField.')
    db.alter_column('test_alterc', 'num', models.IntegerField())
    db.execute_deferred_sql()
    db.execute('INSERT    INTO    test_alterc    (num)    VALUES    (-3)')
    db.delete_table('test_alterc')
    db.start_transaction()
