Open ghost opened 8 years ago
User and Profile are defined as below:
var User = db.qDefine('User', { ID: {type: 'serial', key: true}, Username: {type: 'text', size: 15, required: true}, Email: {type: 'text', size: 128, required: true} ... }, {}}); User.extendsTo("profile", { CompanyName: {type: 'text', size: 32} ... }, {field: 'UserID'});
I update company_name of User(ID=1) with following code
User.qGet(1).then(function(user) { return Q.nfbind(user.getProfile)().then(function(profile) { profile.CompanyName = 'New company'; return Q.nfbind(user.setProfile)(profile).then(function() {}); }); }) });
I found in sql log, orm executed DELETE and then UPDATE. Could you tell me how to update properties of extendsTo model. Many thanks.
User and Profile are defined as below:
I update company_name of User(ID=1) with following code
I found in sql log, orm executed DELETE and then UPDATE. Could you tell me how to update properties of extendsTo model. Many thanks.