{"action":"created","comment":{"url":"https://api.github.com/repos/foglamp/FogLAMP/pulls/comments/214734445","pull_request_review_id":151849759,"id":214734445,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNDczNDQ0NQ==","diff_hunk":"@@ -0,0 +1,64 @@\n+CREATE SEQUENCE foglamp.destinations_id_seq\n+    INCREMENT 1\n+    START 1\n+    MINVALUE 1\n+    MAXVALUE 9223372036854775807\n+    CACHE 1;\n+\n+CREATE TABLE foglamp.destinations (\n+       id            integer                     NOT NULL DEFAULT nextval('foglamp.destinations_id_seq'::regclass),   -- Sequence ID\n+       type          smallint                    NOT NULL DEFAULT 1,                                                  -- Enum : 1: OMF, 2: Elasticsearch\n+       description   character varying(255)      NOT NULL DEFAULT ''::character varying COLLATE pg_catalog.\"default\", -- A brief description of the destination entry\n+       properties    jsonb                       NOT NULL DEFAULT '{ \"streaming\" : \"all\" }'::jsonb,                   -- A generic set of properties\n+       active_window jsonb                       NOT NULL DEFAULT '[ \"always\" ]'::jsonb,                              -- The window of operations\n+       active        boolean                     NOT NULL DEFAULT true,                                               -- When false, all streams to this destination stop and are inactive\n+       ts            timestamp(6) with time zone NOT NULL DEFAULT now(),                                              -- Creation or last update\n+       CONSTRAINT destination_pkey PRIMARY KEY (id) );\n+\n+INSERT INTO foglamp.destinations ( id, description )\n+       VALUES (0, 'none' );\n+\n+-- Add the constraint to the the table\n+BEGIN TRANSACTION;\n+DROP TABLE IF EXISTS foglamp.streams_old;\n+ALTER TABLE foglamp.streams RENAME TO streams_old;\n+\n+ALTER TABLE foglamp.streams_old RENAME CONSTRAINT strerams_pkey TO strerams_pkey_old;\n+\n+CREATE TABLE foglamp.streams (\n+       id             integer                     NOT NULL DEFAULT nextval('foglamp.streams_id_seq'::regclass),         -- Sequence ID\n+       destination_id integer                     NOT NULL ,                                                            -- FK to foglamp.destinations\n+       description    character varying(255)      NOT NULL DEFAULT ''::character varying COLLATE pg_catalog.\"default\",  -- A brief description of the stream entry\n+       properties     jsonb                       NOT NULL DEFAULT '{}'::jsonb,                                         -- A generic set of properties\n+       object_stream  jsonb                       NOT NULL DEFAULT '{}'::jsonb,                                         -- Definition of what must be streamed\n+       object_block   jsonb                       NOT NULL DEFAULT '{}'::jsonb,                                         -- Definition of how the stream must be organised\n+       object_filter  jsonb                       NOT NULL DEFAULT '{}'::jsonb,                                         -- Any filter involved in selecting the data to stream\n+       active_window  jsonb                       NOT NULL DEFAULT '{}'::jsonb,                                         -- The window of operations\n+       active         boolean                     NOT NULL DEFAULT true,                                                -- When false, all data to this stream stop and are inactive\n+       last_object    bigint                      NOT NULL DEFAULT 0,                                                   -- The ID of the last object streamed (asset or reading, depending on the object_stream)\n+       ts             timestamp(6) with time zone NOT NULL DEFAULT now(),                                               -- Creation or last update\n+       CONSTRAINT strerams_pkey PRIMARY KEY (id),\n+       CONSTRAINT streams_fk1 FOREIGN KEY (destination_id)\n+       REFERENCES foglamp.destinations (id) MATCH SIMPLE\n+               ON UPDATE NO ACTION\n+               ON DELETE NO ACTION );\n+\n+INSERT INTO foglamp.streams\n+        SELECT\n+            id,\n+            0,","path":"scripts/plugins/storage/postgres/downgrade/11.sql","position":49,"original_position":49,"commit_id":"d423b7a790ccaea3fa8860f72cf93d2e293cd530","original_commit_id":"d423b7a790ccaea3fa8860f72cf93d2e293cd530","user":{"login":"praveen-garg","id":1974003,"node_id":"MDQ6VXNlcjE5NzQwMDM=","avatar_url":"https://avatars2.githubusercontent.com/u/1974003?v=4","gravatar_id":"","url":"https://api.github.com/users/praveen-garg","html_url":"https://github.com/praveen-garg","followers_url":"https://api.github.com/users/praveen-garg/followers","following_url":"https://api.github.com/users/praveen-garg/following{/other_user}","gists_url":"https://api.github.com/users/praveen-garg/gists{/gist_id}","starred_url":"https://api.github.com/users/praveen-garg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/praveen-garg/subscriptions","organizations_url":"https://api.github.com/users/praveen-garg/orgs","repos_url":"https://api.github.com/users/praveen-garg/repos","events_url":"https://api.github.com/users/praveen-garg/events{/privacy}","received_events_url":"https://api.github.com/users/praveen-garg/received_events","type":"User","site_admin":false},"body":"why hard-coded 0?","created_at":"2018-09-03T16:44:55Z","updated_at":"2018-09-03T16:44:55Z","html_url":"https://github.com/foglamp/FogLAMP/pull/1057#discussion_r214734445","pull_request_url":"https://api.github.com/repos/foglamp/FogLAMP/pulls/1057","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/foglamp/FogLAMP/pulls/comments/214734445"},"html":{"href":"https://github.com/foglamp/FogLAMP/pull/1057#discussion_r214734445"},"pull_request":{"href":"https://api.github.com/repos/foglamp/FogLAMP/pulls/1057"}}},"pull_request":{"url":"https://api.github.com/repos/foglamp/FogLAMP/pulls/1057","id":211780295,"node_id":"MDExOlB1bGxSZXF1ZXN0MjExNzgwMjk1","html_url":"https://github.com/foglamp/FogLAMP/pull/1057","diff_url":"https://github.com/foglamp/FogLAMP/pull/1057.diff","patch_url":"https://github.com/foglamp/FogLAMP/pull/1057.patch","issue_url":"https://api.github.com/repos/foglamp/FogLAMP/issues/1057","number":1057,"state":"open","locked":false,"title":"Fogl 1641 : The destinations table is obsolete and will be removed","user":{"login":"sstefano69","id":4919069,"node_id":"MDQ6VXNlcjQ5MTkwNjk=","avatar_url":"https://avatars3.githubusercontent.com/u/4919069?v=4","gravatar_id":"","url":"https://api.github.com/users/sstefano69","html_url":"https://github.com/sstefano69","followers_url":"https://api.github.com/users/sstefano69/followers","following_url":"https://api.github.com/users/sstefano69/following{/other_user}","gists_url":"https://api.github.com/users/sstefano69/gists{/gist_id}","starred_url":"https://api.github.com/users/sstefano69/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sstefano69/subscriptions","organizations_url":"https://api.github.com/users/sstefano69/orgs","repos_url":"https://api.github.com/users/sstefano69/repos","events_url":"https://api.github.com/users/sstefano69/events{/privacy}","received_events_url":"https://api.github.com/users/sstefano69/received_events","type":"User","site_admin":false},"body":"**ready**","created_at":"2018-08-29T14:45:09Z","updated_at":"2018-09-03T16:44:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"23cd9cff66a7f355c3def74090abfec5aa2f1d2d","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":944296659,"node_id":"MDU6TGFiZWw5NDQyOTY2NTk=","url":"https://api.github.com/repos/foglamp/FogLAMP/labels/DO%20NOT%20MERGE%20YET","name":"DO NOT MERGE YET","color":"ce4057","default":false},{"id":684030137,"node_id":"MDU6TGFiZWw2ODQwMzAxMzc=","url":"https://api.github.com/repos/foglamp/FogLAMP/labels/architectural_review_pending","name":"architectural_review_pending","color":"fbca04","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/foglamp/FogLAMP/pulls/1057/commits","review_comments_url":"https://api.github.com/repos/foglamp/FogLAMP/pulls/1057/comments","review_comment_url":"https://api.github.com/repos/foglamp/FogLAMP/pulls/comments{/number}","comments_url":"https://api.github.com/repos/foglamp/FogLAMP/issues/1057/comments","statuses_url":"https://api.github.com/repos/foglamp/FogLAMP/statuses/d423b7a790ccaea3fa8860f72cf93d2e293cd530","head":{"label":"foglamp:FOGL-1641","ref":"FOGL-1641","sha":"d423b7a790ccaea3fa8860f72cf93d2e293cd530","user":{"login":"foglamp","id":27822234,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI3ODIyMjM0","avatar_url":"https://avatars0.githubusercontent.com/u/27822234?v=4","gravatar_id":"","url":"https://api.github.com/users/foglamp","html_url":"https://github.com/foglamp","followers_url":"https://api.github.com/users/foglamp/followers","following_url":"https://api.github.com/users/foglamp/following{/other_user}","gists_url":"https://api.github.com/users/foglamp/gists{/gist_id}","starred_url":"https://api.github.com/users/foglamp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/foglamp/subscriptions","organizations_url":"https://api.github.com/users/foglamp/orgs","repos_url":"https://api.github.com/users/foglamp/repos","events_url":"https://api.github.com/users/foglamp/events{/privacy}","received_events_url":"https://api.github.com/users/foglamp/received_events","type":"Organization","site_admin":false},"repo":{"id":88887957,"node_id":"MDEwOlJlcG9zaXRvcnk4ODg4Nzk1Nw==","name":"FogLAMP","full_name":"foglamp/FogLAMP","owner":{"login":"foglamp","id":27822234,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI3ODIyMjM0","avatar_url":"https://avatars0.githubusercontent.com/u/27822234?v=4","gravatar_id":"","url":"https://api.github.com/users/foglamp","html_url":"https://github.com/foglamp","followers_url":"https://api.github.com/users/foglamp/followers","following_url":"https://api.github.com/users/foglamp/following{/other_user}","gists_url":"https://api.github.com/users/foglamp/gists{/gist_id}","starred_url":"https://api.github.com/users/foglamp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/foglamp/subscriptions","organizations_url":"https://api.github.com/users/foglamp/orgs","repos_url":"https://api.github.com/users/foglamp/repos","events_url":"https://api.github.com/users/foglamp/events{/privacy}","received_events_url":"https://api.github.com/users/foglamp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/foglamp/FogLAMP","description":"An open source platform for the Internet of Things, it acts as an edge gateway between sensor devices and cloud storage systems","fork":false,"url":"https://api.github.com/repos/foglamp/FogLAMP","forks_url":"https://api.github.com/repos/foglamp/FogLAMP/forks","keys_url":"https://api.github.com/repos/foglamp/FogLAMP/keys{/key_id}","collaborators_url":"https://api.github.com/repos/foglamp/FogLAMP/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/foglamp/FogLAMP/teams","hooks_url":"https://api.github.com/repos/foglamp/FogLAMP/hooks","issue_events_url":"https://api.github.com/repos/foglamp/FogLAMP/issues/events{/number}","events_url":"https://api.github.com/repos/foglamp/FogLAMP/events","assignees_url":"https://api.github.com/repos/foglamp/FogLAMP/assignees{/user}","branches_url":"https://api.github.com/repos/foglamp/FogLAMP/branches{/branch}","tags_url":"https://api.github.com/repos/foglamp/FogLAMP/tags","blobs_url":"https://api.github.com/repos/foglamp/FogLAMP/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/foglamp/FogLAMP/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/foglamp/FogLAMP/git/refs{/sha}","trees_url":"https://api.github.com/repos/foglamp/FogLAMP/git/trees{/sha}","statuses_url":"https://api.github.com/repos/foglamp/FogLAMP/statuses/{sha}","languages_url":"https://api.github.com/repos/foglamp/FogLAMP/languages","stargazers_url":"https://api.github.com/repos/foglamp/FogLAMP/stargazers","contributors_url":"https://api.github.com/repos/foglamp/FogLAMP/contributors","subscribers_url":"https://api.github.com/repos/foglamp/FogLAMP/subscribers","subscription_url":"https://api.github.com/repos/foglamp/FogLAMP/subscription","commits_url":"https://api.github.com/repos/foglamp/FogLAMP/commits{/sha}","git_commits_url":"https://api.github.com/repos/foglamp/FogLAMP/git/commits{/sha}","comments_url":"https://api.github.com/repos/foglamp/FogLAMP/comments{/number}","issue_comment_url":"https://api.github.com/repos/foglamp/FogLAMP/issues/comments{/number}","contents_url":"https://api.github.com/repos/foglamp/FogLAMP/contents/{+path}","compare_url":"https://api.github.com/repos/foglamp/FogLAMP/compare/{base}...{head}","merges_url":"https://api.github.com/repos/foglamp/FogLAMP/merges","archive_url":"https://api.github.com/repos/foglamp/FogLAMP/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/foglamp/FogLAMP/downloads","issues_url":"https://api.github.com/repos/foglamp/FogLAMP/issues{/number}","pulls_url":"https://api.github.com/repos/foglamp/FogLAMP/pulls{/number}","milestones_url":"https://api.github.com/repos/foglamp/FogLAMP/milestones{/number}","notifications_url":"https://api.github.com/repos/foglamp/FogLAMP/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/foglamp/FogLAMP/labels{/name}","releases_url":"https://api.github.com/repos/foglamp/FogLAMP/releases{/id}","deployments_url":"https://api.github.com/repos/foglamp/FogLAMP/deployments","created_at":"2017-04-20T16:35:27Z","updated_at":"2018-09-03T15:18:28Z","pushed_at":"2018-09-03T16:28:52Z","git_url":"git://github.com/foglamp/FogLAMP.git","ssh_url":"git@github.com:foglamp/FogLAMP.git","clone_url":"https://github.com/foglamp/FogLAMP.git","svn_url":"https://github.com/foglamp/FogLAMP","homepage":"http://foglamp.readthedocs.io/","size":14442,"stargazers_count":27,"watchers_count":27,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":20,"mirror_url":null,"archived":false,"open_issues_count":10,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":20,"open_issues":10,"watchers":27,"default_branch":"develop"}},"base":{"label":"foglamp:develop","ref":"develop","sha":"1b3571b973238a4448c01f29a04fe2a542f581ef","user":{"login":"foglamp","id":27822234,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI3ODIyMjM0","avatar_url":"https://avatars0.githubusercontent.com/u/27822234?v=4","gravatar_id":"","url":"https://api.github.com/users/foglamp","html_url":"https://github.com/foglamp","followers_url":"https://api.github.com/users/foglamp/followers","following_url":"https://api.github.com/users/foglamp/following{/other_user}","gists_url":"https://api.github.com/users/foglamp/gists{/gist_id}","starred_url":"https://api.github.com/users/foglamp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/foglamp/subscriptions","organizations_url":"https://api.github.com/users/foglamp/orgs","repos_url":"https://api.github.com/users/foglamp/repos","events_url":"https://api.github.com/users/foglamp/events{/privacy}","received_events_url":"https://api.github.com/users/foglamp/received_events","type":"Organization","site_admin":false},"repo":{"id":88887957,"node_id":"MDEwOlJlcG9zaXRvcnk4ODg4Nzk1Nw==","name":"FogLAMP","full_name":"foglamp/FogLAMP","owner":{"login":"foglamp","id":27822234,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI3ODIyMjM0","avatar_url":"https://avatars0.githubusercontent.com/u/27822234?v=4","gravatar_id":"","url":"https://api.github.com/users/foglamp","html_url":"https://github.com/foglamp","followers_url":"https://api.github.com/users/foglamp/followers","following_url":"https://api.github.com/users/foglamp/following{/other_user}","gists_url":"https://api.github.com/users/foglamp/gists{/gist_id}","starred_url":"https://api.github.com/users/foglamp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/foglamp/subscriptions","organizations_url":"https://api.github.com/users/foglamp/orgs","repos_url":"https://api.github.com/users/foglamp/repos","events_url":"https://api.github.com/users/foglamp/events{/privacy}","received_events_url":"https://api.github.com/users/foglamp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/foglamp/FogLAMP","description":"An open source platform for the Internet of Things, it acts as an edge gateway between sensor devices and cloud storage systems","fork":false,"url":"https://api.github.com/repos/foglamp/FogLAMP","forks_url":"https://api.github.com/repos/foglamp/FogLAMP/forks","keys_url":"https://api.github.com/repos/foglamp/FogLAMP/keys{/key_id}","collaborators_url":"https://api.github.com/repos/foglamp/FogLAMP/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/foglamp/FogLAMP/teams","hooks_url":"https://api.github.com/repos/foglamp/FogLAMP/hooks","issue_events_url":"https://api.github.com/repos/foglamp/FogLAMP/issues/events{/number}","events_url":"https://api.github.com/repos/foglamp/FogLAMP/events","assignees_url":"https://api.github.com/repos/foglamp/FogLAMP/assignees{/user}","branches_url":"https://api.github.com/repos/foglamp/FogLAMP/branches{/branch}","tags_url":"https://api.github.com/repos/foglamp/FogLAMP/tags","blobs_url":"https://api.github.com/repos/foglamp/FogLAMP/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/foglamp/FogLAMP/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/foglamp/FogLAMP/git/refs{/sha}","trees_url":"https://api.github.com/repos/foglamp/FogLAMP/git/trees{/sha}","statuses_url":"https://api.github.com/repos/foglamp/FogLAMP/statuses/{sha}","languages_url":"https://api.github.com/repos/foglamp/FogLAMP/languages","stargazers_url":"https://api.github.com/repos/foglamp/FogLAMP/stargazers","contributors_url":"https://api.github.com/repos/foglamp/FogLAMP/contributors","subscribers_url":"https://api.github.com/repos/foglamp/FogLAMP/subscribers","subscription_url":"https://api.github.com/repos/foglamp/FogLAMP/subscription","commits_url":"https://api.github.com/repos/foglamp/FogLAMP/commits{/sha}","git_commits_url":"https://api.github.com/repos/foglamp/FogLAMP/git/commits{/sha}","comments_url":"https://api.github.com/repos/foglamp/FogLAMP/comments{/number}","issue_comment_url":"https://api.github.com/repos/foglamp/FogLAMP/issues/comments{/number}","contents_url":"https://api.github.com/repos/foglamp/FogLAMP/contents/{+path}","compare_url":"https://api.github.com/repos/foglamp/FogLAMP/compare/{base}...{head}","merges_url":"https://api.github.com/repos/foglamp/FogLAMP/merges","archive_url":"https://api.github.com/repos/foglamp/FogLAMP/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/foglamp/FogLAMP/downloads","issues_url":"https://api.github.com/repos/foglamp/FogLAMP/issues{/number}","pulls_url":"https://api.github.com/repos/foglamp/FogLAMP/pulls{/number}","milestones_url":"https://api.github.com/repos/foglamp/FogLAMP/milestones{/number}","notifications_url":"https://api.github.com/repos/foglamp/FogLAMP/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/foglamp/FogLAMP/labels{/name}","releases_url":"https://api.github.com/repos/foglamp/FogLAMP/releases{/id}","deployments_url":"https://api.github.com/repos/foglamp/FogLAMP/deployments","created_at":"2017-04-20T16:35:27Z","updated_at":"2018-09-03T15:18:28Z","pushed_at":"2018-09-03T16:28:52Z","git_url":"git://github.com/foglamp/FogLAMP.git","ssh_url":"git@github.com:foglamp/FogLAMP.git","clone_url":"https://github.com/foglamp/FogLAMP.git","svn_url":"https://github.com/foglamp/FogLAMP","homepage":"http://foglamp.readthedocs.io/","size":14442,"stargazers_count":27,"watchers_count":27,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":20,"mirror_url":null,"archived":false,"open_issues_count":10,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":20,"open_issues":10,"watchers":27,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/foglamp/FogLAMP/pulls/1057"},"html":{"href":"https://github.com/foglamp/FogLAMP/pull/1057"},"issue":{"href":"https://api.github.com/repos/foglamp/FogLAMP/issues/1057"},"comments":{"href":"https://api.github.com/repos/foglamp/FogLAMP/issues/1057/comments"},"review_comments":{"href":"https://api.github.com/repos/foglamp/FogLAMP/pulls/1057/comments"},"review_comment":{"href":"https://api.github.com/repos/foglamp/FogLAMP/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/foglamp/FogLAMP/pulls/1057/commits"},"statuses":{"href":"https://api.github.com/repos/foglamp/FogLAMP/statuses/d423b7a790ccaea3fa8860f72cf93d2e293cd530"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"praveen-garg"}}