mirror of
https://github.com/paralus/paralus.git
synced 2026-08-24 15:47:19 +00:00
Signed-off-by: niravparikh05 <nir.parikh05@gmail.com> Signed-off-by: Nirav Parikh <52062717+niravparikh05@users.noreply.github.com> Co-authored-by: Akshay Gaikwad <akshay196@users.noreply.github.com>
40 lines
1.6 KiB
SQL
40 lines
1.6 KiB
SQL
CREATE TABLE IF NOT EXISTS cluster_clusters (
|
|
id uuid NOT NULL default uuid_generate_v4(),
|
|
organization_id uuid not null,
|
|
partner_id uuid not null,
|
|
project_id uuid not null,
|
|
metro_id uuid,
|
|
name varchar NOT NULL,
|
|
display_name varchar NOT NULL,
|
|
created_at timestamp WITH time zone NOT NULL,
|
|
modified_at timestamp WITH time zone,
|
|
trash boolean NOT NULL default false,
|
|
deleted_at timestamp with time zone,
|
|
labels jsonb NOT NULL DEFAULT '{}'::jsonb,
|
|
annotations jsonb NOT NULL DEFAULT '{}'::jsonb,
|
|
blueprint_ref varchar NOT NULL default '',
|
|
cluster_type text,
|
|
override_selector varchar NOT NULL default '',
|
|
token varchar not null,
|
|
conditions jsonb NOT NULL default '[]'::jsonb,
|
|
published_blueprint varchar NOT NULL default '',
|
|
system_task_count integer NOT NULL DEFAULT 0,
|
|
custom_task_count integer NOT NULL DEFAULT 0,
|
|
auxiliary_task_count integer NOT NULL DEFAULT 0,
|
|
extra jsonb NOT NULL DEFAULT '{}'::jsonb,
|
|
share_mode VARCHAR DEFAULT 'CUSTOM',
|
|
proxy_config jsonb
|
|
);
|
|
|
|
ALTER TABLE ONLY cluster_clusters ADD CONSTRAINT cluster_clusters_pkey PRIMARY KEY (id);
|
|
|
|
CREATE INDEX cluster_clusters_name_organization_id_partner_id_key ON cluster_clusters USING btree (name, organization_id, partner_id);
|
|
|
|
CREATE INDEX idx_cluster_blueprint ON cluster_clusters USING btree (blueprint_ref, published_blueprint);
|
|
|
|
CREATE INDEX idx_clusters_labels ON cluster_clusters USING GIN (labels jsonb_path_ops);
|
|
|
|
ALTER TABLE ONLY cluster_clusters
|
|
ADD CONSTRAINT cluster_clusters_token_fkey FOREIGN KEY (token)
|
|
REFERENCES cluster_tokens(name) DEFERRABLE INITIALLY DEFERRED;
|