* Optimize reactions table

Change reactions primary key to (PostId, UserId, EmojiName) so fetching
reactions for post will use primary key lookup instead of table scan.

* fix db version

* review fixes

* update database schema in scripts/
Этот коммит содержится в:
Patryk Pomykalski
2020-03-17 10:53:31 +01:00
коммит произвёл GitHub
родитель a1719e9fcf
Коммит 9369d65441
7 изменённых файлов: 81 добавлений и 4 удалений

Просмотреть файл

@@ -46,6 +46,20 @@ func (_m *SqlStore) AlterColumnTypeIfExists(tableName string, columnName string,
return r0
}
// AlterPrimaryKey provides a mock function with given fields: tableName, columnNames
func (_m *SqlStore) AlterPrimaryKey(tableName string, columnNames []string) bool {
ret := _m.Called(tableName, columnNames)
var r0 bool
if rf, ok := ret.Get(0).(func(string, []string) bool); ok {
r0 = rf(tableName, columnNames)
} else {
r0 = ret.Get(0).(bool)
}
return r0
}
// Audit provides a mock function with given fields:
func (_m *SqlStore) Audit() store.AuditStore {
ret := _m.Called()