ledger123 / runmyaccounts

SQL-Ledger Customizations by Run My Accounts
GNU General Public License v2.0
16 stars 9 forks source link

SQL statement for creating dataset template from existing database #398

Closed sweitmann closed 1 year ago

sweitmann commented 1 year ago

Hi Armaghan,

Could you please let me know how to formulate the SQL statements for creating a new dataset template from an existing database?

I have been configuring a new database with all the latest changes for the Run my Accounts German market dataset template (RMADE_DEU_Basiskontenplan-chart.sql).

And now I need to create the new SQL statements for that German dataset template, so that whenever we create a new dataset for German market it will also contain my latest changes.

Regards

ledger123 commented 1 year ago

Hi Sebastian,

Good evening.

Script to create such a file is linked here: https://gist.github.com/ledger123/4e3651cd11d65c8a7e5bbf4c9fa20936

You just need to copy the script any where on the server where you have the database. Then edit the script and change the database name 'ledger28' to your database and run the script from command line like this:

perl generate_chart_file.pl

It will create the required chart file in the current folder which you can then move any where.

Right now it creates INSERT statements for 3 tables chart, curr, defaults (as per my need) but you can add or remove tables from this list as needed by editing the script.

Let me know if any adjustments are needed.

Regards

sweitmann commented 1 year ago

Wonderful, works fantastically! Thank you, Armaghan!