Re: recommended schema diff tools?
| От | Thomas Kellerer | 
|---|---|
| Тема | Re: recommended schema diff tools? | 
| Дата | |
| Msg-id | jm6u9n$qvt$1@dough.gmane.org обсуждение исходный текст | 
| Ответ на | Re: recommended schema diff tools? (Chris Angelico <rosuav@gmail.com>) | 
| Ответы | Re: recommended schema diff tools? | 
| Список | pgsql-general | 
Chris Angelico wrote on 12.04.2012 17:10:
> patchlevel = query("select patchlevel from config")
> switch (patchlevel)
> {
>    default: print("Unknown patch level!"); break;
>    case 1:
>      print("20120216: Adding Foobar columns to Quux")
>      query("ALTER TABLE Quux ADD foo smallint not null default 0, ADD
> bar varchar")
>    case 2:
>      ... etc ...
>    case 42:
>      ...
>      // Add new patch levels here
>      query("update config set patchlevel=43"); query("commit");
>    case 43: break;
> }
>
>
> Every change is thus assigned a number. The current patch level is a
> safe no-op; any unrecognized number is a major error. The script is
> thus safe to run on any database, and will always bring that database
> up to the script's current patch level.
Sounds like you implement something very similar to Liquibase.
		
	В списке pgsql-general по дате отправления: