Rebuild association tables, ensure file-system-based galleries cannot be changed (#2955)

* Re-create tables to include primary keys
* Filesystem-based galleries cannot change images
This commit is contained in:
WithoutPants
2022-09-30 09:18:58 +10:00
committed by GitHub
parent dce90a3ed9
commit ad7fbce5f7
16 changed files with 983 additions and 52 deletions

View File

@@ -65,6 +65,24 @@ func IntIntercect(v1, v2 []int) []int {
return ret
}
// IntNotIntersect returns a slice of ints containing values that do not exist in both provided slices.
func IntNotIntersect(v1, v2 []int) []int {
var ret []int
for _, v := range v1 {
if !IntInclude(v2, v) {
ret = append(ret, v)
}
}
for _, v := range v2 {
if !IntInclude(v1, v) {
ret = append(ret, v)
}
}
return ret
}
// IntSliceToStringSlice converts a slice of ints to a slice of strings.
func IntSliceToStringSlice(ss []int) []string {
ret := make([]string, len(ss))