I was thinking about implementing a user registration system. Where will be 'users' and 'user_activation' tables.
if my tables looked like this: table -> fields:
users -> id,username,activated(boolean), etc.
user_activation -> users_id (foreign key constraint obviously),token, etc.
I can't think of a way to do this with a foreign key, but you could use a trigger:
delimiter // CREATE TRIGGER user_activation_tr BEFORE UPDATE ON users FOR EACH ROW BEGIN IF NEW.activated THEN DELETE FROM user_activation WHERE users_id = NEW.id; END IF; END;// delimiter ;