Giter VIP home page Giter VIP logo

Comments (1)

mserajnik avatar mserajnik commented on July 22, 2024

I don't know how to commit sql fixes

Open the sql directory in a terminal and run one of the following scripts (depending on your operating system/environment):

./touch_migration.sh
# or
python make_migration.py

If you are on Windows, you can instead also run the make_migration.bat script, afaik simply by double-clicking it in Windows Explorer (and I am sure you can run it from a cmd or PowerShell session too).

All of these scripts should produce a new, time-stamped file in sql/migrations, e.g., /sql/migrations/20240620215951_world.sql, which will look like this:

DROP PROCEDURE IF EXISTS add_migration;
DELIMITER ??
CREATE PROCEDURE `add_migration`()
BEGIN
DECLARE v INT DEFAULT 1;
SET v = (SELECT COUNT(*) FROM `migrations` WHERE `id`='20240620215951');
IF v = 0 THEN
INSERT INTO `migrations` VALUES ('20240620215951');
-- Add your query below.



-- End of migration.
END IF;
END??
DELIMITER ;
CALL add_migration();
DROP PROCEDURE IF EXISTS add_migration;

Now you'll simply have to add your SQL statements between the -- Add your query below. and the -- End of migration. comments and make a PR that includes this new file.

Note that the SQL syntax/style should match the existing migrations. E.g., in the fix you posted (without checking the fix itself) you would have to remove the database name (because it shouldn't be assumed that the database name will always be mangos), so instead of

UPDATE `mangos`.`creature_template` -- ...

you would just write

UPDATE `creature_template` -- ...

from core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.