Create Index Problem

Nov 21, 2016 at 7:36 AM
Hello,
I backup via your dll. But I saw Index Problem.

For example, the creation code must be like this:
CREATE TABLE siparis_detay  ( 
    id                  int(11) AUTO_INCREMENT NOT NULL,
    uid                 varchar(50) NOT NULL,
    siparis_uid         varchar(100) NOT NULL,
    kampanya_uid        varchar(50) NULL,
    kampanya_grup_uid   varchar(5) NULL,
    tip                 int(11) NOT NULL DEFAULT '0',
    company_code        varchar(20) NOT NULL,
    device_id           varchar(100) NOT NULL,
    stok_kodu           varchar(100) NULL,
    aciklama            varchar(500) NULL,
    satir_ara_toplami   double NOT NULL DEFAULT '0.0000',
    satir_toplami       double NOT NULL DEFAULT '0.0000',
    birim_sira          int(1) NOT NULL DEFAULT '1',
    kayit_tarihi        timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
    updatetime          timestamp NOT NULL,
    PRIMARY KEY(id)
)
ENGINE = InnoDB
AUTO_INCREMENT = 2197143;
CREATE INDEX siparis_detay_idx3 USING BTREE ON siparis_detay(tip, company_code, stok_kodu);
CREATE INDEX siparis_detay_idx2 USING BTREE ON siparis_detay(uid, company_code);
CREATE INDEX siparis_detay_idx1 USING BTREE ON siparis_detay(company_code, updatetime);
But dll exported like following:
CREATE TABLE IF NOT EXISTS `siparis_detay` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `uid` varchar(50) COLLATE utf8_turkish_ci NOT NULL,
  `siparis_uid` varchar(100) COLLATE utf8_turkish_ci NOT NULL,
  `kampanya_uid` varchar(50) COLLATE utf8_turkish_ci DEFAULT NULL,
  `kampanya_grup_uid` varchar(5) COLLATE utf8_turkish_ci DEFAULT NULL,
  `tip` int(11) NOT NULL DEFAULT '0',
  `company_code` varchar(20) COLLATE utf8_turkish_ci NOT NULL,
  `device_id` varchar(100) COLLATE utf8_turkish_ci NOT NULL,
  `stok_kodu` varchar(100) COLLATE utf8_turkish_ci DEFAULT NULL,
  `aciklama` varchar(500) COLLATE utf8_turkish_ci DEFAULT NULL,
  `satir_ara_toplami` double(11,4) NOT NULL DEFAULT '0.0000',
  `satir_toplami` double(11,4) NOT NULL DEFAULT '0.0000',
  `birim_sira` int(1) NOT NULL DEFAULT '1',
  `kayit_tarihi` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `updatetime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `siparis_detay_idx1` (`company_code`,`updatetime`),
  KEY `siparis_detay_idx2` (`uid`,`company_code`),
  KEY `siparis_detay_idx3` (`tip`,`company_code`,`stok_kodu`)
) ENGINE=InnoDB AUTO_INCREMENT=2192019 DEFAULT CHARSET=utf8 COLLATE=utf8_turkish_ci;
What can I do to solve this problem?
Coordinator
Mar 23 at 2:37 AM
Edited Mar 23 at 2:38 AM
If you wish to keep the value of auto_increment
AUTO_INCREMENT = 2197143;
You can add an additional line of this:
mb.ExportInfo.ResetAutoIncrement = false;
Example:
string constr = "server=localhost;user=root;pwd=1234;database=test2;convertzerodatetime=true;charset=utf8;";
using (MySqlConnection conn = new MySqlConnection(constr))
{
    using (MySqlCommand cmd = new MySqlCommand())
    {
        using (MySqlBackup mb = new MySqlBackup(cmd))
        {
            conn.Open();
            cmd.Connection = conn;
            mb.ExportInfo.ResetAutoIncrement = false;
            mb.ExportToFile("C:\\backup.sql");
            conn.Close();
        }
    }
}