Compare commits
2 Commits
83336cf0fa
...
88743898fe
Author | SHA1 | Date | |
---|---|---|---|
|
88743898fe | ||
|
1389225b45 |
3
db.go
3
db.go
@ -113,7 +113,7 @@ func dbUpdate() (err error) {// {{{
|
||||
return err
|
||||
}
|
||||
for i := (schema+1); i <= DB_SCHEMA; i++ {
|
||||
log.Printf("\x1b[32mNotes\x1b[0m Upgrading SQL schema to revision %d\n", i)
|
||||
log.Printf("\x1b[32mNotes\x1b[0m Upgrading SQL schema to revision %d...", i)
|
||||
sql, _ := embedded.ReadFile(
|
||||
fmt.Sprintf("sql/%04d.sql", i),
|
||||
)
|
||||
@ -125,6 +125,7 @@ func dbUpdate() (err error) {// {{{
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
log.Printf("\x1b[32mNotes\x1b[0m OK: %d", i)
|
||||
}
|
||||
|
||||
return
|
||||
|
4
main.go
4
main.go
@ -20,9 +20,9 @@ import (
|
||||
_ "embed"
|
||||
)
|
||||
|
||||
const VERSION = "v9";
|
||||
const VERSION = "v10";
|
||||
const LISTEN_HOST = "0.0.0.0";
|
||||
const DB_SCHEMA = 11
|
||||
const DB_SCHEMA = 12
|
||||
|
||||
var (
|
||||
flagPort int
|
||||
|
5
node.go
5
node.go
@ -386,7 +386,10 @@ func (session Session) SearchNodes(search string) (nodes []Node, err error) {//
|
||||
FROM node
|
||||
WHERE
|
||||
crypto_key_id IS NULL AND
|
||||
content ~* $1
|
||||
(
|
||||
content ~* $1 OR
|
||||
name ~* $1
|
||||
)
|
||||
ORDER BY
|
||||
updated DESC
|
||||
`, search)
|
||||
|
2
sql/0012.sql
Normal file
2
sql/0012.sql
Normal file
@ -0,0 +1,2 @@
|
||||
DROP INDEX node_content_index;
|
||||
CREATE INDEX node_search_index ON node USING gin (name gin_trgm_ops, content gin_trgm_ops);
|
Loading…
Reference in New Issue
Block a user