averbraeck / housinggame-admin

Administrator app for the Housing Game
https://housing-game.tbm.tudelft.nl
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

Make admin function for duplicaton of gameversion and scenario #16

Closed averbraeck closed 10 months ago

averbraeck commented 10 months ago

To create alternatives (and translations), duplication of a complete scenario or game version would save a lot of work. All dependent tables except the gameplay tables should be copied in a cascading fashion.

averbraeck commented 10 months ago

In addition, deletion of unused scenarios, and unused game versions can be added (to delete test versions). The deletion follows the cloning, but in reverse order.

averbraeck commented 10 months ago

The code will be added as static helper functions in the SqlUtils class. For cloning, the name will be appended with (1), (2), etc. The user can change this name after cloning.

averbraeck commented 10 months ago

Cloning and deleting of ScenarioParameters and Scenario has been tested, and it works. Results have been checked in the database as well.

averbraeck commented 10 months ago

GameVersion, Scenario, and ScenarioParameters can be cloned and cascadingly destroyed.