Commit ff3ae4eb authored by salvis's avatar salvis

Fix upgrade path from D5 (change acl_id column to auto_increment).

parent a79a5ac2
......@@ -2,6 +2,10 @@ CHANGELOG for ACL for Drupal 6
acl 6.x-1.x-dev:
acl 6.x-1.x-BETA3 (2009-01-03):
Bugs fixed:
- Fix upgrade path from D5 (change acl_id column to auto_increment).
acl 6.x-1.x-BETA2 (2008-10-14):
Bugs fixed:
- #205012, by fago: Fixed the acl form to work correctly when integrated more than once into a form.
......
......@@ -23,7 +23,8 @@ function acl_schema() {
'module' => array(
'description' => t('The name of the module that created this ACL entry.'),
'type' => 'varchar',
'length' => 255),
'length' => 255,
'not null' => TRUE),
'name' => array(
'description' => t('A name (or other identifying information) for this ACL entry, given by the module that created it.'),
'type' => 'varchar',
......@@ -146,3 +147,15 @@ function acl_update_6() {
db_add_field($ret, 'acl_node', 'priority', array('type' => 'int', 'size' => 'small', 'not null' => TRUE, 'default' => 0));
return $ret;
}
/**
* Change acl_id to auto-increment.
*/
function acl_update_6000() {
$ret = array();
db_change_field($ret, 'acl', 'acl_id', 'acl_id', array('type' => 'serial', 'not null' => TRUE));
// (Dropping and recreating the primary key on an auto_increment column would cause a MySQL failure.)
db_change_field($ret, 'acl', 'module', 'module', array('type' => 'varchar', 'length' => 255, 'not null' => TRUE));
db_change_field($ret, 'acl', 'name', 'name', array('type' => 'varchar', 'length' => 255));
return $ret;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment