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


PHP CM_Db_Db::existsColumn方法代码示例

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


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

示例1: testExistsColumn

 public function testExistsColumn()
 {
     $this->assertSame(true, CM_Db_Db::existsColumn('test', 'foo'));
     $this->assertSame(false, CM_Db_Db::existsColumn('test', 'test'));
 }
开发者ID:cargomedia,项目名称:cm,代码行数:5,代码来源:DbTest.php

示例2: int

<?php

if (CM_Db_Db::existsColumn('cm_stream_publish', 'userId')) {
    CM_Db_Db::exec('ALTER TABLE  `cm_stream_publish` MODIFY  `userId` int(10) unsigned DEFAULT NULL');
}
开发者ID:cargomedia,项目名称:cm,代码行数:5,代码来源:15.php

示例3: char

<?php

if (!CM_Db_Db::existsColumn('cm_locationState', 'abbreviation')) {
    CM_Db_Db::exec('ALTER TABLE `cm_locationState` ADD `abbreviation` char(2) AFTER `name`');
}
CM_Model_Location::createUSStatesAbbreviation();
开发者ID:cargomedia,项目名称:cm,代码行数:6,代码来源:13.php

示例4: int

<?php

if (CM_Db_Db::existsTable('cm_model_location_city_ip') && !CM_Db_Db::existsTable('cm_model_location_ip')) {
    CM_Db_Db::exec('RENAME TABLE `cm_model_location_city_ip` TO `cm_model_location_ip`');
}
if (CM_Db_Db::existsTable('cm_model_location_ip')) {
    if (CM_Db_Db::existsIndex('cm_model_location_ip', 'cityId')) {
        CM_Db_Db::exec('DROP INDEX `cityId` ON `cm_model_location_ip`');
    }
    if (CM_Db_Db::existsColumn('cm_model_location_ip', 'cityId') && !CM_Db_Db::existsColumn('cm_model_location_ip', 'id')) {
        CM_Db_Db::exec('ALTER TABLE `cm_model_location_ip` CHANGE COLUMN `cityId` `id` int(10) unsigned NOT NULL ');
    }
    if (!CM_Db_Db::existsColumn('cm_model_location_ip', 'level')) {
        CM_Db_Db::exec('ALTER TABLE `cm_model_location_ip` ADD COLUMN `level` int(10) unsigned NOT NULL AFTER `id`');
    }
    if (CM_Db_Db::existsColumn('cm_model_location_ip', 'level')) {
        CM_Db_Db::update('cm_model_location_ip', array('level' => CM_Model_Location::LEVEL_CITY), array('level' => 0));
    }
    if (CM_Db_Db::existsTable('cm_model_location_country_ip')) {
        $result = CM_Db_Db::select('cm_model_location_country_ip', array('countryId', 'ipStart', 'ipEnd'));
        foreach ($result->fetchAll() as $row) {
            CM_Db_Db::insert('cm_model_location_ip', array('id' => $row['countryId'], 'level' => CM_Model_Location::LEVEL_COUNTRY, 'ipStart' => $row['ipStart'], 'ipEnd' => $row['ipEnd']));
        }
        CM_Db_Db::exec('DROP TABLE `cm_model_location_country_ip`');
    }
}
开发者ID:cargomedia,项目名称:cm,代码行数:26,代码来源:30.php

示例5: int

<?php

if (CM_Db_Db::existsIndex('cm_svm', 'trainingChanges')) {
    CM_Db_Db::exec('DROP INDEX `trainingChanges` on `cm_svm`');
}
if (CM_Db_Db::existsColumn('cm_svm', 'trainingChanges')) {
    CM_Db_Db::exec('
        ALTER TABLE `cm_svm`
          DROP COLUMN `trainingChanges`,
          ADD COLUMN `updateStamp` int(10) unsigned NOT NULL');
    CM_Db_Db::update('cm_svm', array('updateStamp' => time()));
}
开发者ID:cargomedia,项目名称:cm,代码行数:12,代码来源:27.php

示例6: VARCHAR

<?php

if (!CM_Db_Db::existsColumn('cm_streamChannelArchive_media', 'key')) {
    CM_Db_Db::exec("ALTER TABLE cm_streamChannelArchive_media ADD `key` VARCHAR(64) DEFAULT NULL, ADD INDEX (`key`)");
}
开发者ID:cargomedia,项目名称:cm,代码行数:5,代码来源:59.php

示例7:

<?php

if (!CM_Db_Db::existsColumn('cm_mail', 'customHeaders')) {
    CM_Db_Db::exec('
        ALTER TABLE `cm_mail` ADD COLUMN `customHeaders` text AFTER `bcc`;');
}
开发者ID:cargomedia,项目名称:cm,代码行数:6,代码来源:47.php

示例8: int

<?php

if (!CM_Db_Db::existsColumn('cm_ipBlocked', 'expirationStamp')) {
    CM_Db_Db::exec("ALTER TABLE `cm_ipBlocked`\n                    ADD `expirationStamp` int(10) unsigned NOT NULL,\n                    ADD KEY `expirationStamp` (`expirationStamp`);");
}
$config = CM_Config::get();
CM_Db_Db::exec("UPDATE `cm_ipBlocked` SET `expirationStamp` = `createStamp` + " . $config->CM_Paging_Ip_Blocked->maxAge . " WHERE `expirationStamp` = 0");
开发者ID:cargomedia,项目名称:cm,代码行数:7,代码来源:45.php

示例9: array

<?php

if (!CM_Db_Db::existsColumn('cm_languageKey', 'variables')) {
    CM_Db_Db::exec("ALTER TABLE `cm_languageKey` ADD `variables` text CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL AFTER name");
}
if (CM_Db_Db::existsTable('cm_languageKey_variable')) {
    $results = CM_Db_Db::select('cm_languageKey_variable', '*')->fetchAll();
    $variableList = array();
    foreach ($results as $result) {
        $variableList[$result['languageKeyId']][] = $result['name'];
    }
    foreach ($variableList as $languageKeyId => $variables) {
        CM_Db_Db::update('cm_languageKey', array('variables' => json_encode($variables)), array('id' => $languageKeyId));
    }
    CM_Db_Db::exec('DROP TABLE `cm_languageKey_variable`');
}
开发者ID:cargomedia,项目名称:cm,代码行数:16,代码来源:33.php

示例10: varchar

<?php

if (CM_Db_Db::existsColumn('cm_cli_command_manager_process', 'hostId')) {
    CM_Db_Db::exec('
        ALTER TABLE `cm_cli_command_manager_process`
          DROP KEY `hostId`,
          DROP COLUMN `hostId`,
          ADD COLUMN `machineId` varchar(100) NOT NULL AFTER `commandName`,
          ADD KEY `machineId` (`machineId`)
    ');
    CM_Db_Db::delete('cm_cli_command_manager_process');
}
开发者ID:cargomedia,项目名称:cm,代码行数:12,代码来源:71.php

示例11: int

<?php

if (!CM_Db_Db::existsTable('cm_model_currency')) {
    CM_Db_Db::exec("CREATE TABLE `cm_model_currency` (\n                      `id` int(10) unsigned NOT NULL AUTO_INCREMENT,\n                      `code` varchar(3) NOT NULL DEFAULT '',\n                      `abbreviation` varchar(3) NOT NULL DEFAULT '',\n                      PRIMARY KEY (`id`),\n                      UNIQUE KEY `code` (`code`),\n                      UNIQUE KEY `string` (`abbreviation`)\n                    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;");
}
if (!CM_Db_Db::existsTable('cm_model_currency_country')) {
    CM_Db_Db::exec("CREATE TABLE `cm_model_currency_country` (\n                      `currencyId` int(10) NOT NULL,\n                      `countryId` int(10) NOT NULL,\n                      UNIQUE KEY `countryId` (`countryId`)\n                    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;");
}
if (!CM_Db_Db::existsColumn('cm_user', 'currencyId')) {
    CM_Db_Db::exec("ALTER TABLE `cm_user` ADD `currencyId` INT(10) UNSIGNED DEFAULT NULL");
}
开发者ID:cargomedia,项目名称:cm,代码行数:11,代码来源:49.php

示例12:

<?php

if (!CM_Db_Db::existsColumn('cm_streamChannel', 'adapterType')) {
    CM_Db_Db::exec('ALTER TABLE  `cm_streamChannel` ADD  `adapterType` INT NOT NULL');
    CM_Db_Db::exec('ALTER TABLE  `cm_streamChannel` ADD INDEX `type` (`type`)');
    CM_Db_Db::exec('ALTER TABLE  `cm_streamChannel` ADD UNIQUE `key-adapterType` (`key`, `adapterType`)');
}
开发者ID:cargomedia,项目名称:cm,代码行数:7,代码来源:4.php

示例13: varchar

<?php

if (!CM_Db_Db::existsColumn('cm_tmp_location', 'nameFull')) {
    CM_Db_Db::exec('ALTER TABLE `cm_tmp_location` ADD COLUMN `nameFull` varchar(480) DEFAULT NULL AFTER `name`;');
    $searchCli = new CM_Elasticsearch_Index_Cli(null, new CM_OutputStream_Stream_Output());
    $searchCli->create('location');
}
开发者ID:cargomedia,项目名称:cm,代码行数:7,代码来源:31.php

示例14: INT

<?php

if (!CM_Db_Db::existsTable('cm_streamchannel_thumbnail')) {
    CM_Db_Db::exec("CREATE TABLE `cm_streamchannel_thumbnail` (\n          `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,\n          `channelId` INT(10) UNSIGNED NOT NULL,\n          `createStamp` INT(10) UNSIGNED NOT NULL,\n          PRIMARY KEY (`id`),\n          KEY `channelId-createStamp` (`channelId`, `createStamp`)\n        ) ENGINE=MyISAM DEFAULT CHARSET=utf8;");
}
if (CM_Db_Db::existsColumn('cm_streamChannel_media', 'thumbnailCount')) {
    CM_Db_Db::exec("ALTER TABLE cm_streamChannel_media DROP thumbnailCount, DROP `data`");
}
if (CM_Db_Db::existsColumn('cm_streamChannelArchive_media', 'thumbnailCount')) {
    CM_Db_Db::exec("ALTER TABLE cm_streamChannelArchive_media DROP thumbnailCount, DROP `data`");
}
开发者ID:cargomedia,项目名称:cm,代码行数:11,代码来源:62.php

示例15: int

<?php

if (!CM_Db_Db::existsColumn('cm_splittest', 'optimized')) {
    CM_Db_Db::exec('
        ALTER TABLE `cm_splittest` ADD COLUMN `optimized` int(1) unsigned NOT NULL AFTER `name`');
}
if (!CM_Db_Db::existsIndex('cm_splittestVariation_fixture', 'splittestVariationCreateStamp')) {
    CM_Db_Db::exec('
        ALTER TABLE `cm_splittestVariation_fixture`
          ADD INDEX `splittestVariationCreateStamp` (`splittestId`,`variationId`,`createStamp`),
          ADD INDEX `splittestVariationConversionStamp` (`splittestId`,`variationId`,`conversionStamp`),
          DROP INDEX `splittestId`,
          DROP INDEX `createStamp`,
          DROP INDEX `conversionStamp`');
}
开发者ID:cargomedia,项目名称:cm,代码行数:15,代码来源:46.php


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