[Migration] Add a service_username to thirdparty_logins

pull/1476/head
Peter Goodhall 2022-05-05 15:11:33 +01:00
rodzic 867456de1a
commit 98dd08a6f8
2 zmienionych plików z 35 dodań i 1 usunięć

Wyświetl plik

@ -21,7 +21,7 @@ $config['migration_enabled'] = TRUE;
| be upgraded / downgraded to.
|
*/
$config['migration_version'] = 91;
$config['migration_version'] = 92;
/*
|--------------------------------------------------------------------------

Wyświetl plik

@ -0,0 +1,34 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
Creates column service_username in table thirdparty_logins
*/
class Migration_add_service_username extends CI_Migration {
public function up()
{
if ($this->db->table_exists('thirdparty_logins')) {
$fields = array(
'service_username' => array(
'type' => 'VARCHAR',
'constraint' => '255',
'null' => TRUE
)
);
if (!$this->db->field_exists('public_slug', 'thirdparty_logins')) {
$this->dbforge->add_column('thirdparty_logins', $fields);
}
}
}
public function down()
{
$this->dbforge->drop_column('thirdparty_logins', 'service_username');
}
}