From 0d41ea87657719c114f7ba050e5ed1b94e8dd0c4 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 25 Sep 2003 01:33:59 +0000 Subject: [PATCH] fixed wrong NOT NULL attributes in phpgw_accounts --- phpgwapi/setup/setup.inc.php | 3 +- phpgwapi/setup/tables_current.inc.php | 20 ++++++------- phpgwapi/setup/tables_update.inc.php | 41 +++++++++++++++++++++++++++ 3 files changed, 53 insertions(+), 11 deletions(-) diff --git a/phpgwapi/setup/setup.inc.php b/phpgwapi/setup/setup.inc.php index 622a4b7079..fc5a581d0b 100755 --- a/phpgwapi/setup/setup.inc.php +++ b/phpgwapi/setup/setup.inc.php @@ -15,7 +15,7 @@ /* Basic information about this app */ $setup_info['phpgwapi']['name'] = 'phpgwapi'; $setup_info['phpgwapi']['title'] = 'phpgwapi'; - $setup_info['phpgwapi']['version'] = '0.9.99.003'; + $setup_info['phpgwapi']['version'] = '0.9.99.004'; $setup_info['phpgwapi']['versions']['current_header'] = '1.24'; $setup_info['phpgwapi']['enable'] = 3; $setup_info['phpgwapi']['app_order'] = 1; @@ -57,3 +57,4 @@ + diff --git a/phpgwapi/setup/tables_current.inc.php b/phpgwapi/setup/tables_current.inc.php index b1664ebf4d..08852b11e2 100644 --- a/phpgwapi/setup/tables_current.inc.php +++ b/phpgwapi/setup/tables_current.inc.php @@ -52,18 +52,18 @@ ), 'phpgw_accounts' => array( 'fd' => array( - 'account_id' => array('type' => 'auto','nullable' => False), - 'account_lid' => array('type' => 'varchar','precision' => '25','nullable' => False), + 'account_id' => array('type' => 'auto'), + 'account_lid' => array('type' => 'varchar','precision' => '25'), 'account_pwd' => array('type' => 'varchar','precision' => '32','nullable' => False), - 'account_firstname' => array('type' => 'varchar','precision' => '50','nullable' => False), - 'account_lastname' => array('type' => 'varchar','precision' => '50','nullable' => False), - 'account_lastlogin' => array('type' => 'int','precision' => '4','nullable' => False), - 'account_lastloginfrom' => array('type' => 'varchar','precision' => '255','nullable' => False), - 'account_lastpwd_change' => array('type' => 'int','precision' => '4','nullable' => False), + 'account_firstname' => array('type' => 'varchar','precision' => '50'), + 'account_lastname' => array('type' => 'varchar','precision' => '50'), + 'account_lastlogin' => array('type' => 'int','precision' => '4'), + 'account_lastloginfrom' => array('type' => 'varchar','precision' => '255'), + 'account_lastpwd_change' => array('type' => 'int','precision' => '4'), 'account_status' => array('type' => 'char','precision' => '1','nullable' => False,'default' => 'A'), - 'account_expires' => array('type' => 'int','precision' => '4','nullable' => False), - 'account_type' => array('type' => 'char','precision' => '1','nullable' => True), - 'person_id' => array('type' => 'int','precision' => '4','nullable' => True), + 'account_expires' => array('type' => 'int','precision' => '4'), + 'account_type' => array('type' => 'char','precision' => '1'), + 'person_id' => array('type' => 'int','precision' => '4'), 'account_primary_group' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0') ), 'pk' => array('account_id'), diff --git a/phpgwapi/setup/tables_update.inc.php b/phpgwapi/setup/tables_update.inc.php index 442872e58a..e54d4cc752 100644 --- a/phpgwapi/setup/tables_update.inc.php +++ b/phpgwapi/setup/tables_update.inc.php @@ -882,4 +882,45 @@ return $GLOBALS['setup_info']['phpgwapi']['currentver']; } + + + $test[] = '0.9.99.003'; + function phpgwapi_upgrade0_9_99_003() + { + $GLOBALS['phpgw_setup']->oProc->AlterColumn('phpgw_accounts','account_id',array( + 'type' => 'auto' + )); + $GLOBALS['phpgw_setup']->oProc->AlterColumn('phpgw_accounts','account_lid',array( + 'type' => 'varchar', + 'precision' => '25' + )); + $GLOBALS['phpgw_setup']->oProc->AlterColumn('phpgw_accounts','account_firstname',array( + 'type' => 'varchar', + 'precision' => '50' + )); + $GLOBALS['phpgw_setup']->oProc->AlterColumn('phpgw_accounts','account_lastname',array( + 'type' => 'varchar', + 'precision' => '50' + )); + $GLOBALS['phpgw_setup']->oProc->AlterColumn('phpgw_accounts','account_lastlogin',array( + 'type' => 'int', + 'precision' => '4' + )); + $GLOBALS['phpgw_setup']->oProc->AlterColumn('phpgw_accounts','account_lastloginfrom',array( + 'type' => 'varchar', + 'precision' => '255' + )); + $GLOBALS['phpgw_setup']->oProc->AlterColumn('phpgw_accounts','account_lastpwd_change',array( + 'type' => 'int', + 'precision' => '4' + )); + $GLOBALS['phpgw_setup']->oProc->AlterColumn('phpgw_accounts','account_expires',array( + 'type' => 'int', + 'precision' => '4' + )); + + + $GLOBALS['setup_info']['phpgwapi']['currentver'] = '0.9.99.004'; + return $GLOBALS['setup_info']['phpgwapi']['currentver']; + } ?>