AzerothCore
Pages :

How to create a DB PR via GitHub

This is a simplified guide to easily create PRs containing DB fixes (SQL code) without bothering with the terminal, an easier alternative to the traditional way of creating PRs. If you want to submit C++ or other non-SQL kind of fixes, please follow the other guide.

Do only ONCE: create your AzerothCore fork

You need to be signed on github.com. If you don't have an account yet, create one.

Open the AzerothCore repository and create a fork of it by clicking in the top-right "Fork" button:

Create a fork of AzerothCore

Creating a new PR

1. Update your fork on GitHub

Open your browser and navigate to your fork on GitHub (change YourUsername with your actual GitHub username):

https://github.com/YourUsername/azerothcore-wotlk

If your master branch is not up to date with latest AzerothCore, you'll see something like:

This branch is XX commits behind azerothcore:master

AzerothCore update fork

to update it, click on Fetch upstream and then Fetch and merge.

As a result, your fork's master branch should say:

This branch is even with azerothcore:master

AzerothCore fork updated

2. Create a new branch

Make sure you have the master branch currently selected, click on the branches dropdown and create a new branch.

AzerothCore fork updated

You can name your new branch the way you want (typically something related to your fix), just make sure you haven't used that name before and that you are creating the new branch by copying the master branch.

You should see a message like Create branch my-new-branch-123 from master.

After you create the new branch, make sure you keep that one selected.

You now need to navigate inside the data/sql/updates/pending_db_world folder of your fork.

You can either do it manually by clicking on the data folder, then sql, updates, pending_db_world;

...or you can just open this URL (change YourUsername with your actual GitHub username):

https://github.com/YourUsername/azerothcore-wotlk/tree/my-new-branch-123/data/sql/updates/pending_db_world

4. Create and commit a new file

Back on GitHub, from the pending_db_world folder, click Add file and then Create new file:

AzerothCore create new SQL file

Now you need to:

  • Give the file any name with the file extension .sql.
  • Add a new line, then add your own SQL code below and then add a new empty line at the end of the file.

AzerothCore new SQL file example

Now scroll down the page, you'll need to:

  1. Fill out the commit message, we use the Conventional Commits format, for example fix(DB/Creature): some commit description here.
  2. Include some extra description (optional).
  3. Make sure that "Commit directly to the your-new-branch-name" is selected.
  4. Click Commit new file.

AzerothCore create new commit

5. Open the PR

Go back to the main AzerothCore repository, you will notice that GitHub is smart enough to realize that you are about to open a PR and shows this nice light-yellow box:

AzerothCore - Compare & pull request

click on the "Compare & pull request" green button (located on the right).

Now fill the PR template following the instructions that will appear in the screen, do not forget to add the testing instructions so people can be able to test your PR and it can be merged:

AzerothCore - Compare & pull request

It's also a good practice to check the "File changes" tab to see that everything is in place as you expect:

AzerothCore - Compare & pull request

That's it!