EvilPuncker Posted August 1, 2012 Group: Members Topic Count: 19 Topics Per Day: 0.00 Content Count: 713 Reputation: 71 Joined: 11/08/11 Last Seen: December 25, 2024 Share Posted August 1, 2012 I would like to suggest the addition of an auto update system for sql db updates, like: We start with db_version 0 Something got modified in db so instead of devs adding a new .sql upgrade file (that noobs don't know a sh*t about, look at support and bugtracker for "favorite") they would add it to source and it would execute on server start and would change db_version to 1 etc etc etc etc etc for those who knows a bit about coding, take a look at this as example, it is from opentibia emulator feel free to flame this thread, I don't care It was just something that passed into my head after seeing all that topic/bugreports every time that a .sql upgrade goes out, it would be really nice IMO to have it implemented! but lets elaborate and give your point also (you guys are negative but whatever xD) 1 Quote Link to comment Share on other sites More sharing options...
Vengeance Posted August 1, 2012 Group: Members Topic Count: 8 Topics Per Day: 0.00 Content Count: 65 Reputation: 13 Joined: 01/08/12 Last Seen: February 19, 2015 Share Posted August 1, 2012 this will cause problems for any custom modifications done in the db or the server...better this things be how it is...or a new addon to just add sql to db..like the map cache will do I guess... Quote Link to comment Share on other sites More sharing options...
xazax Posted August 1, 2012 Group: Members Topic Count: 11 Topics Per Day: 0.00 Content Count: 427 Reputation: 123 Joined: 11/17/11 Last Seen: December 31, 2022 Share Posted August 1, 2012 I think it is possible to create an optional step: importing the whole item_db.txt or item_db.sql to sql at startup. But I don't really see the point in of this feature. What would be more useful, and still possible to implement is: to create a post commit hook, that monitors for db changes, and if item_db or mob_db changes, do automatic conversion, and a commit. This way the sql files would be 100% percent up to date all time. Quote Link to comment Share on other sites More sharing options...
EvilPuncker Posted August 1, 2012 Group: Members Topic Count: 19 Topics Per Day: 0.00 Content Count: 713 Reputation: 71 Joined: 11/08/11 Last Seen: December 25, 2024 Author Share Posted August 1, 2012 xazax and others! I mean changes into main.sql xD Quote Link to comment Share on other sites More sharing options...
xazax Posted August 1, 2012 Group: Members Topic Count: 11 Topics Per Day: 0.00 Content Count: 427 Reputation: 123 Joined: 11/17/11 Last Seen: December 31, 2022 Share Posted August 1, 2012 Oh, I see your point now Quote Link to comment Share on other sites More sharing options...
EvilPuncker Posted August 1, 2012 Group: Members Topic Count: 19 Topics Per Day: 0.00 Content Count: 713 Reputation: 71 Joined: 11/08/11 Last Seen: December 25, 2024 Author Share Posted August 1, 2012 some issues that current system causes: http://rathena.org/board/tracker/issue-6391-unknown-column-r16552/ http://rathena.org/board/tracker/issue-6355-sql-error-related-to-srccharcharc878/ http://rathena.org/board/tracker/issue-6364-db-error-unknown-column/ http://rathena.org/board/topic/68445-unknown-column-favorite-in-field-list/ http://rathena.org/board/topic/68407-regarding-about-lots-of-problem/#entry125272 some more I've missed Quote Link to comment Share on other sites More sharing options...
xazax Posted August 1, 2012 Group: Members Topic Count: 11 Topics Per Day: 0.00 Content Count: 427 Reputation: 123 Joined: 11/17/11 Last Seen: December 31, 2022 Share Posted August 1, 2012 Yeah, as far as I can see, it would definitely involve giving the database some kind of version. After that, there are 2 options: * Hardcoded updates on startup * Execute formatted .sql files from a folder on startup. One must be able to disable this feature though, because it is a security hole, and you need to set less strict premissions to your server's mysql user. ( however I guess most user do not bother much with permission anyways ) 1 Quote Link to comment Share on other sites More sharing options...
EvilPuncker Posted August 1, 2012 Group: Members Topic Count: 19 Topics Per Day: 0.00 Content Count: 713 Reputation: 71 Joined: 11/08/11 Last Seen: December 25, 2024 Author Share Posted August 1, 2012 One must be able to disable this feature though indeed Quote Link to comment Share on other sites More sharing options...
Lemongrass Posted August 1, 2012 Group: Developer Topic Count: 28 Topics Per Day: 0.01 Content Count: 547 Reputation: 270 Joined: 11/08/11 Last Seen: June 10, 2024 Share Posted August 1, 2012 I would rather prefer, that the rAthena SVN version is merged into a file and this file is checked on startup and if there is a sql update file for that revision the server(s) should tell you at startup that you have to run these. That would require to save two values though: the last revision that was used the current revision So it can tell you all of the updates that have to be done to the database. But I would not run it automatically since you can never know if someone changes his database and these changes contradict to the newest updates. Quote Link to comment Share on other sites More sharing options...
Vianna Posted August 2, 2012 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 47 Reputation: 8 Joined: 12/06/11 Last Seen: January 13, 2013 Share Posted August 2, 2012 Then we would have to give privileges to alter tables to the MySQL account used by the server =( The database itself could have a row somewhere telling its version, and then when a dev changed the tables in a way that they would have to be updated using upgrade_rXXXXX.sql, he would also increment a constant, let's say, MIN_SQL_DB_VERSION, in mmo.h. The upgrade_rXXXXX.sql file would also change the version number. Then, whenever a server started, it would compare the database's version with MIN_SQL_DB_VERSION and it would print a message saying that the tables were changed and that they have to be updated manually. Quote Link to comment Share on other sites More sharing options...
EvilPuncker Posted August 2, 2012 Group: Members Topic Count: 19 Topics Per Day: 0.00 Content Count: 713 Reputation: 71 Joined: 11/08/11 Last Seen: December 25, 2024 Author Share Posted August 2, 2012 you guys make things look way so complicated when they are not =P Quote Link to comment Share on other sites More sharing options...
Salepate Posted August 16, 2012 Group: Members Topic Count: 1 Topics Per Day: 0.00 Content Count: 3 Reputation: 2 Joined: 05/21/12 Last Seen: April 12 Share Posted August 16, 2012 It is true, the server's sql account should remain at minimal privilege, it is not its task to update SQL table, but to display a warning on start-up is a good idea though. 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.