On Tue, Sep 24, 2013 at 2:53 PM, Michael Bayer <mike...@zzzcomputing.com>wrote:

>
> On Sep 24, 2013, at 5:42 PM, Ken Lareau <klar...@tagged.com> wrote:
>
> On Tue, Sep 24, 2013 at 11:10 AM, Ken Lareau <klar...@tagged.com> wrote:
>
>>
>> On Tue, Sep 24, 2013 at 10:32 AM, Michael Bayer <mike...@zzzcomputing.com
>> > wrote:
>>
>>>
>>> On Sep 24, 2013, at 12:00 PM, Ken Lareau <klar...@tagged.com> wrote:
>>>
>>> >
>>> >
>>> >
>>> > Of course, this leads back to the original question... how exactly
>>> > does one accomplish this? :)  Hopefully the clarification above helps
>>> > some in determining this.
>>>
>>> as I said, build a trigger:
>>>
>>> http://dev.mysql.com/doc/refman/5.0/en/triggers.html
>>>
>>>
>>>
>> Oh, you meant on the database side... d'oh.  *slaps hand to forehead*
>> Thanks, will look at this.
>>
>
> Sadly after over an hour of fighting with MySQL triggers and being
> unsuccessful at getting any variation to work, I've decided that I'm
> just going to need to shut down key infrastructure pieces during
> the column renaming and avoid the temporary new column as it
> would just complicate my current codebase more than it already
> is... once again, I do appreciate the help, however.
>
>
> I googled for "mysql trigger copy autoincrement" and got this:
>
> "Copy auto-increment value to another column on insert":
>
> http://forums.mysql.com/read.php?99,186171,186241#msg-186241
>
> the trigger here makes use of LAST_INSERT_ID() and is worth a shot.
>

Closer, but it requires the main tables to not already have any
values in them (if I'm understanding the SQL correctly), and I'm
working with existing tables already populated with plenty of
data.  Honestly, at this point simply renaming the columns is
far less painful. :)  (And thankfully only needs to be done once.)
But thanks for the info, much appreciated.

-- 
- Ken Lareau

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to