 
 CREATE TABLE "api_client" (
         "id"                    SERIAL8         PRIMARY KEY,
-        "name"                  TEXT            NOT NULL,
+        "name"                  TEXT,
         UNIQUE ("member_id", "client_identifier"),
         "member_id"             INT4            REFERENCES "member" ("id")
                                                 ON DELETE CASCADE ON UPDATE CASCADE,

        CONSTRAINT "one_of_authorization_code_and_refresh_token_set"
          CHECK ("authorization_code" NOTNULL OR "refresh_token" NOTNULL),
        CONSTRAINT "refresh_token_if_and_only_if_refreshed"
          CHECK ("refreshed" NOTNULL = "refresh_token" NOTNULL) );

COMMENT ON TABLE "api_access" IS 'Issued OAuth2 authorization codes and refresh tokens';

COMMENT ON COLUMN "api_access"."created"              IS 'Date/time when authorization code (or first refresh token when there is no authorization code) has been created';
COMMENT ON COLUMN "api_access"."authorization_code"   IS 'OAuth2 authorization code';
COMMENT ON COLUMN "api_access"."refreshed"            IS 'Date/time of last refresh';
COMMENT ON COLUMN "api_access"."refresh_token"        IS 'OAuth2 refresh token';


                                                ON DELETE CASCADE ON UPDATE CASCADE,
        "member_id"             INT4            REFERENCES "member" ("id")
                                                ON DELETE CASCADE ON UPDATE CASCADE,
        "access_level"          "api_access_level" NOT NULL,
        "validity_period"       INTERVAL        NOT NULL,
        "created"               TIMESTAMPTZ     NOT NULL DEFAULT now(),
        "authorization_code"    TEXT,
        "refreshed"             TIMESTAMPTZ,
