Ticket #1305 (closed defect: fixed)

Opened 11 months ago

Last modified 10 months ago

notnull not using default

Reported by: turnbullm Owned by: jwage
Priority: minor Milestone:
Component: Attributes Version: 0.11.0
Severity: Keywords:
Cc: Has Test: no
Status: Pending Core Response Has Patch: no

Description

If I setup a model 'Testing' with a column like so:

$this->hasColumn('test', 'string', 255, array(

'notnull' => true, 'default' => 'test',

));

Then do this..

$testing = new Testing(); $testingtest? = null; $testing->save();

Should not doctrine be smart enough to detect that its null, and set it to 'test'?

Because at the moment it doesn't, and then the mysql database complains with this: Column 'test' cannot be null

Change History

Changed 11 months ago by jwage

  • milestone changed from Unknown to 1.0.0-RC1

Changed 11 months ago by guilhermeblanco

  • status changed from new to closed
  • resolution set to fixed

(In [4770]) fixes #1305. When you try to assign a null value in a column that has notnull=true, it tries to assign the default value, preventing SQL error. Updated ticket #923. It had incorrect call place in code.

Changed 10 months ago by anonymous

  • milestone New deleted

Milestone New deleted

Note: See TracTickets for help on using tickets.