auth

Main authentication module for my projects
git clone git://git.finwo.net/app/auth
Log | Files | Refs

007_client_consents.sql (508B)


      1 CREATE TABLE client_consents (
      2   user_id TEXT NOT NULL,
      3   realm_id TEXT NOT NULL REFERENCES realms(id) ON DELETE CASCADE,
      4   client_id TEXT NOT NULL,
      5   scopes TEXT NOT NULL,
      6   granted_via TEXT NOT NULL CHECK (granted_via IN ('user', 'trusted')),
      7   created_at INTEGER NOT NULL,
      8   updated_at INTEGER NOT NULL,
      9   revoked_at INTEGER,
     10   PRIMARY KEY (user_id, realm_id, client_id)
     11 );
     12 
     13 CREATE INDEX client_consents_client ON client_consents(client_id);
     14 CREATE INDEX client_consents_user ON client_consents(user_id);