本文整理汇总了PHP中DBUtil::drop_fields方法的典型用法代码示例。如果您正苦于以下问题:PHP DBUtil::drop_fields方法的具体用法?PHP DBUtil::drop_fields怎么用?PHP DBUtil::drop_fields使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBUtil
的用法示例。
在下文中一共展示了DBUtil::drop_fields方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: down
public function down()
{
// load the sentry config file
\Config::load('sentry', true);
// add group table columns level, is_admin and parent
\DBUtil::add_fields(\Config::get('sentry.table.groups'), array('level' => array('constraint' => 11, 'type' => 'int'), 'is_admin' => array('constraint' => 1, 'type' => 'tinyint'), 'parent' => array('constraint' => 11, 'type' => 'int')));
// remove group table column permission
\DBUtil::drop_fields(\Config::get('sentry.table.groups'), array('permissions'));
// remove user table column permission
\DBUtil::drop_fields(\Config::get('sentry.table.users'), array('permissions'));
\DBUtil::modify_fields(\Config::get('sentry.table.users'), array('password' => array('constraint' => 81, 'type' => 'varchar'), 'temp_password' => array('constraint' => 81, 'type' => 'varchar'), 'password_reset_hash' => array('constraint' => 81, 'type' => 'varchar'), 'remember_me' => array('constraint' => 81, 'type' => 'varchar'), 'activation_hash' => array('constraint' => 81, 'type' => 'varchar')));
}
示例2: down
function down()
{
// get the driver used
\Config::load('auth', true);
$drivers = \Config::get('auth.driver', array());
is_array($drivers) or $drivers = array($drivers);
if (in_array('Ormauth', $drivers)) {
// get the tablename
\Config::load('ormauth', true);
$table = \Config::get('ormauth.table_name', 'users');
\DBUtil::drop_fields($table . '_permissions', array('actions'));
\DBUtil::drop_fields($table . '_user_permissions', array('actions'));
\DBUtil::drop_fields($table . '_group_permissions', array('actions'));
\DBUtil::drop_fields($table . '_role_permissions', array('actions'));
}
}
示例3: down
function down()
{
// get the drivers defined
$drivers = normalize_driver_types();
if (in_array('Ormauth', $drivers)) {
// get the tablename
\Config::load('ormauth', true);
$table = \Config::get('ormauth.table_name', 'users');
// make sure the configured DB is used
\DBUtil::set_connection(\Config::get('ormauth.db_connection', null));
\DBUtil::drop_fields($table . '_permissions', array('actions'));
\DBUtil::drop_fields($table . '_user_permissions', array('actions'));
\DBUtil::drop_fields($table . '_group_permissions', array('actions'));
\DBUtil::drop_fields($table . '_role_permissions', array('actions'));
}
// reset any DBUtil connection set
\DBUtil::set_connection(null);
}
示例4: down
function down()
{
// get the driver used
\Config::load('auth', true);
$drivers = \Config::get('auth.driver', array());
is_array($drivers) or $drivers = array($drivers);
if (in_array('Ormauth', $drivers)) {
// get the tablename
\Config::load('ormauth', true);
$basetable = \Config::get('ormauth.table_name', 'users');
// make sure the configured DB is used
\DBUtil::set_connection(\Config::get('ormauth.db_connection', null));
\DBUtil::drop_fields($basetable . '_user_permissions', array('id'));
\DBUtil::create_index($basetable . '_user_permissions', array('user_id', 'perms_id'), '', 'PRIMARY');
\DBUtil::drop_fields($basetable . '_group_permissions', array('id'));
\DBUtil::create_index($basetable . '_group_permissions', array('group_id', 'perms_id'), '', 'PRIMARY');
\DBUtil::drop_fields($basetable . '_role_permissions', array('id'));
\DBUtil::create_index($basetable . '_role_permissions', array('role_id', 'perms_id'), '', 'PRIMARY');
}
// reset any DBUtil connection set
\DBUtil::set_connection(null);
}
示例5: down
public function down()
{
\DBUtil::drop_fields('tomorrow_list_stats', array('dialler'));
}
示例6: down
public function down()
{
\Config::load('sentry', true);
\DBUtil::drop_fields(\Config::get('sentry.table.groups'), array('parent'));
}
示例7: _alter_or_return_fields
private function _alter_or_return_fields($name, array $fields, $new)
{
if (!$new) {
if (\Cli::option('R', false) || \Cli::option('remove', false)) {
\DBUtil::drop_fields('users', array_keys($fields));
\Cli::write(\Cli::color("{$name} fields removed successfully", 'green'));
} else {
\DBUtil::add_fields('users', $fields);
\Cli::write(\Cli::color("{$name} fields added successfully", 'green'));
}
} else {
return $fields;
}
}
示例8: up
public function up()
{
\DBUtil::drop_fields('students', array('status'));
}
示例9: down
public function down()
{
// drop
\DBUtil::drop_fields('task_queues', 'priority');
}
示例10: down
public function down()
{
\DBUtil::add_fields('authentications', array('token' => array('constraint' => 255, 'type' => 'varchar', 'null' => true)));
\DBUtil::drop_fields('authentications', array('access_token', 'expires', 'refresh_token'));
}