open-bounty/resources/migrations/20170215174652-repo-enable-state.up.sql
Teemu Patja d35b794ca4
New UX, webhook securing, atomic repo toggling etc.
Secure Github webhooks (Fixes #18)
* Use a unique random secret for webhooks
* Validate payload signature when receiving webhook

Make enabling + disabling a repo more robust
* store repository state instead of enabled flag in DB
* atomic toggle UI button (Fixes #17)

New UX for managing repos
* group repos by owner
* look and feel according to UI spec

General improvements
* only request user's repos via Github API once per session
* fix issue with cljs code figwheel reload
* simplify app-db structure
2017-02-18 11:07:51 +02:00

16 lines
603 B
SQL

CREATE TABLE "public"."repo_state" (
"id" int,
"description" character varying(32) NOT NULL,
PRIMARY KEY ("id")
);
INSERT INTO "public"."repo_state"("id", "description") VALUES(0, 'Not enabled');
INSERT INTO "public"."repo_state"("id", "description") VALUES(1, 'Creating hook');
INSERT INTO "public"."repo_state"("id", "description") VALUES(2, 'Enabled');
INSERT INTO "public"."repo_state"("id", "description") VALUES(-1, 'Failed to create hook');
ALTER TABLE "public"."repositories" DROP COLUMN "enabled";
ALTER TABLE "public"."repositories"
ADD COLUMN "state" int NOT NULL DEFAULT 0;