Re: Altering primary key values
But from this output :
mysql> SHOW CREATE TABLE lz_stats_aggs\G
*************************** 1. row ***************************
Table: lz_stats_aggs
Create Table: CREATE TABLE `lz_stats_aggs` (
`year` smallint(4) unsigned NOT NULL DEFAULT '0',
`month` tinyint(3) unsigned NOT NULL DEFAULT '0',
`day` tinyint(3) unsigned NOT NULL DEFAULT '0',
`time` int(10) unsigned NOT NULL DEFAULT '0',
`mtime` int(10) unsigned NOT NULL DEFAULT '0',
`sessions` int(10) unsigned NOT NULL DEFAULT '0',
`visitors_unique` int(10) unsigned NOT NULL DEFAULT '0',
`conversions` int(10) unsigned NOT NULL DEFAULT '0',
`aggregated` int(10) unsigned NOT NULL DEFAULT '0',
`chats_forwards` int(10) unsigned NOT NULL DEFAULT '0',
`chats_posts_internal` int(10) unsigned NOT NULL DEFAULT '0',
`chats_posts_external` int(10) unsigned NOT NULL DEFAULT '0',
`avg_time_site` double unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`year`,`month`,`day`),
KEY `time` (`time`),
KEY `aggregated` (`aggregated`),
KEY `mtime` (`mtime`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin
1 row in set (0.00 sec)
mysql>
There is no foreign key, but only key. Does these also mean this table has relations with the other tables?
The reason I ask is because before this, I did a first attempt restore into the tables for some date range, and I remember there was a primary key error for the date 15/7 - 16/7 like in the first post. I deleted these rows so that I could restore from the "*.csv" file without problems.
Then after some days, the team using this website reported that they are not receiving proper statistical reports like they used to before. But in addition to deleting these rows, I also dropped another table called "lz_chat_archive", which keeps record of daily chats, and restored only the table from the original db.
So I am not sure if dropping this table caused the error, or deleting the rows with the primary keys on the other set of tables was the culprit.
Now I am doing the restore of the entire DB second time, and don't want to repeat the mistake I did the first time.