Manage shared ARNavi VPS contours and application keys from infrastructure
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"schemaVersion": "nodedc.device-b2-foundation.v1",
|
||||
"releaseId": "device-b2-foundation-v1-20260930-001",
|
||||
"baselineReleaseId": "device-core-release-v1-r14-6ca6738bab22d0fdef714b90c68959363106ee5b",
|
||||
"baselineSha256": "385c2fec8fce300cb80a93edfbcb0d537e34755b0ccc35294c0102b3c4a7f724",
|
||||
"sqlSha256": "dc5608eccb8f628aab49390d245e6758505bb8a459a49705c375c3ca59b3e03b",
|
||||
"transition": "add-private-vault-and-three-tables",
|
||||
"runtime": "same-image-core-only",
|
||||
"newPorts": false
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
begin;
|
||||
|
||||
-- One remote host identity per company. Project hosts are views of this source;
|
||||
-- an imported credential never chooses the local company or project.
|
||||
create table device_b2_hosts (
|
||||
id uuid primary key,
|
||||
owner_scope_id uuid not null references device_owner_scopes(id),
|
||||
remote_host_id text not null,
|
||||
endpoint text not null,
|
||||
fingerprint text not null check (fingerprint ~ '^[a-f0-9]{64}$'),
|
||||
integration_id text not null check (integration_id ~ '^[a-f0-9]{32}$'),
|
||||
authority text not null check (authority in ('host','contours')),
|
||||
secret_ref text not null,
|
||||
revision bigint not null default 1,
|
||||
created_at timestamptz not null default now(),
|
||||
updated_at timestamptz not null default now(),
|
||||
unique(owner_scope_id, remote_host_id),
|
||||
unique(id, owner_scope_id)
|
||||
);
|
||||
create table device_b2_host_views (
|
||||
host_id uuid not null,
|
||||
project_id uuid not null,
|
||||
owner_scope_id uuid not null,
|
||||
source_id uuid not null,
|
||||
primary key(host_id),
|
||||
foreign key(host_id, project_id, owner_scope_id)
|
||||
references device_infrastructure_hosts(id, project_id, owner_scope_id),
|
||||
foreign key(source_id, owner_scope_id) references device_b2_hosts(id, owner_scope_id)
|
||||
);
|
||||
create table device_b2_contour_links (
|
||||
source_id uuid not null,
|
||||
contour_id text not null check (contour_id ~ '^[a-f0-9]{32}$'),
|
||||
project_id uuid not null,
|
||||
owner_scope_id uuid not null,
|
||||
created_by_ref text not null,
|
||||
created_at timestamptz not null default now(),
|
||||
primary key(source_id, contour_id),
|
||||
foreign key(source_id, owner_scope_id) references device_b2_hosts(id, owner_scope_id),
|
||||
foreign key(project_id, owner_scope_id) references device_projects(id, owner_scope_id)
|
||||
);
|
||||
comment on table device_b2_hosts is 'nodedc.device-b2-foundation/v1';
|
||||
comment on table device_b2_host_views is 'nodedc.device-b2-foundation/v1';
|
||||
comment on table device_b2_contour_links is 'nodedc.device-b2-foundation/v1';
|
||||
commit;
|
||||
Reference in New Issue
Block a user