{"action":"created","comment":{"url":"https://api.github.com/repos/thelounge/thelounge/pulls/comments/172119831","pull_request_review_id":101082308,"id":172119831,"diff_hunk":"@@ -0,0 +1,126 @@\n+\"use strict\";\n+\n+const path = require(\"path\");\n+const fsextra = require(\"fs-extra\");\n+const sqlite3 = require(\"sqlite3\");\n+const Helper = require(\"../helper\");\n+const Msg = require(\"../models/msg\");\n+\n+const currentSchemaVersion = 1;","path":"src/plugins/sqlite.js","position":9,"original_position":9,"commit_id":"adf6fe23184c483f603cc812a162fa683a730fbf","original_commit_id":"adf6fe23184c483f603cc812a162fa683a730fbf","user":{"login":"McInkay","id":2162657,"avatar_url":"https://avatars2.githubusercontent.com/u/2162657?v=4","gravatar_id":"","url":"https://api.github.com/users/McInkay","html_url":"https://github.com/McInkay","followers_url":"https://api.github.com/users/McInkay/followers","following_url":"https://api.github.com/users/McInkay/following{/other_user}","gists_url":"https://api.github.com/users/McInkay/gists{/gist_id}","starred_url":"https://api.github.com/users/McInkay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/McInkay/subscriptions","organizations_url":"https://api.github.com/users/McInkay/orgs","repos_url":"https://api.github.com/users/McInkay/repos","events_url":"https://api.github.com/users/McInkay/events{/privacy}","received_events_url":"https://api.github.com/users/McInkay/received_events","type":"User","site_admin":false},"body":"> Each migration id is a timestamp, so there is no conflicts across PRs, order is easier to manage, etc.\r\n\r\nI mean, there will be a conflict either way because changing the same line in a file will create a git conflict. But either way, this is what we want, because even if the version is a timestamp, it'll need to change if someone else has merged since I started my development, because otherwise my time might be behind master now, and it looks like the schema is in the past.","created_at":"2018-03-05T08:52:47Z","updated_at":"2018-03-05T08:52:47Z","html_url":"https://github.com/thelounge/thelounge/pull/1839#discussion_r172119831","pull_request_url":"https://api.github.com/repos/thelounge/thelounge/pulls/1839","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/thelounge/thelounge/pulls/comments/172119831"},"html":{"href":"https://github.com/thelounge/thelounge/pull/1839#discussion_r172119831"},"pull_request":{"href":"https://api.github.com/repos/thelounge/thelounge/pulls/1839"}},"in_reply_to_id":172035180},"pull_request":{"url":"https://api.github.com/repos/thelounge/thelounge/pulls/1839","id":158401494,"html_url":"https://github.com/thelounge/thelounge/pull/1839","diff_url":"https://github.com/thelounge/thelounge/pull/1839.diff","patch_url":"https://github.com/thelounge/thelounge/pull/1839.patch","issue_url":"https://api.github.com/repos/thelounge/thelounge/issues/1839","number":1839,"state":"open","locked":false,"title":"Add sqlite logging and reloading messages","user":{"login":"xPaw","id":613331,"avatar_url":"https://avatars3.githubusercontent.com/u/613331?v=4","gravatar_id":"","url":"https://api.github.com/users/xPaw","html_url":"https://github.com/xPaw","followers_url":"https://api.github.com/users/xPaw/followers","following_url":"https://api.github.com/users/xPaw/following{/other_user}","gists_url":"https://api.github.com/users/xPaw/gists{/gist_id}","starred_url":"https://api.github.com/users/xPaw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xPaw/subscriptions","organizations_url":"https://api.github.com/users/xPaw/orgs","repos_url":"https://api.github.com/users/xPaw/repos","events_url":"https://api.github.com/users/xPaw/events{/privacy}","received_events_url":"https://api.github.com/users/xPaw/received_events","type":"User","site_admin":false},"body":"This is inspired by #1529 because I wanted to get a simpler backend in, then search can be added separately.\r\n\r\nThis takes some work from #663 but ultimately supersedes it.\r\nCloses #442.\r\n\r\nFirst commit introduces network UUIDs and fixes #1392, this is to prevent logging incorrectly when you are connected to same network under different nicknames (e.g. ZNC). This also makes it simpler to lookup networks and things like that.\r\n\r\nSecond commit adds creation of sqlite database itself and logging messages into the database. Currently it only writes actual messages and notices. Other message types are not written for one simple reason: backwards compatibility. If we store entire `Msg` object as json in the database, we will have to support any changes in these messages for all the types (good example is when I refactored `nick/mode` into a single `from` field).\r\n\r\nThird commit actually adds reading messages back into the channel buffer when these channels are created or joined. `loadMessages` still needs some work to make loading messages a bit nicer.\r\n\r\nFourth commit adds a config variable to enable sqlite (it's disabled by default to not disrupt existing instances, at least right now).","created_at":"2017-12-14T16:24:02Z","updated_at":"2018-03-05T08:52:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"51098dc1aaa1eaba87835d4d48b60e14b9852384","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":323424562,"url":"https://api.github.com/repos/thelounge/thelounge/labels/Type:%20Feature","name":"Type: Feature","color":"86c5f9","default":false}],"milestone":{"url":"https://api.github.com/repos/thelounge/thelounge/milestones/28","html_url":"https://github.com/thelounge/thelounge/milestone/28","labels_url":"https://api.github.com/repos/thelounge/thelounge/milestones/28/labels","id":2803396,"number":28,"title":"3.0.0","description":"","creator":{"login":"astorije","id":113730,"avatar_url":"https://avatars1.githubusercontent.com/u/113730?v=4","gravatar_id":"","url":"https://api.github.com/users/astorije","html_url":"https://github.com/astorije","followers_url":"https://api.github.com/users/astorije/followers","following_url":"https://api.github.com/users/astorije/following{/other_user}","gists_url":"https://api.github.com/users/astorije/gists{/gist_id}","starred_url":"https://api.github.com/users/astorije/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astorije/subscriptions","organizations_url":"https://api.github.com/users/astorije/orgs","repos_url":"https://api.github.com/users/astorije/repos","events_url":"https://api.github.com/users/astorije/events{/privacy}","received_events_url":"https://api.github.com/users/astorije/received_events","type":"User","site_admin":false},"open_issues":30,"closed_issues":113,"state":"open","created_at":"2017-09-29T17:49:11Z","updated_at":"2018-03-04T23:57:16Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/thelounge/thelounge/pulls/1839/commits","review_comments_url":"https://api.github.com/repos/thelounge/thelounge/pulls/1839/comments","review_comment_url":"https://api.github.com/repos/thelounge/thelounge/pulls/comments{/number}","comments_url":"https://api.github.com/repos/thelounge/thelounge/issues/1839/comments","statuses_url":"https://api.github.com/repos/thelounge/thelounge/statuses/adf6fe23184c483f603cc812a162fa683a730fbf","head":{"label":"thelounge:sqlite","ref":"sqlite","sha":"adf6fe23184c483f603cc812a162fa683a730fbf","user":{"login":"thelounge","id":14336958,"avatar_url":"https://avatars1.githubusercontent.com/u/14336958?v=4","gravatar_id":"","url":"https://api.github.com/users/thelounge","html_url":"https://github.com/thelounge","followers_url":"https://api.github.com/users/thelounge/followers","following_url":"https://api.github.com/users/thelounge/following{/other_user}","gists_url":"https://api.github.com/users/thelounge/gists{/gist_id}","starred_url":"https://api.github.com/users/thelounge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thelounge/subscriptions","organizations_url":"https://api.github.com/users/thelounge/orgs","repos_url":"https://api.github.com/users/thelounge/repos","events_url":"https://api.github.com/users/thelounge/events{/privacy}","received_events_url":"https://api.github.com/users/thelounge/received_events","type":"Organization","site_admin":false},"repo":{"id":51344082,"name":"thelounge","full_name":"thelounge/thelounge","owner":{"login":"thelounge","id":14336958,"avatar_url":"https://avatars1.githubusercontent.com/u/14336958?v=4","gravatar_id":"","url":"https://api.github.com/users/thelounge","html_url":"https://github.com/thelounge","followers_url":"https://api.github.com/users/thelounge/followers","following_url":"https://api.github.com/users/thelounge/following{/other_user}","gists_url":"https://api.github.com/users/thelounge/gists{/gist_id}","starred_url":"https://api.github.com/users/thelounge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thelounge/subscriptions","organizations_url":"https://api.github.com/users/thelounge/orgs","repos_url":"https://api.github.com/users/thelounge/repos","events_url":"https://api.github.com/users/thelounge/events{/privacy}","received_events_url":"https://api.github.com/users/thelounge/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/thelounge/thelounge","description":"💬 The Lounge — Modern self-hosted web IRC client","fork":false,"url":"https://api.github.com/repos/thelounge/thelounge","forks_url":"https://api.github.com/repos/thelounge/thelounge/forks","keys_url":"https://api.github.com/repos/thelounge/thelounge/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thelounge/thelounge/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thelounge/thelounge/teams","hooks_url":"https://api.github.com/repos/thelounge/thelounge/hooks","issue_events_url":"https://api.github.com/repos/thelounge/thelounge/issues/events{/number}","events_url":"https://api.github.com/repos/thelounge/thelounge/events","assignees_url":"https://api.github.com/repos/thelounge/thelounge/assignees{/user}","branches_url":"https://api.github.com/repos/thelounge/thelounge/branches{/branch}","tags_url":"https://api.github.com/repos/thelounge/thelounge/tags","blobs_url":"https://api.github.com/repos/thelounge/thelounge/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thelounge/thelounge/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thelounge/thelounge/git/refs{/sha}","trees_url":"https://api.github.com/repos/thelounge/thelounge/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thelounge/thelounge/statuses/{sha}","languages_url":"https://api.github.com/repos/thelounge/thelounge/languages","stargazers_url":"https://api.github.com/repos/thelounge/thelounge/stargazers","contributors_url":"https://api.github.com/repos/thelounge/thelounge/contributors","subscribers_url":"https://api.github.com/repos/thelounge/thelounge/subscribers","subscription_url":"https://api.github.com/repos/thelounge/thelounge/subscription","commits_url":"https://api.github.com/repos/thelounge/thelounge/commits{/sha}","git_commits_url":"https://api.github.com/repos/thelounge/thelounge/git/commits{/sha}","comments_url":"https://api.github.com/repos/thelounge/thelounge/comments{/number}","issue_comment_url":"https://api.github.com/repos/thelounge/thelounge/issues/comments{/number}","contents_url":"https://api.github.com/repos/thelounge/thelounge/contents/{+path}","compare_url":"https://api.github.com/repos/thelounge/thelounge/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thelounge/thelounge/merges","archive_url":"https://api.github.com/repos/thelounge/thelounge/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thelounge/thelounge/downloads","issues_url":"https://api.github.com/repos/thelounge/thelounge/issues{/number}","pulls_url":"https://api.github.com/repos/thelounge/thelounge/pulls{/number}","milestones_url":"https://api.github.com/repos/thelounge/thelounge/milestones{/number}","notifications_url":"https://api.github.com/repos/thelounge/thelounge/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thelounge/thelounge/labels{/name}","releases_url":"https://api.github.com/repos/thelounge/thelounge/releases{/id}","deployments_url":"https://api.github.com/repos/thelounge/thelounge/deployments","created_at":"2016-02-09T03:16:03Z","updated_at":"2018-03-04T05:17:11Z","pushed_at":"2018-03-05T01:46:04Z","git_url":"git://github.com/thelounge/thelounge.git","ssh_url":"git@github.com:thelounge/thelounge.git","clone_url":"https://github.com/thelounge/thelounge.git","svn_url":"https://github.com/thelounge/thelounge","homepage":"https://thelounge.chat","size":8315,"stargazers_count":1744,"watchers_count":1744,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":279,"mirror_url":null,"archived":false,"open_issues_count":194,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":279,"open_issues":194,"watchers":1744,"default_branch":"master"}},"base":{"label":"thelounge:master","ref":"master","sha":"68cc9a2e2875a857d44eb0087541634caf0dc10c","user":{"login":"thelounge","id":14336958,"avatar_url":"https://avatars1.githubusercontent.com/u/14336958?v=4","gravatar_id":"","url":"https://api.github.com/users/thelounge","html_url":"https://github.com/thelounge","followers_url":"https://api.github.com/users/thelounge/followers","following_url":"https://api.github.com/users/thelounge/following{/other_user}","gists_url":"https://api.github.com/users/thelounge/gists{/gist_id}","starred_url":"https://api.github.com/users/thelounge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thelounge/subscriptions","organizations_url":"https://api.github.com/users/thelounge/orgs","repos_url":"https://api.github.com/users/thelounge/repos","events_url":"https://api.github.com/users/thelounge/events{/privacy}","received_events_url":"https://api.github.com/users/thelounge/received_events","type":"Organization","site_admin":false},"repo":{"id":51344082,"name":"thelounge","full_name":"thelounge/thelounge","owner":{"login":"thelounge","id":14336958,"avatar_url":"https://avatars1.githubusercontent.com/u/14336958?v=4","gravatar_id":"","url":"https://api.github.com/users/thelounge","html_url":"https://github.com/thelounge","followers_url":"https://api.github.com/users/thelounge/followers","following_url":"https://api.github.com/users/thelounge/following{/other_user}","gists_url":"https://api.github.com/users/thelounge/gists{/gist_id}","starred_url":"https://api.github.com/users/thelounge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thelounge/subscriptions","organizations_url":"https://api.github.com/users/thelounge/orgs","repos_url":"https://api.github.com/users/thelounge/repos","events_url":"https://api.github.com/users/thelounge/events{/privacy}","received_events_url":"https://api.github.com/users/thelounge/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/thelounge/thelounge","description":"💬 The Lounge — Modern self-hosted web IRC client","fork":false,"url":"https://api.github.com/repos/thelounge/thelounge","forks_url":"https://api.github.com/repos/thelounge/thelounge/forks","keys_url":"https://api.github.com/repos/thelounge/thelounge/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thelounge/thelounge/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thelounge/thelounge/teams","hooks_url":"https://api.github.com/repos/thelounge/thelounge/hooks","issue_events_url":"https://api.github.com/repos/thelounge/thelounge/issues/events{/number}","events_url":"https://api.github.com/repos/thelounge/thelounge/events","assignees_url":"https://api.github.com/repos/thelounge/thelounge/assignees{/user}","branches_url":"https://api.github.com/repos/thelounge/thelounge/branches{/branch}","tags_url":"https://api.github.com/repos/thelounge/thelounge/tags","blobs_url":"https://api.github.com/repos/thelounge/thelounge/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thelounge/thelounge/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thelounge/thelounge/git/refs{/sha}","trees_url":"https://api.github.com/repos/thelounge/thelounge/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thelounge/thelounge/statuses/{sha}","languages_url":"https://api.github.com/repos/thelounge/thelounge/languages","stargazers_url":"https://api.github.com/repos/thelounge/thelounge/stargazers","contributors_url":"https://api.github.com/repos/thelounge/thelounge/contributors","subscribers_url":"https://api.github.com/repos/thelounge/thelounge/subscribers","subscription_url":"https://api.github.com/repos/thelounge/thelounge/subscription","commits_url":"https://api.github.com/repos/thelounge/thelounge/commits{/sha}","git_commits_url":"https://api.github.com/repos/thelounge/thelounge/git/commits{/sha}","comments_url":"https://api.github.com/repos/thelounge/thelounge/comments{/number}","issue_comment_url":"https://api.github.com/repos/thelounge/thelounge/issues/comments{/number}","contents_url":"https://api.github.com/repos/thelounge/thelounge/contents/{+path}","compare_url":"https://api.github.com/repos/thelounge/thelounge/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thelounge/thelounge/merges","archive_url":"https://api.github.com/repos/thelounge/thelounge/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thelounge/thelounge/downloads","issues_url":"https://api.github.com/repos/thelounge/thelounge/issues{/number}","pulls_url":"https://api.github.com/repos/thelounge/thelounge/pulls{/number}","milestones_url":"https://api.github.com/repos/thelounge/thelounge/milestones{/number}","notifications_url":"https://api.github.com/repos/thelounge/thelounge/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thelounge/thelounge/labels{/name}","releases_url":"https://api.github.com/repos/thelounge/thelounge/releases{/id}","deployments_url":"https://api.github.com/repos/thelounge/thelounge/deployments","created_at":"2016-02-09T03:16:03Z","updated_at":"2018-03-04T05:17:11Z","pushed_at":"2018-03-05T01:46:04Z","git_url":"git://github.com/thelounge/thelounge.git","ssh_url":"git@github.com:thelounge/thelounge.git","clone_url":"https://github.com/thelounge/thelounge.git","svn_url":"https://github.com/thelounge/thelounge","homepage":"https://thelounge.chat","size":8315,"stargazers_count":1744,"watchers_count":1744,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":279,"mirror_url":null,"archived":false,"open_issues_count":194,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":279,"open_issues":194,"watchers":1744,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/thelounge/thelounge/pulls/1839"},"html":{"href":"https://github.com/thelounge/thelounge/pull/1839"},"issue":{"href":"https://api.github.com/repos/thelounge/thelounge/issues/1839"},"comments":{"href":"https://api.github.com/repos/thelounge/thelounge/issues/1839/comments"},"review_comments":{"href":"https://api.github.com/repos/thelounge/thelounge/pulls/1839/comments"},"review_comment":{"href":"https://api.github.com/repos/thelounge/thelounge/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/thelounge/thelounge/pulls/1839/commits"},"statuses":{"href":"https://api.github.com/repos/thelounge/thelounge/statuses/adf6fe23184c483f603cc812a162fa683a730fbf"}},"author_association":"OWNER"}}
{"actor":{"display_login":"McInkay"}}