Skip to content

Commit

Permalink
Add log table to database and reformat schema
Browse files Browse the repository at this point in the history
  • Loading branch information
jrauh01 committed Nov 21, 2023
1 parent e612b8a commit efb7536
Showing 1 changed file with 49 additions and 28 deletions.
77 changes: 49 additions & 28 deletions schema/mysql/schema.sql
Original file line number Diff line number Diff line change
@@ -1,30 +1,51 @@
CREATE TABLE node (
id binary(20) NOT NULL,
canonical_name varchar(253) COLLATE utf8mb4_unicode_ci NOT NULL,
name varchar(253) COLLATE utf8mb4_unicode_ci NOT NULL,
uid varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
resource_version varchar(255) NOT NULL,
created bigint unsigned NOT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
CREATE TABLE node
(
id BINARY(20) NOT NULL,
canonical_name VARCHAR(253) COLLATE utf8mb4_unicode_ci NOT NULL,
name VARCHAR(253) COLLATE utf8mb4_unicode_ci NOT NULL,
uid VARCHAR(255) COLLATE utf8mb4_unicode_ci NOT NULL,
resource_version VARCHAR(255) NOT NULL,
created BIGINT UNSIGNED NOT NULL,
PRIMARY KEY (id)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_bin;

CREATE TABLE namespace (
id binary(20) NOT NULL,
canonical_name varchar(63) COLLATE utf8mb4_unicode_ci NOT NULL,
name varchar(63) COLLATE utf8mb4_unicode_ci NOT NULL,
uid varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
resource_version varchar(255) NOT NULL,
created bigint unsigned NOT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
CREATE TABLE namespace
(
id BINARY(20) NOT NULL,
canonical_name VARCHAR(63) COLLATE utf8mb4_unicode_ci NOT NULL,
name VARCHAR(63) COLLATE utf8mb4_unicode_ci NOT NULL,
uid VARCHAR(255) COLLATE utf8mb4_unicode_ci NOT NULL,
resource_version VARCHAR(255) NOT NULL,
created BIGINT UNSIGNED NOT NULL,
PRIMARY KEY (id)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_bin;

CREATE TABLE pod (
id binary(20) NOT NULL,
canonical_name varchar(317) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'namespace/name',
namespace varchar(63) COLLATE utf8mb4_unicode_ci NOT NULL,
name varchar(253) COLLATE utf8mb4_unicode_ci NOT NULL,
uid varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
resource_version varchar(255) NOT NULL,
created bigint unsigned NOT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
CREATE TABLE pod
(
id BINARY(20) NOT NULL,
canonical_name VARCHAR(317) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'namespace/name',
namespace VARCHAR(63) COLLATE utf8mb4_unicode_ci NOT NULL,
name VARCHAR(253) COLLATE utf8mb4_unicode_ci NOT NULL,
uid VARCHAR(255) COLLATE utf8mb4_unicode_ci NOT NULL,
resource_version VARCHAR(255) NOT NULL,
created BIGINT UNSIGNED NOT NULL,
PRIMARY KEY (id)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_bin;

CREATE TABLE log
(
id BINARY(20) NOT NULL,
reference_id BINARY(20) NOT NULL,
container_name VARCHAR(255) COLLATE utf8mb4_unicode_ci NOT NULL,
time LONGTEXT NOT NULL,
log LONGTEXT NOT NULL,
PRIMARY KEY (id)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_bin;

0 comments on commit efb7536

Please sign in to comment.