Last active
August 29, 2015 14:08
-
-
Save kehh/5cba7d60d57e408bcc50 to your computer and use it in GitHub Desktop.
Clean Storage Locations
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- ssh wamadm@wamcmis | |
-- sudo su cmis | |
-- mysql cmis | |
begin; | |
create table sl_deletes as select location_id from ca_storage_location_labels where name = 'Kew Street' and location_id != 3; | |
alter table sl_deletes add primary key (location_id); | |
update ca_objects_x_storage_locations set location_id = 3 where location_id in (select location_id from sl_deletes); | |
set innodb_lock_wait_timeout=360; | |
delete from ca_storage_location_labels where location_id in (select location_id from sl_deletes); | |
delete from ca_storage_locations where location_id in (select location_id from sl_deletes); | |
drop table sl_deletes; | |
commit; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment