CREATE TABLE `tenant_secret` (
`id` varchar(36) NOT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
`deleted_at` datetime DEFAULT NULL,
`deleted` tinyint(1) NOT NULL,
`status` varchar(20) NOT NULL,
`role` varchar(255) DEFAULT NULL,
`tenant_id` varchar(36) NOT NULL,
`secret_id` varchar(36) NOT NULL,
PRIMARY KEY (`id`,`tenant_id`,`secret_id`),
UNIQUE KEY `_tenant_secret_uc` (`tenant_id`,`secret_id`),
KEY `secret_id` (`secret_id`),
CONSTRAINT `tenant_secret_ibfk_1` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`),
CONSTRAINT `tenant_secret_ibfk_2` FOREIGN KEY (`secret_id`) REFERENCES `secrets` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
Table "public.tenant_secret"
Column | Type | Modifiers | Storage | Stats target | Description
------------+-----------------------------+-----------+----------+--------------+-------------
id | character varying(36) | not null | extended | |
created_at | timestamp without time zone | not null | plain | |
updated_at | timestamp without time zone | not null | plain | |
deleted_at | timestamp without time zone | | plain | |
deleted | boolean | not null | plain | |
status | character varying(20) | not null | extended | |
role | character varying(255) | | extended | |
tenant_id | character varying(36) | not null | extended | |
secret_id | character varying(36) | not null | extended | |
Indexes:
"tenant_secret_pkey" PRIMARY KEY, btree (id, tenant_id, secret_id)
"_tenant_secret_uc" UNIQUE CONSTRAINT, btree (tenant_id, secret_id)
Foreign-key constraints:
"tenant_secret_secret_id_fkey" FOREIGN KEY (secret_id) REFERENCES secrets(id)
"tenant_secret_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id)
Has OIDs: no