From 00eaa99eb3abc552791bf95fb20879e4bc999073 Mon Sep 17 00:00:00 2001 From: Philipp Date: Fri, 30 Dec 2022 17:15:15 +0100 Subject: [PATCH] Make updated_at not nullable, it should get set at the creation as well --- database.sql | 2 +- doc/database/db_key-value.md | 2 +- static/dbstructure.config.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/database.sql b/database.sql index b7d4ac35d..2ae33689c 100644 --- a/database.sql +++ b/database.sql @@ -845,7 +845,7 @@ CREATE TABLE IF NOT EXISTS `intro` ( CREATE TABLE IF NOT EXISTS `key-value` ( `k` varbinary(50) NOT NULL COMMENT '', `v` mediumtext COMMENT '', - `updated_at` int unsigned COMMENT 'timestamp of the last update', + `updated_at` int unsigned NOT NULL COMMENT 'timestamp of the last update', PRIMARY KEY(`k`) ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='A key value storage'; diff --git a/doc/database/db_key-value.md b/doc/database/db_key-value.md index 514fdaa69..2ed3baa48 100644 --- a/doc/database/db_key-value.md +++ b/doc/database/db_key-value.md @@ -10,7 +10,7 @@ Fields | ---------- | ---------------------------- | ------------- | ---- | --- | ------- | ----- | | k | | varbinary(50) | NO | PRI | NULL | | | v | | mediumtext | YES | | NULL | | -| updated_at | timestamp of the last update | int unsigned | YES | | NULL | | +| updated_at | timestamp of the last update | int unsigned | NO | | NULL | | Indexes ------------ diff --git a/static/dbstructure.config.php b/static/dbstructure.config.php index 7ced8172f..25e416d50 100644 --- a/static/dbstructure.config.php +++ b/static/dbstructure.config.php @@ -894,7 +894,7 @@ return [ "fields" => [ "k" => ["type" => "varbinary(50)", "not null" => "1", "primary" => "1", "comment" => ""], "v" => ["type" => "mediumtext", "comment" => ""], - "updated_at" => ["type" => "int unsigned", "comment" => "timestamp of the last update"], + "updated_at" => ["type" => "int unsigned", "not null" => "1", "comment" => "timestamp of the last update"], ], "indexes" => [ "PRIMARY" => ["k"],