ekyc

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

20240618073559_create_ratelimit.ts (677B)


      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 "ratelimit" (
     11             "key" varchar not null,
     12             "count" int4 not null,
     13             "expire" timestamp not null,
     14             "version" int4 not null default 0,
     15             constraint ratelimit_pk primary key("key")
     16         );`;
     17   }
     18 
     19   /** Runs on rollback */
     20   async down(_info: Info): Promise<void> {
     21     await this.client.queryArray`drop table "ratelimit" cascade;`;
     22   }
     23 }