<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
	<title>Binary Orders of Magnitude &#187; DBUpgrade</title>
	<atom:link href="https://www.sergeychernyshev.com/blog/category/dbupgrade/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.sergeychernyshev.com/blog/category/dbupgrade/</link>
	<description>Sergey&#39;s blog about projects and web in general.</description>
	<lastBuildDate>Sun, 17 Oct 2010 23:14:07 GMT</lastBuildDate>
	<language>en-US</language>
	<item>
		<title>DBUpgrade: now you can have multiple schemas in the same DB!</title>
		<link>https://www.sergeychernyshev.com/blog/multiple-schemas-in-the-same-database/</link>
		<pubDate>Sun, 17 Oct 2010 23:14:07 GMT</pubDate>
		<dc:creator><![CDATA[Sergey Chernyshev]]></dc:creator>
		<category><![CDATA[DBUpgrade]]></category>
		<category><![CDATA[Github]]></category>
		<category><![CDATA[Open Source]]></category>
		<guid isPermaLink="true">https://www.sergeychernyshev.com/blog/multiple-schemas-in-the-same-database/</guid>
		<description><![CDATA[I was struggling with DBUpgrade in projects with multiple independent components. I had to maintain the schema in main project which was quite crazy considering that projects are independent and have different timelines that had to be in sync. So I changed DBUpgrade to OO model and added namespacing so you can have multiple schema-versioning…]]></description>
		<content:encoded><![CDATA[<p><a href="http://www.dbupgrade.org/"><img src="https://www.sergeychernyshev.com/blog/content/uploads/2010/03/dbupgrade.png" alt="DBUpgrade" title="DBUpgrade logo" width="128" height="128" style="float: right; border: 0; margin-left: 1em" /></a>I was struggling with DBUpgrade in projects with multiple independent components. I had to maintain the schema in main project which was quite crazy considering that projects are independent and have different timelines that had to be in sync.</p>
<p>So I changed DBUpgrade to OO model and added namespacing so you can have multiple schema-versioning tables in the same database and update them independently from each other.</p>
<p>To identify subproject and have it’s version to be kept separately, you can supply 3rd parameter when you create <code>DBUpgrade</code> object.</p>
<blockquote>
<pre><code>$dbupgrade = new DBUpgrade($db, $versions, 'myproject');
</code></pre>
</blockquote>
<p>If you omit this parameter (makes sense for main project) then it will revert to previous behavior and use <code>db_version</code> table for this schema’s versioning. This way, it’s backwards compatible and provides easy migration path.</p>
<p>I also renamed a bunch of files so you might want to update your code, but it should be very easy as I provided a boilerplate <code>[dbupgrade.php](http://github.com/sergeychernyshev/DBUpgrade/blob/master/dbupgrade.php)</code> which you can just copy to your folder and move your <a href="http://www.dbupgrade.org/Main_Page#Migrations">migrations</a> and DB connection info over.</p>
<p>If you noticed, I also bundled a simple upgrade client which is already included in a boilerplate so it works for full upgrade (will run all migrations to the latest version):</p>
<blockquote>
<pre><code>[user@example myproject]$ php dbupgrade.php
Upgrading from v.0 to v.2
Upgraded to v.1
Upgraded to v.2
</code></pre>
</blockquote>
<p>and single version downgrade (only downgrades to previous version):</p>
<blockquote>
<pre><code>[user@example myproject]$ php dbupgrade.php down
Downgrading from v.2 to v.1
Downgraded to v.1
</code></pre>
</blockquote>
<p>in command line mode.</p>
<p>Full upgrade can also be executed through the web by opening very same <code>dbupgrade.php</code> in the browser:</p>
<blockquote>
<pre><code>http://www.example.com/dbupgrade.php
</code></pre>
</blockquote>
<p>I also moved the project to <a href="http://github.com/sergeychernyshev/DBUpgrade">Github hosting</a> to encourage more openness and community so you can now <a href="http://github.com/sergeychernyshev/DBUpgrade">fork it</a> easily!</p>
<p>Github also supports Subversion read-only endpoints so if you’re using SVN externals to bundle DBUpgrade with your project, you can simply update your trunk URL to:</p>
<blockquote>
<pre><code>http://svn.github.com/sergeychernyshev/DBUpgrade.git
</code></pre>
</blockquote>
<p>Feel free to use it as <a href="http://www.kernel.org/pub/software/scm/git/docs/git-submodule.html">Git submodule</a> or <a href="http://svnbook.red-bean.com/en/1.0/ch07s03.html">SVN External</a> within your project and hope you’ll find it much easier to maintain deployment roll-outs now.</p>
]]></content:encoded>
	</item>
	<item>
		<title>DBUpgrade got a site, logo and twitter account</title>
		<link>https://www.sergeychernyshev.com/blog/dbupgrade-got-a-site-logo-and-twitter-account/</link>
		<pubDate>Tue, 02 Mar 2010 23:10:39 GMT</pubDate>
		<dc:creator><![CDATA[Sergey Chernyshev]]></dc:creator>
		<category><![CDATA[DBUpgrade]]></category>
		<guid isPermaLink="true">https://www.sergeychernyshev.com/blog/dbupgrade-got-a-site-logo-and-twitter-account/</guid>
		<description><![CDATA[DBUpgrade project got a new site, logo and @dbupgrade twitter account. DBUpgrade.org is a wiki site so please feel free to help me documenting it, providing your own solutions and describing your use cases. This is not much, but quite enough for a small open source project to survive. Go ahead, subscribe to this blog…]]></description>
		<content:encoded><![CDATA[<p><a href="http://www.dbupgrade.org/"><img src="https://www.sergeychernyshev.com/blog/content/uploads/2010/03/dbupgrade.png" alt="DBUpgrade" title="DBUpgrade logo" width="128" height="128" style="float: right; border: 0; margin-left: 1em" /></a><br />
DBUpgrade project got a new site, logo and <a href="http://twitter.com/dbupgrade">@dbupgrade</a> twitter account.</p>
<p><a href="http://www.dbupgrade.org/">DBUpgrade.org</a> is a wiki site so please feel free to help me documenting it, providing your own solutions and describing your use cases.</p>
<p>This is not much, but quite enough for a small open source project to survive.</p>
<p>Go ahead, subscribe to this blog and twitter if you’d like to get updates about the project.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
