Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorThomas Steur <thomas.steur@googlemail.com>2014-04-03 03:11:18 +0400
committerThomas Steur <thomas.steur@googlemail.com>2014-04-03 03:11:18 +0400
commit98bc277a08af76e7f498b37b13dada76be727e8f (patch)
treeea046a63621a8c4caddaae248ef6d29f61bc5228 /core
parent23bf6195a3cd3bdb1c24d76690336914f384da0f (diff)
started to work on command to set number of available custom variables
Diffstat (limited to 'core')
-rw-r--r--core/Db.php13
-rw-r--r--core/Db/Schema/Mysql.php31
2 files changed, 14 insertions, 30 deletions
diff --git a/core/Db.php b/core/Db.php
index f099d01409..3647a5878f 100644
--- a/core/Db.php
+++ b/core/Db.php
@@ -331,6 +331,19 @@ class Db
}
/**
+ * Get columns information from table
+ *
+ * @param string|array $table The name of the table you want to get the columns definition for.
+ * @return \Zend_Db_Statement
+ */
+ static public function getColumnNamesFromTable($table)
+ {
+ $columns = self::fetchAssoc("SHOW COLUMNS FROM " . $table);
+
+ return array_keys($columns);
+ }
+
+ /**
* Locks the supplied table or tables.
*
* **NOTE:** Piwik does not require the `LOCK TABLES` privilege to be available. Piwik
diff --git a/core/Db/Schema/Mysql.php b/core/Db/Schema/Mysql.php
index fa326a9dc4..34c3764f2f 100644
--- a/core/Db/Schema/Mysql.php
+++ b/core/Db/Schema/Mysql.php
@@ -192,16 +192,6 @@ class Mysql implements SchemaInterface
location_city varchar(255) DEFAULT NULL,
location_latitude float(10, 6) DEFAULT NULL,
location_longitude float(10, 6) DEFAULT NULL,
- custom_var_k1 VARCHAR(200) DEFAULT NULL,
- custom_var_v1 VARCHAR(200) DEFAULT NULL,
- custom_var_k2 VARCHAR(200) DEFAULT NULL,
- custom_var_v2 VARCHAR(200) DEFAULT NULL,
- custom_var_k3 VARCHAR(200) DEFAULT NULL,
- custom_var_v3 VARCHAR(200) DEFAULT NULL,
- custom_var_k4 VARCHAR(200) DEFAULT NULL,
- custom_var_v4 VARCHAR(200) DEFAULT NULL,
- custom_var_k5 VARCHAR(200) DEFAULT NULL,
- custom_var_v5 VARCHAR(200) DEFAULT NULL,
PRIMARY KEY(idvisit),
INDEX index_idsite_config_datetime (idsite, config_id, visit_last_action_time),
INDEX index_idsite_datetime (idsite, visit_last_action_time),
@@ -264,16 +254,6 @@ class Mysql implements SchemaInterface
revenue_shipping float default NULL,
revenue_discount float default NULL,
- custom_var_k1 VARCHAR(200) DEFAULT NULL,
- custom_var_v1 VARCHAR(200) DEFAULT NULL,
- custom_var_k2 VARCHAR(200) DEFAULT NULL,
- custom_var_v2 VARCHAR(200) DEFAULT NULL,
- custom_var_k3 VARCHAR(200) DEFAULT NULL,
- custom_var_v3 VARCHAR(200) DEFAULT NULL,
- custom_var_k4 VARCHAR(200) DEFAULT NULL,
- custom_var_v4 VARCHAR(200) DEFAULT NULL,
- custom_var_k5 VARCHAR(200) DEFAULT NULL,
- custom_var_v5 VARCHAR(200) DEFAULT NULL,
PRIMARY KEY (idvisit, idgoal, buster),
UNIQUE KEY unique_idsite_idorder (idsite, idorder),
INDEX index_idsite_datetime ( idsite, server_time )
@@ -293,16 +273,7 @@ class Mysql implements SchemaInterface
idaction_event_category INTEGER(10) UNSIGNED DEFAULT NULL,
idaction_event_action INTEGER(10) UNSIGNED DEFAULT NULL,
time_spent_ref_action INTEGER(10) UNSIGNED NOT NULL,
- custom_var_k1 VARCHAR(200) DEFAULT NULL,
- custom_var_v1 VARCHAR(200) DEFAULT NULL,
- custom_var_k2 VARCHAR(200) DEFAULT NULL,
- custom_var_v2 VARCHAR(200) DEFAULT NULL,
- custom_var_k3 VARCHAR(200) DEFAULT NULL,
- custom_var_v3 VARCHAR(200) DEFAULT NULL,
- custom_var_k4 VARCHAR(200) DEFAULT NULL,
- custom_var_v4 VARCHAR(200) DEFAULT NULL,
- custom_var_k5 VARCHAR(200) DEFAULT NULL,
- custom_var_v5 VARCHAR(200) DEFAULT NULL,
+
custom_float FLOAT NULL DEFAULT NULL,
PRIMARY KEY(idlink_va),
INDEX index_idvisit(idvisit),