Note, it is not necessary to bother with migrate=False if you are setting
migrate_enabled=False -- the latter will prevent all migrations (the former
is simply used to set the default value of the "migrate" argument for each
.define_table in case it is not explicitly set, but that is ignored when
migrate_enabled=False). There should be no need for fake_migrate if there
are no plans to do any migrations at all.
Anthony
On Thursday, January 9, 2014 8:35:48 AM UTC-5, Paolo Valleri wrote:
>
> Then set the three variables Michele mentioned to false directly, it is
> not necessary to create any metadata,
> the following code snippet print the station name from a remote database
> (vpn address), the powerful thing is that the table station has several
> fields but I defined only once :)
>
> db = DAL('postgres://web2py:[email protected]:5432/postgis',
> migrate=False,
> migrate_enabled=False,
> lazy_tables=True,
> pool_size=3
> )
>
> db.define_table('station',
> Field('name')
> )
>
> print db(db.station).select()
>
>
> Paolo
>
>
> 2014/1/9 Tushar Tuteja <[email protected] <javascript:>>
>
>> No,
>> I don't want to alter the 5 tables schema.
>> But I want to perform CRUD operations.
>> And it would be great if somehow I can restrict web2py from altering
>> table schemas all together as a J2EE application is running on the same the
>> DB and DB is a remote DB.
>> thanks,
>> Tushar Tuteja
>>
>>
>> On 9 January 2014 18:45, Paolo Valleri <[email protected] <javascript:>
>> > wrote:
>>
>>> Mind that DAL should be instantiated with fake_migrate_all;
>>> run your app once, then you can set it to false. This operation will
>>> create several files (one for each defined table) in the app/databases/
>>> directory
>>>
>>> moreover, do you need to alter the 5 tables you mentioned?
>>>
>>> Paolo
>>>
>>>
>>> On Thursday, January 9, 2014 12:59:18 PM UTC+1, Michele Comitini wrote:
>>>
>>>> Instantiate the DAL with fake_migrate=True,
>>>> migrate=False,migrate_enable=False
>>>> Define the tables with only the fields you are going to need in a model
>>>> file.
>>>> This is going to create the metadata needed by web2py without touching
>>>> your legacy database schema.
>>>>
>>>>
>>>>
>>>>
>>>> 2014/1/9 Tushar Tuteja <[email protected]>
>>>>
>>>>> I have a J2EE application and a database which has 200 tables in it.
>>>>> I want to develop a new application using web2py, which would use only
>>>>> 5 tables.
>>>>> I want to know how should I go about it. As I am not clear about how I
>>>>> would use database without mapping all the 200 tables which is a huge
>>>>> task.
>>>>> and I don't want web2py to make any changes on the database tables and
>>>>> their schema.
>>>>> only crud operations on the records of the 5 tables.
>>>>>
>>>>> Thanks,
>>>>> Regards,
>>>>> Tushar Tuteja
>>>>>
>>>>> --
>>>>> Resources:
>>>>> - http://web2py.com
>>>>> - http://web2py.com/book (Documentation)
>>>>> - http://github.com/web2py/web2py (Source code)
>>>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>>>> ---
>>>>> 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 [email protected].
>>>>>
>>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>>
>>>>
>>>> --
>>> Resources:
>>> - http://web2py.com
>>> - http://web2py.com/book (Documentation)
>>> - http://github.com/web2py/web2py (Source code)
>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>> ---
>>> You received this message because you are subscribed to a topic in the
>>> Google Groups "web2py-users" group.
>>> To unsubscribe from this topic, visit
>>> https://groups.google.com/d/topic/web2py/BPabc0lulcw/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to
>>> [email protected] <javascript:>.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>
>>
>>
>> --
>> Tushar Tuteja
>> Undergraduate Student(Fourth Year)
>> Civil Engineering
>> IIT Delhi
>> +919953061943
>> [email protected] <javascript:>
>> [email protected] <javascript:>
>> "The question isn't who is going to let me; its who is going to stop me!"
>> - Howard Roark
>>
>> --
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> ---
>> You received this message because you are subscribed to a topic in the
>> Google Groups "web2py-users" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/web2py/BPabc0lulcw/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.