Files
paralus/persistence/migrations/admindb/000019_sentry_bootstrap_agent_template.up.sql
Akshay Gaikwad d88c82e0df fix: re-running admindb migration fails (#205)
Make all admindb migration queries re-entrance so re-running migration
would not fail.

Signed-off-by: Akshay Gaikwad <akgaikwad001@gmail.com>
2023-04-28 14:21:32 +05:30

27 lines
1.2 KiB
SQL

CREATE TABLE IF NOT EXISTS sentry_bootstrap_agent_template (
-- database id fields
name character varying(256) PRIMARY KEY,
organization_id uuid,
partner_id uuid,
project_id uuid,
infra_ref character varying(256) NOT NULL REFERENCES sentry_bootstrap_infra(name),
-- paralus meta fields
display_name character varying(256) NOT NULL,
created_at timestamp WITH time zone NOT NULL,
modified_at timestamp WITH time zone,
deleted_at timestamp with time zone,
labels jsonb NOT NULL DEFAULT '{}' ::jsonb,
annotations jsonb NOT NULL DEFAULT '{}' ::jsonb,
trash boolean NOT NULL default false,
-- template spec
auto_register boolean NOT NULL DEFAULT FALSE,
ignore_multiple_register boolean NOT NULL DEFAULT FALSE,
auto_approve boolean NOT NULL DEFAULT FALSE,
template_type character varying(512) NOT NULL,
hosts jsonb NOT NULL DEFAULT '[]'::jsonb,
token character varying(256) NOT NULL UNIQUE,
incluster_template text NOT NULL,
outofcluster_template text NOT NULL,
CONSTRAINT sentry_bootstrap_agent_templa_name_partner_id_organization__key UNIQUE (name, partner_id, organization_id, project_id)
);