1
0
mirror of synced 2024-12-14 23:26:04 +03:00
doctrine2/manual/codes/Connection modules - Export - Altering table.php
2006-12-15 22:32:34 +00:00

40 lines
1.3 KiB
PHP

<?php
$a = array('name' => 'userlist',
'add' => array(
'quota' => array(
'type' => 'integer',
'unsigned' => 1
)
),
'remove' => array(
'file_limit' => array(),
'time_limit' => array()
),
'change' => array(
'name' => array(
'length' => '20',
'definition' => array(
'type' => 'text',
'length' => 20
)
)
),
'rename' => array(
'sex' => array(
'name' => 'gender',
'definition' => array(
'type' => 'text',
'length' => 1,
'default' => 'M'
)
)
)
);
$dbh = new PDO('dsn','username','pw');
$conn = Doctrine_Manager::getInstance()->openConnection($dbh);
$conn->export->alterTable('mytable', $a);
?>