Make updated_at not nullable, it should get set at the creation as well
This commit is contained in:
parent
f96aec18cc
commit
00eaa99eb3
|
@ -845,7 +845,7 @@ CREATE TABLE IF NOT EXISTS `intro` (
|
||||||
CREATE TABLE IF NOT EXISTS `key-value` (
|
CREATE TABLE IF NOT EXISTS `key-value` (
|
||||||
`k` varbinary(50) NOT NULL COMMENT '',
|
`k` varbinary(50) NOT NULL COMMENT '',
|
||||||
`v` mediumtext 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`)
|
PRIMARY KEY(`k`)
|
||||||
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='A key value storage';
|
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='A key value storage';
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ Fields
|
||||||
| ---------- | ---------------------------- | ------------- | ---- | --- | ------- | ----- |
|
| ---------- | ---------------------------- | ------------- | ---- | --- | ------- | ----- |
|
||||||
| k | | varbinary(50) | NO | PRI | NULL | |
|
| k | | varbinary(50) | NO | PRI | NULL | |
|
||||||
| v | | mediumtext | YES | | 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
|
Indexes
|
||||||
------------
|
------------
|
||||||
|
|
|
@ -894,7 +894,7 @@ return [
|
||||||
"fields" => [
|
"fields" => [
|
||||||
"k" => ["type" => "varbinary(50)", "not null" => "1", "primary" => "1", "comment" => ""],
|
"k" => ["type" => "varbinary(50)", "not null" => "1", "primary" => "1", "comment" => ""],
|
||||||
"v" => ["type" => "mediumtext", "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" => [
|
"indexes" => [
|
||||||
"PRIMARY" => ["k"],
|
"PRIMARY" => ["k"],
|
||||||
|
|
Loading…
Reference in a new issue