database: add created_at field for layers and vulnerabilities
This commit is contained in:
parent
f351d6304e
commit
ccaaff000e
@ -30,7 +30,8 @@ CREATE TABLE IF NOT EXISTS Layer (
|
||||
name VARCHAR(128) NOT NULL UNIQUE,
|
||||
engineversion SMALLINT NOT NULL,
|
||||
parent_id INT NULL REFERENCES Layer ON DELETE CASCADE,
|
||||
namespace_id INT NULL REFERENCES Namespace);
|
||||
namespace_id INT NULL REFERENCES Namespace,
|
||||
created_at TIMESTAMP WITH TIME ZONE);
|
||||
|
||||
CREATE INDEX ON Layer (parent_id);
|
||||
CREATE INDEX ON Layer (namespace_id);
|
||||
|
@ -115,8 +115,9 @@ func init() {
|
||||
AND v.deleted_at IS NULL`
|
||||
|
||||
queries["i_layer"] = `
|
||||
INSERT INTO Layer(name, engineversion, parent_id, namespace_id)
|
||||
VALUES($1, $2, $3, $4) RETURNING id`
|
||||
INSERT INTO Layer(name, engineversion, parent_id, namespace_id, created_at)
|
||||
VALUES($1, $2, $3, $4, CURRENT_TIMESTAMP)
|
||||
RETURNING id`
|
||||
|
||||
queries["u_layer"] = `UPDATE LAYER SET engineversion = $2, namespace_id = $3 WHERE id = $1`
|
||||
|
||||
@ -158,8 +159,8 @@ func init() {
|
||||
WHERE vfif.vulnerability_id = $1`
|
||||
|
||||
queries["i_vulnerability"] = `
|
||||
INSERT INTO Vulnerability(namespace_id, name, description, link, severity, metadata)
|
||||
VALUES($1, $2, $3, $4, $5, $6)
|
||||
INSERT INTO Vulnerability(namespace_id, name, description, link, severity, metadata, created_at)
|
||||
VALUES($1, $2, $3, $4, $5, $6, CURRENT_TIMESTAMP)
|
||||
RETURNING id`
|
||||
|
||||
queries["i_vulnerability_fixedin_feature"] = `
|
||||
|
Loading…
Reference in New Issue
Block a user