[baseten-users] updating of SQL-views

Patrick De Visschere pdvisschere at fulladsl.be
Sun Feb 21 18:03:35 EET 2010


Hi,

Perhaps I should have made more clear that I've built the database  
completely manually without an .xcdatamodel.
I set-up the relationships so that they are recognized by the assistant.

I've found that he behaviour I've described is due to the use of  
duplicate names and the way baseten detects relationships between  
views and tables.
Suppose a  foreign constraint name2__name1 between a table (name1) and  
(name2) where (name1) contains a column named name2 referring to an id  
of (name2); sofar there is no problem; however in my case (name2)  
contained also a column named name2 and when a view is defined over  
both tables then baseten finds a relationship between this view and   
(name2).

Since this is very likely a side-effect, I now avoid using such  
duplicate names and I've implemented one of your suggested solutions  
to keep the data up-to-date.

Regards,

P. De Visschere

On 19 Feb, 2010, at 4:19 PM, Tuukka Norri wrote:

> Patrick De Visschere kirjoitti 13.2.2010 kello 12.58:
>> I was a little bit surprised because I have another example,  more  
>> complicated, where it works anyway.
>>
>> Suppose I move the dependent column to a separate table (B) with a  
>> one-to-one between A and B and the view V now joining A and B.
>> In that case the dependent column of B is sometimes updated  
>> automatically.
>> I can only guess why it sometimes works but not always: apparently  
>> a one-to-one relationship is made  (I guess by the assistant)  
>> between the view V and one of the underlying tables (A and B). I  
>> guess that If this relationship is to the dependent table B, then  
>> it's updated; if it is to the main table A, it is not.
>> Does this make sense?
>
> Hi!
>
> Can you post the SQL generated by the assistant? I can then try to  
> make a guess on what's going on. Right now I can't think of any  
> cases where this would happen but we'll see.
> -- 
> Best regards,
> Tuukka Norri
> MK&C
>
>
>
> _______________________________________________
> baseten-users mailing list
> baseten-users at lists.basetenframework.org
> http://lists.basetenframework.org/mailman/listinfo/baseten-users




More information about the baseten-users mailing list