Explorar o código

upd default indexes

a.binder %!s(int64=8) %!d(string=hai) anos
pai
achega
6c4b7dd801
Modificáronse 1 ficheiros con 9 adicións e 5 borrados
  1. 9 5
      SE/se-lib/Core/Database/Mysql.php

+ 9 - 5
SE/se-lib/Core/Database/Mysql.php

@@ -1344,8 +1344,6 @@ class Core_Database_Mysql extends Core_Database {
 						$sql_="describe  `".$h[0]."`";
 					    $result_=self::query($sql_) or die1(' Problem ze sql '.$sql_);
 						while($h_=self::fetch($result_)) {
-
-
 							DEBUG_S(-3,'dane z tabeli',$h_,__FILE__,__FUNCTION__,__LINE__);
 							 $sql="\n alter ignore table `".$h[0]."_HIST` add ".$h_->Field." varchar(255) default 'N/S;'  ; " ;
 							 self::query($sql) or DEBUG_S(-3,' Problem ze sql '.$sql,array($sql),__FILE__,__FUNCTION__,__LINE__);
@@ -1359,14 +1357,20 @@ class Core_Database_Mysql extends Core_Database {
 	       				 self::query($sql) or DEBUG_S(-3,' Problem ze sql '.$sql,array($sql),__FILE__,__FUNCTION__,__LINE__);
 	       				 $sql="\n alter ignore table `".$h[0]."_HIST` add ".$tst_column." varchar(255) default 'N/S;'  ; " ;
 	       				 self::query($sql) or DEBUG_S(-3,' Problem ze sql '.$sql,array($sql),__FILE__,__FUNCTION__,__LINE__);
+					}
 
-	}
-
-       			    $sql="\n alter ignore table `".$h[0]."_HIST` add `_action_time` TIMESTAMP NOT NULL  after `ID_USERS2` ; " ;
+       			     $sql="\n alter ignore table `".$h[0]."_HIST` add `_action_time` TIMESTAMP NOT NULL  after `ID_USERS2` ; " ;
        				 self::query($sql) or DEBUG_S(-3,' Problem ze sql '.$sql,array($sql),__FILE__,__FUNCTION__,__LINE__);
        			     $sql="\n alter ignore table `".$h[0]."_HIST` add `_action_type` varchar(16)  after `_action_time` ; " ;
 	       		     self::query($sql) or DEBUG_S(-3,' Problem ze sql '.$sql,array($sql),__FILE__,__FUNCTION__,__LINE__);
 
+		   			 //default index
+		   			 $sql="\n alter ignore table `".$h[0]."` add INDEX A_ADM_COMPANY (A_ADM_COMPANY) ; " ;
+       				 self::query($sql) or DEBUG_S(-3,' Problem ze sql '.$sql,array($sql),__FILE__,__FUNCTION__,__LINE__);
+       				 $sql="\n alter ignore table `".$h[0]."` add INDEX A_CLASSIFIED (A_CLASSIFIED) ; " ;
+       				 self::query($sql) or DEBUG_S(-3,' Problem ze sql '.$sql,array($sql),__FILE__,__FUNCTION__,__LINE__);
+		   			 $sql="\n alter ignore table `".$h[0]."` add INDEX L_APPOITMENT_USER (L_APPOITMENT_USER) ; " ;
+       				 self::query($sql) or DEBUG_S(-3,' Problem ze sql '.$sql,array($sql),__FILE__,__FUNCTION__,__LINE__);
 
        			}
 	   	//! IMPORT_SORT_DESC_INFO