Tutorial Improvements: recommend naming structure #76

Open
joevandyk opened this Issue Feb 26, 2013 · 8 comments

Projects

None yet

3 participants

@joevandyk

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

@theory
Owner
theory commented Feb 26, 2013

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.

@joevandyk

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?

@theory
Owner
theory commented Feb 26, 2013

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
Owner
theory commented Feb 26, 2013

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!

@joevandyk

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
notifications@github.comwrote:

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
.

@theory
Owner
theory commented Feb 28, 2013

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

@tonylukasavage

@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?

@theory
Owner
theory commented May 27, 2015

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment