<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: SQLAlchemy Migrate Process Hiccups</title>
	<atom:link href="http://percious.com/blog/archives/24/feed" rel="self" type="application/rss+xml" />
	<link>http://percious.com/blog/archives/24</link>
	<description>pythonic musings of a mountaineer</description>
	<lastBuildDate>Mon, 06 Feb 2012 19:28:59 -0600</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: twoja łaznienka</title>
		<link>http://percious.com/blog/archives/24/comment-page-1#comment-80050</link>
		<dc:creator>twoja łaznienka</dc:creator>
		<pubDate>Tue, 31 Jan 2012 19:33:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.percious.com/blog/archives/24#comment-80050</guid>
		<description>78. Good blog! I truly love how it is simple on my eyes and the data are well written. I am wondering how I could be notified when a new post has been made. I have subscribed to your RSS feed which must do the trick! Have a nice day!</description>
		<content:encoded><![CDATA[<p>78. Good blog! I truly love how it is simple on my eyes and the data are well written. I am wondering how I could be notified when a new post has been made. I have subscribed to your RSS feed which must do the trick! Have a nice day!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Romona Schleining</title>
		<link>http://percious.com/blog/archives/24/comment-page-1#comment-53420</link>
		<dc:creator>Romona Schleining</dc:creator>
		<pubDate>Wed, 27 Jul 2011 18:22:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.percious.com/blog/archives/24#comment-53420</guid>
		<description>Who wants to hear something refreshing? Easy is as easy does is what I always say. So I found an easy way to make money. It&#039;s a little known secret that is only shared by some top level Internet gurus. There is nothing illegal or shady about it... it&#039;s just kind of secret. And the best part - it is really running on full autopilot. This super affiliate push button software is the real thing, so if you&#039;re planning to use it unethically, or use it for scam purposes, this software isn&#039;t for you! If you can spend no more than 3 minutes to download and setup this software, and then click the &#039;Start Button&#039; just once to start this autopilot push button software... Then you can make money online. Basically what it does is bring a stream of free visitors to any website. Don&#039;t even bother trying to figure out how this powerful software works. It&#039;s a pretty amazing piece of software and it just simply... works. Get it before it is gone -&gt; http://tinyurl.com/pbcsites</description>
		<content:encoded><![CDATA[<p>Who wants to hear something refreshing? Easy is as easy does is what I always say. So I found an easy way to make money. It&#8217;s a little known secret that is only shared by some top level Internet gurus. There is nothing illegal or shady about it&#8230; it&#8217;s just kind of secret. And the best part &#8211; it is really running on full autopilot. This super affiliate push button software is the real thing, so if you&#8217;re planning to use it unethically, or use it for scam purposes, this software isn&#8217;t for you! If you can spend no more than 3 minutes to download and setup this software, and then click the &#8216;Start Button&#8217; just once to start this autopilot push button software&#8230; Then you can make money online. Basically what it does is bring a stream of free visitors to any website. Don&#8217;t even bother trying to figure out how this powerful software works. It&#8217;s a pretty amazing piece of software and it just simply&#8230; works. Get it before it is gone -&gt; <a href="http://tinyurl.com/pbcsites" rel="nofollow">http://tinyurl.com/pbcsites</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Elements of Criminal Law</title>
		<link>http://percious.com/blog/archives/24/comment-page-1#comment-49620</link>
		<dc:creator>Elements of Criminal Law</dc:creator>
		<pubDate>Sat, 11 Jun 2011 11:41:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.percious.com/blog/archives/24#comment-49620</guid>
		<description>&lt;strong&gt;Great info....&lt;/strong&gt;

[...] This chronicle without a doubt tells it like it is. It&#039;s in complete accordance with my point of view and I very willing to create a link back to it on the blog I oversee. Thank you. [...]...</description>
		<content:encoded><![CDATA[<p><strong>Great info&#8230;.</strong></p>
<p>[...] This chronicle without a doubt tells it like it is. It&#8217;s in complete accordance with my point of view and I very willing to create a link back to it on the blog I oversee. Thank you. [...]&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Teen Private Chat</title>
		<link>http://percious.com/blog/archives/24/comment-page-1#comment-46159</link>
		<dc:creator>Teen Private Chat</dc:creator>
		<pubDate>Sun, 17 Apr 2011 17:12:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.percious.com/blog/archives/24#comment-46159</guid>
		<description>I thought it would be wonderful thing to go to sleep using her breasts as pillows because they were so soft. Sucking, caressing, and foundling those huge mounds of hers I was in tit heaven and I never wanted to leave them alone. But I was also getting signals from her pussy. The heat that was being generated from her pussy felt like a fire. Then she yelled out &quot;EAT MY PUSSY!!!!&quot; Who am I to ignore this black beauty&#039;s cry? So I slid down to sample the juices flowing from her pussy.</description>
		<content:encoded><![CDATA[<p>I thought it would be wonderful thing to go to sleep using her breasts as pillows because they were so soft. Sucking, caressing, and foundling those huge mounds of hers I was in tit heaven and I never wanted to leave them alone. But I was also getting signals from her pussy. The heat that was being generated from her pussy felt like a fire. Then she yelled out &#8220;EAT MY PUSSY!!!!&#8221; Who am I to ignore this black beauty&#8217;s cry? So I slid down to sample the juices flowing from her pussy.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lucas</title>
		<link>http://percious.com/blog/archives/24/comment-page-1#comment-8039</link>
		<dc:creator>Lucas</dc:creator>
		<pubDate>Wed, 04 Feb 2009 16:33:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.percious.com/blog/archives/24#comment-8039</guid>
		<description>Seems like Hans and Doug solution combined should be new migrate plan.

Add a 
set_table_version(tablename, version)

Version could be a combination of numbers (production.testing.development)(1.3.503)

then when doing upgrades use the solution that goes through each upgrade version from 0 but first check if this version of the upgrade was applied? (isEligible(CurrentTableVersion,upgradeTableVersion)

If upgrade was not applied, apply it, 
if upgrade was applied move on to the next item.

This would make sure you only upgrade from what you are on forward. 

There should also be a command to reset it all. For example after few years you are at production 40.1.0, and you don&#039;t want to check all the upgrades from day1. There should be a reset that takes the current 40.1.0 and makes it a first upgrade. 

Now we just needs some code samples to fill these parts in and connect it to migrate.

Thanks,
Lucas</description>
		<content:encoded><![CDATA[<p>Seems like Hans and Doug solution combined should be new migrate plan.</p>
<p>Add a<br />
set_table_version(tablename, version)</p>
<p>Version could be a combination of numbers (production.testing.development)(1.3.503)</p>
<p>then when doing upgrades use the solution that goes through each upgrade version from 0 but first check if this version of the upgrade was applied? (isEligible(CurrentTableVersion,upgradeTableVersion)</p>
<p>If upgrade was not applied, apply it,<br />
if upgrade was applied move on to the next item.</p>
<p>This would make sure you only upgrade from what you are on forward. </p>
<p>There should also be a command to reset it all. For example after few years you are at production 40.1.0, and you don&#8217;t want to check all the upgrades from day1. There should be a reset that takes the current 40.1.0 and makes it a first upgrade. </p>
<p>Now we just needs some code samples to fill these parts in and connect it to migrate.</p>
<p>Thanks,<br />
Lucas</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jorge Vargas</title>
		<link>http://percious.com/blog/archives/24/comment-page-1#comment-3413</link>
		<dc:creator>Jorge Vargas</dc:creator>
		<pubDate>Wed, 10 Dec 2008 08:19:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.percious.com/blog/archives/24#comment-3413</guid>
		<description>I got very little experience with migrate, but I think there is a 3th, from migrate docs:
&quot;A freshly versioned database begins at version 0 by default. This assumes the database is empty. (If this is a bad assumption, you can specify the version at the time the database is declared under version control, with the version_control command.) We&#039;ll see that creating and applying change scripts changes the database&#039;s version number. &quot;

This implies you can alter the initial version number. Although I&#039;m not sure if you can do that with a migrate command, so back to your example: Say it is your project and I&#039;m the one hoping in from time to time, you will give the the current model and the current db number, which I&#039;ll insert as my first migration, and with that we should be able to fool the db.

Now that&#039;s all theory as I haven&#039;t been able to get migrations going for this project :)</description>
		<content:encoded><![CDATA[<p>I got very little experience with migrate, but I think there is a 3th, from migrate docs:<br />
&#8220;A freshly versioned database begins at version 0 by default. This assumes the database is empty. (If this is a bad assumption, you can specify the version at the time the database is declared under version control, with the version_control command.) We&#8217;ll see that creating and applying change scripts changes the database&#8217;s version number. &#8221;</p>
<p>This implies you can alter the initial version number. Although I&#8217;m not sure if you can do that with a migrate command, so back to your example: Say it is your project and I&#8217;m the one hoping in from time to time, you will give the the current model and the current db number, which I&#8217;ll insert as my first migration, and with that we should be able to fool the db.</p>
<p>Now that&#8217;s all theory as I haven&#8217;t been able to get migrations going for this project <img src='http://percious.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hans</title>
		<link>http://percious.com/blog/archives/24/comment-page-1#comment-3261</link>
		<dc:creator>Hans</dc:creator>
		<pubDate>Sat, 06 Dec 2008 15:31:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.percious.com/blog/archives/24#comment-3261</guid>
		<description>I should also clarify that the end solution for us was a little more involved than simply storing version number in the table comment.  Because we are using an ORM that generates the SQL based on a schema.xml file (Propel, to be specific), we modified our build system to split out all of the DDL related to indexes, foreign keys, views, etc.  Before we actually run the migration code for each table, we do things like drop all FKEY constraints on the table.  In some cases we have to drop other dependent objects too (e.g. views).  At the end of our migration code we actually re-apply all of that dependent object creation DDL; much of it does not get applied (because it was never dropped), but that has proven a clean way of upgrading non-table objects.

So, the point I wanted to clarify is that while the table-version-in-model method only addresses versioning for tables, we found that this was all that we really *needed* to version since we could drop and recreate all the other (dependent) objects in the system.

We also moved all of the comment-setting code into database functions -- we have a set_table_version(tablename, version) method, for example -- which does some fancy regex to replace or prepend the version information to a comment.  And a get_table_version(tablename) to get the current version.  End result just looks like &quot;v1.0.2 - Table to store user data.&quot;

In any event, the approach shouldn&#039;t scare you like PHPNuke :)  There was actually some thought put into how this works -- and keeping the abstraction points in place to avoid coupling it too closely to any one particular database or even any one particular versioning mechanism.  (We could always re-implement the Upgrade-&gt;isEligible(Table) method to use something besides table comments to determine eligibility.)

-H</description>
		<content:encoded><![CDATA[<p>I should also clarify that the end solution for us was a little more involved than simply storing version number in the table comment.  Because we are using an ORM that generates the SQL based on a schema.xml file (Propel, to be specific), we modified our build system to split out all of the DDL related to indexes, foreign keys, views, etc.  Before we actually run the migration code for each table, we do things like drop all FKEY constraints on the table.  In some cases we have to drop other dependent objects too (e.g. views).  At the end of our migration code we actually re-apply all of that dependent object creation DDL; much of it does not get applied (because it was never dropped), but that has proven a clean way of upgrading non-table objects.</p>
<p>So, the point I wanted to clarify is that while the table-version-in-model method only addresses versioning for tables, we found that this was all that we really *needed* to version since we could drop and recreate all the other (dependent) objects in the system.</p>
<p>We also moved all of the comment-setting code into database functions &#8212; we have a set_table_version(tablename, version) method, for example &#8212; which does some fancy regex to replace or prepend the version information to a comment.  And a get_table_version(tablename) to get the current version.  End result just looks like &#8220;v1.0.2 &#8211; Table to store user data.&#8221;</p>
<p>In any event, the approach shouldn&#8217;t scare you like PHPNuke <img src='http://percious.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   There was actually some thought put into how this works &#8212; and keeping the abstraction points in place to avoid coupling it too closely to any one particular database or even any one particular versioning mechanism.  (We could always re-implement the Upgrade-&gt;isEligible(Table) method to use something besides table comments to determine eligibility.)</p>
<p>-H</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Doug Hellmann</title>
		<link>http://percious.com/blog/archives/24/comment-page-1#comment-3256</link>
		<dc:creator>Doug Hellmann</dc:creator>
		<pubDate>Sat, 06 Dec 2008 13:21:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.percious.com/blog/archives/24#comment-3256</guid>
		<description>I haven&#039;t used sqlalchemy-migrate, but the way we deal with this in the alter scripts we wrote at work is to have each migration test the database to see if it needs to be applied.  So if a script wants to add a column, first the test() method is invoked and it looks for the column.  If it isn&#039;t found, it returns True, and the alter() method is run.  If the column is found by test(), it returns False and the alter() method is not run.  

We found this to be much more workable than depending on recording which alterations have been made to a given database -- that&#039;s just redundant information if you have the ability to look at the schema.</description>
		<content:encoded><![CDATA[<p>I haven&#8217;t used sqlalchemy-migrate, but the way we deal with this in the alter scripts we wrote at work is to have each migration test the database to see if it needs to be applied.  So if a script wants to add a column, first the test() method is invoked and it looks for the column.  If it isn&#8217;t found, it returns True, and the alter() method is run.  If the column is found by test(), it returns False and the alter() method is not run.  </p>
<p>We found this to be much more workable than depending on recording which alterations have been made to a given database &#8212; that&#8217;s just redundant information if you have the ability to look at the schema.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: percious</title>
		<link>http://percious.com/blog/archives/24/comment-page-1#comment-3242</link>
		<dc:creator>percious</dc:creator>
		<pubDate>Sat, 06 Dec 2008 04:52:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.percious.com/blog/archives/24#comment-3242</guid>
		<description>Thanks for the reply hans.  This was exactly the kind of discussion I was hoping to get.  You have a unique solution to the problem, and I must admit it has the benefit of being flexible in that you could use other migrate solutions since the migration data is stored within the database, but it scares me a little in the way that PHPNuke does...  But seriously, I am interested in all solutions people have for this problem.  The more I think about it, the more I like solution 2.</description>
		<content:encoded><![CDATA[<p>Thanks for the reply hans.  This was exactly the kind of discussion I was hoping to get.  You have a unique solution to the problem, and I must admit it has the benefit of being flexible in that you could use other migrate solutions since the migration data is stored within the database, but it scares me a little in the way that PHPNuke does&#8230;  But seriously, I am interested in all solutions people have for this problem.  The more I think about it, the more I like solution 2.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hans</title>
		<link>http://percious.com/blog/archives/24/comment-page-1#comment-3235</link>
		<dc:creator>Hans</dc:creator>
		<pubDate>Sat, 06 Dec 2008 00:47:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.percious.com/blog/archives/24#comment-3235</guid>
		<description>Well, I haven&#039;t used Migrate yet; I look forward to being able to do that on an upcoming project.  I had to solve a similar problem with our PHP ORM solution not that long ago.  What we ended up doing was actually storing versions of our model in the database -- in the comments on table names, to be specific.  We also had a lightweight set of DB utilities and baseclasses that we could extend with our actual migration scripts.  Yes, this solution does require that you use an RDBMS that supports comments (we use postgresql), but in practice it actually has worked very well and it provides some additional assurance that our migration scripts won&#039;t try to migrate an already-upgraded table.   This is certainly not the best solution, but I wanted to offer another lightweight option to this migration issue.

-H</description>
		<content:encoded><![CDATA[<p>Well, I haven&#8217;t used Migrate yet; I look forward to being able to do that on an upcoming project.  I had to solve a similar problem with our PHP ORM solution not that long ago.  What we ended up doing was actually storing versions of our model in the database &#8212; in the comments on table names, to be specific.  We also had a lightweight set of DB utilities and baseclasses that we could extend with our actual migration scripts.  Yes, this solution does require that you use an RDBMS that supports comments (we use postgresql), but in practice it actually has worked very well and it provides some additional assurance that our migration scripts won&#8217;t try to migrate an already-upgraded table.   This is certainly not the best solution, but I wanted to offer another lightweight option to this migration issue.</p>
<p>-H</p>
]]></content:encoded>
	</item>
</channel>
</rss>

