chore(config): drop the unused minitems / maxitems database fields - #34
Merged
Conversation
InitializeFromSql() had both SELECTs commented out, so neither column was ever read: the seller's ceiling comes from AuctionHouseBot.MaxItems in the conf file. Editing the columns, or setting them through ".ahbotoptions minitems/maxitems", looked like it worked and changed nothing. MinItems went further than that - GetMinItems() had no caller left anywhere, so AuctionHouseBot.MinItems, the member, the accessors, the column and the GM command were all inert. All removed. The maxitems GM command stays as a runtime-only override (it already recalculates the per-quality maxima) but no longer writes to a column nobody reads. The column drop ships as a guarded, re-runnable z_-prefixed migration. mod_auctionhousebot.sql is deliberately left untouched: changing that file makes the DB updater re-apply its DROP TABLE and wipe the tuned prices and percentages.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to the discussion on #33.
Why
AHBConfig::InitializeFromSql()had both reads commented out:So the
minitems/maxitemscolumns were never read. The seller's ceiling comes fromAuctionHouseBot.MaxItemsin the conf file. Both columns were still being written by.ahbotoptions minitems/maxitems, which made editing them look effective while doing nothing — the exact trap worth removing.MinItemswas worse:GetMinItems()had no caller anywhere. The conf option (AuctionHouseBot.MinItems = 10000), the member, the accessors, the column and the GM command were all completely inert.Changes
minItems(member,Get/SetMinItems, conf read, reset, copy-ctor),AuctionHouseBot.MinItemsfrom the conf dist, theminitemsGM command, its enum value and its help line.minItemsdebug log..ahbotoptions maxitemskeeps working as a runtime-only override — it already recalculates the per-quality maxima viaCalculatePercents()— but no longerUPDATEs a column nothing reads. Help text now says "until restart".z_2026_08_24_00_drop_minitems_maxitems.sqldrops both columns.Migration notes
information_schemaand re-runnable, and works on MySQL as well as MariaDB (MySQL has noDROP COLUMN IF EXISTS).mod_auctionhousebot.sqlis deliberately left untouched. That file starts withDROP TABLE IF EXISTS; changing it changes its hash and the DB updater would re-apply it, wiping the tuned prices and percentages in the live table. The consequence is that a fresh install creates the two columns and this migration drops them again immediately afterwards — thez_prefix keeps it sorted after the base file, same trickz_filter_disabled_and_trash.sqluses.mod_ahbot.conffiles may still carry aAuctionHouseBot.MinItemsline. Harmless — unknown options are ignored — but it can be deleted.Verification
minItems/minitemsreferences remain insrc/,conf/ordocs/.core-buildworkflow on this PR.Note on ordering with #33
Independent of #33 (that one only touches
GetItemsToSell()); no conflicts expected in either merge order.