# HG changeset patch # User jbe # Date 1344627590 -7200 # Node ID 0a42a2600a2b7b96dec8e5331c74286b85cda3ad # Parent 028a52d23e568c53afc3757c9c887402cd6feb2f Included old API tables maked as "deprecated" to allow testing with alpha api and preliminary authorization interface after core update to v2.1 diff -r 028a52d23e56 -r 0a42a2600a2b core.sql --- a/core.sql Fri Aug 10 16:50:14 2012 +0200 +++ b/core.sql Fri Aug 10 21:39:50 2012 +0200 @@ -170,6 +170,26 @@ COMMENT ON COLUMN "member"."statement" IS 'Freely chosen text of the member for his/her profile'; +CREATE TYPE "application_access_level" AS ENUM + ('member', 'full', 'pseudonymous', 'anonymous'); + +COMMENT ON TYPE "application_access_level" IS 'DEPRECATED, WILL BE REMOVED! Access privileges for applications using the API'; + + +CREATE TABLE "member_application" ( + "id" SERIAL8 PRIMARY KEY, + UNIQUE ("member_id", "name"), + "member_id" INT4 NOT NULL REFERENCES "member" ("id") + ON DELETE CASCADE ON UPDATE CASCADE, + "name" TEXT NOT NULL, + "comment" TEXT, + "access_level" "application_access_level" NOT NULL, + "key" TEXT NOT NULL UNIQUE, + "last_usage" TIMESTAMPTZ ); + +COMMENT ON TABLE "member_application" IS 'DEPRECATED, WILL BE REMOVED! Registered application being allowed to use the API'; + + CREATE TYPE "api_access_level" AS ENUM ( 'none', 'anonymous', 'authors_pseudonymous', 'all_pseudonymous', 'everything', 'member' );