.sql question

Place for sharing your game modifications for Life is Feudal: Your Own

Java1970
True Believer
 
Posts: 2
Joined: 21 Feb 2015, 20:10

.sql question

Post by Java1970 » 18 Jan 2016, 21:42

So I read that there are 3 .sql files that of importance.
- new.sql
- patch.sql
- dump.sql

I assume that the new.sql is the base sql file to initially populate the database tables and I wouldn't ever need to modify that.

What, however, is the difference between the dump and patch sql files?

I've read some posts saying to make this change you modify the patch.sql file and other posts saying to make this same change you modify the dump.sql file.

Hence my confusion on some of this stuff.

Any help on understanding the purpose and difference of these two files is greatly appreciated

User avatar
Azzerhoden
Alpha Tester
 
Posts: 1621
Joined: 08 May 2014, 17:44

Re: .sql question

Post by Azzerhoden » 18 Jan 2016, 23:12

When I want something to run on server startup (such as removing stumps and low quality trees) I make changes in patch.sql.

For those one time only changes - I just drop the SQL into the query window on Heidi.
| - Alpha Tester and Zealous Believer
Image

Kingdom of Hyperion founding Duchy - A practical RP Community est. 1999 - Apply Today!

User avatar
Sethturace
 
Posts: 19
Joined: 08 Feb 2015, 11:24

Re: .sql question

Post by Sethturace » 07 Feb 2016, 11:35

hello, i did the same but the game (the server) cleans up 4 tables in the DB on startup and write the standard values into the tables, so i can not make changes to object_types or recipe_requirement.

do someone know why?

her is a part of the logfile:

Code: Select all
^CREATE TABLE IF NOT EXI
ECHO 2016-02-05 10:58:58.756 {02} <initServer> ### Patching database [2/2]...
WARN 2016-02-05 10:58:58.756 {02} <initServer> ### DB::noRS(0 ms) USE `lif_1`;
WARN 2016-02-05 10:58:59.115 {02} <initServer> ### DB::mNoRS(353 ms) /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;

DELETE FROM `animal_breeds`;

DELETE FROM `objects_types`;

DELETE FROM `recipe`;

DELETE FROM `recipe_requirement`;

/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;


MacDante
 
Posts: 95
Joined: 12 May 2015, 10:08

Re: .sql question

Post by MacDante » 07 Feb 2016, 12:06

dump.sql is last sql run from SQL folder.

sql order run from sql folder:
1. new.sql (run anytime ahen db dont exist)
2. patch.sql (witch actual dews changes to new.sql)
3. dump.sql (with actual recipes and items in game)

dump.sql:
This SQL actualize all recipes and all items in a game. If you want change any type of this elements, you should change in this file, or make another file with changes, and any time when is patch you should copy and paste own changes on end of dump.sql file... :)

User avatar
Sethturace
 
Posts: 19
Joined: 08 Feb 2015, 11:24

Re: .sql question

Post by Sethturace » 07 Feb 2016, 12:18

i will try it, thank you!

//edit: now it works

Return to Game mods

cron