Commit da86fd89 authored by zYne's avatar zYne

added docs for notnull constraint

parent 61ccabb6
A not-null constraint simply specifies that a column must not assume the null value. A not-null constraint is always written as a column constraint.
The following definition uses a notnull constraint for column 'name'. This means that the specified column doesn't accept
null values.
<code type='php'>
class User extends Doctrine_Record
{
public function setTableDefinition()
{
$this->hasColumn('name', 'string', 200, array('notnull' => true,
'primary' => true));
}
}
</code>
When this class gets exported to database the following Sql statement would get executed (in Mysql):
CREATE TABLE user (name VARCHAR(200) NOT NULL, PRIMARY KEY(name))
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