You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Matthew McNaney edited this page Jan 28, 2016
·
3 revisions
Create table
// Create a new table based on the current database engine
$foo = $db->buildTable('foo');
// Create a table primary index id column. Creation differs based on database
// engine.
$foo->addPrimaryIndexId();
$first_name = $foo->addDataType('first_name', 'varchar');
$first_name->setSize(30);
$last_name = $foo->addDataType('last_name', 'varchar');
$last_name->setSize(30);
$created = $foo->addDataType('created', 'timestamp');
$created->setIsNull(true);
// Call create method
$foo->create();