{"action":"created","comment":{"url":"https://api.github.com/repos/raster-foundry/raster-foundry/pulls/comments/180434383","pull_request_review_id":110852200,"id":180434383,"diff_hunk":"@@ -0,0 +1,60 @@\n+package com.azavea.rf.database\n+\n+import com.azavea.rf.datamodel.Platform\n+import com.azavea.rf.database.Implicits._\n+import doobie._\n+import doobie.implicits._\n+import cats._\n+import cats.data._\n+import cats.effect.IO\n+import cats.syntax.either._\n+import doobie.postgres._\n+import doobie.postgres.implicits._\n+import doobie.scalatest.imports._\n+import org.scalatest._\n+import io.circe._\n+import io.circe.syntax._\n+import java.util.UUID\n+import scala.concurrent.ExecutionContext.Implicits.global\n+\n+class PlatformDaoSpec extends FunSuite with Matchers with IOChecker with DBTestConfig {\n+\n+    def createPlatform: ConnectionIO[Platform] = {\n+        val platformName = \"test platform\"\n+        for {\n+            usr <- defaultUserQ\n+            create <- PlatformDao.create(Platform.Create(platformName, usr).toPlatform)\n+        } yield create\n+    }\n+\n+    test(\"insertion\") {\n+        val transaction = for {\n+            platformIn <- createPlatform\n+            platformOut <- PlatformDao.query.filter(platformIn.id).selectQ.unique\n+        } yield platformOut\n+\n+        val result = transaction.transact(xa).unsafeRunSync\n+        result.name shouldBe \"test platform\"\n+    }\n+\n+    test(\"insertion types\") { check(PlatformDao.selectF.query[Platform]) }\n+\n+    test(\"update\") {\n+        val transaction = for {\n+            usr <- defaultUserQ\n+            platformIn <- createPlatform\n+            platformUpdate <- PlatformDao.update(platformIn, platformIn.id, usr)\n+        } yield platformUpdate\n+\n+        transaction.transact(xa).unsafeRunSync shouldBe 1","path":"app-backend/db/src/test/scala/com/azavea/rf/database/PlatformDaoSpec.scala","position":null,"original_position":49,"commit_id":"c4b1d04d44203df275e6da5ef17368c5419ef90a","original_commit_id":"55c37d3845aff299290b91711832754123581c93","user":{"login":"jisantuc","id":5702984,"avatar_url":"https://avatars3.githubusercontent.com/u/5702984?v=4","gravatar_id":"","url":"https://api.github.com/users/jisantuc","html_url":"https://github.com/jisantuc","followers_url":"https://api.github.com/users/jisantuc/followers","following_url":"https://api.github.com/users/jisantuc/following{/other_user}","gists_url":"https://api.github.com/users/jisantuc/gists{/gist_id}","starred_url":"https://api.github.com/users/jisantuc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jisantuc/subscriptions","organizations_url":"https://api.github.com/users/jisantuc/orgs","repos_url":"https://api.github.com/users/jisantuc/repos","events_url":"https://api.github.com/users/jisantuc/events{/privacy}","received_events_url":"https://api.github.com/users/jisantuc/received_events","type":"User","site_admin":false},"body":"Maybe skip this also since the testing branch has a more robust strategy for this","created_at":"2018-04-10T14:08:20Z","updated_at":"2018-04-10T14:08:20Z","html_url":"https://github.com/raster-foundry/raster-foundry/pull/3125#discussion_r180434383","pull_request_url":"https://api.github.com/repos/raster-foundry/raster-foundry/pulls/3125","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/raster-foundry/raster-foundry/pulls/comments/180434383"},"html":{"href":"https://github.com/raster-foundry/raster-foundry/pull/3125#discussion_r180434383"},"pull_request":{"href":"https://api.github.com/repos/raster-foundry/raster-foundry/pulls/3125"}},"in_reply_to_id":180193644},"pull_request":{"url":"https://api.github.com/repos/raster-foundry/raster-foundry/pulls/3125","id":179210155,"html_url":"https://github.com/raster-foundry/raster-foundry/pull/3125","diff_url":"https://github.com/raster-foundry/raster-foundry/pull/3125.diff","patch_url":"https://github.com/raster-foundry/raster-foundry/pull/3125.patch","issue_url":"https://api.github.com/repos/raster-foundry/raster-foundry/issues/3125","number":3125,"state":"open","locked":false,"title":"[Platforms] Add platform datamodel, DAO, DAOSpec, and Routes","user":{"login":"alkamin","id":2442245,"avatar_url":"https://avatars2.githubusercontent.com/u/2442245?v=4","gravatar_id":"","url":"https://api.github.com/users/alkamin","html_url":"https://github.com/alkamin","followers_url":"https://api.github.com/users/alkamin/followers","following_url":"https://api.github.com/users/alkamin/following{/other_user}","gists_url":"https://api.github.com/users/alkamin/gists{/gist_id}","starred_url":"https://api.github.com/users/alkamin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alkamin/subscriptions","organizations_url":"https://api.github.com/users/alkamin/orgs","repos_url":"https://api.github.com/users/alkamin/repos","events_url":"https://api.github.com/users/alkamin/events{/privacy}","received_events_url":"https://api.github.com/users/alkamin/received_events","type":"User","site_admin":false},"body":"## Overview\r\n\r\nNote that this is a PR against the platform branch.\r\n\r\nThis PR adds a datamodel, DAO, DAO tests, and routes for platforms.\r\n\r\n### Checklist\r\n\r\n~- [ ] Styleguide updated, if necessary~\r\n~- [ ] Swagger specification updated, if necessary~\r\n~- [ ] Symlinks from new migrations present or corrected for any new migrations~\r\n- [x] PR has a name that won't get you publicly shamed for vagueness\r\n\r\n### Notes\r\n\r\nYou'll need this sql snippet, which is in place of making a migration. We'll need to formulate a plan to address migrations on our long running feature branches.\r\n\r\n```sql\r\nCREATE TABLE platforms (\r\n    id UUID PRIMARY KEY NOT NULL,\r\n    created_at TIMESTAMP NOT NULL,\r\n    created_by VARCHAR(255) REFERENCES users(id) NOT NULL,\r\n    modified_at TIMESTAMP NOT NULL,\r\n    modified_by VARCHAR(255) REFERENCES users(id) NOT NULL,\r\n    name TEXT NOT NULL,\r\n    settings JSONB NOT NULL default '{}'\r\n);\r\n```\r\n## Testing Instructions\r\n\r\n * Run the above SQL manually\r\n * Make sure it compiles\r\n * `db/test`\r\n\r\nCloses #3089\r\n","created_at":"2018-04-03T20:25:21Z","updated_at":"2018-04-10T14:08:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2dcccb38416dfce1512830d56389da2fd1038bb1","assignee":{"login":"jisantuc","id":5702984,"avatar_url":"https://avatars3.githubusercontent.com/u/5702984?v=4","gravatar_id":"","url":"https://api.github.com/users/jisantuc","html_url":"https://github.com/jisantuc","followers_url":"https://api.github.com/users/jisantuc/followers","following_url":"https://api.github.com/users/jisantuc/following{/other_user}","gists_url":"https://api.github.com/users/jisantuc/gists{/gist_id}","starred_url":"https://api.github.com/users/jisantuc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jisantuc/subscriptions","organizations_url":"https://api.github.com/users/jisantuc/orgs","repos_url":"https://api.github.com/users/jisantuc/repos","events_url":"https://api.github.com/users/jisantuc/events{/privacy}","received_events_url":"https://api.github.com/users/jisantuc/received_events","type":"User","site_admin":false},"assignees":[{"login":"jisantuc","id":5702984,"avatar_url":"https://avatars3.githubusercontent.com/u/5702984?v=4","gravatar_id":"","url":"https://api.github.com/users/jisantuc","html_url":"https://github.com/jisantuc","followers_url":"https://api.github.com/users/jisantuc/followers","following_url":"https://api.github.com/users/jisantuc/following{/other_user}","gists_url":"https://api.github.com/users/jisantuc/gists{/gist_id}","starred_url":"https://api.github.com/users/jisantuc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jisantuc/subscriptions","organizations_url":"https://api.github.com/users/jisantuc/orgs","repos_url":"https://api.github.com/users/jisantuc/repos","events_url":"https://api.github.com/users/jisantuc/events{/privacy}","received_events_url":"https://api.github.com/users/jisantuc/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/raster-foundry/raster-foundry/pulls/3125/commits","review_comments_url":"https://api.github.com/repos/raster-foundry/raster-foundry/pulls/3125/comments","review_comment_url":"https://api.github.com/repos/raster-foundry/raster-foundry/pulls/comments{/number}","comments_url":"https://api.github.com/repos/raster-foundry/raster-foundry/issues/3125/comments","statuses_url":"https://api.github.com/repos/raster-foundry/raster-foundry/statuses/c4b1d04d44203df275e6da5ef17368c5419ef90a","head":{"label":"raster-foundry:feature/ak/platforms-and-org-management","ref":"feature/ak/platforms-and-org-management","sha":"c4b1d04d44203df275e6da5ef17368c5419ef90a","user":{"login":"raster-foundry","id":30530043,"avatar_url":"https://avatars3.githubusercontent.com/u/30530043?v=4","gravatar_id":"","url":"https://api.github.com/users/raster-foundry","html_url":"https://github.com/raster-foundry","followers_url":"https://api.github.com/users/raster-foundry/followers","following_url":"https://api.github.com/users/raster-foundry/following{/other_user}","gists_url":"https://api.github.com/users/raster-foundry/gists{/gist_id}","starred_url":"https://api.github.com/users/raster-foundry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raster-foundry/subscriptions","organizations_url":"https://api.github.com/users/raster-foundry/orgs","repos_url":"https://api.github.com/users/raster-foundry/repos","events_url":"https://api.github.com/users/raster-foundry/events{/privacy}","received_events_url":"https://api.github.com/users/raster-foundry/received_events","type":"Organization","site_admin":false},"repo":{"id":36464140,"name":"raster-foundry","full_name":"raster-foundry/raster-foundry","owner":{"login":"raster-foundry","id":30530043,"avatar_url":"https://avatars3.githubusercontent.com/u/30530043?v=4","gravatar_id":"","url":"https://api.github.com/users/raster-foundry","html_url":"https://github.com/raster-foundry","followers_url":"https://api.github.com/users/raster-foundry/followers","following_url":"https://api.github.com/users/raster-foundry/following{/other_user}","gists_url":"https://api.github.com/users/raster-foundry/gists{/gist_id}","starred_url":"https://api.github.com/users/raster-foundry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raster-foundry/subscriptions","organizations_url":"https://api.github.com/users/raster-foundry/orgs","repos_url":"https://api.github.com/users/raster-foundry/repos","events_url":"https://api.github.com/users/raster-foundry/events{/privacy}","received_events_url":"https://api.github.com/users/raster-foundry/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/raster-foundry/raster-foundry","description":"The Raster Foundry web application.","fork":false,"url":"https://api.github.com/repos/raster-foundry/raster-foundry","forks_url":"https://api.github.com/repos/raster-foundry/raster-foundry/forks","keys_url":"https://api.github.com/repos/raster-foundry/raster-foundry/keys{/key_id}","collaborators_url":"https://api.github.com/repos/raster-foundry/raster-foundry/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/raster-foundry/raster-foundry/teams","hooks_url":"https://api.github.com/repos/raster-foundry/raster-foundry/hooks","issue_events_url":"https://api.github.com/repos/raster-foundry/raster-foundry/issues/events{/number}","events_url":"https://api.github.com/repos/raster-foundry/raster-foundry/events","assignees_url":"https://api.github.com/repos/raster-foundry/raster-foundry/assignees{/user}","branches_url":"https://api.github.com/repos/raster-foundry/raster-foundry/branches{/branch}","tags_url":"https://api.github.com/repos/raster-foundry/raster-foundry/tags","blobs_url":"https://api.github.com/repos/raster-foundry/raster-foundry/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/raster-foundry/raster-foundry/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/raster-foundry/raster-foundry/git/refs{/sha}","trees_url":"https://api.github.com/repos/raster-foundry/raster-foundry/git/trees{/sha}","statuses_url":"https://api.github.com/repos/raster-foundry/raster-foundry/statuses/{sha}","languages_url":"https://api.github.com/repos/raster-foundry/raster-foundry/languages","stargazers_url":"https://api.github.com/repos/raster-foundry/raster-foundry/stargazers","contributors_url":"https://api.github.com/repos/raster-foundry/raster-foundry/contributors","subscribers_url":"https://api.github.com/repos/raster-foundry/raster-foundry/subscribers","subscription_url":"https://api.github.com/repos/raster-foundry/raster-foundry/subscription","commits_url":"https://api.github.com/repos/raster-foundry/raster-foundry/commits{/sha}","git_commits_url":"https://api.github.com/repos/raster-foundry/raster-foundry/git/commits{/sha}","comments_url":"https://api.github.com/repos/raster-foundry/raster-foundry/comments{/number}","issue_comment_url":"https://api.github.com/repos/raster-foundry/raster-foundry/issues/comments{/number}","contents_url":"https://api.github.com/repos/raster-foundry/raster-foundry/contents/{+path}","compare_url":"https://api.github.com/repos/raster-foundry/raster-foundry/compare/{base}...{head}","merges_url":"https://api.github.com/repos/raster-foundry/raster-foundry/merges","archive_url":"https://api.github.com/repos/raster-foundry/raster-foundry/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/raster-foundry/raster-foundry/downloads","issues_url":"https://api.github.com/repos/raster-foundry/raster-foundry/issues{/number}","pulls_url":"https://api.github.com/repos/raster-foundry/raster-foundry/pulls{/number}","milestones_url":"https://api.github.com/repos/raster-foundry/raster-foundry/milestones{/number}","notifications_url":"https://api.github.com/repos/raster-foundry/raster-foundry/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/raster-foundry/raster-foundry/labels{/name}","releases_url":"https://api.github.com/repos/raster-foundry/raster-foundry/releases{/id}","deployments_url":"https://api.github.com/repos/raster-foundry/raster-foundry/deployments","created_at":"2015-05-28T20:25:45Z","updated_at":"2018-04-04T19:49:20Z","pushed_at":"2018-04-10T12:26:45Z","git_url":"git://github.com/raster-foundry/raster-foundry.git","ssh_url":"git@github.com:raster-foundry/raster-foundry.git","clone_url":"https://github.com/raster-foundry/raster-foundry.git","svn_url":"https://github.com/raster-foundry/raster-foundry","homepage":"https://www.rasterfoundry.com","size":35793,"stargazers_count":52,"watchers_count":52,"language":"CSS","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":25,"mirror_url":null,"archived":false,"open_issues_count":396,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":25,"open_issues":396,"watchers":52,"default_branch":"develop"}},"base":{"label":"raster-foundry:feature/platforms","ref":"feature/platforms","sha":"8f1d736d73751d69165ad14710cfddd76dcc2525","user":{"login":"raster-foundry","id":30530043,"avatar_url":"https://avatars3.githubusercontent.com/u/30530043?v=4","gravatar_id":"","url":"https://api.github.com/users/raster-foundry","html_url":"https://github.com/raster-foundry","followers_url":"https://api.github.com/users/raster-foundry/followers","following_url":"https://api.github.com/users/raster-foundry/following{/other_user}","gists_url":"https://api.github.com/users/raster-foundry/gists{/gist_id}","starred_url":"https://api.github.com/users/raster-foundry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raster-foundry/subscriptions","organizations_url":"https://api.github.com/users/raster-foundry/orgs","repos_url":"https://api.github.com/users/raster-foundry/repos","events_url":"https://api.github.com/users/raster-foundry/events{/privacy}","received_events_url":"https://api.github.com/users/raster-foundry/received_events","type":"Organization","site_admin":false},"repo":{"id":36464140,"name":"raster-foundry","full_name":"raster-foundry/raster-foundry","owner":{"login":"raster-foundry","id":30530043,"avatar_url":"https://avatars3.githubusercontent.com/u/30530043?v=4","gravatar_id":"","url":"https://api.github.com/users/raster-foundry","html_url":"https://github.com/raster-foundry","followers_url":"https://api.github.com/users/raster-foundry/followers","following_url":"https://api.github.com/users/raster-foundry/following{/other_user}","gists_url":"https://api.github.com/users/raster-foundry/gists{/gist_id}","starred_url":"https://api.github.com/users/raster-foundry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raster-foundry/subscriptions","organizations_url":"https://api.github.com/users/raster-foundry/orgs","repos_url":"https://api.github.com/users/raster-foundry/repos","events_url":"https://api.github.com/users/raster-foundry/events{/privacy}","received_events_url":"https://api.github.com/users/raster-foundry/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/raster-foundry/raster-foundry","description":"The Raster Foundry web application.","fork":false,"url":"https://api.github.com/repos/raster-foundry/raster-foundry","forks_url":"https://api.github.com/repos/raster-foundry/raster-foundry/forks","keys_url":"https://api.github.com/repos/raster-foundry/raster-foundry/keys{/key_id}","collaborators_url":"https://api.github.com/repos/raster-foundry/raster-foundry/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/raster-foundry/raster-foundry/teams","hooks_url":"https://api.github.com/repos/raster-foundry/raster-foundry/hooks","issue_events_url":"https://api.github.com/repos/raster-foundry/raster-foundry/issues/events{/number}","events_url":"https://api.github.com/repos/raster-foundry/raster-foundry/events","assignees_url":"https://api.github.com/repos/raster-foundry/raster-foundry/assignees{/user}","branches_url":"https://api.github.com/repos/raster-foundry/raster-foundry/branches{/branch}","tags_url":"https://api.github.com/repos/raster-foundry/raster-foundry/tags","blobs_url":"https://api.github.com/repos/raster-foundry/raster-foundry/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/raster-foundry/raster-foundry/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/raster-foundry/raster-foundry/git/refs{/sha}","trees_url":"https://api.github.com/repos/raster-foundry/raster-foundry/git/trees{/sha}","statuses_url":"https://api.github.com/repos/raster-foundry/raster-foundry/statuses/{sha}","languages_url":"https://api.github.com/repos/raster-foundry/raster-foundry/languages","stargazers_url":"https://api.github.com/repos/raster-foundry/raster-foundry/stargazers","contributors_url":"https://api.github.com/repos/raster-foundry/raster-foundry/contributors","subscribers_url":"https://api.github.com/repos/raster-foundry/raster-foundry/subscribers","subscription_url":"https://api.github.com/repos/raster-foundry/raster-foundry/subscription","commits_url":"https://api.github.com/repos/raster-foundry/raster-foundry/commits{/sha}","git_commits_url":"https://api.github.com/repos/raster-foundry/raster-foundry/git/commits{/sha}","comments_url":"https://api.github.com/repos/raster-foundry/raster-foundry/comments{/number}","issue_comment_url":"https://api.github.com/repos/raster-foundry/raster-foundry/issues/comments{/number}","contents_url":"https://api.github.com/repos/raster-foundry/raster-foundry/contents/{+path}","compare_url":"https://api.github.com/repos/raster-foundry/raster-foundry/compare/{base}...{head}","merges_url":"https://api.github.com/repos/raster-foundry/raster-foundry/merges","archive_url":"https://api.github.com/repos/raster-foundry/raster-foundry/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/raster-foundry/raster-foundry/downloads","issues_url":"https://api.github.com/repos/raster-foundry/raster-foundry/issues{/number}","pulls_url":"https://api.github.com/repos/raster-foundry/raster-foundry/pulls{/number}","milestones_url":"https://api.github.com/repos/raster-foundry/raster-foundry/milestones{/number}","notifications_url":"https://api.github.com/repos/raster-foundry/raster-foundry/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/raster-foundry/raster-foundry/labels{/name}","releases_url":"https://api.github.com/repos/raster-foundry/raster-foundry/releases{/id}","deployments_url":"https://api.github.com/repos/raster-foundry/raster-foundry/deployments","created_at":"2015-05-28T20:25:45Z","updated_at":"2018-04-04T19:49:20Z","pushed_at":"2018-04-10T12:26:45Z","git_url":"git://github.com/raster-foundry/raster-foundry.git","ssh_url":"git@github.com:raster-foundry/raster-foundry.git","clone_url":"https://github.com/raster-foundry/raster-foundry.git","svn_url":"https://github.com/raster-foundry/raster-foundry","homepage":"https://www.rasterfoundry.com","size":35793,"stargazers_count":52,"watchers_count":52,"language":"CSS","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":25,"mirror_url":null,"archived":false,"open_issues_count":396,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":25,"open_issues":396,"watchers":52,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/raster-foundry/raster-foundry/pulls/3125"},"html":{"href":"https://github.com/raster-foundry/raster-foundry/pull/3125"},"issue":{"href":"https://api.github.com/repos/raster-foundry/raster-foundry/issues/3125"},"comments":{"href":"https://api.github.com/repos/raster-foundry/raster-foundry/issues/3125/comments"},"review_comments":{"href":"https://api.github.com/repos/raster-foundry/raster-foundry/pulls/3125/comments"},"review_comment":{"href":"https://api.github.com/repos/raster-foundry/raster-foundry/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/raster-foundry/raster-foundry/pulls/3125/commits"},"statuses":{"href":"https://api.github.com/repos/raster-foundry/raster-foundry/statuses/c4b1d04d44203df275e6da5ef17368c5419ef90a"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"jisantuc"}}