Stable version
2.0.0.5906
Latest version
2.0.0.5906
Bleeding Edge version
2.0.0.5907

Oops! (404 Error)

This link appears to be broken. Please try again later or check the URL.

404 error


-- 1. Rename the original table
ALTER TABLE TokenSequences RENAME TO TokenSequences_old;

-- 2. Recreate the table with the new UNIQUE constraint
CREATE TABLE TokenSequences (
    ID INTEGER PRIMARY KEY,
    Value TEXT NOT NULL,
    TypeID INTEGER NOT NULL,
    CmdID INTEGER NOT NULL,
    IsCustomUserValue INTEGER NOT NULL,
    CONSTRAINT Value_TypeID_CmdID_Unique UNIQUE (Value, TypeID, CmdID)
);

-- 3. Copy the data from the old table
INSERT INTO TokenSequences (ID, Value, TypeID, CmdID, IsCustomUserValue)
SELECT ID, Value, TypeID, CmdID, IsCustomUserValue
FROM TokenSequences_old;

-- 4. Drop the old table
DROP TABLE TokenSequences_old;

-- 5. Re-create the index
create index TokenSequences_Idx_CmdID on TokenSequences(CmdID);