Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 40
Database Table
Matthew McNaney edited this page Jan 28, 2016
·
3 revisions
// 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();