Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE TABLE `interactions` (
- `user_id_to` bigint(11) unsigned NOT NULL,
- `user_id_from` bigint(11) unsigned NOT NULL,
- `type2counter` tinyint(11) unsigned NOT NULL DEFAULT '0',
- `counter` smallint(11) unsigned NOT NULL,
- `updated` date NOT NULL,
- PRIMARY KEY (`user_id_to`,`user_id_from`),
- KEY `uid_from` (`user_id_from`),
- KEY `uid_to_counter` (`user_id_to`,`counter`)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
- INSERT INTO interactions (user_id_to, user_id_from, counter, updated) VALUES ('2266931634','3180832729','3',NOW() ),('2266931634','3133897242','1',NOW() ),('2266931634','3207247957','1',NOW() ),('2266931634','3520390476','1',NOW() ),('2266931634','3631954079','1',NOW() ),('2266931634','3687475949','1',NOW() ),('2266931634','3627629761','1',NOW() ),('2266931634','3779990751','1',NOW() ),('2266931634','4071753134','1',NOW() ),('2266931634','4290900946','3',NOW() )
- ON DUPLICATE KEY UPDATE counter=counter+VALUES(counter), updated=NOW()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement