From 945133102109e6334148bee891a13518a05d0614 Mon Sep 17 00:00:00 2001 From: Niko Storni Date: Fri, 19 Jan 2024 22:35:45 +0100 Subject: [PATCH 1/3] add performance indexes add missing index (from previous manual fix) update deps --- go.mod | 70 +++---- go.sum | 157 +++++++-------- migration/026_add_indexes.sql | 24 +++ migration/bindata.go | 23 +++ model/blocked_entry.go | 140 +++++++------- model/blocked_list.go | 144 +++++++------- model/blocked_list_appeal.go | 51 ++--- model/blocked_list_invite.go | 73 +++---- model/boil_queries.go | 2 +- model/boil_table_names.go | 2 +- model/boil_types.go | 2 +- model/boil_view_names.go | 2 +- model/channel.go | 327 +++++++++++++++----------------- model/channel_algo_callbacks.go | 7 +- model/claim_to_channel.go | 7 +- model/comment.go | 142 +++++++------- model/comment_classification.go | 29 +-- model/creator_setting.go | 29 +-- model/delegated_moderator.go | 51 ++--- model/gorp_migrations.go | 7 +- model/moderator.go | 29 +-- model/mysql_upsert.go | 2 +- model/reaction.go | 73 +++---- model/reaction_type.go | 30 +-- 24 files changed, 735 insertions(+), 688 deletions(-) create mode 100644 migration/026_add_indexes.sql diff --git a/go.mod b/go.mod index cb9f336..3024a58 100644 --- a/go.mod +++ b/go.mod @@ -9,14 +9,14 @@ require ( github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d github.com/caarlos0/env v3.5.0+incompatible github.com/coreos/go-oidc v2.2.1+incompatible - github.com/fatih/color v1.15.0 + github.com/fatih/color v1.16.0 github.com/fatih/structs v1.1.0 github.com/friendsofgo/errors v0.9.2 - github.com/go-co-op/gocron v1.33.1 + github.com/go-co-op/gocron v1.37.0 github.com/go-sql-driver/mysql v1.7.1 - github.com/gorilla/mux v1.8.0 - github.com/gorilla/rpc v1.2.0 - github.com/gorilla/websocket v1.5.0 + github.com/gorilla/mux v1.8.1 + github.com/gorilla/rpc v1.2.1 + github.com/gorilla/websocket v1.5.1 github.com/hbakhtiyor/strsim v0.0.0-20190107154042-4d2bbb273edf github.com/jmoiron/sqlx v1.3.5 github.com/johntdyer/slackrus v0.0.0-20230315191314-80bc92dee4fc @@ -27,67 +27,71 @@ require ( github.com/lbryio/ozzo-validation v3.0.3-0.20170512160344-202201e212ec+incompatible github.com/mitchellh/mapstructure v1.5.0 github.com/pkg/profile v1.7.0 - github.com/prometheus/client_golang v1.16.0 - github.com/rs/cors v1.10.0 - github.com/rubenv/sql-migrate v1.5.2 + github.com/prometheus/client_golang v1.18.0 + github.com/rs/cors v1.10.1 + github.com/rubenv/sql-migrate v1.6.1 github.com/sirupsen/logrus v1.9.3 - github.com/spf13/cast v1.5.1 - github.com/spf13/cobra v1.7.0 - github.com/spf13/viper v1.16.0 + github.com/spf13/cast v1.6.0 + github.com/spf13/cobra v1.8.0 + github.com/spf13/viper v1.18.2 github.com/stretchr/testify v1.8.4 github.com/stripe/stripe-go v70.15.0+incompatible github.com/volatiletech/null/v8 v8.1.2 - github.com/volatiletech/sqlboiler/v4 v4.15.0 - github.com/volatiletech/strmangle v0.0.5 + github.com/volatiletech/sqlboiler/v4 v4.16.0 + github.com/volatiletech/strmangle v0.0.6 github.com/ybbus/jsonrpc/v2 v2.1.7 - golang.org/x/sync v0.3.0 + golang.org/x/sync v0.6.0 ) require ( github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/felixge/fgprof v0.9.3 // indirect - github.com/fsnotify/fsnotify v1.6.0 // indirect + github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/go-errors/errors v1.4.2 // indirect github.com/go-gorp/gorp/v3 v3.1.0 // indirect github.com/gofrs/uuid v4.2.0+incompatible // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/google/pprof v0.0.0-20211214055906-6f57359322fd // indirect - github.com/google/uuid v1.3.1 // indirect + github.com/google/uuid v1.4.0 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/johntdyer/slack-go v0.0.0-20230314151037-c5bf334f9b6e // indirect github.com/lbryio/types v0.0.0-20220224142228-73610f6654a6 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.17 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect - github.com/pelletier/go-toml/v2 v2.0.8 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect + github.com/pelletier/go-toml/v2 v2.1.0 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/pquerna/cachecontrol v0.1.0 // indirect - github.com/prometheus/client_model v0.3.0 // indirect - github.com/prometheus/common v0.42.0 // indirect - github.com/prometheus/procfs v0.10.1 // indirect + github.com/prometheus/client_model v0.5.0 // indirect + github.com/prometheus/common v0.45.0 // indirect + github.com/prometheus/procfs v0.12.0 // indirect github.com/robfig/cron/v3 v3.0.1 // indirect + github.com/sagikazarmark/locafero v0.4.0 // indirect + github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/shopspring/decimal v1.3.1 // indirect github.com/slack-go/slack v0.12.1 // indirect - github.com/spf13/afero v1.9.5 // indirect - github.com/spf13/jwalterweatherman v1.1.0 // indirect + github.com/sourcegraph/conc v0.3.0 // indirect + github.com/spf13/afero v1.11.0 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/subosito/gotenv v1.4.2 // indirect + github.com/subosito/gotenv v1.6.0 // indirect github.com/volatiletech/inflect v0.0.1 // indirect github.com/volatiletech/randomize v0.0.1 // indirect go.uber.org/atomic v1.10.0 // indirect - golang.org/x/crypto v0.9.0 // indirect - golang.org/x/net v0.10.0 // indirect - golang.org/x/oauth2 v0.7.0 // indirect - golang.org/x/sys v0.8.0 // indirect - golang.org/x/text v0.9.0 // indirect + go.uber.org/multierr v1.9.0 // indirect + golang.org/x/crypto v0.17.0 // indirect + golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect + golang.org/x/net v0.19.0 // indirect + golang.org/x/oauth2 v0.15.0 // indirect + golang.org/x/sys v0.15.0 // indirect + golang.org/x/text v0.14.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/protobuf v1.30.0 // indirect + google.golang.org/protobuf v1.31.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/nullbio/null.v6 v6.0.0-20161116030900-40264a2e6b79 // indirect gopkg.in/square/go-jose.v2 v2.6.0 // indirect diff --git a/go.sum b/go.sum index c034c11..38b0082 100644 --- a/go.sum +++ b/go.sum @@ -130,11 +130,13 @@ github.com/coreos/go-oidc v2.2.1+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHo github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= @@ -152,23 +154,23 @@ github.com/ericlagergren/decimal v0.0.0-20190420051523-6335edbaa640/go.mod h1:md github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= -github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= -github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= +github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= +github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/felixge/fgprof v0.9.3 h1:VvyZxILNuCiUCSXtPtYmmtGvb65nqXh2QFWc0Wpf2/g= github.com/felixge/fgprof v0.9.3/go.mod h1:RdbpDgzqYVh/T9fPELJyV7EYJuHB55UTEULNun8eiPw= github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= -github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= +github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= github.com/friendsofgo/errors v0.9.2 h1:X6NYxef4efCBdwI7BgS820zFaN7Cphrmb+Pljdzjtgk= github.com/friendsofgo/errors v0.9.2/go.mod h1:yCvFW5AkDIL9qn7suHVLiI/gH228n7PC4Pn44IGoTOI= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= -github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= +github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= +github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-co-op/gocron v1.33.1 h1:wjX+Dg6Ae29a/f9BSQjY1Rl+jflTpW9aDyMqseCj78c= -github.com/go-co-op/gocron v1.33.1/go.mod h1:NLi+bkm4rRSy1F8U7iacZOz0xPseMoIOnvabGoSe/no= +github.com/go-co-op/gocron v1.37.0 h1:ZYDJGtQ4OMhTLKOKMIch+/CY70Brbb1dGdooLEhh7b0= +github.com/go-co-op/gocron v1.37.0/go.mod h1:3L/n6BkO7ABj+TrfSVXLRzsP26zmikL4ISkLQ0O8iNY= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= @@ -188,9 +190,6 @@ github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9 github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-test/deep v1.0.4 h1:u2CU3YKy9I2pmu9pX0eq50wCgjfGIt539SqR7FbHiho= github.com/go-test/deep v1.0.4/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= -github.com/gobuffalo/logger v1.0.6 h1:nnZNpxYo0zx+Aj9RfMPBm+x9zAU2OayFh/xrAWi34HU= -github.com/gobuffalo/packd v1.0.1 h1:U2wXfRr4E9DH8IdsDLlRFwTZTK7hLfq9qT/QHXGVe/0= -github.com/gobuffalo/packr/v2 v2.8.3 h1:xE1yzvnO56cUC0sTpKR3DIbxZgB54AftTFMhB2XEWlY= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gofrs/uuid v4.2.0+incompatible h1:yyYWMnhkhrKwwr8gAOcOCYxOOscHgDS9yZgBrnJfGa0= @@ -280,8 +279,8 @@ github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm4 github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= -github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= +github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= @@ -290,13 +289,13 @@ github.com/googleapis/gax-go/v2 v2.2.0/go.mod h1:as02EH8zWkzwUoLbBaFeQ+arQaj/Oth github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM= github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= -github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= -github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= -github.com/gorilla/rpc v1.2.0 h1:WvvdC2lNeT1SP32zrIce5l0ECBfbAlmrmSBsuc57wfk= -github.com/gorilla/rpc v1.2.0/go.mod h1:V4h9r+4sF5HnzqbwIez0fKSpANP0zlYd3qR7p36jkTQ= +github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= +github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= +github.com/gorilla/rpc v1.2.1 h1:yC+LMV5esttgpVvNORL/xX4jvTTEUE30UZhZ5JF7K9k= +github.com/gorilla/rpc v1.2.1/go.mod h1:uNpOihAlF5xRFLuTYhfR0yfCTm0WTQSQttkMSptRfGk= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= -github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY= +github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/consul/api v1.12.0/go.mod h1:6pVBMo0ebnYdt2S3H87XhekM/HHrUoTD2XXb/VrZVy0= @@ -366,7 +365,7 @@ github.com/karlseguin/ccache/v2 v2.0.8 h1:lT38cE//uyf6KcFok0rlgXtGFBWxkI6h/qg4tb github.com/karlseguin/ccache/v2 v2.0.8/go.mod h1:2BDThcfQMf/c0jnZowt16eW405XIqZPavt+HoYEtcxQ= github.com/karlseguin/expect v1.0.2-0.20190806010014-778a5f0c6003 h1:vJ0Snvo+SLMY72r5J4sEfkuE7AFbixEP2qRbEcum/wA= github.com/karlseguin/expect v1.0.2-0.20190806010014-778a5f0c6003/go.mod h1:zNBxMY8P21owkeogJELCLeHIt+voOSduHYTFUbwRAV8= -github.com/karrick/godirwalk v1.16.1 h1:DynhcF+bztK8gooS0+NDJFrdNZjJ3gzVzC545UNA9iw= +github.com/kat-co/vala v0.0.0-20170210184112-42e1d8b61f12/go.mod h1:u9MdXq/QageOOSGp7qG4XAQsYUMP+V5zEel/Vrl6OOc= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= github.com/kevinburke/go-bindata/v4 v4.0.2 h1:6qQI0nNTL27wM1En8zQHGBEPp3ETzgFU6hVdSjlkrfE= github.com/kevinburke/go-bindata/v4 v4.0.2/go.mod h1:M/CkBqw2qCZ1Ztv5JyKgocGYWyUkYlDqkqXS1ktLe5c= @@ -400,9 +399,6 @@ github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= -github.com/markbates/errx v1.1.0 h1:QDFeR+UP95dO12JgW+tgi2UVfo0V8YBHiUIOaeBPiEI= -github.com/markbates/oncer v1.0.0 h1:E83IaVAHygyndzPimgUYJjbshhDTALZyXxvk9FOlQRY= -github.com/markbates/safe v1.0.1 h1:yjZkbvRM6IzKj9tlu/zMJLS0n/V351OZWRnF3QfaUxI= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= @@ -417,14 +413,14 @@ github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOA github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= -github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/mattn/go-sqlite3 v1.14.14/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= -github.com/mattn/go-sqlite3 v1.14.15 h1:vfoHhTN1af61xCRSWzFIWzx2YskyMTwHLrExkBOjvxI= +github.com/mattn/go-sqlite3 v1.14.19 h1:fhGleo2h1p8tVChob4I9HpmVFIAkKGpiukdrgQbWfGI= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= -github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= +github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg= +github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k= github.com/microsoft/go-mssqldb v0.17.0/go.mod h1:OkoNGhGEs8EZqchVTtochlXruEhEOaO4S0d2sB5aeGQ= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= @@ -459,8 +455,8 @@ github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144T github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= github.com/pelletier/go-toml/v2 v2.0.5/go.mod h1:OMHamSCAODeSsVrwwvcJOaoN0LIUIaFVNZzmWyNfXas= -github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= -github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= +github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4= +github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= @@ -471,8 +467,9 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/profile v1.7.0 h1:hnbDkaNWPCLMO9wGLdBFTIZvzDrDfBM2072E1S9gJkA= github.com/pkg/profile v1.7.0/go.mod h1:8Uer0jas47ZQMJ7VD+OHknK4YDY07LPUC6dEvqDjvNo= github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= github.com/poy/onpar v1.1.2 h1:QaNrNiZx0+Nar5dLgTVp5mXkyoVFIbepjyEoGSnhbAY= @@ -483,27 +480,27 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8= -github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc= +github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= +github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= -github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= +github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= +github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM= -github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc= +github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lneoxM= +github.com/prometheus/common v0.45.0/go.mod h1:YJmSTw9BoKxJplESWWxlbyttQR4uaEcGyv9MZjVOJsY= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg= -github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= +github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= +github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= @@ -511,14 +508,18 @@ github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6L github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= -github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= -github.com/rs/cors v1.10.0 h1:62NOS1h+r8p1mW6FM0FSB0exioXLhd/sh15KpjWBZ+8= -github.com/rs/cors v1.10.0/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= -github.com/rubenv/sql-migrate v1.5.2 h1:bMDqOnrJVV/6JQgQ/MxOpU+AdO8uzYYA/TxFUBzFtS0= -github.com/rubenv/sql-migrate v1.5.2/go.mod h1:H38GW8Vqf8F0Su5XignRyaRcbXbJunSWxs+kmzlg0Is= +github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rs/cors v1.10.1 h1:L0uuZVXIKlI1SShY2nhFfo44TYvDPQ1w4oFkUJNfhyo= +github.com/rs/cors v1.10.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +github.com/rubenv/sql-migrate v1.6.1 h1:bo6/sjsan9HaXAsNxYP/jCEDUGibHp8JmOBw7NTGRos= +github.com/rubenv/sql-migrate v1.6.1/go.mod h1:tPzespupJS0jacLfhbwto/UjSX+8h2FdWB7ar+QlHa0= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/sagikazarmark/crypt v0.6.0/go.mod h1:U8+INwJo3nBv1m6A/8OBXAq7Jnpspk5AxSgDyEQcea8= +github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ= +github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4= +github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= +github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8= github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= @@ -532,25 +533,26 @@ github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/slack-go/slack v0.12.1 h1:X97b9g2hnITDtNsNe5GkGx6O2/Sz/uC20ejRZN6QxOw= github.com/slack-go/slack v0.12.1/go.mod h1:hlGi5oXA+Gt+yWTPP0plCdRKmjsDxecdHxYQdlMQKOw= +github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= +github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.8.2/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo= github.com/spf13/afero v1.9.2/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= -github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= -github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= +github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= +github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= -github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= -github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= +github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= +github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v1.5.0/go.mod h1:dWXEIy2H428czQCjInthrTRUg7yKbok+2Qi/yBIJoUM= -github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= -github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= -github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= +github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= +github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.12.0/go.mod h1:b6COn30jlNxbm/V2IqWiNWkJ+vZNiMNksliPCiuKtSI= -github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc= -github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg= +github.com/spf13/viper v1.18.2 h1:LUXCnvUvSM6FXAsj6nnfc8Q2tp1dIgUfY9Kc8GsSOiQ= +github.com/spf13/viper v1.18.2/go.mod h1:EKmWIqdnk5lOcmR72yw6hS+8OPYcwD0jteitLMVB+yk= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= @@ -565,15 +567,14 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.5/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stripe/stripe-go v70.15.0+incompatible h1:hNML7M1zx8RgtepEMlxyu/FpVPrP7KZm1gPFQquJQvM= github.com/stripe/stripe-go v70.15.0+incompatible/go.mod h1:A1dQZmO/QypXmsL0T8axYZkSN/uA/T/A64pfKdBAMiY= github.com/subosito/gotenv v1.3.0/go.mod h1:YzJjq/33h7nrwdY+iHMhEOEEbW0ovIz0tB6t6PwAXzs= github.com/subosito/gotenv v1.4.1/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= -github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= -github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= +github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= +github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/volatiletech/inflect v0.0.1 h1:2a6FcMQyhmPZcLa+uet3VJ8gLn/9svWhJxJYwvE8KsU= github.com/volatiletech/inflect v0.0.1/go.mod h1:IBti31tG6phkHitLlr5j7shC5SOo//x0AjDzaJU1PLA= @@ -581,11 +582,11 @@ github.com/volatiletech/null/v8 v8.1.2 h1:kiTiX1PpwvuugKwfvUNX/SU/5A2KGZMXfGD0DU github.com/volatiletech/null/v8 v8.1.2/go.mod h1:98DbwNoKEpRrYtGjWFctievIfm4n4MxG0A6EBUcoS5g= github.com/volatiletech/randomize v0.0.1 h1:eE5yajattWqTB2/eN8df4dw+8jwAzBtbdo5sbWC4nMk= github.com/volatiletech/randomize v0.0.1/go.mod h1:GN3U0QYqfZ9FOJ67bzax1cqZ5q2xuj2mXrXBjWaRTlY= -github.com/volatiletech/sqlboiler/v4 v4.15.0 h1:+twm3mA34SaUF6wB9U6QkXxkK8AKkV5EfgMSvcKWeY4= -github.com/volatiletech/sqlboiler/v4 v4.15.0/go.mod h1:s643wqYyCQ7Ak2hMVxH7kTS0+lFPNlj+gHKUIukJ0YA= +github.com/volatiletech/sqlboiler/v4 v4.16.0 h1:FMzn7eE9FCmnCQYzzV5mzqsUzYlxuozoG5s5nb+k9JA= +github.com/volatiletech/sqlboiler/v4 v4.16.0/go.mod h1:B14BPBGTrJ2X6l7lwnvV/iXgYR48+ozGSlzHI3frl6U= github.com/volatiletech/strmangle v0.0.1/go.mod h1:F6RA6IkB5vq0yTG4GQ0UsbbRcl3ni9P76i+JrTBKFFg= -github.com/volatiletech/strmangle v0.0.5 h1:CompJPy+lAi9h+YU/IzBR4X2RDRuAuEIP+kjFdyZXcU= -github.com/volatiletech/strmangle v0.0.5/go.mod h1:ycDvbDkjDvhC0NUU8w3fWwl5JEMTV56vTKXzR3GeR+0= +github.com/volatiletech/strmangle v0.0.6 h1:AdOYE3B2ygRDq4rXDij/MMwq6KVK/pWAYxpC7CLrkKQ= +github.com/volatiletech/strmangle v0.0.6/go.mod h1:ycDvbDkjDvhC0NUU8w3fWwl5JEMTV56vTKXzR3GeR+0= github.com/wsxiaoys/terminal v0.0.0-20160513160801-0940f3fc43a0 h1:3UeQBvD0TFrlVjOeLOBz+CPAI8dnbqNSVwUwRrkp7vQ= github.com/wsxiaoys/terminal v0.0.0-20160513160801-0940f3fc43a0/go.mod h1:IXCdmsXIht47RaVFLEdVnh1t+pgYtTAhQGj73kz+2DM= github.com/ybbus/jsonrpc/v2 v2.1.7 h1:QjoXuZhkXZ3oLBkrONBe2avzFkYeYLorpeA+d8175XQ= @@ -613,6 +614,8 @@ go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI= +go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -628,10 +631,9 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220826181053-bd7e27e6170d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g= -golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -642,6 +644,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g= +golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -718,8 +722,8 @@ golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= +golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -740,8 +744,8 @@ golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.7.0 h1:qe6s0zUXlPX80/dITx3440hWZ7GwMwgDDyrSGTPJG/g= -golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4= +golang.org/x/oauth2 v0.15.0 h1:s8pnnxNVzjWyrvYdFUQq5llS1PX2zhPXmccZv99h7uQ= +golang.org/x/oauth2 v0.15.0/go.mod h1:q48ptWNTY5XWf+JNten23lcvHpLJ0ZSxF5ttTHKVCAM= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -755,8 +759,8 @@ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220513210516-0976fa681c29/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= -golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -842,12 +846,11 @@ golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220825204002-c680a09ffe64/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= +golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.8.0 h1:n5xxQn2i3PC0yLAbjTpNT85q/Kgzcr2gIoX9OrJUols= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -857,8 +860,8 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1098,8 +1101,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= -google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/migration/026_add_indexes.sql b/migration/026_add_indexes.sql new file mode 100644 index 0000000..ea1234c --- /dev/null +++ b/migration/026_add_indexes.sql @@ -0,0 +1,24 @@ +-- +migrate Up +-- +migrate StatementBegin +CREATE INDEX idx_protected_claim_parent_deleted ON comment(is_protected, lbry_claim_id, parent_id, deleted_at); +-- +migrate StatementEnd + +-- +migrate StatementBegin +CREATE INDEX idx_comment_list ON comment(lbry_claim_id, parent_id, is_flagged, deleted_at, is_pinned, popularity_score, timestamp); +-- +migrate StatementEnd + +-- +migrate StatementBegin +CREATE INDEX idx_channel_deleted ON comment(channel_id, deleted_at); +-- +migrate StatementEnd + +-- +migrate StatementBegin +CREATE INDEX idx_timestamp_desc ON comment_classification (timestamp DESC); +-- +migrate StatementEnd + +-- +migrate StatementBegin +CREATE INDEX idx_claim_amount_protected_deleted ON comment(lbry_claim_id, amount, is_protected, deleted_at); +-- +migrate StatementEnd + +-- +migrate StatementBegin +CREATE INDEX idx_deleted_at ON comment(`deleted_at`); +-- +migrate StatementEnd diff --git a/migration/bindata.go b/migration/bindata.go index 151c9ec..1d92c4d 100644 --- a/migration/bindata.go +++ b/migration/bindata.go @@ -26,6 +26,7 @@ // migration/023_claim_to_channel.sql (794B) // migration/024_more_creator_settings.sql (285B) // migration/025_more_creator_settings_rename.sql (224B) +// migration/026_add_indexes.sql (884B) // migration/migration.go (66B) package migration @@ -614,6 +615,26 @@ func migration025_more_creator_settings_renameSql() (*asset, error) { return a, nil } +var _migration026_add_indexesSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xb4\x92\xc1\x4e\xc3\x30\x0c\x86\xef\x7d\x0a\x1f\x87\xe8\x9e\x80\x13\x6c\x3d\x70\x19\x12\x03\x89\x5b\x66\x12\xaf\x58\x4a\x9c\x28\xf1\x24\xf6\xf6\xa8\x5b\x59\x0b\x2a\x48\x93\xb6\x5b\xe2\xf8\x8f\x3f\xff\xf6\x7c\x0e\xb7\x81\xdb\x8c\x4a\xf0\x9a\xaa\xf1\x75\xad\xa8\x14\x48\xf4\x81\x5a\x96\x6a\xf1\xdc\xdc\xbf\x34\xf0\xb8\x5a\x36\x6f\xc0\xee\xd3\xa4\x1c\x95\xac\x92\x33\xd6\x23\x07\x93\x30\x93\xa8\x71\xe4\x49\xc9\xc1\xd3\x0a\x6c\x0c\x9d\x7e\xc6\x65\x48\xae\xc1\xbf\xe7\x7d\x2f\x61\x57\x43\x2f\xeb\x8e\xbd\xd4\xa0\xde\xdc\x4d\xa3\x34\xe2\xaa\xb3\x20\x7b\x04\xe3\xb9\xe8\x18\xe9\x6f\x08\x2e\x66\xeb\xb1\x6d\xe9\x07\xd0\x21\x9e\x58\xa4\x0b\xa7\x98\x76\x1e\x33\xeb\xde\x14\x1b\x33\xd5\xa0\x1c\xa8\x28\x86\x74\x39\xf0\x0f\x14\x21\x3f\x65\xe7\xf7\xd3\x95\x2c\x3b\xf5\x62\x1c\x15\x3b\x2a\xdc\xf9\x55\x0a\x6f\xd9\xa2\x72\x14\x98\x9d\x32\x61\xd9\xac\x17\x97\x6b\xfd\x30\x16\x0c\x71\x27\x3a\xda\xb2\x09\x27\x7e\x4d\xf1\x28\x39\x8e\x6a\xd8\xb7\x2b\x58\x34\x7c\x39\xa6\xd9\x0c\xe1\xcd\x7f\xa5\xbe\x02\x00\x00\xff\xff\x51\x18\xf4\xcd\x74\x03\x00\x00") + +func migration026_add_indexesSqlBytes() ([]byte, error) { + return bindataRead( + _migration026_add_indexesSql, + "migration/026_add_indexes.sql", + ) +} + +func migration026_add_indexesSql() (*asset, error) { + bytes, err := migration026_add_indexesSqlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "migration/026_add_indexes.sql", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x46, 0xe2, 0xd6, 0x6e, 0x1d, 0xbb, 0xf5, 0x48, 0x0, 0x30, 0x40, 0x9f, 0xb3, 0xfa, 0xad, 0xa8, 0x5b, 0x9f, 0x2e, 0x4e, 0x8a, 0x56, 0x93, 0x8e, 0xba, 0x5a, 0x41, 0xe0, 0x78, 0x9e, 0x54, 0x69}} + return a, nil +} + var _migrationMigrationGo = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x2a\x48\x4c\xce\x4e\x4c\x4f\x55\xc8\xcd\x4c\x2f\x4a\x2c\xc9\xcc\xcf\xe3\xe2\xd2\xd7\x0f\xc9\xc8\x2c\x56\xc8\x2c\x56\x48\xcc\x53\x48\xcd\x2d\x28\xa9\x54\x48\xcf\x57\x48\xcb\xcc\x49\xd5\x51\x48\xcb\x2f\x52\x80\x69\xc9\xcc\x2d\xc8\x2f\x2a\xe1\x02\x04\x00\x00\xff\xff\x4d\x61\xca\x8f\x42\x00\x00\x00") func migrationMigrationGoBytes() ([]byte, error) { @@ -751,6 +772,7 @@ var _bindata = map[string]func() (*asset, error){ "migration/023_claim_to_channel.sql": migration023_claim_to_channelSql, "migration/024_more_creator_settings.sql": migration024_more_creator_settingsSql, "migration/025_more_creator_settings_rename.sql": migration025_more_creator_settings_renameSql, + "migration/026_add_indexes.sql": migration026_add_indexesSql, "migration/migration.go": migrationMigrationGo, } @@ -827,6 +849,7 @@ var _bintree = &bintree{nil, map[string]*bintree{ "023_claim_to_channel.sql": {migration023_claim_to_channelSql, map[string]*bintree{}}, "024_more_creator_settings.sql": {migration024_more_creator_settingsSql, map[string]*bintree{}}, "025_more_creator_settings_rename.sql": {migration025_more_creator_settings_renameSql, map[string]*bintree{}}, + "026_add_indexes.sql": {migration026_add_indexesSql, map[string]*bintree{}}, "migration.go": {migrationMigrationGo, map[string]*bintree{}}, }}, }} diff --git a/model/blocked_entry.go b/model/blocked_entry.go index 0d711db..2b91376 100644 --- a/model/blocked_entry.go +++ b/model/blocked_entry.go @@ -1,4 +1,4 @@ -// Code generated by SQLBoiler 4.15.0 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. +// Code generated by SQLBoiler 4.16.0 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. // This file is meant to be re-generated in place and/or deleted at any time. package model @@ -611,30 +611,23 @@ func (blockedEntryL) LoadBlockedChannel(e boil.Executor, singular bool, maybeBlo } } - args := make([]interface{}, 0, 1) + args := make(map[interface{}]struct{}) if singular { if object.R == nil { object.R = &blockedEntryR{} } if !queries.IsNil(object.BlockedChannelID) { - args = append(args, object.BlockedChannelID) + args[object.BlockedChannelID] = struct{}{} } } else { - Outer: for _, obj := range slice { if obj.R == nil { obj.R = &blockedEntryR{} } - for _, a := range args { - if queries.Equal(a, obj.BlockedChannelID) { - continue Outer - } - } - if !queries.IsNil(obj.BlockedChannelID) { - args = append(args, obj.BlockedChannelID) + args[obj.BlockedChannelID] = struct{}{} } } @@ -644,9 +637,16 @@ func (blockedEntryL) LoadBlockedChannel(e boil.Executor, singular bool, maybeBlo return nil } + argsSlice := make([]interface{}, len(args)) + i := 0 + for arg := range args { + argsSlice[i] = arg + i++ + } + query := NewQuery( qm.From(`channel`), - qm.WhereIn(`channel.claim_id in ?`, args...), + qm.WhereIn(`channel.claim_id in ?`, argsSlice...), ) if mods != nil { mods.Apply(query) @@ -727,30 +727,23 @@ func (blockedEntryL) LoadCreatorChannel(e boil.Executor, singular bool, maybeBlo } } - args := make([]interface{}, 0, 1) + args := make(map[interface{}]struct{}) if singular { if object.R == nil { object.R = &blockedEntryR{} } if !queries.IsNil(object.CreatorChannelID) { - args = append(args, object.CreatorChannelID) + args[object.CreatorChannelID] = struct{}{} } } else { - Outer: for _, obj := range slice { if obj.R == nil { obj.R = &blockedEntryR{} } - for _, a := range args { - if queries.Equal(a, obj.CreatorChannelID) { - continue Outer - } - } - if !queries.IsNil(obj.CreatorChannelID) { - args = append(args, obj.CreatorChannelID) + args[obj.CreatorChannelID] = struct{}{} } } @@ -760,9 +753,16 @@ func (blockedEntryL) LoadCreatorChannel(e boil.Executor, singular bool, maybeBlo return nil } + argsSlice := make([]interface{}, len(args)) + i := 0 + for arg := range args { + argsSlice[i] = arg + i++ + } + query := NewQuery( qm.From(`channel`), - qm.WhereIn(`channel.claim_id in ?`, args...), + qm.WhereIn(`channel.claim_id in ?`, argsSlice...), ) if mods != nil { mods.Apply(query) @@ -843,30 +843,23 @@ func (blockedEntryL) LoadBlockedList(e boil.Executor, singular bool, maybeBlocke } } - args := make([]interface{}, 0, 1) + args := make(map[interface{}]struct{}) if singular { if object.R == nil { object.R = &blockedEntryR{} } if !queries.IsNil(object.BlockedListID) { - args = append(args, object.BlockedListID) + args[object.BlockedListID] = struct{}{} } } else { - Outer: for _, obj := range slice { if obj.R == nil { obj.R = &blockedEntryR{} } - for _, a := range args { - if queries.Equal(a, obj.BlockedListID) { - continue Outer - } - } - if !queries.IsNil(obj.BlockedListID) { - args = append(args, obj.BlockedListID) + args[obj.BlockedListID] = struct{}{} } } @@ -876,9 +869,16 @@ func (blockedEntryL) LoadBlockedList(e boil.Executor, singular bool, maybeBlocke return nil } + argsSlice := make([]interface{}, len(args)) + i := 0 + for arg := range args { + argsSlice[i] = arg + i++ + } + query := NewQuery( qm.From(`blocked_list`), - qm.WhereIn(`blocked_list.id in ?`, args...), + qm.WhereIn(`blocked_list.id in ?`, argsSlice...), ) if mods != nil { mods.Apply(query) @@ -959,30 +959,23 @@ func (blockedEntryL) LoadDelegatedModeratorChannel(e boil.Executor, singular boo } } - args := make([]interface{}, 0, 1) + args := make(map[interface{}]struct{}) if singular { if object.R == nil { object.R = &blockedEntryR{} } if !queries.IsNil(object.DelegatedModeratorChannelID) { - args = append(args, object.DelegatedModeratorChannelID) + args[object.DelegatedModeratorChannelID] = struct{}{} } } else { - Outer: for _, obj := range slice { if obj.R == nil { obj.R = &blockedEntryR{} } - for _, a := range args { - if queries.Equal(a, obj.DelegatedModeratorChannelID) { - continue Outer - } - } - if !queries.IsNil(obj.DelegatedModeratorChannelID) { - args = append(args, obj.DelegatedModeratorChannelID) + args[obj.DelegatedModeratorChannelID] = struct{}{} } } @@ -992,9 +985,16 @@ func (blockedEntryL) LoadDelegatedModeratorChannel(e boil.Executor, singular boo return nil } + argsSlice := make([]interface{}, len(args)) + i := 0 + for arg := range args { + argsSlice[i] = arg + i++ + } + query := NewQuery( qm.From(`channel`), - qm.WhereIn(`channel.claim_id in ?`, args...), + qm.WhereIn(`channel.claim_id in ?`, argsSlice...), ) if mods != nil { mods.Apply(query) @@ -1075,30 +1075,23 @@ func (blockedEntryL) LoadOffendingComment(e boil.Executor, singular bool, maybeB } } - args := make([]interface{}, 0, 1) + args := make(map[interface{}]struct{}) if singular { if object.R == nil { object.R = &blockedEntryR{} } if !queries.IsNil(object.OffendingCommentID) { - args = append(args, object.OffendingCommentID) + args[object.OffendingCommentID] = struct{}{} } } else { - Outer: for _, obj := range slice { if obj.R == nil { obj.R = &blockedEntryR{} } - for _, a := range args { - if queries.Equal(a, obj.OffendingCommentID) { - continue Outer - } - } - if !queries.IsNil(obj.OffendingCommentID) { - args = append(args, obj.OffendingCommentID) + args[obj.OffendingCommentID] = struct{}{} } } @@ -1108,9 +1101,16 @@ func (blockedEntryL) LoadOffendingComment(e boil.Executor, singular bool, maybeB return nil } + argsSlice := make([]interface{}, len(args)) + i := 0 + for arg := range args { + argsSlice[i] = arg + i++ + } + query := NewQuery( qm.From(`comment`), - qm.WhereIn(`comment.comment_id in ?`, args...), + qm.WhereIn(`comment.comment_id in ?`, argsSlice...), qmhelper.WhereIsNull(`comment.deleted_at`), ) if mods != nil { @@ -1192,26 +1192,18 @@ func (blockedEntryL) LoadBlockedListAppeals(e boil.Executor, singular bool, mayb } } - args := make([]interface{}, 0, 1) + args := make(map[interface{}]struct{}) if singular { if object.R == nil { object.R = &blockedEntryR{} } - args = append(args, object.ID) + args[object.ID] = struct{}{} } else { - Outer: for _, obj := range slice { if obj.R == nil { obj.R = &blockedEntryR{} } - - for _, a := range args { - if a == obj.ID { - continue Outer - } - } - - args = append(args, obj.ID) + args[obj.ID] = struct{}{} } } @@ -1219,9 +1211,16 @@ func (blockedEntryL) LoadBlockedListAppeals(e boil.Executor, singular bool, mayb return nil } + argsSlice := make([]interface{}, len(args)) + i := 0 + for arg := range args { + argsSlice[i] = arg + i++ + } + query := NewQuery( qm.From(`blocked_list_appeal`), - qm.WhereIn(`blocked_list_appeal.blocked_entry_id in ?`, args...), + qm.WhereIn(`blocked_list_appeal.blocked_entry_id in ?`, argsSlice...), ) if mods != nil { mods.Apply(query) @@ -2006,7 +2005,7 @@ func (o *BlockedEntry) Upsert(exec boil.Executor, updateColumns, insertColumns b var err error if !cached { - insert, ret := insertColumns.InsertColumnSet( + insert, _ := insertColumns.InsertColumnSet( blockedEntryAllColumns, blockedEntryColumnsWithDefault, blockedEntryColumnsWithoutDefault, @@ -2022,7 +2021,8 @@ func (o *BlockedEntry) Upsert(exec boil.Executor, updateColumns, insertColumns b return errors.New("model: unable to upsert blocked_entry, could not build update column list") } - ret = strmangle.SetComplement(ret, nzUniques) + ret := strmangle.SetComplement(blockedEntryAllColumns, strmangle.SetIntersect(insert, update)) + cache.query = buildUpsertQueryMySQL(dialect, "`blocked_entry`", update, insert) cache.retQuery = fmt.Sprintf( "SELECT %s FROM `blocked_entry` WHERE %s", diff --git a/model/blocked_list.go b/model/blocked_list.go index 311e5d6..f75b4da 100644 --- a/model/blocked_list.go +++ b/model/blocked_list.go @@ -1,4 +1,4 @@ -// Code generated by SQLBoiler 4.15.0 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. +// Code generated by SQLBoiler 4.16.0 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. // This file is meant to be re-generated in place and/or deleted at any time. package model @@ -443,27 +443,20 @@ func (blockedListL) LoadChannel(e boil.Executor, singular bool, maybeBlockedList } } - args := make([]interface{}, 0, 1) + args := make(map[interface{}]struct{}) if singular { if object.R == nil { object.R = &blockedListR{} } - args = append(args, object.ChannelID) + args[object.ChannelID] = struct{}{} } else { - Outer: for _, obj := range slice { if obj.R == nil { obj.R = &blockedListR{} } - for _, a := range args { - if a == obj.ChannelID { - continue Outer - } - } - - args = append(args, obj.ChannelID) + args[obj.ChannelID] = struct{}{} } } @@ -472,9 +465,16 @@ func (blockedListL) LoadChannel(e boil.Executor, singular bool, maybeBlockedList return nil } + argsSlice := make([]interface{}, len(args)) + i := 0 + for arg := range args { + argsSlice[i] = arg + i++ + } + query := NewQuery( qm.From(`channel`), - qm.WhereIn(`channel.claim_id in ?`, args...), + qm.WhereIn(`channel.claim_id in ?`, argsSlice...), ) if mods != nil { mods.Apply(query) @@ -555,26 +555,18 @@ func (blockedListL) LoadBlockedEntries(e boil.Executor, singular bool, maybeBloc } } - args := make([]interface{}, 0, 1) + args := make(map[interface{}]struct{}) if singular { if object.R == nil { object.R = &blockedListR{} } - args = append(args, object.ID) + args[object.ID] = struct{}{} } else { - Outer: for _, obj := range slice { if obj.R == nil { obj.R = &blockedListR{} } - - for _, a := range args { - if queries.Equal(a, obj.ID) { - continue Outer - } - } - - args = append(args, obj.ID) + args[obj.ID] = struct{}{} } } @@ -582,9 +574,16 @@ func (blockedListL) LoadBlockedEntries(e boil.Executor, singular bool, maybeBloc return nil } + argsSlice := make([]interface{}, len(args)) + i := 0 + for arg := range args { + argsSlice[i] = arg + i++ + } + query := NewQuery( qm.From(`blocked_entry`), - qm.WhereIn(`blocked_entry.blocked_list_id in ?`, args...), + qm.WhereIn(`blocked_entry.blocked_list_id in ?`, argsSlice...), ) if mods != nil { mods.Apply(query) @@ -662,26 +661,18 @@ func (blockedListL) LoadBlockedListAppeals(e boil.Executor, singular bool, maybe } } - args := make([]interface{}, 0, 1) + args := make(map[interface{}]struct{}) if singular { if object.R == nil { object.R = &blockedListR{} } - args = append(args, object.ID) + args[object.ID] = struct{}{} } else { - Outer: for _, obj := range slice { if obj.R == nil { obj.R = &blockedListR{} } - - for _, a := range args { - if queries.Equal(a, obj.ID) { - continue Outer - } - } - - args = append(args, obj.ID) + args[obj.ID] = struct{}{} } } @@ -689,9 +680,16 @@ func (blockedListL) LoadBlockedListAppeals(e boil.Executor, singular bool, maybe return nil } + argsSlice := make([]interface{}, len(args)) + i := 0 + for arg := range args { + argsSlice[i] = arg + i++ + } + query := NewQuery( qm.From(`blocked_list_appeal`), - qm.WhereIn(`blocked_list_appeal.blocked_list_id in ?`, args...), + qm.WhereIn(`blocked_list_appeal.blocked_list_id in ?`, argsSlice...), ) if mods != nil { mods.Apply(query) @@ -769,26 +767,18 @@ func (blockedListL) LoadBlockedListInvites(e boil.Executor, singular bool, maybe } } - args := make([]interface{}, 0, 1) + args := make(map[interface{}]struct{}) if singular { if object.R == nil { object.R = &blockedListR{} } - args = append(args, object.ID) + args[object.ID] = struct{}{} } else { - Outer: for _, obj := range slice { if obj.R == nil { obj.R = &blockedListR{} } - - for _, a := range args { - if a == obj.ID { - continue Outer - } - } - - args = append(args, obj.ID) + args[obj.ID] = struct{}{} } } @@ -796,9 +786,16 @@ func (blockedListL) LoadBlockedListInvites(e boil.Executor, singular bool, maybe return nil } + argsSlice := make([]interface{}, len(args)) + i := 0 + for arg := range args { + argsSlice[i] = arg + i++ + } + query := NewQuery( qm.From(`blocked_list_invite`), - qm.WhereIn(`blocked_list_invite.blocked_list_id in ?`, args...), + qm.WhereIn(`blocked_list_invite.blocked_list_id in ?`, argsSlice...), ) if mods != nil { mods.Apply(query) @@ -876,26 +873,18 @@ func (blockedListL) LoadBlockedListInviteChannels(e boil.Executor, singular bool } } - args := make([]interface{}, 0, 1) + args := make(map[interface{}]struct{}) if singular { if object.R == nil { object.R = &blockedListR{} } - args = append(args, object.ID) + args[object.ID] = struct{}{} } else { - Outer: for _, obj := range slice { if obj.R == nil { obj.R = &blockedListR{} } - - for _, a := range args { - if queries.Equal(a, obj.ID) { - continue Outer - } - } - - args = append(args, obj.ID) + args[obj.ID] = struct{}{} } } @@ -903,9 +892,16 @@ func (blockedListL) LoadBlockedListInviteChannels(e boil.Executor, singular bool return nil } + argsSlice := make([]interface{}, len(args)) + i := 0 + for arg := range args { + argsSlice[i] = arg + i++ + } + query := NewQuery( qm.From(`channel`), - qm.WhereIn(`channel.blocked_list_invite_id in ?`, args...), + qm.WhereIn(`channel.blocked_list_invite_id in ?`, argsSlice...), ) if mods != nil { mods.Apply(query) @@ -983,26 +979,18 @@ func (blockedListL) LoadChannels(e boil.Executor, singular bool, maybeBlockedLis } } - args := make([]interface{}, 0, 1) + args := make(map[interface{}]struct{}) if singular { if object.R == nil { object.R = &blockedListR{} } - args = append(args, object.ID) + args[object.ID] = struct{}{} } else { - Outer: for _, obj := range slice { if obj.R == nil { obj.R = &blockedListR{} } - - for _, a := range args { - if queries.Equal(a, obj.ID) { - continue Outer - } - } - - args = append(args, obj.ID) + args[obj.ID] = struct{}{} } } @@ -1010,9 +998,16 @@ func (blockedListL) LoadChannels(e boil.Executor, singular bool, maybeBlockedLis return nil } + argsSlice := make([]interface{}, len(args)) + i := 0 + for arg := range args { + argsSlice[i] = arg + i++ + } + query := NewQuery( qm.From(`channel`), - qm.WhereIn(`channel.blocked_list_id in ?`, args...), + qm.WhereIn(`channel.blocked_list_id in ?`, argsSlice...), ) if mods != nil { mods.Apply(query) @@ -1948,7 +1943,7 @@ func (o *BlockedList) Upsert(exec boil.Executor, updateColumns, insertColumns bo var err error if !cached { - insert, ret := insertColumns.InsertColumnSet( + insert, _ := insertColumns.InsertColumnSet( blockedListAllColumns, blockedListColumnsWithDefault, blockedListColumnsWithoutDefault, @@ -1964,7 +1959,8 @@ func (o *BlockedList) Upsert(exec boil.Executor, updateColumns, insertColumns bo return errors.New("model: unable to upsert blocked_list, could not build update column list") } - ret = strmangle.SetComplement(ret, nzUniques) + ret := strmangle.SetComplement(blockedListAllColumns, strmangle.SetIntersect(insert, update)) + cache.query = buildUpsertQueryMySQL(dialect, "`blocked_list`", update, insert) cache.retQuery = fmt.Sprintf( "SELECT %s FROM `blocked_list` WHERE %s", diff --git a/model/blocked_list_appeal.go b/model/blocked_list_appeal.go index 22fd334..d6190d0 100644 --- a/model/blocked_list_appeal.go +++ b/model/blocked_list_appeal.go @@ -1,4 +1,4 @@ -// Code generated by SQLBoiler 4.15.0 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. +// Code generated by SQLBoiler 4.16.0 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. // This file is meant to be re-generated in place and/or deleted at any time. package model @@ -298,30 +298,23 @@ func (blockedListAppealL) LoadBlockedList(e boil.Executor, singular bool, maybeB } } - args := make([]interface{}, 0, 1) + args := make(map[interface{}]struct{}) if singular { if object.R == nil { object.R = &blockedListAppealR{} } if !queries.IsNil(object.BlockedListID) { - args = append(args, object.BlockedListID) + args[object.BlockedListID] = struct{}{} } } else { - Outer: for _, obj := range slice { if obj.R == nil { obj.R = &blockedListAppealR{} } - for _, a := range args { - if queries.Equal(a, obj.BlockedListID) { - continue Outer - } - } - if !queries.IsNil(obj.BlockedListID) { - args = append(args, obj.BlockedListID) + args[obj.BlockedListID] = struct{}{} } } @@ -331,9 +324,16 @@ func (blockedListAppealL) LoadBlockedList(e boil.Executor, singular bool, maybeB return nil } + argsSlice := make([]interface{}, len(args)) + i := 0 + for arg := range args { + argsSlice[i] = arg + i++ + } + query := NewQuery( qm.From(`blocked_list`), - qm.WhereIn(`blocked_list.id in ?`, args...), + qm.WhereIn(`blocked_list.id in ?`, argsSlice...), ) if mods != nil { mods.Apply(query) @@ -414,27 +414,20 @@ func (blockedListAppealL) LoadBlockedEntry(e boil.Executor, singular bool, maybe } } - args := make([]interface{}, 0, 1) + args := make(map[interface{}]struct{}) if singular { if object.R == nil { object.R = &blockedListAppealR{} } - args = append(args, object.BlockedEntryID) + args[object.BlockedEntryID] = struct{}{} } else { - Outer: for _, obj := range slice { if obj.R == nil { obj.R = &blockedListAppealR{} } - for _, a := range args { - if a == obj.BlockedEntryID { - continue Outer - } - } - - args = append(args, obj.BlockedEntryID) + args[obj.BlockedEntryID] = struct{}{} } } @@ -443,9 +436,16 @@ func (blockedListAppealL) LoadBlockedEntry(e boil.Executor, singular bool, maybe return nil } + argsSlice := make([]interface{}, len(args)) + i := 0 + for arg := range args { + argsSlice[i] = arg + i++ + } + query := NewQuery( qm.From(`blocked_entry`), - qm.WhereIn(`blocked_entry.id in ?`, args...), + qm.WhereIn(`blocked_entry.id in ?`, argsSlice...), ) if mods != nil { mods.Apply(query) @@ -911,7 +911,7 @@ func (o *BlockedListAppeal) Upsert(exec boil.Executor, updateColumns, insertColu var err error if !cached { - insert, ret := insertColumns.InsertColumnSet( + insert, _ := insertColumns.InsertColumnSet( blockedListAppealAllColumns, blockedListAppealColumnsWithDefault, blockedListAppealColumnsWithoutDefault, @@ -927,7 +927,8 @@ func (o *BlockedListAppeal) Upsert(exec boil.Executor, updateColumns, insertColu return errors.New("model: unable to upsert blocked_list_appeal, could not build update column list") } - ret = strmangle.SetComplement(ret, nzUniques) + ret := strmangle.SetComplement(blockedListAppealAllColumns, strmangle.SetIntersect(insert, update)) + cache.query = buildUpsertQueryMySQL(dialect, "`blocked_list_appeal`", update, insert) cache.retQuery = fmt.Sprintf( "SELECT %s FROM `blocked_list_appeal` WHERE %s", diff --git a/model/blocked_list_invite.go b/model/blocked_list_invite.go index c85f18b..49583b2 100644 --- a/model/blocked_list_invite.go +++ b/model/blocked_list_invite.go @@ -1,4 +1,4 @@ -// Code generated by SQLBoiler 4.15.0 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. +// Code generated by SQLBoiler 4.16.0 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. // This file is meant to be re-generated in place and/or deleted at any time. package model @@ -305,27 +305,20 @@ func (blockedListInviteL) LoadBlockedList(e boil.Executor, singular bool, maybeB } } - args := make([]interface{}, 0, 1) + args := make(map[interface{}]struct{}) if singular { if object.R == nil { object.R = &blockedListInviteR{} } - args = append(args, object.BlockedListID) + args[object.BlockedListID] = struct{}{} } else { - Outer: for _, obj := range slice { if obj.R == nil { obj.R = &blockedListInviteR{} } - for _, a := range args { - if a == obj.BlockedListID { - continue Outer - } - } - - args = append(args, obj.BlockedListID) + args[obj.BlockedListID] = struct{}{} } } @@ -334,9 +327,16 @@ func (blockedListInviteL) LoadBlockedList(e boil.Executor, singular bool, maybeB return nil } + argsSlice := make([]interface{}, len(args)) + i := 0 + for arg := range args { + argsSlice[i] = arg + i++ + } + query := NewQuery( qm.From(`blocked_list`), - qm.WhereIn(`blocked_list.id in ?`, args...), + qm.WhereIn(`blocked_list.id in ?`, argsSlice...), ) if mods != nil { mods.Apply(query) @@ -417,27 +417,20 @@ func (blockedListInviteL) LoadInviterChannel(e boil.Executor, singular bool, may } } - args := make([]interface{}, 0, 1) + args := make(map[interface{}]struct{}) if singular { if object.R == nil { object.R = &blockedListInviteR{} } - args = append(args, object.InviterChannelID) + args[object.InviterChannelID] = struct{}{} } else { - Outer: for _, obj := range slice { if obj.R == nil { obj.R = &blockedListInviteR{} } - for _, a := range args { - if a == obj.InviterChannelID { - continue Outer - } - } - - args = append(args, obj.InviterChannelID) + args[obj.InviterChannelID] = struct{}{} } } @@ -446,9 +439,16 @@ func (blockedListInviteL) LoadInviterChannel(e boil.Executor, singular bool, may return nil } + argsSlice := make([]interface{}, len(args)) + i := 0 + for arg := range args { + argsSlice[i] = arg + i++ + } + query := NewQuery( qm.From(`channel`), - qm.WhereIn(`channel.claim_id in ?`, args...), + qm.WhereIn(`channel.claim_id in ?`, argsSlice...), ) if mods != nil { mods.Apply(query) @@ -529,27 +529,20 @@ func (blockedListInviteL) LoadInvitedChannel(e boil.Executor, singular bool, may } } - args := make([]interface{}, 0, 1) + args := make(map[interface{}]struct{}) if singular { if object.R == nil { object.R = &blockedListInviteR{} } - args = append(args, object.InvitedChannelID) + args[object.InvitedChannelID] = struct{}{} } else { - Outer: for _, obj := range slice { if obj.R == nil { obj.R = &blockedListInviteR{} } - for _, a := range args { - if a == obj.InvitedChannelID { - continue Outer - } - } - - args = append(args, obj.InvitedChannelID) + args[obj.InvitedChannelID] = struct{}{} } } @@ -558,9 +551,16 @@ func (blockedListInviteL) LoadInvitedChannel(e boil.Executor, singular bool, may return nil } + argsSlice := make([]interface{}, len(args)) + i := 0 + for arg := range args { + argsSlice[i] = arg + i++ + } + query := NewQuery( qm.From(`channel`), - qm.WhereIn(`channel.claim_id in ?`, args...), + qm.WhereIn(`channel.claim_id in ?`, argsSlice...), ) if mods != nil { mods.Apply(query) @@ -1039,7 +1039,7 @@ func (o *BlockedListInvite) Upsert(exec boil.Executor, updateColumns, insertColu var err error if !cached { - insert, ret := insertColumns.InsertColumnSet( + insert, _ := insertColumns.InsertColumnSet( blockedListInviteAllColumns, blockedListInviteColumnsWithDefault, blockedListInviteColumnsWithoutDefault, @@ -1055,7 +1055,8 @@ func (o *BlockedListInvite) Upsert(exec boil.Executor, updateColumns, insertColu return errors.New("model: unable to upsert blocked_list_invite, could not build update column list") } - ret = strmangle.SetComplement(ret, nzUniques) + ret := strmangle.SetComplement(blockedListInviteAllColumns, strmangle.SetIntersect(insert, update)) + cache.query = buildUpsertQueryMySQL(dialect, "`blocked_list_invite`", update, insert) cache.retQuery = fmt.Sprintf( "SELECT %s FROM `blocked_list_invite` WHERE %s", diff --git a/model/boil_queries.go b/model/boil_queries.go index 4f475c4..8c224de 100644 --- a/model/boil_queries.go +++ b/model/boil_queries.go @@ -1,4 +1,4 @@ -// Code generated by SQLBoiler 4.15.0 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. +// Code generated by SQLBoiler 4.16.0 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. // This file is meant to be re-generated in place and/or deleted at any time. package model diff --git a/model/boil_table_names.go b/model/boil_table_names.go index 2138ece..dd8f7e9 100644 --- a/model/boil_table_names.go +++ b/model/boil_table_names.go @@ -1,4 +1,4 @@ -// Code generated by SQLBoiler 4.15.0 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. +// Code generated by SQLBoiler 4.16.0 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. // This file is meant to be re-generated in place and/or deleted at any time. package model diff --git a/model/boil_types.go b/model/boil_types.go index cb49f27..749e260 100644 --- a/model/boil_types.go +++ b/model/boil_types.go @@ -1,4 +1,4 @@ -// Code generated by SQLBoiler 4.15.0 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. +// Code generated by SQLBoiler 4.16.0 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. // This file is meant to be re-generated in place and/or deleted at any time. package model diff --git a/model/boil_view_names.go b/model/boil_view_names.go index 4f47af1..dfebf21 100644 --- a/model/boil_view_names.go +++ b/model/boil_view_names.go @@ -1,4 +1,4 @@ -// Code generated by SQLBoiler 4.15.0 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. +// Code generated by SQLBoiler 4.16.0 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. // This file is meant to be re-generated in place and/or deleted at any time. package model diff --git a/model/channel.go b/model/channel.go index 7cd3a8d..eeee052 100644 --- a/model/channel.go +++ b/model/channel.go @@ -1,4 +1,4 @@ -// Code generated by SQLBoiler 4.15.0 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. +// Code generated by SQLBoiler 4.16.0 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. // This file is meant to be re-generated in place and/or deleted at any time. package model @@ -572,30 +572,23 @@ func (channelL) LoadBlockedListInvite(e boil.Executor, singular bool, maybeChann } } - args := make([]interface{}, 0, 1) + args := make(map[interface{}]struct{}) if singular { if object.R == nil { object.R = &channelR{} } if !queries.IsNil(object.BlockedListInviteID) { - args = append(args, object.BlockedListInviteID) + args[object.BlockedListInviteID] = struct{}{} } } else { - Outer: for _, obj := range slice { if obj.R == nil { obj.R = &channelR{} } - for _, a := range args { - if queries.Equal(a, obj.BlockedListInviteID) { - continue Outer - } - } - if !queries.IsNil(obj.BlockedListInviteID) { - args = append(args, obj.BlockedListInviteID) + args[obj.BlockedListInviteID] = struct{}{} } } @@ -605,9 +598,16 @@ func (channelL) LoadBlockedListInvite(e boil.Executor, singular bool, maybeChann return nil } + argsSlice := make([]interface{}, len(args)) + i := 0 + for arg := range args { + argsSlice[i] = arg + i++ + } + query := NewQuery( qm.From(`blocked_list`), - qm.WhereIn(`blocked_list.id in ?`, args...), + qm.WhereIn(`blocked_list.id in ?`, argsSlice...), ) if mods != nil { mods.Apply(query) @@ -688,30 +688,23 @@ func (channelL) LoadBlockedList(e boil.Executor, singular bool, maybeChannel int } } - args := make([]interface{}, 0, 1) + args := make(map[interface{}]struct{}) if singular { if object.R == nil { object.R = &channelR{} } if !queries.IsNil(object.BlockedListID) { - args = append(args, object.BlockedListID) + args[object.BlockedListID] = struct{}{} } } else { - Outer: for _, obj := range slice { if obj.R == nil { obj.R = &channelR{} } - for _, a := range args { - if queries.Equal(a, obj.BlockedListID) { - continue Outer - } - } - if !queries.IsNil(obj.BlockedListID) { - args = append(args, obj.BlockedListID) + args[obj.BlockedListID] = struct{}{} } } @@ -721,9 +714,16 @@ func (channelL) LoadBlockedList(e boil.Executor, singular bool, maybeChannel int return nil } + argsSlice := make([]interface{}, len(args)) + i := 0 + for arg := range args { + argsSlice[i] = arg + i++ + } + query := NewQuery( qm.From(`blocked_list`), - qm.WhereIn(`blocked_list.id in ?`, args...), + qm.WhereIn(`blocked_list.id in ?`, argsSlice...), ) if mods != nil { mods.Apply(query) @@ -804,26 +804,18 @@ func (channelL) LoadBlockedChannelBlockedEntries(e boil.Executor, singular bool, } } - args := make([]interface{}, 0, 1) + args := make(map[interface{}]struct{}) if singular { if object.R == nil { object.R = &channelR{} } - args = append(args, object.ClaimID) + args[object.ClaimID] = struct{}{} } else { - Outer: for _, obj := range slice { if obj.R == nil { obj.R = &channelR{} } - - for _, a := range args { - if queries.Equal(a, obj.ClaimID) { - continue Outer - } - } - - args = append(args, obj.ClaimID) + args[obj.ClaimID] = struct{}{} } } @@ -831,9 +823,16 @@ func (channelL) LoadBlockedChannelBlockedEntries(e boil.Executor, singular bool, return nil } + argsSlice := make([]interface{}, len(args)) + i := 0 + for arg := range args { + argsSlice[i] = arg + i++ + } + query := NewQuery( qm.From(`blocked_entry`), - qm.WhereIn(`blocked_entry.blocked_channel_id in ?`, args...), + qm.WhereIn(`blocked_entry.blocked_channel_id in ?`, argsSlice...), ) if mods != nil { mods.Apply(query) @@ -911,26 +910,18 @@ func (channelL) LoadCreatorChannelBlockedEntries(e boil.Executor, singular bool, } } - args := make([]interface{}, 0, 1) + args := make(map[interface{}]struct{}) if singular { if object.R == nil { object.R = &channelR{} } - args = append(args, object.ClaimID) + args[object.ClaimID] = struct{}{} } else { - Outer: for _, obj := range slice { if obj.R == nil { obj.R = &channelR{} } - - for _, a := range args { - if queries.Equal(a, obj.ClaimID) { - continue Outer - } - } - - args = append(args, obj.ClaimID) + args[obj.ClaimID] = struct{}{} } } @@ -938,9 +929,16 @@ func (channelL) LoadCreatorChannelBlockedEntries(e boil.Executor, singular bool, return nil } + argsSlice := make([]interface{}, len(args)) + i := 0 + for arg := range args { + argsSlice[i] = arg + i++ + } + query := NewQuery( qm.From(`blocked_entry`), - qm.WhereIn(`blocked_entry.creator_channel_id in ?`, args...), + qm.WhereIn(`blocked_entry.creator_channel_id in ?`, argsSlice...), ) if mods != nil { mods.Apply(query) @@ -1018,26 +1016,18 @@ func (channelL) LoadDelegatedModeratorChannelBlockedEntries(e boil.Executor, sin } } - args := make([]interface{}, 0, 1) + args := make(map[interface{}]struct{}) if singular { if object.R == nil { object.R = &channelR{} } - args = append(args, object.ClaimID) + args[object.ClaimID] = struct{}{} } else { - Outer: for _, obj := range slice { if obj.R == nil { obj.R = &channelR{} } - - for _, a := range args { - if queries.Equal(a, obj.ClaimID) { - continue Outer - } - } - - args = append(args, obj.ClaimID) + args[obj.ClaimID] = struct{}{} } } @@ -1045,9 +1035,16 @@ func (channelL) LoadDelegatedModeratorChannelBlockedEntries(e boil.Executor, sin return nil } + argsSlice := make([]interface{}, len(args)) + i := 0 + for arg := range args { + argsSlice[i] = arg + i++ + } + query := NewQuery( qm.From(`blocked_entry`), - qm.WhereIn(`blocked_entry.delegated_moderator_channel_id in ?`, args...), + qm.WhereIn(`blocked_entry.delegated_moderator_channel_id in ?`, argsSlice...), ) if mods != nil { mods.Apply(query) @@ -1125,26 +1122,18 @@ func (channelL) LoadBlockedLists(e boil.Executor, singular bool, maybeChannel in } } - args := make([]interface{}, 0, 1) + args := make(map[interface{}]struct{}) if singular { if object.R == nil { object.R = &channelR{} } - args = append(args, object.ClaimID) + args[object.ClaimID] = struct{}{} } else { - Outer: for _, obj := range slice { if obj.R == nil { obj.R = &channelR{} } - - for _, a := range args { - if a == obj.ClaimID { - continue Outer - } - } - - args = append(args, obj.ClaimID) + args[obj.ClaimID] = struct{}{} } } @@ -1152,9 +1141,16 @@ func (channelL) LoadBlockedLists(e boil.Executor, singular bool, maybeChannel in return nil } + argsSlice := make([]interface{}, len(args)) + i := 0 + for arg := range args { + argsSlice[i] = arg + i++ + } + query := NewQuery( qm.From(`blocked_list`), - qm.WhereIn(`blocked_list.channel_id in ?`, args...), + qm.WhereIn(`blocked_list.channel_id in ?`, argsSlice...), ) if mods != nil { mods.Apply(query) @@ -1232,26 +1228,18 @@ func (channelL) LoadInviterChannelBlockedListInvites(e boil.Executor, singular b } } - args := make([]interface{}, 0, 1) + args := make(map[interface{}]struct{}) if singular { if object.R == nil { object.R = &channelR{} } - args = append(args, object.ClaimID) + args[object.ClaimID] = struct{}{} } else { - Outer: for _, obj := range slice { if obj.R == nil { obj.R = &channelR{} } - - for _, a := range args { - if a == obj.ClaimID { - continue Outer - } - } - - args = append(args, obj.ClaimID) + args[obj.ClaimID] = struct{}{} } } @@ -1259,9 +1247,16 @@ func (channelL) LoadInviterChannelBlockedListInvites(e boil.Executor, singular b return nil } + argsSlice := make([]interface{}, len(args)) + i := 0 + for arg := range args { + argsSlice[i] = arg + i++ + } + query := NewQuery( qm.From(`blocked_list_invite`), - qm.WhereIn(`blocked_list_invite.inviter_channel_id in ?`, args...), + qm.WhereIn(`blocked_list_invite.inviter_channel_id in ?`, argsSlice...), ) if mods != nil { mods.Apply(query) @@ -1339,26 +1334,18 @@ func (channelL) LoadInvitedChannelBlockedListInvites(e boil.Executor, singular b } } - args := make([]interface{}, 0, 1) + args := make(map[interface{}]struct{}) if singular { if object.R == nil { object.R = &channelR{} } - args = append(args, object.ClaimID) + args[object.ClaimID] = struct{}{} } else { - Outer: for _, obj := range slice { if obj.R == nil { obj.R = &channelR{} } - - for _, a := range args { - if a == obj.ClaimID { - continue Outer - } - } - - args = append(args, obj.ClaimID) + args[obj.ClaimID] = struct{}{} } } @@ -1366,9 +1353,16 @@ func (channelL) LoadInvitedChannelBlockedListInvites(e boil.Executor, singular b return nil } + argsSlice := make([]interface{}, len(args)) + i := 0 + for arg := range args { + argsSlice[i] = arg + i++ + } + query := NewQuery( qm.From(`blocked_list_invite`), - qm.WhereIn(`blocked_list_invite.invited_channel_id in ?`, args...), + qm.WhereIn(`blocked_list_invite.invited_channel_id in ?`, argsSlice...), ) if mods != nil { mods.Apply(query) @@ -1446,26 +1440,18 @@ func (channelL) LoadComments(e boil.Executor, singular bool, maybeChannel interf } } - args := make([]interface{}, 0, 1) + args := make(map[interface{}]struct{}) if singular { if object.R == nil { object.R = &channelR{} } - args = append(args, object.ClaimID) + args[object.ClaimID] = struct{}{} } else { - Outer: for _, obj := range slice { if obj.R == nil { obj.R = &channelR{} } - - for _, a := range args { - if queries.Equal(a, obj.ClaimID) { - continue Outer - } - } - - args = append(args, obj.ClaimID) + args[obj.ClaimID] = struct{}{} } } @@ -1473,9 +1459,16 @@ func (channelL) LoadComments(e boil.Executor, singular bool, maybeChannel interf return nil } + argsSlice := make([]interface{}, len(args)) + i := 0 + for arg := range args { + argsSlice[i] = arg + i++ + } + query := NewQuery( qm.From(`comment`), - qm.WhereIn(`comment.channel_id in ?`, args...), + qm.WhereIn(`comment.channel_id in ?`, argsSlice...), qmhelper.WhereIsNull(`comment.deleted_at`), ) if mods != nil { @@ -1554,26 +1547,18 @@ func (channelL) LoadCreatorChannelCreatorSettings(e boil.Executor, singular bool } } - args := make([]interface{}, 0, 1) + args := make(map[interface{}]struct{}) if singular { if object.R == nil { object.R = &channelR{} } - args = append(args, object.ClaimID) + args[object.ClaimID] = struct{}{} } else { - Outer: for _, obj := range slice { if obj.R == nil { obj.R = &channelR{} } - - for _, a := range args { - if a == obj.ClaimID { - continue Outer - } - } - - args = append(args, obj.ClaimID) + args[obj.ClaimID] = struct{}{} } } @@ -1581,9 +1566,16 @@ func (channelL) LoadCreatorChannelCreatorSettings(e boil.Executor, singular bool return nil } + argsSlice := make([]interface{}, len(args)) + i := 0 + for arg := range args { + argsSlice[i] = arg + i++ + } + query := NewQuery( qm.From(`creator_setting`), - qm.WhereIn(`creator_setting.creator_channel_id in ?`, args...), + qm.WhereIn(`creator_setting.creator_channel_id in ?`, argsSlice...), ) if mods != nil { mods.Apply(query) @@ -1661,26 +1653,18 @@ func (channelL) LoadModChannelDelegatedModerators(e boil.Executor, singular bool } } - args := make([]interface{}, 0, 1) + args := make(map[interface{}]struct{}) if singular { if object.R == nil { object.R = &channelR{} } - args = append(args, object.ClaimID) + args[object.ClaimID] = struct{}{} } else { - Outer: for _, obj := range slice { if obj.R == nil { obj.R = &channelR{} } - - for _, a := range args { - if a == obj.ClaimID { - continue Outer - } - } - - args = append(args, obj.ClaimID) + args[obj.ClaimID] = struct{}{} } } @@ -1688,9 +1672,16 @@ func (channelL) LoadModChannelDelegatedModerators(e boil.Executor, singular bool return nil } + argsSlice := make([]interface{}, len(args)) + i := 0 + for arg := range args { + argsSlice[i] = arg + i++ + } + query := NewQuery( qm.From(`delegated_moderator`), - qm.WhereIn(`delegated_moderator.mod_channel_id in ?`, args...), + qm.WhereIn(`delegated_moderator.mod_channel_id in ?`, argsSlice...), ) if mods != nil { mods.Apply(query) @@ -1768,26 +1759,18 @@ func (channelL) LoadCreatorChannelDelegatedModerators(e boil.Executor, singular } } - args := make([]interface{}, 0, 1) + args := make(map[interface{}]struct{}) if singular { if object.R == nil { object.R = &channelR{} } - args = append(args, object.ClaimID) + args[object.ClaimID] = struct{}{} } else { - Outer: for _, obj := range slice { if obj.R == nil { obj.R = &channelR{} } - - for _, a := range args { - if a == obj.ClaimID { - continue Outer - } - } - - args = append(args, obj.ClaimID) + args[obj.ClaimID] = struct{}{} } } @@ -1795,9 +1778,16 @@ func (channelL) LoadCreatorChannelDelegatedModerators(e boil.Executor, singular return nil } + argsSlice := make([]interface{}, len(args)) + i := 0 + for arg := range args { + argsSlice[i] = arg + i++ + } + query := NewQuery( qm.From(`delegated_moderator`), - qm.WhereIn(`delegated_moderator.creator_channel_id in ?`, args...), + qm.WhereIn(`delegated_moderator.creator_channel_id in ?`, argsSlice...), ) if mods != nil { mods.Apply(query) @@ -1875,26 +1865,18 @@ func (channelL) LoadModChannelModerators(e boil.Executor, singular bool, maybeCh } } - args := make([]interface{}, 0, 1) + args := make(map[interface{}]struct{}) if singular { if object.R == nil { object.R = &channelR{} } - args = append(args, object.ClaimID) + args[object.ClaimID] = struct{}{} } else { - Outer: for _, obj := range slice { if obj.R == nil { obj.R = &channelR{} } - - for _, a := range args { - if queries.Equal(a, obj.ClaimID) { - continue Outer - } - } - - args = append(args, obj.ClaimID) + args[obj.ClaimID] = struct{}{} } } @@ -1902,9 +1884,16 @@ func (channelL) LoadModChannelModerators(e boil.Executor, singular bool, maybeCh return nil } + argsSlice := make([]interface{}, len(args)) + i := 0 + for arg := range args { + argsSlice[i] = arg + i++ + } + query := NewQuery( qm.From(`moderator`), - qm.WhereIn(`moderator.mod_channel_id in ?`, args...), + qm.WhereIn(`moderator.mod_channel_id in ?`, argsSlice...), ) if mods != nil { mods.Apply(query) @@ -1982,26 +1971,18 @@ func (channelL) LoadReactions(e boil.Executor, singular bool, maybeChannel inter } } - args := make([]interface{}, 0, 1) + args := make(map[interface{}]struct{}) if singular { if object.R == nil { object.R = &channelR{} } - args = append(args, object.ClaimID) + args[object.ClaimID] = struct{}{} } else { - Outer: for _, obj := range slice { if obj.R == nil { obj.R = &channelR{} } - - for _, a := range args { - if queries.Equal(a, obj.ClaimID) { - continue Outer - } - } - - args = append(args, obj.ClaimID) + args[obj.ClaimID] = struct{}{} } } @@ -2009,9 +1990,16 @@ func (channelL) LoadReactions(e boil.Executor, singular bool, maybeChannel inter return nil } + argsSlice := make([]interface{}, len(args)) + i := 0 + for arg := range args { + argsSlice[i] = arg + i++ + } + query := NewQuery( qm.From(`reaction`), - qm.WhereIn(`reaction.channel_id in ?`, args...), + qm.WhereIn(`reaction.channel_id in ?`, argsSlice...), ) if mods != nil { mods.Apply(query) @@ -3558,7 +3546,7 @@ func (o *Channel) Upsert(exec boil.Executor, updateColumns, insertColumns boil.C var err error if !cached { - insert, ret := insertColumns.InsertColumnSet( + insert, _ := insertColumns.InsertColumnSet( channelAllColumns, channelColumnsWithDefault, channelColumnsWithoutDefault, @@ -3574,7 +3562,8 @@ func (o *Channel) Upsert(exec boil.Executor, updateColumns, insertColumns boil.C return errors.New("model: unable to upsert channel, could not build update column list") } - ret = strmangle.SetComplement(ret, nzUniques) + ret := strmangle.SetComplement(channelAllColumns, strmangle.SetIntersect(insert, update)) + cache.query = buildUpsertQueryMySQL(dialect, "`channel`", update, insert) cache.retQuery = fmt.Sprintf( "SELECT %s FROM `channel` WHERE %s", diff --git a/model/channel_algo_callbacks.go b/model/channel_algo_callbacks.go index 94beb91..eef9680 100644 --- a/model/channel_algo_callbacks.go +++ b/model/channel_algo_callbacks.go @@ -1,4 +1,4 @@ -// Code generated by SQLBoiler 4.15.0 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. +// Code generated by SQLBoiler 4.16.0 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. // This file is meant to be re-generated in place and/or deleted at any time. package model @@ -483,7 +483,7 @@ func (o *ChannelAlgoCallback) Upsert(exec boil.Executor, updateColumns, insertCo var err error if !cached { - insert, ret := insertColumns.InsertColumnSet( + insert, _ := insertColumns.InsertColumnSet( channelAlgoCallbackAllColumns, channelAlgoCallbackColumnsWithDefault, channelAlgoCallbackColumnsWithoutDefault, @@ -499,7 +499,8 @@ func (o *ChannelAlgoCallback) Upsert(exec boil.Executor, updateColumns, insertCo return errors.New("model: unable to upsert channel_algo_callbacks, could not build update column list") } - ret = strmangle.SetComplement(ret, nzUniques) + ret := strmangle.SetComplement(channelAlgoCallbackAllColumns, strmangle.SetIntersect(insert, update)) + cache.query = buildUpsertQueryMySQL(dialect, "`channel_algo_callbacks`", update, insert) cache.retQuery = fmt.Sprintf( "SELECT %s FROM `channel_algo_callbacks` WHERE %s", diff --git a/model/claim_to_channel.go b/model/claim_to_channel.go index e9533ab..8dc467b 100644 --- a/model/claim_to_channel.go +++ b/model/claim_to_channel.go @@ -1,4 +1,4 @@ -// Code generated by SQLBoiler 4.15.0 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. +// Code generated by SQLBoiler 4.16.0 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. // This file is meant to be re-generated in place and/or deleted at any time. package model @@ -461,7 +461,7 @@ func (o *ClaimToChannel) Upsert(exec boil.Executor, updateColumns, insertColumns var err error if !cached { - insert, ret := insertColumns.InsertColumnSet( + insert, _ := insertColumns.InsertColumnSet( claimToChannelAllColumns, claimToChannelColumnsWithDefault, claimToChannelColumnsWithoutDefault, @@ -477,7 +477,8 @@ func (o *ClaimToChannel) Upsert(exec boil.Executor, updateColumns, insertColumns return errors.New("model: unable to upsert claim_to_channel, could not build update column list") } - ret = strmangle.SetComplement(ret, nzUniques) + ret := strmangle.SetComplement(claimToChannelAllColumns, strmangle.SetIntersect(insert, update)) + cache.query = buildUpsertQueryMySQL(dialect, "`claim_to_channel`", update, insert) cache.retQuery = fmt.Sprintf( "SELECT %s FROM `claim_to_channel` WHERE %s", diff --git a/model/comment.go b/model/comment.go index 6eb5ebb..6874dc6 100644 --- a/model/comment.go +++ b/model/comment.go @@ -1,4 +1,4 @@ -// Code generated by SQLBoiler 4.15.0 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. +// Code generated by SQLBoiler 4.16.0 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. // This file is meant to be re-generated in place and/or deleted at any time. package model @@ -486,30 +486,23 @@ func (commentL) LoadChannel(e boil.Executor, singular bool, maybeComment interfa } } - args := make([]interface{}, 0, 1) + args := make(map[interface{}]struct{}) if singular { if object.R == nil { object.R = &commentR{} } if !queries.IsNil(object.ChannelID) { - args = append(args, object.ChannelID) + args[object.ChannelID] = struct{}{} } } else { - Outer: for _, obj := range slice { if obj.R == nil { obj.R = &commentR{} } - for _, a := range args { - if queries.Equal(a, obj.ChannelID) { - continue Outer - } - } - if !queries.IsNil(obj.ChannelID) { - args = append(args, obj.ChannelID) + args[obj.ChannelID] = struct{}{} } } @@ -519,9 +512,16 @@ func (commentL) LoadChannel(e boil.Executor, singular bool, maybeComment interfa return nil } + argsSlice := make([]interface{}, len(args)) + i := 0 + for arg := range args { + argsSlice[i] = arg + i++ + } + query := NewQuery( qm.From(`channel`), - qm.WhereIn(`channel.claim_id in ?`, args...), + qm.WhereIn(`channel.claim_id in ?`, argsSlice...), ) if mods != nil { mods.Apply(query) @@ -602,30 +602,23 @@ func (commentL) LoadParent(e boil.Executor, singular bool, maybeComment interfac } } - args := make([]interface{}, 0, 1) + args := make(map[interface{}]struct{}) if singular { if object.R == nil { object.R = &commentR{} } if !queries.IsNil(object.ParentID) { - args = append(args, object.ParentID) + args[object.ParentID] = struct{}{} } } else { - Outer: for _, obj := range slice { if obj.R == nil { obj.R = &commentR{} } - for _, a := range args { - if queries.Equal(a, obj.ParentID) { - continue Outer - } - } - if !queries.IsNil(obj.ParentID) { - args = append(args, obj.ParentID) + args[obj.ParentID] = struct{}{} } } @@ -635,9 +628,16 @@ func (commentL) LoadParent(e boil.Executor, singular bool, maybeComment interfac return nil } + argsSlice := make([]interface{}, len(args)) + i := 0 + for arg := range args { + argsSlice[i] = arg + i++ + } + query := NewQuery( qm.From(`comment`), - qm.WhereIn(`comment.comment_id in ?`, args...), + qm.WhereIn(`comment.comment_id in ?`, argsSlice...), qmhelper.WhereIsNull(`comment.deleted_at`), ) if mods != nil { @@ -719,26 +719,19 @@ func (commentL) LoadCommentClassification(e boil.Executor, singular bool, maybeC } } - args := make([]interface{}, 0, 1) + args := make(map[interface{}]struct{}) if singular { if object.R == nil { object.R = &commentR{} } - args = append(args, object.CommentID) + args[object.CommentID] = struct{}{} } else { - Outer: for _, obj := range slice { if obj.R == nil { obj.R = &commentR{} } - for _, a := range args { - if a == obj.CommentID { - continue Outer - } - } - - args = append(args, obj.CommentID) + args[obj.CommentID] = struct{}{} } } @@ -746,9 +739,16 @@ func (commentL) LoadCommentClassification(e boil.Executor, singular bool, maybeC return nil } + argsSlice := make([]interface{}, len(args)) + i := 0 + for arg := range args { + argsSlice[i] = arg + i++ + } + query := NewQuery( qm.From(`comment_classification`), - qm.WhereIn(`comment_classification.comment_id in ?`, args...), + qm.WhereIn(`comment_classification.comment_id in ?`, argsSlice...), ) if mods != nil { mods.Apply(query) @@ -828,26 +828,18 @@ func (commentL) LoadOffendingCommentBlockedEntries(e boil.Executor, singular boo } } - args := make([]interface{}, 0, 1) + args := make(map[interface{}]struct{}) if singular { if object.R == nil { object.R = &commentR{} } - args = append(args, object.CommentID) + args[object.CommentID] = struct{}{} } else { - Outer: for _, obj := range slice { if obj.R == nil { obj.R = &commentR{} } - - for _, a := range args { - if queries.Equal(a, obj.CommentID) { - continue Outer - } - } - - args = append(args, obj.CommentID) + args[obj.CommentID] = struct{}{} } } @@ -855,9 +847,16 @@ func (commentL) LoadOffendingCommentBlockedEntries(e boil.Executor, singular boo return nil } + argsSlice := make([]interface{}, len(args)) + i := 0 + for arg := range args { + argsSlice[i] = arg + i++ + } + query := NewQuery( qm.From(`blocked_entry`), - qm.WhereIn(`blocked_entry.offending_comment_id in ?`, args...), + qm.WhereIn(`blocked_entry.offending_comment_id in ?`, argsSlice...), ) if mods != nil { mods.Apply(query) @@ -935,26 +934,18 @@ func (commentL) LoadParentComments(e boil.Executor, singular bool, maybeComment } } - args := make([]interface{}, 0, 1) + args := make(map[interface{}]struct{}) if singular { if object.R == nil { object.R = &commentR{} } - args = append(args, object.CommentID) + args[object.CommentID] = struct{}{} } else { - Outer: for _, obj := range slice { if obj.R == nil { obj.R = &commentR{} } - - for _, a := range args { - if queries.Equal(a, obj.CommentID) { - continue Outer - } - } - - args = append(args, obj.CommentID) + args[obj.CommentID] = struct{}{} } } @@ -962,9 +953,16 @@ func (commentL) LoadParentComments(e boil.Executor, singular bool, maybeComment return nil } + argsSlice := make([]interface{}, len(args)) + i := 0 + for arg := range args { + argsSlice[i] = arg + i++ + } + query := NewQuery( qm.From(`comment`), - qm.WhereIn(`comment.parent_id in ?`, args...), + qm.WhereIn(`comment.parent_id in ?`, argsSlice...), qmhelper.WhereIsNull(`comment.deleted_at`), ) if mods != nil { @@ -1043,26 +1041,18 @@ func (commentL) LoadReactions(e boil.Executor, singular bool, maybeComment inter } } - args := make([]interface{}, 0, 1) + args := make(map[interface{}]struct{}) if singular { if object.R == nil { object.R = &commentR{} } - args = append(args, object.CommentID) + args[object.CommentID] = struct{}{} } else { - Outer: for _, obj := range slice { if obj.R == nil { obj.R = &commentR{} } - - for _, a := range args { - if a == obj.CommentID { - continue Outer - } - } - - args = append(args, obj.CommentID) + args[obj.CommentID] = struct{}{} } } @@ -1070,9 +1060,16 @@ func (commentL) LoadReactions(e boil.Executor, singular bool, maybeComment inter return nil } + argsSlice := make([]interface{}, len(args)) + i := 0 + for arg := range args { + argsSlice[i] = arg + i++ + } + query := NewQuery( qm.From(`reaction`), - qm.WhereIn(`reaction.comment_id in ?`, args...), + qm.WhereIn(`reaction.comment_id in ?`, argsSlice...), ) if mods != nil { mods.Apply(query) @@ -1908,7 +1905,7 @@ func (o *Comment) Upsert(exec boil.Executor, updateColumns, insertColumns boil.C var err error if !cached { - insert, ret := insertColumns.InsertColumnSet( + insert, _ := insertColumns.InsertColumnSet( commentAllColumns, commentColumnsWithDefault, commentColumnsWithoutDefault, @@ -1924,7 +1921,8 @@ func (o *Comment) Upsert(exec boil.Executor, updateColumns, insertColumns boil.C return errors.New("model: unable to upsert comment, could not build update column list") } - ret = strmangle.SetComplement(ret, nzUniques) + ret := strmangle.SetComplement(commentAllColumns, strmangle.SetIntersect(insert, update)) + cache.query = buildUpsertQueryMySQL(dialect, "`comment`", update, insert) cache.retQuery = fmt.Sprintf( "SELECT %s FROM `comment` WHERE %s", diff --git a/model/comment_classification.go b/model/comment_classification.go index 340ffd8..26b5591 100644 --- a/model/comment_classification.go +++ b/model/comment_classification.go @@ -1,4 +1,4 @@ -// Code generated by SQLBoiler 4.15.0 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. +// Code generated by SQLBoiler 4.16.0 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. // This file is meant to be re-generated in place and/or deleted at any time. package model @@ -348,27 +348,20 @@ func (commentClassificationL) LoadComment(e boil.Executor, singular bool, maybeC } } - args := make([]interface{}, 0, 1) + args := make(map[interface{}]struct{}) if singular { if object.R == nil { object.R = &commentClassificationR{} } - args = append(args, object.CommentID) + args[object.CommentID] = struct{}{} } else { - Outer: for _, obj := range slice { if obj.R == nil { obj.R = &commentClassificationR{} } - for _, a := range args { - if a == obj.CommentID { - continue Outer - } - } - - args = append(args, obj.CommentID) + args[obj.CommentID] = struct{}{} } } @@ -377,9 +370,16 @@ func (commentClassificationL) LoadComment(e boil.Executor, singular bool, maybeC return nil } + argsSlice := make([]interface{}, len(args)) + i := 0 + for arg := range args { + argsSlice[i] = arg + i++ + } + query := NewQuery( qm.From(`comment`), - qm.WhereIn(`comment.comment_id in ?`, args...), + qm.WhereIn(`comment.comment_id in ?`, argsSlice...), qmhelper.WhereIsNull(`comment.deleted_at`), ) if mods != nil { @@ -756,7 +756,7 @@ func (o *CommentClassification) Upsert(exec boil.Executor, updateColumns, insert var err error if !cached { - insert, ret := insertColumns.InsertColumnSet( + insert, _ := insertColumns.InsertColumnSet( commentClassificationAllColumns, commentClassificationColumnsWithDefault, commentClassificationColumnsWithoutDefault, @@ -772,7 +772,8 @@ func (o *CommentClassification) Upsert(exec boil.Executor, updateColumns, insert return errors.New("model: unable to upsert comment_classification, could not build update column list") } - ret = strmangle.SetComplement(ret, nzUniques) + ret := strmangle.SetComplement(commentClassificationAllColumns, strmangle.SetIntersect(insert, update)) + cache.query = buildUpsertQueryMySQL(dialect, "`comment_classification`", update, insert) cache.retQuery = fmt.Sprintf( "SELECT %s FROM `comment_classification` WHERE %s", diff --git a/model/creator_setting.go b/model/creator_setting.go index e5d8a8e..bef23b5 100644 --- a/model/creator_setting.go +++ b/model/creator_setting.go @@ -1,4 +1,4 @@ -// Code generated by SQLBoiler 4.15.0 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. +// Code generated by SQLBoiler 4.16.0 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. // This file is meant to be re-generated in place and/or deleted at any time. package model @@ -525,27 +525,20 @@ func (creatorSettingL) LoadCreatorChannel(e boil.Executor, singular bool, maybeC } } - args := make([]interface{}, 0, 1) + args := make(map[interface{}]struct{}) if singular { if object.R == nil { object.R = &creatorSettingR{} } - args = append(args, object.CreatorChannelID) + args[object.CreatorChannelID] = struct{}{} } else { - Outer: for _, obj := range slice { if obj.R == nil { obj.R = &creatorSettingR{} } - for _, a := range args { - if a == obj.CreatorChannelID { - continue Outer - } - } - - args = append(args, obj.CreatorChannelID) + args[obj.CreatorChannelID] = struct{}{} } } @@ -554,9 +547,16 @@ func (creatorSettingL) LoadCreatorChannel(e boil.Executor, singular bool, maybeC return nil } + argsSlice := make([]interface{}, len(args)) + i := 0 + for arg := range args { + argsSlice[i] = arg + i++ + } + query := NewQuery( qm.From(`channel`), - qm.WhereIn(`channel.claim_id in ?`, args...), + qm.WhereIn(`channel.claim_id in ?`, argsSlice...), ) if mods != nil { mods.Apply(query) @@ -943,7 +943,7 @@ func (o *CreatorSetting) Upsert(exec boil.Executor, updateColumns, insertColumns var err error if !cached { - insert, ret := insertColumns.InsertColumnSet( + insert, _ := insertColumns.InsertColumnSet( creatorSettingAllColumns, creatorSettingColumnsWithDefault, creatorSettingColumnsWithoutDefault, @@ -959,7 +959,8 @@ func (o *CreatorSetting) Upsert(exec boil.Executor, updateColumns, insertColumns return errors.New("model: unable to upsert creator_setting, could not build update column list") } - ret = strmangle.SetComplement(ret, nzUniques) + ret := strmangle.SetComplement(creatorSettingAllColumns, strmangle.SetIntersect(insert, update)) + cache.query = buildUpsertQueryMySQL(dialect, "`creator_setting`", update, insert) cache.retQuery = fmt.Sprintf( "SELECT %s FROM `creator_setting` WHERE %s", diff --git a/model/delegated_moderator.go b/model/delegated_moderator.go index f55ec1f..d6d9e8a 100644 --- a/model/delegated_moderator.go +++ b/model/delegated_moderator.go @@ -1,4 +1,4 @@ -// Code generated by SQLBoiler 4.15.0 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. +// Code generated by SQLBoiler 4.16.0 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. // This file is meant to be re-generated in place and/or deleted at any time. package model @@ -269,27 +269,20 @@ func (delegatedModeratorL) LoadModChannel(e boil.Executor, singular bool, maybeD } } - args := make([]interface{}, 0, 1) + args := make(map[interface{}]struct{}) if singular { if object.R == nil { object.R = &delegatedModeratorR{} } - args = append(args, object.ModChannelID) + args[object.ModChannelID] = struct{}{} } else { - Outer: for _, obj := range slice { if obj.R == nil { obj.R = &delegatedModeratorR{} } - for _, a := range args { - if a == obj.ModChannelID { - continue Outer - } - } - - args = append(args, obj.ModChannelID) + args[obj.ModChannelID] = struct{}{} } } @@ -298,9 +291,16 @@ func (delegatedModeratorL) LoadModChannel(e boil.Executor, singular bool, maybeD return nil } + argsSlice := make([]interface{}, len(args)) + i := 0 + for arg := range args { + argsSlice[i] = arg + i++ + } + query := NewQuery( qm.From(`channel`), - qm.WhereIn(`channel.claim_id in ?`, args...), + qm.WhereIn(`channel.claim_id in ?`, argsSlice...), ) if mods != nil { mods.Apply(query) @@ -381,27 +381,20 @@ func (delegatedModeratorL) LoadCreatorChannel(e boil.Executor, singular bool, ma } } - args := make([]interface{}, 0, 1) + args := make(map[interface{}]struct{}) if singular { if object.R == nil { object.R = &delegatedModeratorR{} } - args = append(args, object.CreatorChannelID) + args[object.CreatorChannelID] = struct{}{} } else { - Outer: for _, obj := range slice { if obj.R == nil { obj.R = &delegatedModeratorR{} } - for _, a := range args { - if a == obj.CreatorChannelID { - continue Outer - } - } - - args = append(args, obj.CreatorChannelID) + args[obj.CreatorChannelID] = struct{}{} } } @@ -410,9 +403,16 @@ func (delegatedModeratorL) LoadCreatorChannel(e boil.Executor, singular bool, ma return nil } + argsSlice := make([]interface{}, len(args)) + i := 0 + for arg := range args { + argsSlice[i] = arg + i++ + } + query := NewQuery( qm.From(`channel`), - qm.WhereIn(`channel.claim_id in ?`, args...), + qm.WhereIn(`channel.claim_id in ?`, argsSlice...), ) if mods != nil { mods.Apply(query) @@ -845,7 +845,7 @@ func (o *DelegatedModerator) Upsert(exec boil.Executor, updateColumns, insertCol var err error if !cached { - insert, ret := insertColumns.InsertColumnSet( + insert, _ := insertColumns.InsertColumnSet( delegatedModeratorAllColumns, delegatedModeratorColumnsWithDefault, delegatedModeratorColumnsWithoutDefault, @@ -861,7 +861,8 @@ func (o *DelegatedModerator) Upsert(exec boil.Executor, updateColumns, insertCol return errors.New("model: unable to upsert delegated_moderator, could not build update column list") } - ret = strmangle.SetComplement(ret, nzUniques) + ret := strmangle.SetComplement(delegatedModeratorAllColumns, strmangle.SetIntersect(insert, update)) + cache.query = buildUpsertQueryMySQL(dialect, "`delegated_moderator`", update, insert) cache.retQuery = fmt.Sprintf( "SELECT %s FROM `delegated_moderator` WHERE %s", diff --git a/model/gorp_migrations.go b/model/gorp_migrations.go index 7c0329d..bb5bf0a 100644 --- a/model/gorp_migrations.go +++ b/model/gorp_migrations.go @@ -1,4 +1,4 @@ -// Code generated by SQLBoiler 4.15.0 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. +// Code generated by SQLBoiler 4.16.0 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. // This file is meant to be re-generated in place and/or deleted at any time. package model @@ -448,7 +448,7 @@ func (o *GorpMigration) Upsert(exec boil.Executor, updateColumns, insertColumns var err error if !cached { - insert, ret := insertColumns.InsertColumnSet( + insert, _ := insertColumns.InsertColumnSet( gorpMigrationAllColumns, gorpMigrationColumnsWithDefault, gorpMigrationColumnsWithoutDefault, @@ -464,7 +464,8 @@ func (o *GorpMigration) Upsert(exec boil.Executor, updateColumns, insertColumns return errors.New("model: unable to upsert gorp_migrations, could not build update column list") } - ret = strmangle.SetComplement(ret, nzUniques) + ret := strmangle.SetComplement(gorpMigrationAllColumns, strmangle.SetIntersect(insert, update)) + cache.query = buildUpsertQueryMySQL(dialect, "`gorp_migrations`", update, insert) cache.retQuery = fmt.Sprintf( "SELECT %s FROM `gorp_migrations` WHERE %s", diff --git a/model/moderator.go b/model/moderator.go index e798346..6c6fda9 100644 --- a/model/moderator.go +++ b/model/moderator.go @@ -1,4 +1,4 @@ -// Code generated by SQLBoiler 4.15.0 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. +// Code generated by SQLBoiler 4.16.0 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. // This file is meant to be re-generated in place and/or deleted at any time. package model @@ -242,30 +242,23 @@ func (moderatorL) LoadModChannel(e boil.Executor, singular bool, maybeModerator } } - args := make([]interface{}, 0, 1) + args := make(map[interface{}]struct{}) if singular { if object.R == nil { object.R = &moderatorR{} } if !queries.IsNil(object.ModChannelID) { - args = append(args, object.ModChannelID) + args[object.ModChannelID] = struct{}{} } } else { - Outer: for _, obj := range slice { if obj.R == nil { obj.R = &moderatorR{} } - for _, a := range args { - if queries.Equal(a, obj.ModChannelID) { - continue Outer - } - } - if !queries.IsNil(obj.ModChannelID) { - args = append(args, obj.ModChannelID) + args[obj.ModChannelID] = struct{}{} } } @@ -275,9 +268,16 @@ func (moderatorL) LoadModChannel(e boil.Executor, singular bool, maybeModerator return nil } + argsSlice := make([]interface{}, len(args)) + i := 0 + for arg := range args { + argsSlice[i] = arg + i++ + } + query := NewQuery( qm.From(`channel`), - qm.WhereIn(`channel.claim_id in ?`, args...), + qm.WhereIn(`channel.claim_id in ?`, argsSlice...), ) if mods != nil { mods.Apply(query) @@ -697,7 +697,7 @@ func (o *Moderator) Upsert(exec boil.Executor, updateColumns, insertColumns boil var err error if !cached { - insert, ret := insertColumns.InsertColumnSet( + insert, _ := insertColumns.InsertColumnSet( moderatorAllColumns, moderatorColumnsWithDefault, moderatorColumnsWithoutDefault, @@ -713,7 +713,8 @@ func (o *Moderator) Upsert(exec boil.Executor, updateColumns, insertColumns boil return errors.New("model: unable to upsert moderator, could not build update column list") } - ret = strmangle.SetComplement(ret, nzUniques) + ret := strmangle.SetComplement(moderatorAllColumns, strmangle.SetIntersect(insert, update)) + cache.query = buildUpsertQueryMySQL(dialect, "`moderator`", update, insert) cache.retQuery = fmt.Sprintf( "SELECT %s FROM `moderator` WHERE %s", diff --git a/model/mysql_upsert.go b/model/mysql_upsert.go index 0914f21..4266847 100644 --- a/model/mysql_upsert.go +++ b/model/mysql_upsert.go @@ -1,4 +1,4 @@ -// Code generated by SQLBoiler 4.15.0 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. +// Code generated by SQLBoiler 4.16.0 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. // This file is meant to be re-generated in place and/or deleted at any time. package model diff --git a/model/reaction.go b/model/reaction.go index 1d92e75..b6224af 100644 --- a/model/reaction.go +++ b/model/reaction.go @@ -1,4 +1,4 @@ -// Code generated by SQLBoiler 4.15.0 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. +// Code generated by SQLBoiler 4.16.0 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. // This file is meant to be re-generated in place and/or deleted at any time. package model @@ -305,30 +305,23 @@ func (reactionL) LoadChannel(e boil.Executor, singular bool, maybeReaction inter } } - args := make([]interface{}, 0, 1) + args := make(map[interface{}]struct{}) if singular { if object.R == nil { object.R = &reactionR{} } if !queries.IsNil(object.ChannelID) { - args = append(args, object.ChannelID) + args[object.ChannelID] = struct{}{} } } else { - Outer: for _, obj := range slice { if obj.R == nil { obj.R = &reactionR{} } - for _, a := range args { - if queries.Equal(a, obj.ChannelID) { - continue Outer - } - } - if !queries.IsNil(obj.ChannelID) { - args = append(args, obj.ChannelID) + args[obj.ChannelID] = struct{}{} } } @@ -338,9 +331,16 @@ func (reactionL) LoadChannel(e boil.Executor, singular bool, maybeReaction inter return nil } + argsSlice := make([]interface{}, len(args)) + i := 0 + for arg := range args { + argsSlice[i] = arg + i++ + } + query := NewQuery( qm.From(`channel`), - qm.WhereIn(`channel.claim_id in ?`, args...), + qm.WhereIn(`channel.claim_id in ?`, argsSlice...), ) if mods != nil { mods.Apply(query) @@ -421,27 +421,20 @@ func (reactionL) LoadComment(e boil.Executor, singular bool, maybeReaction inter } } - args := make([]interface{}, 0, 1) + args := make(map[interface{}]struct{}) if singular { if object.R == nil { object.R = &reactionR{} } - args = append(args, object.CommentID) + args[object.CommentID] = struct{}{} } else { - Outer: for _, obj := range slice { if obj.R == nil { obj.R = &reactionR{} } - for _, a := range args { - if a == obj.CommentID { - continue Outer - } - } - - args = append(args, obj.CommentID) + args[obj.CommentID] = struct{}{} } } @@ -450,9 +443,16 @@ func (reactionL) LoadComment(e boil.Executor, singular bool, maybeReaction inter return nil } + argsSlice := make([]interface{}, len(args)) + i := 0 + for arg := range args { + argsSlice[i] = arg + i++ + } + query := NewQuery( qm.From(`comment`), - qm.WhereIn(`comment.comment_id in ?`, args...), + qm.WhereIn(`comment.comment_id in ?`, argsSlice...), qmhelper.WhereIsNull(`comment.deleted_at`), ) if mods != nil { @@ -534,27 +534,20 @@ func (reactionL) LoadReactionType(e boil.Executor, singular bool, maybeReaction } } - args := make([]interface{}, 0, 1) + args := make(map[interface{}]struct{}) if singular { if object.R == nil { object.R = &reactionR{} } - args = append(args, object.ReactionTypeID) + args[object.ReactionTypeID] = struct{}{} } else { - Outer: for _, obj := range slice { if obj.R == nil { obj.R = &reactionR{} } - for _, a := range args { - if a == obj.ReactionTypeID { - continue Outer - } - } - - args = append(args, obj.ReactionTypeID) + args[obj.ReactionTypeID] = struct{}{} } } @@ -563,9 +556,16 @@ func (reactionL) LoadReactionType(e boil.Executor, singular bool, maybeReaction return nil } + argsSlice := make([]interface{}, len(args)) + i := 0 + for arg := range args { + argsSlice[i] = arg + i++ + } + query := NewQuery( qm.From(`reaction_type`), - qm.WhereIn(`reaction_type.id in ?`, args...), + qm.WhereIn(`reaction_type.id in ?`, argsSlice...), ) if mods != nil { mods.Apply(query) @@ -1077,7 +1077,7 @@ func (o *Reaction) Upsert(exec boil.Executor, updateColumns, insertColumns boil. var err error if !cached { - insert, ret := insertColumns.InsertColumnSet( + insert, _ := insertColumns.InsertColumnSet( reactionAllColumns, reactionColumnsWithDefault, reactionColumnsWithoutDefault, @@ -1093,7 +1093,8 @@ func (o *Reaction) Upsert(exec boil.Executor, updateColumns, insertColumns boil. return errors.New("model: unable to upsert reaction, could not build update column list") } - ret = strmangle.SetComplement(ret, nzUniques) + ret := strmangle.SetComplement(reactionAllColumns, strmangle.SetIntersect(insert, update)) + cache.query = buildUpsertQueryMySQL(dialect, "`reaction`", update, insert) cache.retQuery = fmt.Sprintf( "SELECT %s FROM `reaction` WHERE %s", diff --git a/model/reaction_type.go b/model/reaction_type.go index c024191..6ccb8f5 100644 --- a/model/reaction_type.go +++ b/model/reaction_type.go @@ -1,4 +1,4 @@ -// Code generated by SQLBoiler 4.15.0 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. +// Code generated by SQLBoiler 4.16.0 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. // This file is meant to be re-generated in place and/or deleted at any time. package model @@ -237,26 +237,18 @@ func (reactionTypeL) LoadReactions(e boil.Executor, singular bool, maybeReaction } } - args := make([]interface{}, 0, 1) + args := make(map[interface{}]struct{}) if singular { if object.R == nil { object.R = &reactionTypeR{} } - args = append(args, object.ID) + args[object.ID] = struct{}{} } else { - Outer: for _, obj := range slice { if obj.R == nil { obj.R = &reactionTypeR{} } - - for _, a := range args { - if a == obj.ID { - continue Outer - } - } - - args = append(args, obj.ID) + args[obj.ID] = struct{}{} } } @@ -264,9 +256,16 @@ func (reactionTypeL) LoadReactions(e boil.Executor, singular bool, maybeReaction return nil } + argsSlice := make([]interface{}, len(args)) + i := 0 + for arg := range args { + argsSlice[i] = arg + i++ + } + query := NewQuery( qm.From(`reaction`), - qm.WhereIn(`reaction.reaction_type_id in ?`, args...), + qm.WhereIn(`reaction.reaction_type_id in ?`, argsSlice...), ) if mods != nil { mods.Apply(query) @@ -657,7 +656,7 @@ func (o *ReactionType) Upsert(exec boil.Executor, updateColumns, insertColumns b var err error if !cached { - insert, ret := insertColumns.InsertColumnSet( + insert, _ := insertColumns.InsertColumnSet( reactionTypeAllColumns, reactionTypeColumnsWithDefault, reactionTypeColumnsWithoutDefault, @@ -673,7 +672,8 @@ func (o *ReactionType) Upsert(exec boil.Executor, updateColumns, insertColumns b return errors.New("model: unable to upsert reaction_type, could not build update column list") } - ret = strmangle.SetComplement(ret, nzUniques) + ret := strmangle.SetComplement(reactionTypeAllColumns, strmangle.SetIntersect(insert, update)) + cache.query = buildUpsertQueryMySQL(dialect, "`reaction_type`", update, insert) cache.retQuery = fmt.Sprintf( "SELECT %s FROM `reaction_type` WHERE %s", From d8d1559f0d0605ad4b546e64b282d1e90f6111a2 Mon Sep 17 00:00:00 2001 From: Niko Storni Date: Fri, 19 Jan 2024 22:36:06 +0100 Subject: [PATCH 2/3] adjust users --- .env.example | 4 ++-- .github/workflows/main.yml | 12 ++++++------ README.md | 4 ++-- cmd/root.go | 2 +- docker-compose.yml | 8 ++++---- scripts/setup.sh | 4 ++-- scripts/test_db_via_docker.sh | 12 ++++++------ sqlboiler.toml | 4 ++-- 8 files changed, 25 insertions(+), 25 deletions(-) diff --git a/.env.example b/.env.example index a9238d4..a8ed1dc 100644 --- a/.env.example +++ b/.env.example @@ -1,4 +1,4 @@ -MYSQL_DSN_RO="lbry-ro:lbry@tcp(localhost:3306)/commentron" -MYSQL_DSN_RW="lbry-rw:lbry@tcp(localhost:3306)/commentron" +MYSQL_DSN_RO="commentron-ro:commentron@tcp(localhost:3306)/commentron" +MYSQL_DSN_RW="commentron-rw:commentron@tcp(localhost:3306)/commentron" SDK_URL="https://api.na-backend.odysee.com/api/v1/proxy" SOCKETY_TOKEN="sockety_token" #If you want to integrate directly with sockety locally diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6eccc2b..b7955d0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,11 +22,11 @@ jobs: run: | sudo mysql -u root -proot -e 'CREATE DATABASE IF NOT EXISTS commentron;' sudo mysql -u root -proot -e 'CREATE DATABASE IF NOT EXISTS social;' - sudo mysql -u root -proot -e "CREATE USER 'lbry-rw'@'localhost' IDENTIFIED BY 'lbry';" - sudo mysql -u root -proot -e "CREATE USER 'lbry-ro'@'localhost' IDENTIFIED BY 'lbry';" - sudo mysql -u root -proot -e "GRANT ALL ON commentron.* TO 'lbry-rw'@'localhost';" - sudo mysql -u root -proot -e "GRANT SELECT ON commentron.* TO 'lbry-ro'@'localhost';" - sudo mysql -u root -proot -e "GRANT ALL ON social.* TO 'lbry-rw'@'localhost';" + sudo mysql -u root -proot -e "CREATE USER 'commentron-rw'@'localhost' IDENTIFIED BY 'commentron';" + sudo mysql -u root -proot -e "CREATE USER 'commentron-ro'@'localhost' IDENTIFIED BY 'commentron';" + sudo mysql -u root -proot -e "GRANT ALL ON commentron.* TO 'commentron-rw'@'localhost';" + sudo mysql -u root -proot -e "GRANT SELECT ON commentron.* TO 'commentron-ro'@'localhost';" + sudo mysql -u root -proot -e "GRANT ALL ON social.* TO 'commentron-rw'@'localhost';" - name: Cache uses: actions/cache@v2 @@ -56,7 +56,7 @@ jobs: env: GOPRIVATE: github.com/OdyseeTeam IS_TEST: true - SDK_URL: https://api.lbry.tv/api/v1/proxy + SDK_URL: https://api.na-backend.odysee.com/api/v1/proxy run: | ./scripts/build.sh ./scripts/lint.sh diff --git a/README.md b/README.md index 783a9a2..5721de3 100644 --- a/README.md +++ b/README.md @@ -10,9 +10,9 @@ This is the commenting system for odysee.com. The system uses a JSON RPC server. Make sure you setup the configuration to use env files. -`MYSQL_DSN_RO="lbry-ro:lbry@tcp(localhost:3306)/commentron"` +`MYSQL_DSN_RO="commentron-ro:commentron@tcp(localhost:3306)/commentron"` -`MYSQL_DSN_RW="lbry-rw:lbry@tcp(localhost:3306)/commentron"` +`MYSQL_DSN_RW="commentron-rw:commentron@tcp(localhost:3306)/commentron"` `SDK_URL="https://api.na-backend.odysee.com/api/v1/proxy"` diff --git a/cmd/root.go b/cmd/root.go index 95c47fa..728ce64 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -20,7 +20,7 @@ func init() { var rootCmd = &cobra.Command{ Use: "commentron", - Short: "LBRY Comment Server", + Short: "Odysee Comment Server", Long: `Accepts new and delivers existing comments`, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { diff --git a/docker-compose.yml b/docker-compose.yml index 86b0ff3..ef2bbaa 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,18 +8,18 @@ services: - "3306" environment: - MYSQL_DATABASE=commentron - - MYSQL_USER=lbry - - MYSQL_PASSWORD=lbry + - MYSQL_USER=commentron + - MYSQL_PASSWORD=commentron - MYSQL_LOG_CONSOLE=true volumes: - data:/var/lib/mysql" commentron: - image: lbry/commentron:master + image: odyseeteam/commentron:master restart: "no" ports: - "5900:5900" environment: - - MYSQL_DSN=lbry:lbry@tcp(mysql:3306)/commentron + - MYSQL_DSN=commentron:commentron@tcp(mysql:3306)/commentron - AUTH_TOKEN= depends_on: - mysql diff --git a/scripts/setup.sh b/scripts/setup.sh index 48f420d..cfe54f4 100755 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash export DEBUGGING=1 -export MYSQL_DSN_RO="lbry-ro:lbry@tcp(localhost:3306)/commentron" -export MYSQL_DSN_RW="lbry-rw:lbry@tcp(localhost:3306)/commentron" +export MYSQL_DSN_RO="commentron-ro:commentron@tcp(localhost:3306)/commentron" +export MYSQL_DSN_RW="commentron-rw:commentron@tcp(localhost:3306)/commentron" touch -a .env && set -o allexport; source ./.env; set +o allexport diff --git a/scripts/test_db_via_docker.sh b/scripts/test_db_via_docker.sh index 4033bac..6cafd1c 100755 --- a/scripts/test_db_via_docker.sh +++ b/scripts/test_db_via_docker.sh @@ -5,11 +5,11 @@ mkdir -p /tmp/commentron/init.d tee /tmp/commentron/init.d/001_init.sql < Date: Fri, 19 Jan 2024 22:45:22 +0100 Subject: [PATCH 3/3] adjust runners fix user --- .github/workflows/main.yml | 6 +++--- Dockerfile | 2 +- docker-compose.yml | 2 +- sqlboiler.toml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b7955d0..5c4a348 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,11 +4,11 @@ on: [ push, pull_request ] jobs: build: - runs-on: ubuntu-20.04 # equivalent to 'dist: focal' + runs-on: ubuntu-22.04 steps: - name: Check out code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Setup Go uses: actions/setup-go@v4 @@ -29,7 +29,7 @@ jobs: sudo mysql -u root -proot -e "GRANT ALL ON social.* TO 'commentron-rw'@'localhost';" - name: Cache - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: | ${{ runner.home }}/go/pkg/mod diff --git a/Dockerfile b/Dockerfile index 1f00934..4e5f2c0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ ## Comments server for Odysee.com -FROM ubuntu:20.04 +FROM ubuntu:22.04 LABEL MAINTAINER="beamer" RUN export DEBIAN_FRONTEND=noninteractive && \ diff --git a/docker-compose.yml b/docker-compose.yml index ef2bbaa..2ebde83 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: mysql: - image: mysql/mysql-server:5.7.31 + image: percona:ps-8.0 restart: "no" expose: - "3306" diff --git a/sqlboiler.toml b/sqlboiler.toml index d10a6ca..022a743 100644 --- a/sqlboiler.toml +++ b/sqlboiler.toml @@ -7,6 +7,6 @@ output="model" dbname="commentron" host="localhost" port=3306 - user="commentron" + user="commentron-rw" pass="commentron" sslmode="false" \ No newline at end of file