You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Default values is not used when property is not specified #104
$ node app.js
ok
mysql> SELECT * FROM testentity;
+----+-----------+--------+
| id | name | rating |
+----+-----------+--------+
| 1 | Test name | NULL |
| 2 | NULL | 15 |
| 3 | NULL | NULL |
+----+-----------+--------+
mysql> describe testentity;
+--------+------------------+------+-----+--------------+----------------+
| Field | Type | Null | Key | Default | Extra |
+--------+------------------+------+-----+--------------+----------------+
| id | int(11) unsigned | NO | PRI | NULL | auto_increment |
| name | varchar(255) | YES | | Default name | |
| rating | int(11) | YES | | 0 | |
+--------+------------------+------+-----+--------------+----------------+
As you can see sync() works correctly and creates proper table structure containing default values. Therefore I assume that inserting query contains statement with explicit NULL assignement.
I think that orm should use default value if property of entity were not specified.
Activity
dresende commentedon Apr 8, 2013
I'm going to test it, thank you
dresende commentedon Apr 8, 2013
Found it, posting fix in a minute.
Fixes bug detected on previous commit about drivers using wrong escap…
2.0.8