YAGNI and database creation scripts -


Now, I have a code that creates the database (just create a query on a few SQLite databases) accessing my main database In class It seems unnecessary because I have no intention of ever using the code. I'll just need it if something goes wrong and I need to recreate the database. Do I want to ...

  1. Leave things as they are, even if the database creation code is one quarter of my file size.
  2. The database-creation code is likely to have a different script such that I will run it manually if I need to run it again, and when it is working on the main code it will be out-off Out-of-the-mind will give
  3. Delete database dependency code and amendment control, if I ever need to retrieve it myself.
"post-text" itemprop = "text">

I think this code is best to keep. Even more importantly, you should keep this code (or generate) each time you change the database schema.

This is important for the following reasons.

  1. How often do you need to wonder if you need to migrate your server, or other environment (for example test or demo), and similar installation is required.
  2. I also find that when I do not have special coding, I often refer to DDL SQL, touched the system for some time.
  3. You have a reference to the decisions you made, like the indexes you created, unique keys, etc.

If you do not have a disciplined approach for this, I have found that the database schema can be changed from time to time, because such vague changes can be made, and as long as you They do not kill the databases, they can cause unclear issues. Without a disciplined approach (i.e. a reference definition of schema), it may be worse that you will know that different databases are completely different schemas.


Comments