feature8030 move WIM connector to plugins
[osm/RO.git] / RO / osm_ro / database_utils / migrations / down / 34_remove_wim_tables.sql
1 /**
2 * Licensed under the Apache License, Version 2.0 (the "License"); you may
3 * not use this file except in compliance with the License. You may obtain
4 * a copy of the License at
5 *
6 * http://www.apache.org/licenses/LICENSE-2.0
7 *
8 * Unless required by applicable law or agreed to in writing, software
9 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11 * License for the specific language governing permissions and limitations
12 * under the License.
13 **/
14 --
15 -- Tear down database structure required for integrating OSM with
16 -- Wide Are Network Infrastructure Managers
17 --
18
19 DROP TABLE IF EXISTS wim_port_mappings;
20 DROP TABLE IF EXISTS wim_nfvo_tenants;
21 DROP TABLE IF EXISTS instance_wim_nets;
22
23 ALTER TABLE `vim_wim_actions` DROP FOREIGN KEY `FK_actions_wims`;
24 ALTER TABLE `vim_wim_actions` DROP INDEX `FK_actions_wims`;
25 ALTER TABLE `vim_wim_actions` DROP INDEX `item_type_id`;
26 ALTER TABLE `vim_wim_actions` MODIFY `item` enum(
27 'datacenters_flavors',
28 'datacenter_images',
29 'instance_nets',
30 'instance_vms',
31 'instance_interfaces',
32 'instance_sfis',
33 'instance_sfs',
34 'instance_classifications',
35 'instance_sfps') NOT NULL
36 COMMENT 'table where the item is stored';
37 ALTER TABLE `vim_wim_actions` MODIFY `datacenter_vim_id` varchar(36) NOT NULL;
38 ALTER TABLE `vim_wim_actions` DROP `wim_internal_id`, DROP `wim_account_id`;
39 ALTER TABLE `vim_wim_actions` RENAME TO `vim_actions`;
40
41 DROP TABLE IF EXISTS wim_accounts;
42 DROP TABLE IF EXISTS wims;
43
44 DELETE FROM schema_version WHERE version_int='34';