When creating SQL scripts, what methods do you use when working with them?
How do you split the SQL across files? For example, do you put things relating to each table into separate files (table creation, indexes for the table, etc.), or do you group similar things into the same file (all indexes in one file, all table creation in another file, etc.)? Maybe you just have ONE BIG file that contains all the code?
We have all SQL statements related to the same table
grouped into one file:
This is good for us, since we have many developers
who often ask for changes in tables. If we wanted
to have an easy way of re-installing the app in another
machine, we'd probably have chosen to create few
files containing absolutely everything.
We also add comments about when and who requested