YAGNI and database creation scripts

Posted by Daniel Straight on Stack Overflow See other posts from Stack Overflow or by Daniel Straight
Published on 2010-06-18T13:35:58Z Indexed on 2010/06/18 13:53 UTC
Read the original article Hit count: 272

Filed under:
|
|

Right now, I have code which creates the database (just a few CREATE queries on a SQLite database) in my main database access class. This seems unnecessary as I have no intention of ever using the code. I would just need it if something went wrong and I needed to recreate the database. Should I...

  1. Leave things as they are, even though the database creation code is about a quarter of my file size.
  2. Move the database-creation code to a separate script. It's likely I'll be running it manually if I ever need to run it again anyway, and that would put it out-of-sight-out-of-mind while working on the main code.
  3. Delete the database-creation code and rely on revision control if I ever find myself needing it again.

© Stack Overflow or respective owner

Related posts about database

Related posts about best-practices