Just a little modification and all is right.

Le lundi 15 juillet 2013 16:21:13 UTC+2, Massimo Di Pierro a écrit :
>
> I made some simplification to your patch. Please check it in trunk. Thank 
> you!
>
>
> On Monday, 15 July 2013 03:51:39 UTC-5, Olivier Johner wrote:
>>
>> I propose this patch
>>
>>
>> Le vendredi 12 juillet 2013 14:08:21 UTC+2, Olivier Johner a écrit :
>>>
>>> It's ok for the foreign key but when you archive records in another 
>>> database, all fields comes in "big int" and raise a value error for string 
>>> fields
>>>
>>> ValueError: invalid literal for long() with base 10: 'v6 box spearmint'
>>>
>>>
>>> Le dimanche 16 juin 2013 10:28:26 UTC+2, Massimo Di Pierro a écrit :
>>>>
>>>> This should now be fixed in trunk. Please check it.
>>>>
>>>> On Thursday, 6 June 2013 08:19:35 UTC-5, Lamps902 wrote:
>>>>>
>>>>> To clarify, due to the SQL Foreign Key constraint (which is retained 
>>>>> when archive tables are created through auth.enable_record_versioning), 
>>>>> some of the archive database's tables still retain an association with 
>>>>> the 
>>>>> auth_user table's id field. However, the rows with the ids on which the 
>>>>> new 
>>>>> tables depend may not necessarily be transferred from the application's 
>>>>> primary database to the archive database. Is there a way to use the DAL 
>>>>> to 
>>>>> remove the Foreign Key constraint? Thanks.
>>>>>
>>>>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


diff --git a/gluon/dal.py b/gluon/dal.py
index d510711..f72b103 100644
--- a/gluon/dal.py
+++ b/gluon/dal.py
@@ -8307,7 +8307,7 @@ class Table(object):
         field_type = self if same_db else 'bigint'
         clones = []
         for field in self:
-            nfk = same_db or field.type.startswith('reference')
+            nfk = same_db or not field.type.startswith('reference')
             clones.append(field.clone(
                     unique=False, type=field.type if nfk else 'bigint'))
         archive_db.define_table(

Reply via email to