Insert is blocked by a unique index
Hello,By accident a row in a user table has been deleted.
Not a problem I thought, I just insert it again with the same values as before like
INSERT INTO users (id, username, password) VALUES (14, 'superman', '123qwe');
But the insert is blocked by a contstraint. The constraint turned out to be a unique index on the column username.
Is it possible to do the insert like this:
ALTER TABLE 'users' DISABLE CONSTRAINT 'users_con_unique_index';
INSERT INTO users (id, username, password) VALUES (14, 'superman', '123qwe');
ALTER TABLE 'users' ENABLE CONSTRAINT 'users_con_unique_index';
But do I risk to mess up the index by doing this?
Do I need to update the index in some how afterwards?
Best regards
Fredrik