Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Tutorial Improvements: recommend naming structure #76

Open
joevandyk opened this Issue · 6 comments

2 participants

Joe Van Dyk David E. Wheeler
Joe Van Dyk

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

David E. Wheeler
Owner

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.

Joe Van Dyk

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?

David E. Wheeler
Owner

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.

David E. Wheeler
Owner

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!

Joe Van Dyk
David E. Wheeler
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.