New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature db migration #96
Feature db migration #96
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我们期望的应该是 引入 migrate工具,对于每次的变更项有migrate工具来解决,不然每次变更还是需要新增migrate的代码,
类似这种 https://github.com/goharbor/harbor/blob/main/src/migration/migration.go
开了个讨论帖,一起讨论讨论吧:#99 |
903ba53
to
c433233
Compare
Codecov Report
@@ Coverage Diff @@
## v1.5.0-feat-app-refactor #96 +/- ##
========================================================
Coverage 4.67% 4.67%
========================================================
Files 10 10
Lines 1454 1454
========================================================
Hits 68 68
Misses 1384 1384
Partials 2 2 Continue to review full report at Codecov.
|
ba95654
to
71e24f1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks sampsonye
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
func sureCreateTable(ormer orm.Ormer) { | ||
ddl := `CREATE TABLE IF NOT EXISTS __dbmigration ( | ||
last_migration_date datetime DEFAULT CURRENT_TIMESTAMP | ||
)` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不考虑加个索引什么的?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
记录来自 @sampsonye 的私下回复
https://dev.mysql.com/doc/refman/8.0/en/mysql-indexes.html
Indexes are less important for queries on small tables, or big tables where report queries process most or all of the rows. When a query needs to access most of the rows, reading sequentially is faster than working through an index. Sequential reads minimize disk seeks, even if not all the rows are needed for the query. See [Section 8.2.1.23, “Avoiding Full Table Scans”](https://dev.mysql.com/doc/refman/8.0/en/table-scan-avoidance.html) for details.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/LGTM
Which changes (Bug/Feature):
Fixes #55
Special notes for reviewers: