fix some schema issues
This commit is contained in:
parent
c7ead94934
commit
c18d165a5f
|
@ -16,8 +16,8 @@ create table if not exists pools(
|
||||||
primary key(layer3domain_id, id)
|
primary key(layer3domain_id, id)
|
||||||
);
|
);
|
||||||
|
|
||||||
create table if not exists container(
|
create table if not exists containers(
|
||||||
layer3domain_id integer not null references layer3domain(id),
|
layer3domain_id integer not null references layer3domains(id),
|
||||||
network cidr not null,
|
network cidr not null,
|
||||||
pool_id integer not null,
|
pool_id integer not null,
|
||||||
created_at timestamptz not null default now(),
|
created_at timestamptz not null default now(),
|
||||||
|
@ -26,14 +26,14 @@ create table if not exists container(
|
||||||
modified_by varchar(128) not null,
|
modified_by varchar(128) not null,
|
||||||
attributes jsonb not null default '{}'::jsonb,
|
attributes jsonb not null default '{}'::jsonb,
|
||||||
unique(layer3domain_id, network),
|
unique(layer3domain_id, network),
|
||||||
foreign key (layer3domain_id, pool_id) references pools(layer3domain_id, pool_id)
|
foreign key (layer3domain_id, pool_id) references pools(layer3domain_id, id)
|
||||||
);
|
);
|
||||||
create index on container(layer3domain_id, pool_id, network);
|
create index if not exists container_reference_key on containers(layer3domain_id, pool_id, network);
|
||||||
|
|
||||||
create table if not exists ips(
|
create table if not exists ips(
|
||||||
layer3domain_id integer not null,
|
layer3domain_id integer not null,
|
||||||
version smallint not null,
|
version smallint not null,
|
||||||
address decimal(40,0) not null,
|
address inet not null,
|
||||||
attributes jsonb not null default '{}'::jsonb,
|
attributes jsonb not null default '{}'::jsonb,
|
||||||
created_at timestamptz not null default now(),
|
created_at timestamptz not null default now(),
|
||||||
created_by varchar(128) not null,
|
created_by varchar(128) not null,
|
||||||
|
@ -70,7 +70,7 @@ create table if not exists zoneviews(
|
||||||
modified_at timestamptz not null default now(),
|
modified_at timestamptz not null default now(),
|
||||||
modified_by varchar(128) not null
|
modified_by varchar(128) not null
|
||||||
);
|
);
|
||||||
create index on zoneviews(zone_id, id);
|
create index if not exists zoneviews_reference_key on zoneviews(zone_id, id);
|
||||||
|
|
||||||
create table if not exists records(
|
create table if not exists records(
|
||||||
zoneview_id integer not null references zoneviews(id) on delete cascade,
|
zoneview_id integer not null references zoneviews(id) on delete cascade,
|
||||||
|
|
Loading…
Reference in New Issue