<?php

// Копируем таблицу вычислений
run_query("DROP TABLE IF EXISTS " . $config['table_prefix'] . "calc_old");
run_query("CREATE TABLE " . $config['table_prefix'] . "calc_old LIKE " . $config['table_prefix'] . "calc");
run_query("INSERT INTO " . $config['table_prefix'] . "calc_old SELECT * FROM " . $config['table_prefix'] . "calc");

// Копируем таблицу cron
run_query("DROP TABLE IF EXISTS " . $config['table_prefix'] . "cron_old");
run_query("CREATE TABLE " . $config['table_prefix'] . "cron_old LIKE " . $config['table_prefix'] . "cron");
run_query("INSERT INTO " . $config['table_prefix'] . "cron_old SELECT * FROM " . $config['table_prefix'] . "cron");

// Копируем таблицу представлений
run_query("DROP TABLE IF EXISTS " . $config['table_prefix'] . "reports_old");
run_query("CREATE TABLE " . $config['table_prefix'] . "reports_old LIKE " . $config['table_prefix'] . "reports");
run_query("INSERT INTO " . $config['table_prefix'] . "reports_old SELECT * FROM " . $config['table_prefix'] . "reports");