On Thu, Jul 4, 2013 at 9:25 AM, Christophe Pettus <
x...@thebuild.com> wrote:
> Hi, Andres,
>
> (Sorry, sent the last email too soon.)
>
> On Jul 4, 2013, at 2:19 PM, Andres Riancho wrote:
>
>> Hmm, so, if I run "python manage.py migrate" N times on N different
>> servers, things will break, right?
>
> That works correctly; as Andrew noted, if you run "python manage.py migrate" twice in a row on the same database, the results are idempotent.
Great :)
>> maybe it would be useful to have
>> a "south" table in the DB where south stores the state of the
>> migrations, and also if a migration is currently running?
>
> Check your database; south already has tables that track the state of migrations.
Great, so why can't we have atomic migrations on all DBMS? Before
starting migration 00001, south sets the "working" bit to True in the
corresponding south table entry, and when it finishes it sets it to
False. We also keep a field which states if the migration was applied
or not, default to False. if a second instance/server wants to also
start with 00001 at any point in time, it needs to verify that both
"working" and "applied" are False.
Sorry if all this is already answered somewhere else, I'm a south newbie.
PS: Maybe atomic and idempotent questions should go to the FAQ?
> A system management process that can potentially spray multiple changes in parallel at a server and hope that they are correctly locked and idempotent on the server is probably
> one that is doomed to failure. You probably want to solve the problem of serializing changes properly against servers at the system management level.
>
> --
> -- Christophe Pettus
>
x...@thebuild.com
>