USE cod_db;

-- Disable foreign key checks to allow truncating and dropping tables without constraint violations
SET FOREIGN_KEY_CHECKS = 0;

-- Truncate the tables
TRUNCATE TABLE  users;

-- Drop the tables
DROP TABLE IF EXISTS users;

-- Drop the Products tables
DROP TABLE IF EXISTS combination_options;
DROP TABLE IF EXISTS variant_combinations;
DROP TABLE IF EXISTS product_variants;
DROP TABLE IF EXISTS product_options;
DROP TABLE IF EXISTS product_images;
DROP TABLE IF EXISTS product_categories;
DROP TABLE IF EXISTS products;

-- Drop the Orders tables
DROP TABLE IF EXISTS order_items;
DROP TABLE IF EXISTS orders;


-- Re-enable foreign key checks
SET FOREIGN_KEY_CHECKS = 1;

truncate table areas;

truncate table combination_options;

truncate table notifications;

truncate table order_items;

truncate table order_status_changes;

truncate table orders;

truncate table product_categories;

truncate table categories;

truncate table product_images;

truncate table product_variants;

truncate table product_options;

# truncate table users;

truncate table variant_combinations;

truncate table products;

truncate table visitors;


