Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(db): use text constraints, not limited size data types #757

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions src/main/resources/db/migration/V4.0.0__cryostat.sql
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
maxAge bigint not null,
maxSize bigint not null,
metadata jsonb,
name varchar(255),
name text check (char_length(name) < 64),
remoteId bigint not null,
startTime bigint not null,
state smallint check (state between 0 and 4),
Expand All @@ -40,48 +40,48 @@
create table DiscoveryNode (
id bigint not null,
labels jsonb,
name varchar(255) not null,
nodeType varchar(255) not null,
name text not null check (char_length(name) < 255),
nodeType text not null check (char_length(nodeType) < 255),
parentNode bigint,
primary key (id)
);

create table DiscoveryPlugin (
id uuid not null,
builtin boolean not null,
callback varchar(255) unique,
callback text unique,
credential_id bigint unique,
realm_id bigint not null unique,
primary key (id)
);

create table MatchExpression (
id bigint not null,
script varchar(255) not null,
script text not null check (char_length(script) < 1024),
primary key (id)
);

create table Rule (
id bigint not null,
archivalPeriodSeconds integer not null,
description varchar(255),
description text check (char_length(description) < 1024),
enabled boolean not null,
eventSpecifier varchar(255) not null,
eventSpecifier text not null check (char_length(eventSpecifier) < 255),
initialDelaySeconds integer not null,
maxAgeSeconds integer not null,
maxSizeBytes integer not null,
name varchar(255) unique,
name text unique check (char_length(name) < 255),
preservedArchives integer not null,
matchExpression bigint unique,
primary key (id)
);

create table Target (
id bigint not null,
alias varchar(255),
alias text check (char_length(alias) < 255),
annotations jsonb,
connectUrl bytea unique,
jvmId varchar(255),
jvmId text check (char_length(jvmId) < 255),
labels jsonb,
discoveryNode bigint unique,
primary key (id)
Expand Down
Loading