当前位置: 首页>>代码示例>>PHP>>正文


PHP DbHelper::createTable方法代码示例

本文整理汇总了PHP中Piwik\DbHelper::createTable方法的典型用法代码示例。如果您正苦于以下问题:PHP DbHelper::createTable方法的具体用法?PHP DbHelper::createTable怎么用?PHP DbHelper::createTable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Piwik\DbHelper的用法示例。


在下文中一共展示了DbHelper::createTable方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: install

 public static function install()
 {
     $tableAlert = "`idalert` INT NOT NULL PRIMARY KEY ,\n                       `name` VARCHAR(100) NOT NULL ,\n                       `login` VARCHAR(100) NOT NULL ,\n                       `period` VARCHAR(5) NOT NULL ,\n                       `report` VARCHAR(150) NOT NULL ,\n                       `report_condition` VARCHAR(50) ,\n                       `report_matched` VARCHAR(255) ,\n                       `metric` VARCHAR(150) NOT NULL ,\n                       `metric_condition` VARCHAR(50) NOT NULL ,\n                       `metric_matched` FLOAT NOT NULL ,\n                       `compared_to` SMALLINT (4) UNSIGNED NOT NULL DEFAULT 1 ,\n                       `email_me` BOOLEAN NOT NULL DEFAULT '0',\n                       `additional_emails` TEXT ,\n                       `phone_numbers` TEXT ";
     DbHelper::createTable('alert', $tableAlert);
     $tableAlertSite = "`idalert` INT( 11 ) NOT NULL ,\n                           `idsite` INT( 11 ) NOT NULL ,\n                           PRIMARY KEY ( idalert, idsite )";
     DbHelper::createTable('alert_site', $tableAlertSite);
     $tableAlertLog = "`idtriggered` BIGINT unsigned NOT NULL AUTO_INCREMENT,\n\t\t\t              `idalert` INT( 11 ) NOT NULL ,\n\t\t\t              `idsite` INT( 11 ) NOT NULL ,\n\t\t\t              `ts_triggered` timestamp NOT NULL default CURRENT_TIMESTAMP,\n\t\t\t              `ts_last_sent` timestamp NULL DEFAULT NULL,\n\t\t\t              `value_old` DECIMAL (20,3) DEFAULT NULL,\n\t\t\t              `value_new` DECIMAL (20,3) DEFAULT NULL,\n                          `name` VARCHAR(100) NOT NULL ,\n\t\t\t              `login` VARCHAR(100) NOT NULL ,\n\t\t\t              `period` VARCHAR(5) NOT NULL ,\n\t\t\t              `report` VARCHAR(150) NOT NULL ,\n\t\t\t              `report_condition` VARCHAR(50) ,\n\t\t\t              `report_matched` VARCHAR(1000) ,\n\t\t\t              `metric` VARCHAR(150) NOT NULL ,\n\t\t\t              `metric_condition` VARCHAR(50) NOT NULL ,\n\t\t\t              `metric_matched` FLOAT NOT NULL ,\n\t\t\t              `compared_to` SMALLINT NOT NULL DEFAULT 1 ,\n\t\t\t              `email_me` BOOLEAN NOT NULL  DEFAULT '0',\n\t\t\t              `additional_emails` TEXT ,\n\t\t\t              `phone_numbers` TEXT ,\n\t\t\t              PRIMARY KEY (idtriggered)";
     DbHelper::createTable('alert_triggered', $tableAlertLog);
 }
开发者ID:andrzejewsky,项目名称:plugin-CustomAlerts,代码行数:9,代码来源:Model.php

示例2: install

 /**
  * Installs the plugin. Derived classes should implement this class if the plugin
  * needs to:
  *
  * - create tables
  * - update existing tables
  * - etc.
  *
  * @throws \Exception if installation of fails for some reason.
  */
 public function install()
 {
     try {
         DbHelper::createTable('bannerstats', "\n            `label` varchar(100) not null,\n            `content_name_id` int not null,\n            `impression`    int not null,\n            `interaction`   int not null,\n            `referrer`      varchar(200),\n            `target`        varchar(200),\n            `date`          date,\n            `custom_var_v1`\tvarchar(200),\n            `custom_var_v2`\tvarchar(200),\n            `custom_var_v3`\tvarchar(200),\n            `custom_var_v4`\tvarchar(200),\n            `custom_var_v5`\tvarchar(200),\n\n            UNIQUE KEY `unique_combination` (`date`, `label`, `content_name_id`, `referrer`, `target`)\n       ");
     } catch (Exception $e) {
         // ignore error if table already exists (1050 code is for 'table already exists')
         if (!Db::get()->isErrNo($e, '1050')) {
             throw $e;
         }
     }
 }
开发者ID:Ratus,项目名称:VPSCashPiwikBannerPlugin,代码行数:21,代码来源:VpsCashPromo.php

示例3: install

 public static function install()
 {
     $reportTable = "idreport SERIAL4 NOT NULL,\n\t\t\t\t\t    idsite INTEGER NOT NULL,\n\t\t\t\t\t    login VARCHAR(100) NOT NULL,\n\t\t\t\t\t    description VARCHAR(255) NOT NULL,\n\t\t\t\t\t    idsegment INTEGER,\n\t\t\t\t\t    period VARCHAR(10) NOT NULL,\n\t\t\t\t\t    hour TINYINT NOT NULL DEFAULT 0,\n\t\t\t\t\t    type VARCHAR(10) NOT NULL,\n\t\t\t\t\t    format VARCHAR(10) NOT NULL,\n\t\t\t\t\t    reports TEXT NOT NULL,\n\t\t\t\t\t    parameters TEXT NULL,\n\t\t\t\t\t    ts_created TIMESTAMP WITHOUT TIME ZONE NULL,\n\t\t\t\t\t    ts_last_sent TIMESTAMP WITHOUT TIME ZONE NULL,\n\t\t\t\t\t    deleted TINYINT NOT NULL DEFAULT 0,\n\t\t\t\t\t    PRIMARY KEY (idreport)";
     DbHelper::createTable(self::$rawPrefix, $reportTable);
 }
开发者ID:FluentDevelopment,项目名称:piwik,代码行数:5,代码来源:PgModel.php

示例4: install

 public function install()
 {
     $reportTable = "`idreport` INT(11) NOT NULL AUTO_INCREMENT,\n\t\t\t\t\t    `idsite` INTEGER(11) NOT NULL,\n\t\t\t\t\t    `login` VARCHAR(100) NOT NULL,\n\t\t\t\t\t    `description` VARCHAR(255) NOT NULL,\n\t\t\t\t\t    `idsegment` INT(11),\n\t\t\t\t\t    `period` VARCHAR(10) NOT NULL,\n\t\t\t\t\t    `hour` tinyint NOT NULL default 0,\n\t\t\t\t\t    `type` VARCHAR(10) NOT NULL,\n\t\t\t\t\t    `format` VARCHAR(10) NOT NULL,\n\t\t\t\t\t    `reports` TEXT NOT NULL,\n\t\t\t\t\t    `parameters` TEXT NULL,\n\t\t\t\t\t    `ts_created` TIMESTAMP NULL,\n\t\t\t\t\t    `ts_last_sent` TIMESTAMP NULL,\n\t\t\t\t\t    `deleted` tinyint(4) NOT NULL default 0,\n\t\t\t\t\t    PRIMARY KEY (`idreport`)";
     DbHelper::createTable('report', $reportTable);
 }
开发者ID:a4tunado,项目名称:piwik,代码行数:5,代码来源:ScheduledReports.php

示例5: install

 /**
  * @throws Exception if non-recoverable error
  */
 public function install()
 {
     $userLanguage = "login VARCHAR( 100 ) NOT NULL ,\n\t\t\t\t\t     language VARCHAR( 10 ) NOT NULL ,\n\t\t\t\t\t     PRIMARY KEY ( login )";
     DbHelper::createTable('user_language', $userLanguage);
 }
开发者ID:carriercomm,项目名称:piwik,代码行数:8,代码来源:LanguagesManager.php

示例6: install

 public static function install()
 {
     $userLanguage = "login VARCHAR( 100 ) NOT NULL ,\n\t\t\t\t\t     language VARCHAR( 10 ) NOT NULL ,\n\t\t\t\t\t     use_12_hour_clock TINYINT(1) NOT NULL DEFAULT 0 ,\n\t\t\t\t\t     PRIMARY KEY ( login )";
     DbHelper::createTable(self::$rawPrefix, $userLanguage);
 }
开发者ID:diosmosis,项目名称:piwik,代码行数:5,代码来源:Model.php

示例7: install

 public static function install()
 {
     $dashboard = "login VARCHAR( 100 ) NOT NULL ,\n\t\t\t\t\t  iddashboard INT NOT NULL ,\n\t\t\t\t\t  name VARCHAR( 100 ) NULL DEFAULT NULL ,\n\t\t\t\t\t  layout TEXT NOT NULL,\n\t\t\t\t\t  PRIMARY KEY ( login , iddashboard )";
     DbHelper::createTable(self::$rawPrefix, $dashboard);
 }
开发者ID:TensorWrenchOSS,项目名称:piwik,代码行数:5,代码来源:Model.php

示例8: install

 public function install()
 {
     $segmentTable = "`idsegment` INT(11) NOT NULL AUTO_INCREMENT,\n\t\t\t\t\t     `name` VARCHAR(255) NOT NULL,\n\t\t\t\t\t     `definition` TEXT NOT NULL,\n\t\t\t\t\t     `login` VARCHAR(100) NOT NULL,\n\t\t\t\t\t     `enable_all_users` tinyint(4) NOT NULL default 0,\n\t\t\t\t\t     `enable_only_idsite` INTEGER(11) NULL,\n\t\t\t\t\t     `auto_archive` tinyint(4) NOT NULL default 0,\n\t\t\t\t\t     `ts_created` TIMESTAMP NULL,\n\t\t\t\t\t     `ts_last_edit` TIMESTAMP NULL,\n\t\t\t\t\t     `deleted` tinyint(4) NOT NULL default 0,\n\t\t\t\t\t     PRIMARY KEY (`idsegment`)";
     DbHelper::createTable('segment', $segmentTable);
 }
开发者ID:a4tunado,项目名称:piwik,代码行数:5,代码来源:SegmentEditor.php

示例9: install

 public function install()
 {
     $table = "`creation_date` datetime NOT NULL ,\n                  `category` VARCHAR(200) NOT NULL ,\n                  `name` VARCHAR(200) NOT NULL ,\n                  `action` VARCHAR(200) NOT NULL,\n                  `count` INT UNSIGNED NOT NULL DEFAULT 0 ,\n                  `wall_time` BIGINT UNSIGNED NOT NULL DEFAULT 0 ,\n                  PRIMARY KEY(`category`, `name`, `action`)";
     DbHelper::createTable($this->tableName, $table);
 }
开发者ID:andrzejewsky,项目名称:plugin-AnonymousPiwikUsageMeasurement,代码行数:5,代码来源:Profiles.php

示例10: install

 public function install()
 {
     $table = "`idcustomdimension` BIGINT UNSIGNED NOT NULL,\n                  `idsite` BIGINT UNSIGNED NOT NULL ,\n                  `name` VARCHAR(100) NOT NULL ,\n                  `index` SMALLINT UNSIGNED NOT NULL ,\n                  `scope` VARCHAR(10) NOT NULL ,\n                  `active` TINYINT UNSIGNED NOT NULL DEFAULT 0,\n                  `extractions` TEXT NOT NULL DEFAULT '',\n                  `case_sensitive` TINYINT UNSIGNED NOT NULL DEFAULT 1,\n                  UNIQUE KEY idcustomdimension_idsite (`idcustomdimension`, `idsite`),\n                  UNIQUE KEY uniq_hash(idsite, `scope`, `index`)";
     DbHelper::createTable($this->tableName, $table);
 }
开发者ID:ep123,项目名称:plugin-CustomDimensions,代码行数:5,代码来源:Configuration.php


注:本文中的Piwik\DbHelper::createTable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。