Skip to content

[Bug]: Incorrect foreign key mismatch error #4155

Description

@VamcoDThomson

What did you do?

With the tables:

CREATE TABLE IF NOT EXISTS single_drives(
        drive_sequential_number     INTEGER PRIMARY KEY,
        drive_serial_number         TEXT NOT NULL, 
        drive_model                 TEXT, 
        base_board                  INTEGER NOT NULL, 
        cpu_board                   INTEGER, 
        transistor_board            INTEGER, 
        filter_board                INTEGER, 
        fpga_firmware               TEXT,
        dsp_firmware                TEXT, 
        boot_version                TEXT, 
        notes                       TEXT, 
        service_notes               TEXT, 
        previous_sequential_number  INTEGER,
        UNIQUE(drive_sequential_number),
        UNIQUE(drive_serial_number),
        FOREIGN KEY(base_board)                 REFERENCES drive_base_boards(base_board_id)
            ON UPDATE CASCADE
            ON DELETE SET NULL,
        FOREIGN KEY(cpu_board)                  REFERENCES drive_cpu_boards(cpu_board_id)
            ON UPDATE CASCADE
            ON DELETE SET NULL,
        FOREIGN KEY(transistor_board)           REFERENCES drive_transistor_boards(transistor_board_id)
            ON UPDATE CASCADE
            ON DELETE SET NULL,
        FOREIGN KEY(filter_board)               REFERENCES drive_cpu_boards(filter_board_id)
            ON UPDATE CASCADE
            ON DELETE SET NULL
        FOREIGN KEY(previous_sequential_number) REFERENCES single_drives(drive_sequential_number)
            ON UPDATE CASCADE
            ON DELETE SET NULL

CREATE TABLE IF NOT EXISTS drive_cpu_boards(
        cpu_board_id               INTEGER PRIMARY KEY,
        cpu_board_serial_number    TEXT NOT NULL,
        UNIQUE(cpu_board_id)
        UNIQUE(cpu_board_serial_number)
        )

(other tables are present in the database, but I don't believe they are relevant to this error)
I attempted to delete a row from the "single_drives" table by highlighting it in the Browse Data tab and pressing delete.

What did you expect to see?

I expected the row to be deleted.

What did you see instead?

Image I received this error message. This occurs no matter the row I try to delete, and errors based on this same foreign key mismatch occur in other parts of the database as well.

I am able to delete rows from this and other tables when not using the browser, so this seems to be an issue with the browser and not the DB schema itself

DB4S Version

3.13.1

What OS are you seeing the problem on?

Windows

OS version

Windows 11

Relevant log output

Prevention against duplicate issues

  • I have searched for similar issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions