From 301cac18611d86f5d33fb734838bdd46fd5ac0b8 Mon Sep 17 00:00:00 2001 From: Hau Nguyen Date: Tue, 4 Apr 2023 17:25:22 +0700 Subject: [PATCH] feat: extra field --- Makefile | 2 +- docs/2022-07-31-sql.html | 15 +++++++++++++++ posts/2022-07-31-sql.md | 8 ++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8aea164..61b40c1 100644 --- a/Makefile +++ b/Makefile @@ -32,7 +32,7 @@ lint: format: go install github.com/haunt98/gofimports/cmd/gofimports@latest go install mvdan.cc/gofumpt@latest - gofimports -w --company github.com/make-go-great . + gofimports -w --company github.com/make-go-great,github.com/haunt98 . gofumpt -w -extra . gen: diff --git a/docs/2022-07-31-sql.html b/docs/2022-07-31-sql.html index 34f356e..2b91978 100644 --- a/docs/2022-07-31-sql.html +++ b/docs/2022-07-31-sql.html @@ -97,6 +97,21 @@ [Business] time, data -> convert to unix timestamp milliseconds -> [Database] int64 +

+ Extra field for extra things +

+

+ Create new column in database is scary, so I suggest avoid it if you can. + How to avoid, first design table with extra field. It is black hole, put + everything in there if you want. +

+

I always use MySQL json data type for extra field.

convert to unix timestamp milliseconds -> [Database] int64 ``` +## Extra field for extra things + +Create new column in database is scary, so I suggest avoid it if you can. +How to avoid, first design table with extra field. +It is black hole, put everything in there if you want. + +I always use MySQL json data type for extra field. + ## Use index!!! You should use index for faster query, but not too much.