sqitch icon indicating copy to clipboard operation
sqitch copied to clipboard

Tutorial Improvements: recommend naming structure

Open joevandyk opened this issue 13 years ago • 8 comments

The sqitch tutorial doesn't seem to have any recommendations for how to name the changes. Having some sort of a common convention would be nice.

Maybe something like:

deploy/
   functions
   tables
   types
   alterations # used for adding columns to tables/types
   indexes
   schemas

So, a new function would be functions/insert_flip.

Adding a column to the orders table would be alterations/orders_add_email_address

joevandyk avatar Feb 26 '13 19:02 joevandyk

Happy to see a "Sqitch Best Practices" document. I'm still figuring them out myself. Sometimes I name a change that adds a table for the table, e.g., "widgets", other times I include the object type in the change name, e.g., "widgets_table". And for some projects, with a lot of changes, I end up putting things in subdirectories, e.g., "tables/widgets". I think it will be informative to see what sorts of cow paths people form. I don't think I would commit to something yet, myself.

Frankly different folks will prefer different styles, sometimes for different projects. Fortunately, Sqitch can accommodate different opinions on such things.

theory avatar Feb 26 '13 19:02 theory

Not saying you need to commit to it, but a general recommendation would be nice. If people don't realize that they can put the deployment scripts into a different directory, then they will end up with hundreds of files in the same directory.

Is it possible to change the location of a deployment file after it's been made and deployed?

joevandyk avatar Feb 26 '13 22:02 joevandyk

Yeah, revert to the change before it, then edit sqitch.plan and move the file where you want it. So if you wanted to move deploy/widgets.sql into deploy/tables/widgets.sql, you'd first revert (assuming your'e doing dev, not production):

sqitch revert --to widgets^

Move the file and change the name in the sqitch.plan file from widgets to tables/widgets (always a slash, regardless of your OS or file system). Then you can sqitch deploy and be back in business.

theory avatar Feb 26 '13 23:02 theory

Hey, you know what, we should make use of the GitHub wiki for this kind of documentation, at least for now. Feel free to start some pages!

theory avatar Feb 26 '13 23:02 theory

Sure thing.

BTW, starting with github pages is pretty easy (for the sqitch website). Click settings, then click the 'Automatic Page Generator' button.

That creates a gh-pages branch that you can edit and push to.

On Tue, Feb 26, 2013 at 3:01 PM, David E. Wheeler [email protected]:

Hey, you know what, we should make use of the GitHub wikihttps://github.com/theory/sqitch/wikifor this kind of documentation, at least for now. Feel free to start some pages!

— Reply to this email directly or view it on GitHubhttps://github.com/theory/sqitch/issues/76#issuecomment-14145585 .

joevandyk avatar Feb 26 '13 23:02 joevandyk

Yeah, that's how I created the existing site. I just haven't gotten round to updating it.

theory avatar Feb 28 '13 17:02 theory

@theory are you still looking for contributors on this? @spatrickkelly and I are trying to develop naming conventions, but would love to leverage existing. Is there any existing documentation on naming conventions? If yes, where? If not, where could we put forth our ideas for review by you and the community?

tonylukasavage avatar May 27 '15 15:05 tonylukasavage

No document, though I have my own conventions, I guess. Others in my office use different conventions. Happy to discuss on the mail list.

theory avatar May 27 '15 15:05 theory