Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with SQL files. #5485

Closed
ganonDX opened this issue Oct 25, 2020 · 5 comments · Fixed by #5478
Closed

Issue with SQL files. #5485

ganonDX opened this issue Oct 25, 2020 · 5 comments · Fixed by #5478
Labels
component:database A fault that lies within the database of rAthena mode:prerenewal A fault that exists within the pre-renewal mode mode:renewal A fault that exists within the renewal mode type:enhancement Issue that is an enhancement to rAthena

Comments

@ganonDX
Copy link

ganonDX commented Oct 25, 2020

  • Server Mode: re
  • Description of Issue:
    I was wondering if the SQL tables are working as intended? I've added these to my SQL (fresh SQL starting from scratch)
    grafik
    First of all, flux wouldn't display any of the items (while it was working just fine for years using the old itemSQL files.)
    Second: The structure looks really messy to me in MySQL

grafik
Item_db has some usables inside it.
item_db_re has equips
item_db2 is a mix of every type of item
item_db2_re is the exact same as item_db2 but has more columns.

I really don't understand these new SQL tables or how to make them work.

Edit:
Deleted all item related tables -> Added item_db2_re.sql -> then added item_db_re_usable.sql -> then added item_db_re_etc.sql -> then added item_db_re_equip.sql

and at the end there is only equip inside the table item_db_re

Edit2:
Looks like everytime I run one of the 3 SQL tables, the other one gets overwritten and deleted. Basically, applied equip table -> then applied useable table = deletes equip entries and adds useable item entries.

Edit3: Monster tables work just fine (the normal old ones) also being displayed in flux.

@Lemongrass3110
Copy link
Member

The problem you describe is because the table gets deleted and recreated with every file.
This is solved in #5478.

For flux you need to use the files in sql-files/compatibility/*

@Lemongrass3110 Lemongrass3110 added component:database A fault that lies within the database of rAthena mode:prerenewal A fault that exists within the pre-renewal mode mode:renewal A fault that exists within the renewal mode type:enhancement Issue that is an enhancement to rAthena labels Oct 25, 2020
@Lemongrass3110 Lemongrass3110 linked a pull request Oct 25, 2020 that will close this issue
@ganonDX
Copy link
Author

ganonDX commented Oct 25, 2020

The problem you describe is because the table gets deleted and recreated with every file.
This is solved in #5478.

For flux you need to use the files in sql-files/compatibility/*

thanks a lot, I havent noticed the pullrequest yet. I'll be waiting for it to merge then.

I also have not used any of the files inside compatibility and upgrades.

is it necessary to apply all of the files within the folders compatibility and upgrades to my SQL?
(i know this is unrelated, but I couldnt find any documentation regarding the files inside these folders)

@Lemongrass3110
Copy link
Member

If you check out this link https://github.com/rathena/rathena/tree/master/sql-files you will see the README at the bottom, or just open the README.md file on your local clone of the repository.

Basically what you need to do is use the new SQL tables and create a view with the compatability script so that it will show up in the old table format, so that the control panel can read it. All you have to change is to let your control panel read from item_db_re_compat instead of item_db_re. And I think that should be a manageable task.

@ganonDX
Copy link
Author

ganonDX commented Oct 25, 2020

If you check out this link https://github.com/rathena/rathena/tree/master/sql-files you will see the README at the bottom, or just open the README.md file on your local clone of the repository.

Basically what you need to do is use the new SQL tables and create a view with the compatability script so that it will show up in the old table format, so that the control panel can read it. All you have to change is to let your control panel read from item_db_re_compat instead of item_db_re. And I think that should be a manageable task.

thanks a lot for your time and answer. I already knew that part. I was just wondering if it is necessary to apply all the files from the folder sql-files/upgrades/

basically. the readme says "These imports only have to executed if an update has occurred after the initial installation." And that means, If i have a fresh rAthena, I dont need to execute those files? (sorry for the noob or dumb questions)

I am wondering because the folder "upgrades" also contains the "premium storage.sql" which is not included in the SQL files outside the upgrade folder. that makes me question if all other updates (from the upgrade folder) are included or not.

to make it simple.

I cloned rathena 5 minutes ago -> do I need to execute the SQL files from the upgrade folder?

Lemongrass3110 added a commit that referenced this issue Oct 25, 2020
Fixes a couple issues with the column checking.
Adds verification to table columns to make sure table format is correct.
Cleans up the node processing.
Adds a loading progress status.
Adjusts the SQL import files to not destroy previously imported data.
Updated README.md to reflect the changes for SQL importing.

Fixes #5485
Fixes #5477

Thanks to @Lemongrass3110!

Co-authored-by: Lemongrass3110 <lemongrass@kstp.at>
@aleos89
Copy link
Contributor

aleos89 commented Oct 26, 2020

Not every update requires a SQL change, but most of the time you should get a warning at the start of the server stating a SQL discrepancy. We are working on an automatic SQL upgrade in #4916.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:database A fault that lies within the database of rAthena mode:prerenewal A fault that exists within the pre-renewal mode mode:renewal A fault that exists within the renewal mode type:enhancement Issue that is an enhancement to rAthena
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants