Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. CREATE TABLE `interactions` (
  2. `user_id_to` bigint(11) unsigned NOT NULL,
  3. `user_id_from` bigint(11) unsigned NOT NULL,
  4. `type2counter` tinyint(11) unsigned NOT NULL DEFAULT '0',
  5. `counter` smallint(11) unsigned NOT NULL,
  6. `updated` date NOT NULL,
  7. PRIMARY KEY (`user_id_to`,`user_id_from`),
  8. KEY `uid_from` (`user_id_from`),
  9. KEY `uid_to_counter` (`user_id_to`,`counter`)
  10. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  11.  
  12. 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() )
  13. ON DUPLICATE KEY UPDATE counter=counter+VALUES(counter), updated=NOW()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement