github.com/pf-qiu/concourse/v6@v6.7.3-0.20201207032516-1f455d73275f/atc/db/migration/migrations/1601993585_drop_checks.down.sql (about)

     1  BEGIN;
     2    create table checks
     3    (
     4      id bigserial not null
     5      constraint checks_pkey
     6      primary key,
     7      resource_config_scope_id integer
     8      constraint checks_resource_config_scope_id_fkey
     9      references resource_config_scopes
    10      on delete cascade,
    11      schema text not null,
    12      status text not null,
    13      manually_triggered boolean default false,
    14      plan text,
    15      nonce text,
    16      check_error text,
    17      metadata jsonb,
    18      create_time timestamp with time zone default now() not null,
    19      start_time timestamp with time zone,
    20      end_time timestamp with time zone,
    21      span_context jsonb
    22    );
    23  
    24    create unique index resource_config_scope_id_key
    25    on checks (resource_config_scope_id)
    26    where ((status = 'started'::text) AND (manually_triggered = false));
    27  
    28    create index started_checks_idx
    29    on checks (id)
    30    where (status = 'started'::text);
    31  COMMIT;