Megapatch for conversion of schema to lowercase
Oliver Lehmann
lehmann at ans-netz.de
Thu Oct 20 01:38:56 EDT 2005
Ade Lovett wrote:
> An 'upgrade' script in this case is likely to be next to impossible,
> but now that we've branched tinderbox into stable/HEAD, I hope we can
> move forward on this.
>
It is really ugly, but it's 7:30 am here and I just wanted to "transfer" my
old tinderbox schema to the new one as fast as possible, and since mysql
isn't case sensitive about column names, I just took an data-export of my
old DB, droped all tables, installed the new .schema, and run:
# remove all UNKNOWN stuff from build_ports
sed -e "/NULL, 'UNKNOWN', NULL, NULL/d" /mnt/files/tinderbox_data.sql > /mnt/files/tinderbox_data2.sql
# add a 8th row and set it to empty for last_fail_reason
sed "s/\(build_ports.*[^0-9], \)\('2005-\)/\1'', \2/g" /mnt/files/tinderbox_data2.sql > /mnt/files/tinderbox_data3.sql
# remove all FAILED stuff from build_ports
sed "/'FAIL', NULL/d" /mnt/files/tinderbox_data3.sql > /mnt/files/tinderbox_data4.sql
# empty build_ports_queue
sed "/build_ports_queue/d" /mnt/files/tinderbox_data4.sql > /mnt/files/tinderbox_data5.sql
# remove standard inserts for config and host
sed "/config.*-1);/d" /mnt/files/tinderbox_data5.sql > /mnt/files/tinderbox_data6.sql
sed "/hosts.*-1/d" /mnt/files/tinderbox_data6.sql > /mnt/files/tinderbox_data7.sql
added 'SET FOREIGN_KEY_CHECKS=0;' at the beginning of it, and
'SET FOREIGN_KEY_CHECKS=0;' at the end and run it with:
root at nudel scripts> mysql -uroot tinderbox < /mnt/files/tinderbox_data7.sql
root at nudel scripts>
Thats it.
Greetings
--
Oliver Lehmann
http://www.pofo.de/
http://wishlist.ans-netz.de/
More information about the tinderbox-list
mailing list