#!/bin/bash

# Copyright 2020 The Vitess Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# this script removes the customer and corder tables from the commerce
# keyspace

source ./env.sh

vtctlclient DropSources customer.commerce2customer


#!/bin/bash

# Copyright 2020 The Vitess Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# this script removes the customer and corder tables from the commerce
# keyspace

source ./env.sh

vtctlclient SetShardTabletControl -blacklisted_tables=customer,corder -remove commerce/0 rdonly
vtctlclient SetShardTabletControl -blacklisted_tables=customer,corder -remove commerce/0 replica
vtctlclient SetShardTabletControl -blacklisted_tables=customer,corder -remove commerce/0 master
vtctlclient ApplySchema -sql-file drop_commerce_tables.sql commerce
vtctlclient ApplyRoutingRules -rules='{}'

--- 
+++ 
@@ -19,8 +19,5 @@
 
 source ./env.sh
 
-vtctlclient SetShardTabletControl -blacklisted_tables=customer,corder -remove commerce/0 rdonly
-vtctlclient SetShardTabletControl -blacklisted_tables=customer,corder -remove commerce/0 replica
-vtctlclient SetShardTabletControl -blacklisted_tables=customer,corder -remove commerce/0 master
-vtctlclient ApplySchema -sql-file drop_commerce_tables.sql commerce
-vtctlclient ApplyRoutingRules -rules='{}'
+vtctlclient DropSources customer.commerce2customer
+
Change local example to use DropSources

Signed-off-by: Morgan Tocker <cfa41afc5ac20f7c1e01316e2d765e1ba4c4bf7a@gmail.com>
