Skip to content

Use Liquibase for automated database migrations#309

Merged
P0nk merged 143 commits intomasterfrom
feat/liquibase
Jul 22, 2025
Merged

Use Liquibase for automated database migrations#309
P0nk merged 143 commits intomasterfrom
feat/liquibase

Conversation

@P0nk
Copy link
Owner

@P0nk P0nk commented Jul 6, 2025

Description

Use Liquibase - a database migration tool - to run the database scripts required to get the server going. This simplifies the initial setup as well as making it easier to make changes over time. It's a win for everyone.

In addition to the refactoring of the database setup, some functional changes have also been made:

  • Allow multiple drops of the same item from a mob. There was a database constraint preventing this which has been removed.
  • Lower rates of global drops significantly; to act as more of a bonus and less part of the core gameplay

Checklist before requesting a review

  • I have performed a self-review of my code
  • I have tested my changes
  • I have added unit tests that prove my changes work

Screenshots

P0nk added 28 commits July 4, 2025 20:18
Less static variables and generally cleaner code
Some of these duplicate drops should be kept,
but are removed for the sake of efficiency.

For example, Stumpy (3220000) should drop multiple Tree Branch (4000003) and Leaf (4000005), but the duplicate have been removed.
To fix this, one has to go through the removed drops in this commit and manually reintroduce the drops that should have been kept. The "RemoveDuplicateDrops" tool simplifies this a little bit as it produces a file with all the removed drops. As of writing this, it removed duplicate drops from 415 mobs, for a total of 7331 removed drops.

The following SQL query finds the amount of duplicate drops in the database:
SELECT COUNT(*) total_mobs_with_duplicate_items, SUM(extra_item_drops) AS total_duplicate_items
FROM (SELECT dropperid, SUM(extras) AS extra_item_drops
	FROM
		(SELECT dropperid, itemid, COUNT(*) - 1 AS extras
		FROM lb_drop_data
		GROUP BY dropperid, itemid
		HAVING COUNT(*) > 1) AS i
		GROUP BY dropperid
		ORDER BY dropperid
) AS i2
In case you want to add your own custom stuff or change drops or something else.
Global drops are too common, and the ones we have here are not part of vanilla v83
@P0nk P0nk merged commit 1eeb248 into master Jul 22, 2025
1 check passed
@P0nk P0nk deleted the feat/liquibase branch July 22, 2025 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant