{"action":"created","comment":{"url":"https://api.github.com/repos/Metatavu/live-delphi/pulls/comments/172984861","pull_request_review_id":102097514,"id":172984861,"diff_hunk":"@@ -17,86 +17,98 @@\n       this.defineModels();\n     }\n     \n-    defineModels() {\n+    async defineModels() {\n       const Sequelize = this.Sequelize;\n       \n-      this.defineModel('ConnectSession', {\n-        sid: {\n-          type: Sequelize.STRING(191),\n-          primaryKey: true\n-        },\n-        userId: Sequelize.STRING(191),\n-        expires: Sequelize.DATE,\n-        data: Sequelize.TEXT\n-      });\n-      \n-      this.defineModel('Query', {\n-        id: { type: Sequelize.BIGINT, autoIncrement: true, primaryKey: true, allowNull: false },\n-        start: { type: Sequelize.DATE },\n-        end: { type: Sequelize.DATE },\n-        name: { type: Sequelize.STRING(191) },\n-        labelx: { type: Sequelize.STRING(191) },\n-        labely: { type: Sequelize.STRING(191) },\n-        colorx: { type: Sequelize.STRING(191) },\n-        colory: { type: Sequelize.STRING(191) },\n-        segment1Background: { type: Sequelize.STRING(191) },\n-        segment2Background: { type: Sequelize.STRING(191) },\n-        segment3Background: { type: Sequelize.STRING(191) },\n-        segment4Background: { type: Sequelize.STRING(191) },\n-        thesis: { type: 'LONGTEXT', allowNull: false },\n-        type: { type: Sequelize.STRING(191), allowNull: false }\n-      }, {\n-        paranoid: true\n-      });\n-      \n-      this.defineModel('QueryEditor', {\n-        id: { type: Sequelize.BIGINT, autoIncrement: true, primaryKey: true, allowNull: false },\n-        queryId: { type: Sequelize.BIGINT, allowNull: false, references: { model: this.Query, key: 'id' } },\n-        userId: { type: Sequelize.STRING(191), allowNull: false, validate: { isUUID: 4 }  },\n-        role: { type: Sequelize.STRING(191), allowNull: false }\n-      }, {\n-        indexes: [{\n-          name: 'UN_QUERYEDITOR_QUERYID_USER_ID',\n-          unique: true,\n-          fields: ['queryId', 'userId']\n-        }]\n-      });\n-      \n-      this.defineModel('QueryUser', {\n-        id: { type: Sequelize.BIGINT, autoIncrement: true, primaryKey: true, allowNull: false },\n-        queryId: { type: Sequelize.BIGINT, allowNull: false, references: { model: this.Query, key: 'id' } },\n-        userId: { type: Sequelize.STRING(191),  allowNull: false, validate: { isUUID: 4 }  }\n-      }, {\n-        indexes: [{\n-          name: 'UN_QUERYUSER_QUERYID_USER_ID',\n-          unique: true,\n-          fields: ['queryId', 'userId']\n-        }]\n-      });\n-      \n-      this.defineModel('Session', {\n-        id: { type: Sequelize.UUID, primaryKey: true, allowNull: false, defaultValue: Sequelize.UUIDV4 },\n-        userId: { type: Sequelize.STRING(191),  allowNull: false, validate: { isUUID: 4 } },\n-        queryUserId: { type: Sequelize.BIGINT, references: { model: this.QueryUser, key: 'id' } }\n-      });\n-      \n-      this.defineModel('Answer', {\n-        id: { type: Sequelize.BIGINT, autoIncrement: true, primaryKey: true, allowNull: false },\n-        queryUserId: { type: Sequelize.BIGINT, allowNull: false, references: { model: this.QueryUser, key: 'id' } },\n-        x: { type: Sequelize.DOUBLE },\n-        y: { type: Sequelize.DOUBLE }\n-      });\n-      \n-      this.defineModel('Comment', {\n-        id: { type: Sequelize.BIGINT, autoIncrement: true, primaryKey: true, allowNull: false },\n-        isRootComment: { type: Sequelize.BOOLEAN, allowNull: false },\n-        parentCommentId: { type: Sequelize.BIGINT, references: { model: 'Comments', key: 'id' } },\n-        queryUserId: { type: Sequelize.BIGINT, allowNull: false, references: { model: this.QueryUser, key: 'id' } },\n-        queryId: { type: Sequelize.BIGINT, allowNull: false, references: { model: this.Query, key: 'id' } },\n-        comment: { type: Sequelize.TEXT, allowNull: false },\n-        x: { type: Sequelize.DOUBLE },\n-        y: { type: Sequelize.DOUBLE }\n-      });\n+      try {\n+        await this.defineModel('ConnectSession', {\n+          sid: {\n+            type: Sequelize.STRING(191),\n+            primaryKey: true\n+          },\n+          userId: Sequelize.STRING(191),\n+          expires: Sequelize.DATE,\n+          data: Sequelize.TEXT\n+        });\n+\n+        await this.defineModel('QueryFolder', {\n+          id: { type: Sequelize.BIGINT, autoIncrement: true, primaryKey: true, allowNull: false },\n+          name: { type: Sequelize.STRING(191), allowNull: false },\n+          accessCode: { type: Sequelize.STRING(191) }\n+        });\n+\n+        await this.defineModel('Query', {\n+          id: { type: Sequelize.BIGINT, autoIncrement: true, primaryKey: true, allowNull: false },\n+          folderId: { type: Sequelize.BIGINT, references: { model: this.QueryFolder, key: 'id' } },\n+          start: { type: Sequelize.DATE },\n+          end: { type: Sequelize.DATE },\n+          name: { type: Sequelize.STRING(191) },\n+          labelx: { type: Sequelize.STRING(191) },\n+          labely: { type: Sequelize.STRING(191) },\n+          colorx: { type: Sequelize.STRING(191) },\n+          colory: { type: Sequelize.STRING(191) },\n+          segment1Background: { type: Sequelize.STRING(191) },\n+          segment2Background: { type: Sequelize.STRING(191) },\n+          segment3Background: { type: Sequelize.STRING(191) },\n+          segment4Background: { type: Sequelize.STRING(191) },\n+          thesis: { type: 'LONGTEXT', allowNull: false },\n+          type: { type: Sequelize.STRING(191), allowNull: false }\n+        }, {\n+          paranoid: true\n+        });\n+\n+        await this.defineModel('QueryEditor', {","path":"plugins/live-delphi-models/index.js","position":122,"original_position":122,"commit_id":"16fabee21cb47508b6cb9a571a58c720dc5882c6","original_commit_id":"16fabee21cb47508b6cb9a571a58c720dc5882c6","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars0.githubusercontent.com/u/6697940?v=4","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Expected an assignment or function call and instead saw an expression.<br>Missing semicolon.","created_at":"2018-03-07T21:07:36Z","updated_at":"2018-03-07T21:07:37Z","html_url":"https://github.com/Metatavu/live-delphi/pull/89#discussion_r172984861","pull_request_url":"https://api.github.com/repos/Metatavu/live-delphi/pulls/89","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/Metatavu/live-delphi/pulls/comments/172984861"},"html":{"href":"https://github.com/Metatavu/live-delphi/pull/89#discussion_r172984861"},"pull_request":{"href":"https://api.github.com/repos/Metatavu/live-delphi/pulls/89"}}},"pull_request":{"url":"https://api.github.com/repos/Metatavu/live-delphi/pulls/89","id":167031744,"html_url":"https://github.com/Metatavu/live-delphi/pull/89","diff_url":"https://github.com/Metatavu/live-delphi/pull/89.diff","patch_url":"https://github.com/Metatavu/live-delphi/pull/89.patch","issue_url":"https://api.github.com/repos/Metatavu/live-delphi/issues/89","number":89,"state":"open","locked":false,"title":"Added support for folders with access codes","user":{"login":"hkurhinen","id":5680581,"avatar_url":"https://avatars0.githubusercontent.com/u/5680581?v=4","gravatar_id":"","url":"https://api.github.com/users/hkurhinen","html_url":"https://github.com/hkurhinen","followers_url":"https://api.github.com/users/hkurhinen/followers","following_url":"https://api.github.com/users/hkurhinen/following{/other_user}","gists_url":"https://api.github.com/users/hkurhinen/gists{/gist_id}","starred_url":"https://api.github.com/users/hkurhinen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hkurhinen/subscriptions","organizations_url":"https://api.github.com/users/hkurhinen/orgs","repos_url":"https://api.github.com/users/hkurhinen/repos","events_url":"https://api.github.com/users/hkurhinen/events{/privacy}","received_events_url":"https://api.github.com/users/hkurhinen/received_events","type":"User","site_admin":false},"body":"fixes #84 ","created_at":"2018-02-04T21:43:57Z","updated_at":"2018-03-07T21:07:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5fe9736fee27662e14d2cfff1c294917e3c5b6ea","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Metatavu/live-delphi/pulls/89/commits","review_comments_url":"https://api.github.com/repos/Metatavu/live-delphi/pulls/89/comments","review_comment_url":"https://api.github.com/repos/Metatavu/live-delphi/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Metatavu/live-delphi/issues/89/comments","statuses_url":"https://api.github.com/repos/Metatavu/live-delphi/statuses/16fabee21cb47508b6cb9a571a58c720dc5882c6","head":{"label":"Metatavu:feature-#84-folder-support","ref":"feature-#84-folder-support","sha":"16fabee21cb47508b6cb9a571a58c720dc5882c6","user":{"login":"Metatavu","id":20443466,"avatar_url":"https://avatars0.githubusercontent.com/u/20443466?v=4","gravatar_id":"","url":"https://api.github.com/users/Metatavu","html_url":"https://github.com/Metatavu","followers_url":"https://api.github.com/users/Metatavu/followers","following_url":"https://api.github.com/users/Metatavu/following{/other_user}","gists_url":"https://api.github.com/users/Metatavu/gists{/gist_id}","starred_url":"https://api.github.com/users/Metatavu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Metatavu/subscriptions","organizations_url":"https://api.github.com/users/Metatavu/orgs","repos_url":"https://api.github.com/users/Metatavu/repos","events_url":"https://api.github.com/users/Metatavu/events{/privacy}","received_events_url":"https://api.github.com/users/Metatavu/received_events","type":"Organization","site_admin":false},"repo":{"id":91327114,"name":"live-delphi","full_name":"Metatavu/live-delphi","owner":{"login":"Metatavu","id":20443466,"avatar_url":"https://avatars0.githubusercontent.com/u/20443466?v=4","gravatar_id":"","url":"https://api.github.com/users/Metatavu","html_url":"https://github.com/Metatavu","followers_url":"https://api.github.com/users/Metatavu/followers","following_url":"https://api.github.com/users/Metatavu/following{/other_user}","gists_url":"https://api.github.com/users/Metatavu/gists{/gist_id}","starred_url":"https://api.github.com/users/Metatavu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Metatavu/subscriptions","organizations_url":"https://api.github.com/users/Metatavu/orgs","repos_url":"https://api.github.com/users/Metatavu/repos","events_url":"https://api.github.com/users/Metatavu/events{/privacy}","received_events_url":"https://api.github.com/users/Metatavu/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Metatavu/live-delphi","description":null,"fork":false,"url":"https://api.github.com/repos/Metatavu/live-delphi","forks_url":"https://api.github.com/repos/Metatavu/live-delphi/forks","keys_url":"https://api.github.com/repos/Metatavu/live-delphi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Metatavu/live-delphi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Metatavu/live-delphi/teams","hooks_url":"https://api.github.com/repos/Metatavu/live-delphi/hooks","issue_events_url":"https://api.github.com/repos/Metatavu/live-delphi/issues/events{/number}","events_url":"https://api.github.com/repos/Metatavu/live-delphi/events","assignees_url":"https://api.github.com/repos/Metatavu/live-delphi/assignees{/user}","branches_url":"https://api.github.com/repos/Metatavu/live-delphi/branches{/branch}","tags_url":"https://api.github.com/repos/Metatavu/live-delphi/tags","blobs_url":"https://api.github.com/repos/Metatavu/live-delphi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Metatavu/live-delphi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Metatavu/live-delphi/git/refs{/sha}","trees_url":"https://api.github.com/repos/Metatavu/live-delphi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Metatavu/live-delphi/statuses/{sha}","languages_url":"https://api.github.com/repos/Metatavu/live-delphi/languages","stargazers_url":"https://api.github.com/repos/Metatavu/live-delphi/stargazers","contributors_url":"https://api.github.com/repos/Metatavu/live-delphi/contributors","subscribers_url":"https://api.github.com/repos/Metatavu/live-delphi/subscribers","subscription_url":"https://api.github.com/repos/Metatavu/live-delphi/subscription","commits_url":"https://api.github.com/repos/Metatavu/live-delphi/commits{/sha}","git_commits_url":"https://api.github.com/repos/Metatavu/live-delphi/git/commits{/sha}","comments_url":"https://api.github.com/repos/Metatavu/live-delphi/comments{/number}","issue_comment_url":"https://api.github.com/repos/Metatavu/live-delphi/issues/comments{/number}","contents_url":"https://api.github.com/repos/Metatavu/live-delphi/contents/{+path}","compare_url":"https://api.github.com/repos/Metatavu/live-delphi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Metatavu/live-delphi/merges","archive_url":"https://api.github.com/repos/Metatavu/live-delphi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Metatavu/live-delphi/downloads","issues_url":"https://api.github.com/repos/Metatavu/live-delphi/issues{/number}","pulls_url":"https://api.github.com/repos/Metatavu/live-delphi/pulls{/number}","milestones_url":"https://api.github.com/repos/Metatavu/live-delphi/milestones{/number}","notifications_url":"https://api.github.com/repos/Metatavu/live-delphi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Metatavu/live-delphi/labels{/name}","releases_url":"https://api.github.com/repos/Metatavu/live-delphi/releases{/id}","deployments_url":"https://api.github.com/repos/Metatavu/live-delphi/deployments","created_at":"2017-05-15T10:49:32Z","updated_at":"2017-06-06T07:40:59Z","pushed_at":"2018-03-07T21:07:27Z","git_url":"git://github.com/Metatavu/live-delphi.git","ssh_url":"git@github.com:Metatavu/live-delphi.git","clone_url":"https://github.com/Metatavu/live-delphi.git","svn_url":"https://github.com/Metatavu/live-delphi","homepage":null,"size":261,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":3,"license":null,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"Metatavu:master","ref":"master","sha":"adf797b68bf95e9b054a297578cc473ae98ce957","user":{"login":"Metatavu","id":20443466,"avatar_url":"https://avatars0.githubusercontent.com/u/20443466?v=4","gravatar_id":"","url":"https://api.github.com/users/Metatavu","html_url":"https://github.com/Metatavu","followers_url":"https://api.github.com/users/Metatavu/followers","following_url":"https://api.github.com/users/Metatavu/following{/other_user}","gists_url":"https://api.github.com/users/Metatavu/gists{/gist_id}","starred_url":"https://api.github.com/users/Metatavu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Metatavu/subscriptions","organizations_url":"https://api.github.com/users/Metatavu/orgs","repos_url":"https://api.github.com/users/Metatavu/repos","events_url":"https://api.github.com/users/Metatavu/events{/privacy}","received_events_url":"https://api.github.com/users/Metatavu/received_events","type":"Organization","site_admin":false},"repo":{"id":91327114,"name":"live-delphi","full_name":"Metatavu/live-delphi","owner":{"login":"Metatavu","id":20443466,"avatar_url":"https://avatars0.githubusercontent.com/u/20443466?v=4","gravatar_id":"","url":"https://api.github.com/users/Metatavu","html_url":"https://github.com/Metatavu","followers_url":"https://api.github.com/users/Metatavu/followers","following_url":"https://api.github.com/users/Metatavu/following{/other_user}","gists_url":"https://api.github.com/users/Metatavu/gists{/gist_id}","starred_url":"https://api.github.com/users/Metatavu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Metatavu/subscriptions","organizations_url":"https://api.github.com/users/Metatavu/orgs","repos_url":"https://api.github.com/users/Metatavu/repos","events_url":"https://api.github.com/users/Metatavu/events{/privacy}","received_events_url":"https://api.github.com/users/Metatavu/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Metatavu/live-delphi","description":null,"fork":false,"url":"https://api.github.com/repos/Metatavu/live-delphi","forks_url":"https://api.github.com/repos/Metatavu/live-delphi/forks","keys_url":"https://api.github.com/repos/Metatavu/live-delphi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Metatavu/live-delphi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Metatavu/live-delphi/teams","hooks_url":"https://api.github.com/repos/Metatavu/live-delphi/hooks","issue_events_url":"https://api.github.com/repos/Metatavu/live-delphi/issues/events{/number}","events_url":"https://api.github.com/repos/Metatavu/live-delphi/events","assignees_url":"https://api.github.com/repos/Metatavu/live-delphi/assignees{/user}","branches_url":"https://api.github.com/repos/Metatavu/live-delphi/branches{/branch}","tags_url":"https://api.github.com/repos/Metatavu/live-delphi/tags","blobs_url":"https://api.github.com/repos/Metatavu/live-delphi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Metatavu/live-delphi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Metatavu/live-delphi/git/refs{/sha}","trees_url":"https://api.github.com/repos/Metatavu/live-delphi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Metatavu/live-delphi/statuses/{sha}","languages_url":"https://api.github.com/repos/Metatavu/live-delphi/languages","stargazers_url":"https://api.github.com/repos/Metatavu/live-delphi/stargazers","contributors_url":"https://api.github.com/repos/Metatavu/live-delphi/contributors","subscribers_url":"https://api.github.com/repos/Metatavu/live-delphi/subscribers","subscription_url":"https://api.github.com/repos/Metatavu/live-delphi/subscription","commits_url":"https://api.github.com/repos/Metatavu/live-delphi/commits{/sha}","git_commits_url":"https://api.github.com/repos/Metatavu/live-delphi/git/commits{/sha}","comments_url":"https://api.github.com/repos/Metatavu/live-delphi/comments{/number}","issue_comment_url":"https://api.github.com/repos/Metatavu/live-delphi/issues/comments{/number}","contents_url":"https://api.github.com/repos/Metatavu/live-delphi/contents/{+path}","compare_url":"https://api.github.com/repos/Metatavu/live-delphi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Metatavu/live-delphi/merges","archive_url":"https://api.github.com/repos/Metatavu/live-delphi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Metatavu/live-delphi/downloads","issues_url":"https://api.github.com/repos/Metatavu/live-delphi/issues{/number}","pulls_url":"https://api.github.com/repos/Metatavu/live-delphi/pulls{/number}","milestones_url":"https://api.github.com/repos/Metatavu/live-delphi/milestones{/number}","notifications_url":"https://api.github.com/repos/Metatavu/live-delphi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Metatavu/live-delphi/labels{/name}","releases_url":"https://api.github.com/repos/Metatavu/live-delphi/releases{/id}","deployments_url":"https://api.github.com/repos/Metatavu/live-delphi/deployments","created_at":"2017-05-15T10:49:32Z","updated_at":"2017-06-06T07:40:59Z","pushed_at":"2018-03-07T21:07:27Z","git_url":"git://github.com/Metatavu/live-delphi.git","ssh_url":"git@github.com:Metatavu/live-delphi.git","clone_url":"https://github.com/Metatavu/live-delphi.git","svn_url":"https://github.com/Metatavu/live-delphi","homepage":null,"size":261,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":3,"license":null,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Metatavu/live-delphi/pulls/89"},"html":{"href":"https://github.com/Metatavu/live-delphi/pull/89"},"issue":{"href":"https://api.github.com/repos/Metatavu/live-delphi/issues/89"},"comments":{"href":"https://api.github.com/repos/Metatavu/live-delphi/issues/89/comments"},"review_comments":{"href":"https://api.github.com/repos/Metatavu/live-delphi/pulls/89/comments"},"review_comment":{"href":"https://api.github.com/repos/Metatavu/live-delphi/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Metatavu/live-delphi/pulls/89/commits"},"statuses":{"href":"https://api.github.com/repos/Metatavu/live-delphi/statuses/16fabee21cb47508b6cb9a571a58c720dc5882c6"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"houndci-bot"}}