Skip to content

Instantly share code, notes, and snippets.

@bgmarx
Created February 19, 2015 21:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bgmarx/bebf286319b61639e85f to your computer and use it in GitHub Desktop.
Save bgmarx/bebf286319b61639e85f to your computer and use it in GitHub Desktop.
sqlite> CREATE TABLE skypelog (author TEXT, from_dispname TEXT, timestamp INTEGER, body_xml TEXT);
sqlite> CREATE TRIGGER update_skypelog AFTER UPDATE ON Messages
...> BEGIN
...> INSERT INTO skypelog
...> SELECT new.author, new.from_dispname, new.timestamp, new.body_xml
...> WHERE (SELECT count(*) FROM skypelog
...> WHERE timestamp = new.timestamp AND body_xml = new.body_xml) = 0;
...> END;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment