1
0
mirror of synced 2025-01-18 06:21:40 +03:00
This commit is contained in:
zYne 2007-02-27 16:14:59 +00:00
parent da86fd8956
commit a336d424f7
2 changed files with 15 additions and 0 deletions

View File

@ -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>

View File

@ -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.