|
Lines 109-113
return {
Link Here
|
| 109 |
say $out "Added new table 'preservation_processing_attributes_items'"; |
109 |
say $out "Added new table 'preservation_processing_attributes_items'"; |
| 110 |
} |
110 |
} |
| 111 |
|
111 |
|
|
|
112 |
unless ( column_exists('preservation_processing_attributes_items', 'processing_attribute_item_id') ) { |
| 113 |
$dbh->do(q{ |
| 114 |
ALTER TABLE preservation_processing_attributes_items |
| 115 |
DROP CONSTRAINT `preservation_processing_attributes_items_ibfk_1`, |
| 116 |
DROP CONSTRAINT `preservation_processing_attributes_items_ibfk_2`, |
| 117 |
DROP PRIMARY KEY, |
| 118 |
ADD COLUMN `processing_attribute_item_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'primary key', |
| 119 |
ADD PRIMARY KEY(`processing_attribute_item_id`) |
| 120 |
}); |
| 121 |
$dbh->do(q{ |
| 122 |
ALTER TABLE preservation_processing_attributes_items |
| 123 |
ADD CONSTRAINT `preservation_processing_attributes_items_ibfk_1` FOREIGN KEY (`processing_attribute_id`) REFERENCES `preservation_processing_attributes` (`processing_attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE, |
| 124 |
ADD CONSTRAINT `preservation_processing_attributes_items_ibfk_2` FOREIGN KEY (`train_item_id`) REFERENCES `preservation_trains_items` (`train_item_id`) ON DELETE CASCADE ON UPDATE CASCADE |
| 125 |
}); |
| 126 |
} |
| 127 |
|
| 112 |
}, |
128 |
}, |
| 113 |
}; |
129 |
}; |
| 114 |
- |
|
|