feat: extra field
parent
fd40abe3ff
commit
301cac1861
2
Makefile
2
Makefile
|
@ -32,7 +32,7 @@ lint:
|
||||||
format:
|
format:
|
||||||
go install github.com/haunt98/gofimports/cmd/gofimports@latest
|
go install github.com/haunt98/gofimports/cmd/gofimports@latest
|
||||||
go install mvdan.cc/gofumpt@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 .
|
gofumpt -w -extra .
|
||||||
|
|
||||||
gen:
|
gen:
|
||||||
|
|
|
@ -97,6 +97,21 @@
|
||||||
[Business] time, data -> convert to unix timestamp milliseconds -> [Database] int64</pre
|
[Business] time, data -> convert to unix timestamp milliseconds -> [Database] int64</pre
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
|
<h2>
|
||||||
|
<a
|
||||||
|
id="user-content-extra-field-for-extra-things"
|
||||||
|
class="anchor"
|
||||||
|
aria-hidden="true"
|
||||||
|
href="#extra-field-for-extra-things"
|
||||||
|
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
||||||
|
>Extra field for extra things
|
||||||
|
</h2>
|
||||||
|
<p>
|
||||||
|
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.
|
||||||
|
</p>
|
||||||
|
<p>I always use MySQL json data type for extra field.</p>
|
||||||
<h2>
|
<h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-use-index"
|
id="user-content-use-index"
|
||||||
|
|
|
@ -30,6 +30,14 @@ It looks like this:
|
||||||
[Business] time, data -> convert to unix timestamp milliseconds -> [Database] int64
|
[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.
|
||||||
|
|
||||||
## Use index!!!
|
## Use index!!!
|
||||||
|
|
||||||
You should use index for faster query, but not too much.
|
You should use index for faster query, but not too much.
|
||||||
|
|
Loading…
Reference in New Issue