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
$ 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.
The text was updated successfully, but these errors were encountered:
Test example:
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.
The text was updated successfully, but these errors were encountered: