本文整理汇总了PHP中upgrade_mysql_fix_unsigned_and_lob_columns函数的典型用法代码示例。如果您正苦于以下问题:PHP upgrade_mysql_fix_unsigned_and_lob_columns函数的具体用法?PHP upgrade_mysql_fix_unsigned_and_lob_columns怎么用?PHP upgrade_mysql_fix_unsigned_and_lob_columns使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了upgrade_mysql_fix_unsigned_and_lob_columns函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: xmldb_main_upgrade
//.........这里部分代码省略.........
}
if ($oldversion < 2012021700.02) {
// Somewhere before 1.9 summary and content column in post table were not null. In 1.9+
// not null became false.
$columns = $DB->get_columns('post');
// Fix discrepancies in summary field after upgrade from 1.9
if (array_key_exists('summary', $columns) && $columns['summary']->not_null != false) {
$table = new xmldb_table('post');
$summaryfield = new xmldb_field('summary', XMLDB_TYPE_TEXT, 'big', null, null, null, null, 'subject');
if ($dbman->field_exists($table, $summaryfield)) {
$dbman->change_field_notnull($table, $summaryfield);
}
}
// Fix discrepancies in content field after upgrade from 1.9
if (array_key_exists('content', $columns) && $columns['content']->not_null != false) {
$table = new xmldb_table('post');
$contentfield = new xmldb_field('content', XMLDB_TYPE_TEXT, 'big', null, null, null, null, 'summary');
if ($dbman->field_exists($table, $contentfield)) {
$dbman->change_field_notnull($table, $contentfield);
}
}
upgrade_main_savepoint(true, 2012021700.02);
}
// The ability to backup user (private) files is out completely - MDL-29248
if ($oldversion < 2012030100.01) {
unset_config('backup_general_user_files', 'backup');
unset_config('backup_general_user_files_locked', 'backup');
unset_config('backup_auto_user_files', 'backup');
upgrade_main_savepoint(true, 2012030100.01);
}
if ($oldversion < 2012030900.01) {
// Migrate all numbers to signed & all texts and binaries to big size.
// It should be safe to interrupt this and continue later.
upgrade_mysql_fix_unsigned_and_lob_columns();
// Main savepoint reached
upgrade_main_savepoint(true, 2012030900.01);
}
if ($oldversion < 2012031500.01) {
// Upgrade old course_allowed_modules data to be permission overrides.
if ($CFG->restrictmodulesfor === 'all') {
$courses = $DB->get_records_menu('course', array(), 'id', 'id, 1');
} else {
if ($CFG->restrictmodulesfor === 'requested') {
$courses = $DB->get_records_menu('course', array('restrictmodules' => 1), 'id', 'id, 1');
} else {
$courses = array();
}
}
if (!$dbman->table_exists('course_allowed_modules')) {
// Upgrade must already have been run on this server. This might happen,
// for example, during development of these changes.
$courses = array();
}
$modidtoname = $DB->get_records_menu('modules', array(), 'id', 'id, name');
$coursecount = count($courses);
if ($coursecount) {
$pbar = new progress_bar('allowedmods', 500, true);
$transaction = $DB->start_delegated_transaction();
}
$i = 0;
foreach ($courses as $courseid => $notused) {
$i += 1;
upgrade_set_timeout(60);
// 1 minute per course should be fine.
$allowedmoduleids = $DB->get_records_menu('course_allowed_modules', array('course' => $courseid), 'module', 'module, 1');
if (empty($allowedmoduleids)) {
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:67,代码来源:upgrade.php
示例2: xmldb_main_upgrade
//.........这里部分代码省略.........
}
if ($oldversion < 2012021700.02) {
// Somewhere before 1.9 summary and content column in post table were not null. In 1.9+
// not null became false.
$columns = $DB->get_columns('post');
// Fix discrepancies in summary field after upgrade from 1.9
if (array_key_exists('summary', $columns) && $columns['summary']->not_null != false) {
$table = new xmldb_table('post');
$summaryfield = new xmldb_field('summary', XMLDB_TYPE_TEXT, 'big', null, null, null, null, 'subject');
if ($dbman->field_exists($table, $summaryfield)) {
$dbman->change_field_notnull($table, $summaryfield);
}
}
// Fix discrepancies in content field after upgrade from 1.9
if (array_key_exists('content', $columns) && $columns['content']->not_null != false) {
$table = new xmldb_table('post');
$contentfield = new xmldb_field('content', XMLDB_TYPE_TEXT, 'big', null, null, null, null, 'summary');
if ($dbman->field_exists($table, $contentfield)) {
$dbman->change_field_notnull($table, $contentfield);
}
}
upgrade_main_savepoint(true, 2012021700.02);
}
// The ability to backup user (private) files is out completely - MDL-29248
if ($oldversion < 2012030100.01) {
unset_config('backup_general_user_files', 'backup');
unset_config('backup_general_user_files_locked', 'backup');
unset_config('backup_auto_user_files', 'backup');
upgrade_main_savepoint(true, 2012030100.01);
}
if ($oldversion < 2012030900.01) {
// Migrate all numbers to signed & all texts and binaries to big size.
// It should be safe to interrupt this and continue later.
upgrade_mysql_fix_unsigned_and_lob_columns();
// Main savepoint reached
upgrade_main_savepoint(true, 2012030900.01);
}
if ($oldversion < 2012031500.01) {
// Upgrade old course_allowed_modules data to be permission overrides.
if ($CFG->restrictmodulesfor === 'all') {
$courses = $DB->get_records_menu('course', array(), 'id', 'id, 1');
} else {
if ($CFG->restrictmodulesfor === 'requested') {
$courses = $DB->get_records_menu('course', array('restrictmodules' => 1), 'id', 'id, 1');
} else {
$courses = array();
}
}
if (!$dbman->table_exists('course_allowed_modules')) {
// Upgrade must already have been run on this server. This might happen,
// for example, during development of these changes.
$courses = array();
}
$modidtoname = $DB->get_records_menu('modules', array(), 'id', 'id, name');
$coursecount = count($courses);
if ($coursecount) {
$pbar = new progress_bar('allowedmods', 500, true);
$transaction = $DB->start_delegated_transaction();
}
$i = 0;
foreach ($courses as $courseid => $notused) {
$i += 1;
upgrade_set_timeout(60);
// 1 minute per course should be fine.
$allowedmoduleids = $DB->get_records_menu('course_allowed_modules', array('course' => $courseid), 'module', 'module, 1');
if (empty($allowedmoduleids)) {
开发者ID:HuiChangZhai,项目名称:moodle,代码行数:67,代码来源:upgrade.php
示例3: xmldb_main_upgrade
//.........这里部分代码省略.........
}
if ($oldversion < 2012021700.02) {
// Somewhere before 1.9 summary and content column in post table were not null. In 1.9+
// not null became false.
$columns = $DB->get_columns('post');
// Fix discrepancies in summary field after upgrade from 1.9
if (array_key_exists('summary', $columns) && $columns['summary']->not_null != false) {
$table = new xmldb_table('post');
$summaryfield = new xmldb_field('summary', XMLDB_TYPE_TEXT, 'big', null, null, null, null, 'subject');
if ($dbman->field_exists($table, $summaryfield)) {
$dbman->change_field_notnull($table, $summaryfield);
}
}
// Fix discrepancies in content field after upgrade from 1.9
if (array_key_exists('content', $columns) && $columns['content']->not_null != false) {
$table = new xmldb_table('post');
$contentfield = new xmldb_field('content', XMLDB_TYPE_TEXT, 'big', null, null, null, null, 'summary');
if ($dbman->field_exists($table, $contentfield)) {
$dbman->change_field_notnull($table, $contentfield);
}
}
upgrade_main_savepoint(true, 2012021700.02);
}
// The ability to backup user (private) files is out completely - MDL-29248
if ($oldversion < 2012030100.01) {
unset_config('backup_general_user_files', 'backup');
unset_config('backup_general_user_files_locked', 'backup');
unset_config('backup_auto_user_files', 'backup');
upgrade_main_savepoint(true, 2012030100.01);
}
if ($oldversion < 2012030900.01) {
// Migrate all numbers to signed & all texts and binaries to big size.
// It should be safe to interrupt this and continue later.
upgrade_mysql_fix_unsigned_and_lob_columns();
// Main savepoint reached
upgrade_main_savepoint(true, 2012030900.01);
}
if ($oldversion < 2012031500.01) {
// Upgrade old course_allowed_modules data to be permission overrides.
if ($CFG->restrictmodulesfor === 'all') {
$courses = $DB->get_records_menu('course', array(), 'id', 'id, 1');
} else {
if ($CFG->restrictmodulesfor === 'requested') {
$courses = $DB->get_records_menu('course', array('restrictmodules' => 1), 'id', 'id, 1');
} else {
$courses = array();
}
}
if (!$dbman->table_exists('course_allowed_modules')) {
// Upgrade must already have been run on this server. This might happen,
// for example, during development of these changes.
$courses = array();
}
$modidtoname = $DB->get_records_menu('modules', array(), 'id', 'id, name');
$coursecount = count($courses);
if ($coursecount) {
$pbar = new progress_bar('allowedmods', 500, true);
$transaction = $DB->start_delegated_transaction();
}
$i = 0;
foreach ($courses as $courseid => $notused) {
$i += 1;
upgrade_set_timeout(60);
// 1 minute per course should be fine.
$allowedmoduleids = $DB->get_records_menu('course_allowed_modules', array('course' => $courseid), 'module', 'module, 1');
if (empty($allowedmoduleids)) {
开发者ID:saurabh947,项目名称:MoodleLearning,代码行数:67,代码来源:upgrade.php
注:本文中的upgrade_mysql_fix_unsigned_and_lob_columns函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论