This commit is contained in:
parent
da86fd8956
commit
a336d424f7
@ -0,0 +1,11 @@
|
||||
<code type='php'>
|
||||
// export everything, table definitions and constraints
|
||||
|
||||
$manager->setAttribute(Doctrine::ATTR_EXPORT, Doctrine::EXPORT_ALL);
|
||||
|
||||
// export classes without constraints
|
||||
|
||||
$manager->setAttribute(Doctrine::ATTR_EXPORT, Doctrine::EXPORT_TABLES ^
|
||||
Doctrine::EXPORT_CONSTRAINTS);
|
||||
|
||||
</code>
|
@ -17,3 +17,7 @@ class User extends Doctrine_Record
|
||||
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))
|
||||
|
||||
The notnull constraint also acts as an application level validator. This means that if Doctrine validators are turned on, Doctrine will automatically check that specified columns do not contain null values when saved.
|
||||
|
||||
If those columns happen to contain null values Doctrine_Validator_Exception is raised.
|
||||
|
Loading…
x
Reference in New Issue
Block a user