diff --git a/sql/20230915101844_trivy_misconfig.down.sql b/sql/0000010_trivy_misconfig.down.sql similarity index 100% rename from sql/20230915101844_trivy_misconfig.down.sql rename to sql/0000010_trivy_misconfig.down.sql diff --git a/sql/20230915101844_trivy_misconfig.up.sql b/sql/0000010_trivy_misconfig.up.sql similarity index 88% rename from sql/20230915101844_trivy_misconfig.up.sql rename to sql/0000010_trivy_misconfig.up.sql index 02ff2dae..89d758a5 100644 --- a/sql/20230915101844_trivy_misconfig.up.sql +++ b/sql/0000010_trivy_misconfig.up.sql @@ -15,7 +15,7 @@ CREATE TABLE IF NOT EXISTS trivy_misconfig ( misconfig_severity String, misconfig_status String, EventTime DateTime('UTC'), - ExpiryDate DateTime DEFAULT now() + INTERVAL 6 MONTH + ExpiryDate DateTime DEFAULT now() + INTERVAL {{.TTLValue}} {{.TTLUnit}} ) ENGINE = MergeTree() ORDER BY ExpiryDate TTL ExpiryDate; diff --git a/sql/20230915101910_trivyimage.down.sql b/sql/0000011_trivyimage.down.sql similarity index 100% rename from sql/20230915101910_trivyimage.down.sql rename to sql/0000011_trivyimage.down.sql diff --git a/sql/20230915101910_trivyimage.up.sql b/sql/0000011_trivyimage.up.sql similarity index 86% rename from sql/20230915101910_trivyimage.up.sql rename to sql/0000011_trivyimage.up.sql index e2a7aa04..572bb2b4 100644 --- a/sql/20230915101910_trivyimage.up.sql +++ b/sql/0000011_trivyimage.up.sql @@ -11,7 +11,7 @@ CREATE TABLE IF NOT EXISTS trivyimage ( vul_severity String, vul_published_date DateTime('UTC'), vul_last_modified_date DateTime('UTC'), - ExpiryDate DateTime DEFAULT now() + INTERVAL 6 MONTH + ExpiryDate DateTime DEFAULT now() + INTERVAL {{.TTLValue}} {{.TTLUnit}} ) ENGINE = MergeTree() ORDER BY ExpiryDate TTL ExpiryDate; diff --git a/sql/20230915102122_dockerhubbuild.down.sql b/sql/0000012_dockerhubbuild.down.sql similarity index 100% rename from sql/20230915102122_dockerhubbuild.down.sql rename to sql/0000012_dockerhubbuild.down.sql diff --git a/sql/20230915102122_dockerhubbuild.up.sql b/sql/0000012_dockerhubbuild.up.sql similarity index 79% rename from sql/20230915102122_dockerhubbuild.up.sql rename to sql/0000012_dockerhubbuild.up.sql index a9d0b5c1..0485e52b 100644 --- a/sql/20230915102122_dockerhubbuild.up.sql +++ b/sql/0000012_dockerhubbuild.up.sql @@ -6,7 +6,7 @@ CREATE TABLE IF NOT EXISTS dockerhubbuild ( Owner String, Event String, EventTime DateTime('UTC'), - ExpiryDate DateTime DEFAULT now() + INTERVAL 6 MONTH + ExpiryDate DateTime DEFAULT now() + INTERVAL {{.TTLValue}} {{.TTLUnit}} ) ENGINE = MergeTree() ORDER BY ExpiryDate TTL ExpiryDate; diff --git a/sql/20230915102157_azurecontainerpush.down.sql b/sql/0000013_azurecontainerpush.down.sql similarity index 100% rename from sql/20230915102157_azurecontainerpush.down.sql rename to sql/0000013_azurecontainerpush.down.sql diff --git a/sql/20230915102157_azurecontainerpush.up.sql b/sql/0000013_azurecontainerpush.up.sql similarity index 80% rename from sql/20230915102157_azurecontainerpush.up.sql rename to sql/0000013_azurecontainerpush.up.sql index 8bc4a1fc..a0f5916d 100644 --- a/sql/20230915102157_azurecontainerpush.up.sql +++ b/sql/0000013_azurecontainerpush.up.sql @@ -7,7 +7,7 @@ CREATE TABLE IF NOT EXISTS azurecontainerpush ( Size Int32, SHAID String, EventTime DateTime('UTC'), - ExpiryDate DateTime DEFAULT now() + INTERVAL 6 MONTH + ExpiryDate DateTime DEFAULT now() + INTERVAL {{.TTLValue}} {{.TTLUnit}} ) ENGINE = MergeTree() ORDER BY ExpiryDate TTL ExpiryDate; \ No newline at end of file diff --git a/sql/20230915102229_quaycontainerpush.down.sql b/sql/0000014_quaycontainerpush.down.sql similarity index 100% rename from sql/20230915102229_quaycontainerpush.down.sql rename to sql/0000014_quaycontainerpush.down.sql diff --git a/sql/20230915102229_quaycontainerpush.up.sql b/sql/0000014_quaycontainerpush.up.sql similarity index 80% rename from sql/20230915102229_quaycontainerpush.up.sql rename to sql/0000014_quaycontainerpush.up.sql index cf9c0a6e..2c249b56 100644 --- a/sql/20230915102229_quaycontainerpush.up.sql +++ b/sql/0000014_quaycontainerpush.up.sql @@ -7,7 +7,7 @@ CREATE TABLE IF NOT EXISTS quaycontainerpush ( tag String, Event String, EventTime DateTime('UTC'), - ExpiryDate DateTime DEFAULT now() + INTERVAL 6 MONTH + ExpiryDate DateTime DEFAULT now() + INTERVAL {{.TTLValue}} {{.TTLUnit}} ) ENGINE = MergeTree() ORDER BY ExpiryDate TTL ExpiryDate; diff --git a/sql/20230915102314_trivysbom.down.sql b/sql/0000015_trivysbom.down.sql similarity index 100% rename from sql/20230915102314_trivysbom.down.sql rename to sql/0000015_trivysbom.down.sql diff --git a/sql/20230915102314_trivysbom.up.sql b/sql/0000015_trivysbom.up.sql similarity index 91% rename from sql/20230915102314_trivysbom.up.sql rename to sql/0000015_trivysbom.up.sql index 969f1b66..76de0994 100644 --- a/sql/20230915102314_trivysbom.up.sql +++ b/sql/0000015_trivysbom.up.sql @@ -20,7 +20,7 @@ CREATE TABLE IF NOT EXISTS trivysbom ( component_license_exp String, component_purl String, dependency_ref String, - ExpiryDate DateTime DEFAULT now() + INTERVAL 6 MONTH + ExpiryDate DateTime DEFAULT now() + INTERVAL {{.TTLValue}} {{.TTLUnit}} ) ENGINE = MergeTree() ORDER BY ExpiryDate TTL ExpiryDate; diff --git a/sql/20230915102348_azure_devops.down.sql b/sql/0000016_azure_devops.down.sql similarity index 100% rename from sql/20230915102348_azure_devops.down.sql rename to sql/0000016_azure_devops.down.sql diff --git a/sql/20230915102348_azure_devops.up.sql b/sql/0000016_azure_devops.up.sql similarity index 79% rename from sql/20230915102348_azure_devops.up.sql rename to sql/0000016_azure_devops.up.sql index ddd02f2b..06a32dd2 100644 --- a/sql/20230915102348_azure_devops.up.sql +++ b/sql/0000016_azure_devops.up.sql @@ -7,7 +7,7 @@ CREATE TABLE IF NOT EXISTS azure_devops ( RepoName String, TimeStamp DateTime('UTC'), Event String, - ExpiryDate DateTime DEFAULT now() + INTERVAL 6 MONTH + ExpiryDate DateTime DEFAULT now() + INTERVAL {{.TTLValue}} {{.TTLUnit}} ) ENGINE = MergeTree() ORDER BY ExpiryDate TTL ExpiryDate; diff --git a/sql/20230915102437_github.down.sql b/sql/0000017_github.down.sql similarity index 100% rename from sql/20230915102437_github.down.sql rename to sql/0000017_github.down.sql diff --git a/sql/20230915102437_github.up.sql b/sql/0000017_github.up.sql similarity index 79% rename from sql/20230915102437_github.up.sql rename to sql/0000017_github.up.sql index 00b4d3ac..96d9bf24 100644 --- a/sql/20230915102437_github.up.sql +++ b/sql/0000017_github.up.sql @@ -7,7 +7,7 @@ CREATE TABLE IF NOT EXISTS github ( RepoName String, TimeStamp DateTime('UTC'), Event String, - ExpiryDate DateTime DEFAULT now() + INTERVAL 6 MONTH + ExpiryDate DateTime DEFAULT now() + INTERVAL {{.TTLValue}} {{.TTLUnit}} ) ENGINE = MergeTree() ORDER BY ExpiryDate TTL ExpiryDate; diff --git a/sql/20230915102739_gitlab.down.sql b/sql/0000018_gitlab.down.sql similarity index 100% rename from sql/20230915102739_gitlab.down.sql rename to sql/0000018_gitlab.down.sql diff --git a/sql/20230915102739_gitlab.up.sql b/sql/0000018_gitlab.up.sql similarity index 79% rename from sql/20230915102739_gitlab.up.sql rename to sql/0000018_gitlab.up.sql index d448fa48..2403dff1 100644 --- a/sql/20230915102739_gitlab.up.sql +++ b/sql/0000018_gitlab.up.sql @@ -7,7 +7,7 @@ CREATE TABLE IF NOT EXISTS gitlab ( RepoName String, TimeStamp DateTime('UTC'), Event String, - ExpiryDate DateTime DEFAULT now() + INTERVAL 6 MONTH + ExpiryDate DateTime DEFAULT now() + INTERVAL {{.TTLValue}} {{.TTLUnit}} ) ENGINE = MergeTree() ORDER BY ExpiryDate TTL ExpiryDate; diff --git a/sql/20230915102817_bitbucket.down.sql b/sql/0000019_bitbucket.down.sql similarity index 100% rename from sql/20230915102817_bitbucket.down.sql rename to sql/0000019_bitbucket.down.sql diff --git a/sql/20230915102817_bitbucket.up.sql b/sql/0000019_bitbucket.up.sql similarity index 79% rename from sql/20230915102817_bitbucket.up.sql rename to sql/0000019_bitbucket.up.sql index 4a5de37e..adf08956 100644 --- a/sql/20230915102817_bitbucket.up.sql +++ b/sql/0000019_bitbucket.up.sql @@ -7,7 +7,7 @@ CREATE TABLE IF NOT EXISTS bitbucket ( RepoName String, TimeStamp DateTime('UTC'), Event String, - ExpiryDate DateTime DEFAULT now() + INTERVAL 6 MONTH + ExpiryDate DateTime DEFAULT now() + INTERVAL {{.TTLValue}} {{.TTLUnit}} ) ENGINE = MergeTree() ORDER BY ExpiryDate TTL ExpiryDate; diff --git a/sql/20230915101223_events.down.sql b/sql/000001_events.down.sql similarity index 100% rename from sql/20230915101223_events.down.sql rename to sql/000001_events.down.sql diff --git a/sql/20230915101223_events.up.sql b/sql/000001_events.up.sql similarity index 83% rename from sql/20230915101223_events.up.sql rename to sql/000001_events.up.sql index 4d490012..a410aaf5 100644 --- a/sql/20230915101223_events.up.sql +++ b/sql/000001_events.up.sql @@ -12,7 +12,7 @@ CREATE TABLE IF NOT EXISTS events ( Event String, FirstTime String, LastTime String, - ExpiryDate DateTime DEFAULT now() + INTERVAL 6 MONTH + ExpiryDate DateTime DEFAULT now() + INTERVAL {{.TTLValue}} {{.TTLUnit}} ) ENGINE = MergeTree() ORDER BY ExpiryDate TTL ExpiryDate; diff --git a/sql/20230915102843_gitea.down.sql b/sql/0000020_gitea.down.sql similarity index 100% rename from sql/20230915102843_gitea.down.sql rename to sql/0000020_gitea.down.sql diff --git a/sql/20230915102843_gitea.up.sql b/sql/0000020_gitea.up.sql similarity index 79% rename from sql/20230915102843_gitea.up.sql rename to sql/0000020_gitea.up.sql index cc038088..1b42c0e7 100644 --- a/sql/20230915102843_gitea.up.sql +++ b/sql/0000020_gitea.up.sql @@ -7,7 +7,7 @@ CREATE TABLE IF NOT EXISTS gitea ( RepoName String, TimeStamp DateTime('UTC'), Event String, - ExpiryDate DateTime DEFAULT now() + INTERVAL 6 MONTH + ExpiryDate DateTime DEFAULT now() + INTERVAL {{.TTLValue}} {{.TTLUnit}} ) ENGINE = MergeTree() ORDER BY ExpiryDate TTL ExpiryDate; diff --git a/sql/20230915101317_rakkess.down.sql b/sql/000002_rakkess.down.sql similarity index 100% rename from sql/20230915101317_rakkess.down.sql rename to sql/000002_rakkess.down.sql diff --git a/sql/20230915101317_rakkess.up.sql b/sql/000002_rakkess.up.sql similarity index 77% rename from sql/20230915101317_rakkess.up.sql rename to sql/000002_rakkess.up.sql index 2d7cc079..3542f59b 100644 --- a/sql/20230915101317_rakkess.up.sql +++ b/sql/000002_rakkess.up.sql @@ -6,7 +6,7 @@ CREATE TABLE IF NOT EXISTS rakkess ( List String, Update String, EventTime DateTime('UTC'), - ExpiryDate DateTime DEFAULT now() + INTERVAL 6 MONTH + ExpiryDate DateTime DEFAULT now() + INTERVAL {{.TTLValue}} {{.TTLUnit}} ) ENGINE = MergeTree() ORDER BY ExpiryDate TTL ExpiryDate; diff --git a/sql/20230915101358_DeprecatedAPIs.down.sql b/sql/000003_DeprecatedAPIs.down.sql similarity index 100% rename from sql/20230915101358_DeprecatedAPIs.down.sql rename to sql/000003_DeprecatedAPIs.down.sql diff --git a/sql/20230915101358_DeprecatedAPIs.up.sql b/sql/000003_DeprecatedAPIs.up.sql similarity index 79% rename from sql/20230915101358_DeprecatedAPIs.up.sql rename to sql/000003_DeprecatedAPIs.up.sql index 1bc1fdc4..a7ed1b6e 100644 --- a/sql/20230915101358_DeprecatedAPIs.up.sql +++ b/sql/000003_DeprecatedAPIs.up.sql @@ -6,7 +6,7 @@ CREATE TABLE IF NOT EXISTS DeprecatedAPIs ( Deprecated UInt8, Scope String, EventTime DateTime('UTC'), - ExpiryDate DateTime DEFAULT now() + INTERVAL 6 MONTH + ExpiryDate DateTime DEFAULT now() + INTERVAL {{.TTLValue}} {{.TTLUnit}} ) ENGINE = MergeTree() ORDER BY ExpiryDate TTL ExpiryDate; diff --git a/sql/20230915101437_DeletedAPIs.down.sql b/sql/000004_DeletedAPIs.down.sql similarity index 100% rename from sql/20230915101437_DeletedAPIs.down.sql rename to sql/000004_DeletedAPIs.down.sql diff --git a/sql/20230915101437_DeletedAPIs.up.sql b/sql/000004_DeletedAPIs.up.sql similarity index 82% rename from sql/20230915101437_DeletedAPIs.up.sql rename to sql/000004_DeletedAPIs.up.sql index eaeddda3..931b93e7 100644 --- a/sql/20230915101437_DeletedAPIs.up.sql +++ b/sql/000004_DeletedAPIs.up.sql @@ -8,7 +8,7 @@ CREATE TABLE IF NOT EXISTS DeletedAPIs ( Deleted UInt8, Scope String, EventTime DateTime('UTC'), - ExpiryDate DateTime DEFAULT now() + INTERVAL 6 MONTH + ExpiryDate DateTime DEFAULT now() + INTERVAL {{.TTLValue}} {{.TTLUnit}} ) ENGINE = MergeTree() ORDER BY ExpiryDate TTL ExpiryDate; diff --git a/sql/20230915101512_jfrogcontainerpush.down.sql b/sql/000005_jfrogcontainerpush.down.sql similarity index 100% rename from sql/20230915101512_jfrogcontainerpush.down.sql rename to sql/000005_jfrogcontainerpush.down.sql diff --git a/sql/20230915101512_jfrogcontainerpush.up.sql b/sql/000005_jfrogcontainerpush.up.sql similarity index 83% rename from sql/20230915101512_jfrogcontainerpush.up.sql rename to sql/000005_jfrogcontainerpush.up.sql index aa470b8b..6bac6d8d 100644 --- a/sql/20230915101512_jfrogcontainerpush.up.sql +++ b/sql/000005_jfrogcontainerpush.up.sql @@ -9,7 +9,7 @@ CREATE TABLE IF NOT EXISTS jfrogcontainerpush ( Tag String, Event String, EventTime DateTime('UTC'), - ExpiryDate DateTime DEFAULT now() + INTERVAL 6 MONTH + ExpiryDate DateTime DEFAULT now() + INTERVAL {{.TTLValue}} {{.TTLUnit}} ) ENGINE = MergeTree() ORDER BY ExpiryDate TTL ExpiryDate; diff --git a/sql/20230915101549_getall_resources.down.sql b/sql/000006_getall_resources.down.sql similarity index 100% rename from sql/20230915101549_getall_resources.down.sql rename to sql/000006_getall_resources.down.sql diff --git a/sql/20230915101549_getall_resources.up.sql b/sql/000006_getall_resources.up.sql similarity index 77% rename from sql/20230915101549_getall_resources.up.sql rename to sql/000006_getall_resources.up.sql index 5a2c2e17..23991a21 100644 --- a/sql/20230915101549_getall_resources.up.sql +++ b/sql/000006_getall_resources.up.sql @@ -5,7 +5,7 @@ CREATE TABLE IF NOT EXISTS getall_resources ( Resource String, Age String, EventTime DateTime('UTC'), - ExpiryDate DateTime DEFAULT now() + INTERVAL 6 MONTH + ExpiryDate DateTime DEFAULT now() + INTERVAL {{.TTLValue}} {{.TTLUnit}} ) ENGINE = MergeTree() ORDER BY ExpiryDate TTL ExpiryDate; diff --git a/sql/20230915101643_outdated_images.down.sql b/sql/000007_outdated_images.down.sql similarity index 100% rename from sql/20230915101643_outdated_images.down.sql rename to sql/000007_outdated_images.down.sql diff --git a/sql/20230915101643_outdated_images.up.sql b/sql/000007_outdated_images.up.sql similarity index 81% rename from sql/20230915101643_outdated_images.up.sql rename to sql/000007_outdated_images.up.sql index 36a839c3..479c0902 100644 --- a/sql/20230915101643_outdated_images.up.sql +++ b/sql/000007_outdated_images.up.sql @@ -7,7 +7,7 @@ CREATE TABLE IF NOT EXISTS outdated_images ( LatestVersion String, VersionsBehind Int64, EventTime DateTime('UTC'), - ExpiryDate DateTime DEFAULT now() + INTERVAL 6 MONTH + ExpiryDate DateTime DEFAULT now() + INTERVAL {{.TTLValue}} {{.TTLUnit}} ) ENGINE = MergeTree() ORDER BY ExpiryDate TTL ExpiryDate; diff --git a/sql/20230915101736_kubescore.down.sql b/sql/000008_kubescore.down.sql similarity index 100% rename from sql/20230915101736_kubescore.down.sql rename to sql/000008_kubescore.down.sql diff --git a/sql/20230915101736_kubescore.up.sql b/sql/000008_kubescore.up.sql similarity index 76% rename from sql/20230915101736_kubescore.up.sql rename to sql/000008_kubescore.up.sql index fde28707..662fab9b 100644 --- a/sql/20230915101736_kubescore.up.sql +++ b/sql/000008_kubescore.up.sql @@ -4,7 +4,7 @@ CREATE TABLE IF NOT EXISTS kubescore ( cluster_name String, recommendations String, EventTime DateTime('UTC'), - ExpiryDate DateTime DEFAULT now() + INTERVAL 6 MONTH + ExpiryDate DateTime DEFAULT now() + INTERVAL {{.TTLValue}} {{.TTLUnit}} ) ENGINE = MergeTree() ORDER BY ExpiryDate TTL ExpiryDate; diff --git a/sql/20230915101811_trivy_vul.down.sql b/sql/000009_trivy_vul.down.sql similarity index 100% rename from sql/20230915101811_trivy_vul.down.sql rename to sql/000009_trivy_vul.down.sql diff --git a/sql/20230915101811_trivy_vul.up.sql b/sql/000009_trivy_vul.up.sql similarity index 89% rename from sql/20230915101811_trivy_vul.up.sql rename to sql/000009_trivy_vul.up.sql index d2f8efd3..8acb241d 100644 --- a/sql/20230915101811_trivy_vul.up.sql +++ b/sql/000009_trivy_vul.up.sql @@ -15,7 +15,7 @@ CREATE TABLE IF NOT EXISTS trivy_vul ( vul_severity String, vul_published_date DateTime('UTC'), vul_last_modified_date DateTime('UTC'), - ExpiryDate DateTime DEFAULT now() + INTERVAL 6 MONTH + ExpiryDate DateTime DEFAULT now() + INTERVAL {{.TTLValue}} {{.TTLUnit}} ) ENGINE = MergeTree() ORDER BY ExpiryDate TTL ExpiryDate;