ekyc

Electronic KYC process with uploading ID document using OAuth 2.1 (experimental)
Log | Files | Refs | README | LICENSE

20240617195959_create_oauth2flow.ts (861B)


      1 import {
      2   AbstractMigration,
      3   ClientPostgreSQL,
      4   Info,
      5 } from "https://deno.land/x/nessie@2.0.11/mod.ts";
      6 
      7 export default class extends AbstractMigration<ClientPostgreSQL> {
      8   /** Runs on migrate */
      9   async up(_info: Info): Promise<void> {
     10     await this.client.queryArray`create table "oauth2flow" (
     11       "uuid" uuid not null,
     12       "clientId" uuid not null,
     13       "scope" varchar not null,
     14       "state" varchar null,
     15       "resourceOwner" uuid null,
     16       "token" varchar null,
     17       "tokenExpire" timestamp not null default ('1970-01-01 00:00:00'),
     18       "created" timestamp default (current_timestamp),
     19       "version" int4 not null default 0,
     20       constraint oauth2flow_pk primary key("uuid")
     21     );`;
     22   }
     23 
     24   /** Runs on rollback */
     25   async down(_info: Info): Promise<void> {
     26     await this.client.queryArray`drop table "oauth2flow" cascade;`;
     27   }
     28 }