[web2py] Re: Migrations

2018-11-20 Thread Dave S


On Tuesday, November 20, 2018 at 8:30:29 AM UTC-8, Ben Duncan wrote:
>
> Is it necessary to enable or even do migrations in the DAL (creating 
> database/ entries) if the database and the tables are already preexisting ? 
>
> Thanks ...
>
> *Ben Duncan*
> DBA / Chief Software Architect 
> Mississippi State Supreme Court
> Electronic Filing Division
>


Let's see if I get it right:

new table design: enable migrations
new field in existing design: enable migrations
new definition, backend has table:enable fake_migrations

/dps

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Migrations

2018-11-21 Thread Ben Duncan
I tried enable fake migrations (Backend has tables), nothing was created in
databases, but everything works as it should ..
*Ben Duncan*
DBA / Chief Software Architect
Mississippi State Supreme Court
Electronic Filing Division


On Tue, Nov 20, 2018 at 4:20 PM Dave S  wrote:

>
>
> On Tuesday, November 20, 2018 at 8:30:29 AM UTC-8, Ben Duncan wrote:
>>
>> Is it necessary to enable or even do migrations in the DAL (creating
>> database/ entries) if the database and the tables are already preexisting ?
>>
>> Thanks ...
>>
>> *Ben Duncan*
>> DBA / Chief Software Architect
>> Mississippi State Supreme Court
>> Electronic Filing Division
>>
>
>
> Let's see if I get it right:
>
> new table design: enable migrations
> new field in existing design: enable migrations
> new definition, backend has table:enable fake_migrations
>
> /dps
>
> --
> 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 web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Migrations

2018-11-21 Thread Ben Duncan
Ok, I turned migration on for tables, and it gave errors because of foreign
keyes.
Everything looks exactly like the docs spell out.

I'm not sure I see the reasoning for the stuff in directory 'database'.

I'm going ahead putting back migration=False on all the tables, since It
works that way and these
are external tables.

Anyone see any problems with that ?

Thanks ...

*Ben Duncan*
DBA / Chief Software Architect
Mississippi State Supreme Court
Electronic Filing Division


On Wed, Nov 21, 2018 at 6:57 AM Ben Duncan  wrote:

> I tried enable fake migrations (Backend has tables), nothing was created
> in databases, but everything works as it should ..
> *Ben Duncan*
> DBA / Chief Software Architect
> Mississippi State Supreme Court
> Electronic Filing Division
>
>
> On Tue, Nov 20, 2018 at 4:20 PM Dave S  wrote:
>
>>
>>
>> On Tuesday, November 20, 2018 at 8:30:29 AM UTC-8, Ben Duncan wrote:
>>>
>>> Is it necessary to enable or even do migrations in the DAL (creating
>>> database/ entries) if the database and the tables are already preexisting ?
>>>
>>> Thanks ...
>>>
>>> *Ben Duncan*
>>> DBA / Chief Software Architect
>>> Mississippi State Supreme Court
>>> Electronic Filing Division
>>>
>>
>>
>> Let's see if I get it right:
>>
>> new table design: enable migrations
>> new field in existing design: enable migrations
>> new definition, backend has table:enable fake_migrations
>>
>> /dps
>>
>> --
>> 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 web2py+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Migrations

2018-11-21 Thread Dave S


On Wednesday, November 21, 2018 at 5:32:29 AM UTC-8, Ben Duncan wrote:
>
> Ok, I turned migration on for tables, and it gave errors because of 
> foreign keyes. 
> Everything looks exactly like the docs spell out.
>
> I'm not sure I see the reasoning for the stuff in directory 'database'.
>

It's the DAL's representation of the schema, with hints on how to translate 
it for the flavor of DB backend in use (through a driver, like pgsql).  If 
the table changes (in models/mytables.py), the migrate steps update the 
database/*.table files and generate the appropriate SQL instructions to get 
the backend to match.  Fake migrate skips the generate, and is used when 
the changes already are in place on the backend.
 

>
> I'm going ahead putting back migration=False on all the tables, since It 
> works that way and these
> are external tables.
>
> Anyone see any problems with that ?
>
>
Productiion should normally have migration=False.  When it is needed, it 
only needs to be True for one access (barring errors).

 

> Thanks ...
>
> *Ben Duncan*
> DBA / Chief Software Architect 
> Mississippi State Supreme Court
> Electronic Filing Division
>
>

/dps
 

>
> On Wed, Nov 21, 2018 at 6:57 AM Ben Duncan  > wrote:
>
>> I tried enable fake migrations (Backend has tables), nothing was created 
>> in databases, but everything works as it should ..
>> *Ben Duncan*
>> DBA / Chief Software Architect 
>> Mississippi State Supreme Court
>> Electronic Filing Division
>>
>>
>> On Tue, Nov 20, 2018 at 4:20 PM Dave S > 
>> wrote:
>>
>>>
>>>
>>> On Tuesday, November 20, 2018 at 8:30:29 AM UTC-8, Ben Duncan wrote:

 Is it necessary to enable or even do migrations in the DAL (creating 
 database/ entries) if the database and the tables are already preexisting 
 ? 

 Thanks ...

 *Ben Duncan*
 DBA / Chief Software Architect 
 Mississippi State Supreme Court
 Electronic Filing Division

>>>
>>>
>>> Let's see if I get it right:
>>>
>>> new table design: enable migrations
>>> new field in existing design: enable migrations
>>> new definition, backend has table:enable fake_migrations
>>>
>>> /dps
>>>
>>> -- 
>>> 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 web2py+un...@googlegroups.com .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Migrations

2018-11-26 Thread Ben Duncan
Thanks Dave !!!

That makes sense.

I tried a few tables with "fake migration" (for grins and giggles) turned
on and the code that generates the database/ stuff choked and puked all over
the "foreign keys".

I went back and left it as is, with everything expected as a "external"
table, whcih is just as well, since I will have to dove tail this with
a e-filing systems at some point.

Thanks again ...

*Ben Duncan*
DBA / Chief Software Architect
Mississippi State Supreme Court
Electronic Filing Division


On Wed, Nov 21, 2018 at 3:35 PM Dave S  wrote:

>
>
> On Wednesday, November 21, 2018 at 5:32:29 AM UTC-8, Ben Duncan wrote:
>>
>> Ok, I turned migration on for tables, and it gave errors because of
>> foreign keyes.
>> Everything looks exactly like the docs spell out.
>>
>> I'm not sure I see the reasoning for the stuff in directory 'database'.
>>
>
> It's the DAL's representation of the schema, with hints on how to
> translate it for the flavor of DB backend in use (through a driver, like
> pgsql).  If the table changes (in models/mytables.py), the migrate steps
> update the database/*.table files and generate the appropriate SQL
> instructions to get the backend to match.  Fake migrate skips the generate,
> and is used when the changes already are in place on the backend.
>
>
>>
>> I'm going ahead putting back migration=False on all the tables, since It
>> works that way and these
>> are external tables.
>>
>> Anyone see any problems with that ?
>>
>>
> Productiion should normally have migration=False.  When it is needed, it
> only needs to be True for one access (barring errors).
>
>
>
>> Thanks ...
>>
>> *Ben Duncan*
>> DBA / Chief Software Architect
>> Mississippi State Supreme Court
>> Electronic Filing Division
>>
>>
>
> /dps
>
>
>>
>> On Wed, Nov 21, 2018 at 6:57 AM Ben Duncan  wrote:
>>
>>> I tried enable fake migrations (Backend has tables), nothing was created
>>> in databases, but everything works as it should ..
>>> *Ben Duncan*
>>> DBA / Chief Software Architect
>>> Mississippi State Supreme Court
>>> Electronic Filing Division
>>>
>>>
>>> On Tue, Nov 20, 2018 at 4:20 PM Dave S  wrote:
>>>


 On Tuesday, November 20, 2018 at 8:30:29 AM UTC-8, Ben Duncan wrote:
>
> Is it necessary to enable or even do migrations in the DAL (creating
> database/ entries) if the database and the tables are already preexisting 
> ?
>
> Thanks ...
>
> *Ben Duncan*
> DBA / Chief Software Architect
> Mississippi State Supreme Court
> Electronic Filing Division
>


 Let's see if I get it right:

 new table design: enable migrations
 new field in existing design: enable migrations
 new definition, backend has table:enable fake_migrations

 /dps

 --
 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 web2py+un...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.

>>> --
> 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 web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Migrations

2018-11-27 Thread Dave S


On Monday, November 26, 2018 at 4:42:10 AM UTC-8, Ben Duncan wrote:
>
> Thanks Dave !!!
>
> That makes sense.
>
> I tried a few tables with "fake migration" (for grins and giggles) turned 
> on and the code that generates the database/ stuff choked and puked all over
> the "foreign keys". 
>

It might be of interest (says the firmware geek with 1 semester DB creds) 
to have a minimal example that illustrates the problem, but of course that 
would have to fit within the project schedule, as well.
 

>
> I went back and left it as is, with everything expected as a "external" 
> table, whcih is just as well, since I will have to dove tail this with
> a e-filing systems at some point.
>
> Thanks again ...
>
> *Ben Duncan*
> DBA / Chief Software Architect 
> Mississippi State Supreme Court
> Electronic Filing Division
>

Happy to help ... this group has been good to me, and sometimes I can pay 
it forward.

/dps
 

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Migrations

2018-11-27 Thread Ben Duncan
LOL - Understand, can throw down C with the Best of them, write
applications (myriad of programming languages)  and setup Databases and
design them in  my sleep,
but this is my first in a career that spans over 30 years, of having to do
some SERIOUS web programming.

Beginning to feel like a Newbie ..

*Ben Duncan*
DBA / Chief Software Architect
Mississippi State Supreme Court
Electronic Filing Division


On Tue, Nov 27, 2018 at 1:02 PM Dave S  wrote:

>
>
> On Monday, November 26, 2018 at 4:42:10 AM UTC-8, Ben Duncan wrote:
>>
>> Thanks Dave !!!
>>
>> That makes sense.
>>
>> I tried a few tables with "fake migration" (for grins and giggles) turned
>> on and the code that generates the database/ stuff choked and puked all over
>> the "foreign keys".
>>
>
> It might be of interest (says the firmware geek with 1 semester DB creds)
> to have a minimal example that illustrates the problem, but of course that
> would have to fit within the project schedule, as well.
>
>
>>
>> I went back and left it as is, with everything expected as a "external"
>> table, whcih is just as well, since I will have to dove tail this with
>> a e-filing systems at some point.
>>
>> Thanks again ...
>>
>> *Ben Duncan*
>> DBA / Chief Software Architect
>> Mississippi State Supreme Court
>> Electronic Filing Division
>>
>
> Happy to help ... this group has been good to me, and sometimes I can pay
> it forward.
>
> /dps
>
>
> --
> 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 web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Migrations

2018-12-07 Thread Massimo Di Pierro
Welcome to the team!

On Tuesday, 27 November 2018 13:28:51 UTC-8, Ben Duncan wrote:
>
> LOL - Understand, can throw down C with the Best of them, write 
> applications (myriad of programming languages)  and setup Databases and 
> design them in  my sleep,
> but this is my first in a career that spans over 30 years, of having to do 
> some SERIOUS web programming.  
>
> Beginning to feel like a Newbie ..
>
> *Ben Duncan*
> DBA / Chief Software Architect 
> Mississippi State Supreme Court
> Electronic Filing Division
>
>
> On Tue, Nov 27, 2018 at 1:02 PM Dave S  wrote:
>
>>
>>
>> On Monday, November 26, 2018 at 4:42:10 AM UTC-8, Ben Duncan wrote:
>>>
>>> Thanks Dave !!!
>>>
>>> That makes sense.
>>>
>>> I tried a few tables with "fake migration" (for grins and giggles) 
>>> turned on and the code that generates the database/ stuff choked and puked 
>>> all over
>>> the "foreign keys". 
>>>
>>
>> It might be of interest (says the firmware geek with 1 semester DB creds) 
>> to have a minimal example that illustrates the problem, but of course that 
>> would have to fit within the project schedule, as well.
>>  
>>
>>>
>>> I went back and left it as is, with everything expected as a "external" 
>>> table, whcih is just as well, since I will have to dove tail this with
>>> a e-filing systems at some point.
>>>
>>> Thanks again ...
>>>
>>> *Ben Duncan*
>>> DBA / Chief Software Architect 
>>> Mississippi State Supreme Court
>>> Electronic Filing Division
>>>
>>
>> Happy to help ... this group has been good to me, and sometimes I can pay 
>> it forward.
>>
>> /dps
>>  
>>
>> -- 
>> 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 web2py+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Migrations questions (help!)

2010-11-18 Thread VP
Unless you have migration set to False, these things should be
automatic.



On Nov 18, 1:53 pm, Lorin Rivers  wrote:
> My database is PostgreSQL
>
> I have tables defined in my ../models/db.py
>
> Now I want to add some fields to one of the tables defined there. The table 
> has data in it already.
>
> I tried modifying the original table definition but that didn't actually 
> change the table's structure.
>
> Where should I make these changes? I have a model (rounding.py) that creates 
> a new table in the database defined in db.py. That worked after some 
> finagling (I think I had to drop the table and have the model recreate it, 
> but it didn't have data yet).
>
> So what is the best method for making incremental changes to databases?
>
> I'm stuck and need some help.
>
> --
> Lorin Rivers
> Mosasaur: Killer Technical Marketing 
> 
> 512/203.3198 (m)


[web2py] Re: Migrations questions (help!)

2010-11-18 Thread mdipierro
As a rails user, would you share your experience with web2py so far?
What you like, what you do not, what you think rails is better at?
We'll defend ourselves but not take any offense. This can help us
improve.

Massimo

On Nov 18, 2:47 pm, Lorin Rivers  wrote:
> They are not set to false.
>
> I'm coming from a slight rails perspective (some experience with it). In 
> rails, migrations are sequential. If you want to add a field to a table, you 
> create a new migration that only does that.
>
> Regarding my question, then, do most people just edit the model (i.e., add a 
> field, change a field's type, and so on)?
>
> On Nov 18, 2010, at 14:29 , VP wrote:
>
>
>
> > Unless you have migration set to False, these things should be
> > automatic.
>
> > On Nov 18, 1:53 pm, Lorin Rivers  wrote:
> >> My database is PostgreSQL
>
> >> I have tables defined in my ../models/db.py
>
> >> Now I want to add some fields to one of the tables defined there. The 
> >> table has data in it already.
>
> >> I tried modifying the original table definition but that didn't actually 
> >> change the table's structure.
>
> >> Where should I make these changes? I have a model (rounding.py) that 
> >> creates a new table in the database defined in db.py. That worked after 
> >> some finagling (I think I had to drop the table and have the model 
> >> recreate it, but it didn't have data yet).
>
> >> So what is the best method for making incremental changes to databases?
>
> >> I'm stuck and need some help.
>
> >> --
> >> Lorin Rivers
> >> Mosasaur: Killer Technical Marketing 
> >> 
> >> 512/203.3198 (m)
>
> --
> Lorin Rivers
> Mosasaur: Killer Technical Marketing 
> 
> 512/203.3198 (m)


[web2py] Re: Migrations questions (help!)

2010-11-18 Thread mdipierro

> I find the migrations to not work that well and fail silently.

there is one catch with migrations. If you use sqlite, you cannot
change the type of field because sqlite will accept but will not
actually change the column type. It is because sqlite has limited
ALTER TABLE support.

Massimo

>
> Overall, I'm loving web2py and growing to appreciate Python.
>
> On Nov 18, 2010, at 15:12 , mdipierro wrote:
>
>
>
> > As a rails user, would you share your experience with web2py so far?
> > What you like, what you do not, what you think rails is better at?
> > We'll defend ourselves but not take any offense. This can help us
> > improve.
>
> > Massimo
>
> > On Nov 18, 2:47 pm, Lorin Rivers  wrote:
> >> They are not set to false.
>
> >> I'm coming from a slight rails perspective (some experience with it). In 
> >> rails, migrations are sequential. If you want to add a field to a table, 
> >> you create a new migration that only does that.
>
> >> Regarding my question, then, do most people just edit the model (i.e., add 
> >> a field, change a field's type, and so on)?
>
> >> On Nov 18, 2010, at 14:29 , VP wrote:
>
> >>> Unless you have migration set to False, these things should be
> >>> automatic.
>
> >>> On Nov 18, 1:53 pm, Lorin Rivers  wrote:
>  My database is PostgreSQL
>
>  I have tables defined in my ../models/db.py
>
>  Now I want to add some fields to one of the tables defined there. The 
>  table has data in it already.
>
>  I tried modifying the original table definition but that didn't actually 
>  change the table's structure.
>
>  Where should I make these changes? I have a model (rounding.py) that 
>  creates a new table in the database defined in db.py. That worked after 
>  some finagling (I think I had to drop the table and have the model 
>  recreate it, but it didn't have data yet).
>
>  So what is the best method for making incremental changes to databases?
>
>  I'm stuck and need some help.
>
>  --
>  Lorin Rivers
>  Mosasaur: Killer Technical Marketing 
>  
>  512/203.3198 (m)
>
> >> --
> >> Lorin Rivers
> >> Mosasaur: Killer Technical Marketing 
> >> 
> >> 512/203.3198 (m)
>
> --
> Lorin Rivers
> Mosasaur: Killer Technical Marketing 
> 
> 512/203.3198 (m)


Re: [web2py] Re: Migrations questions (help!)

2010-11-18 Thread Lorin Rivers
They are not set to false.

I'm coming from a slight rails perspective (some experience with it). In rails, 
migrations are sequential. If you want to add a field to a table, you create a 
new migration that only does that.

Regarding my question, then, do most people just edit the model (i.e., add a 
field, change a field's type, and so on)?

On Nov 18, 2010, at 14:29 , VP wrote:

> Unless you have migration set to False, these things should be
> automatic.
> 
> 
> 
> On Nov 18, 1:53 pm, Lorin Rivers  wrote:
>> My database is PostgreSQL
>> 
>> I have tables defined in my ../models/db.py
>> 
>> Now I want to add some fields to one of the tables defined there. The table 
>> has data in it already.
>> 
>> I tried modifying the original table definition but that didn't actually 
>> change the table's structure.
>> 
>> Where should I make these changes? I have a model (rounding.py) that creates 
>> a new table in the database defined in db.py. That worked after some 
>> finagling (I think I had to drop the table and have the model recreate it, 
>> but it didn't have data yet).
>> 
>> So what is the best method for making incremental changes to databases?
>> 
>> I'm stuck and need some help.
>> 
>> --
>> Lorin Rivers
>> Mosasaur: Killer Technical Marketing 
>> 
>> 512/203.3198 (m)

-- 
Lorin Rivers
Mosasaur: Killer Technical Marketing 

512/203.3198 (m)




Re: [web2py] Re: Migrations questions (help!)

2010-11-18 Thread Kenneth Lundström
Correct, you edit the db.py file and reload a page and the database is 
updated.



Kenneth


They are not set to false.

I'm coming from a slight rails perspective (some experience with it). In rails, 
migrations are sequential. If you want to add a field to a table, you create a 
new migration that only does that.

Regarding my question, then, do most people just edit the model (i.e., add a 
field, change a field's type, and so on)?

On Nov 18, 2010, at 14:29 , VP wrote:


Unless you have migration set to False, these things should be
automatic.



On Nov 18, 1:53 pm, Lorin Rivers  wrote:

My database is PostgreSQL

I have tables defined in my ../models/db.py

Now I want to add some fields to one of the tables defined there. The table has 
data in it already.

I tried modifying the original table definition but that didn't actually change 
the table's structure.

Where should I make these changes? I have a model (rounding.py) that creates a 
new table in the database defined in db.py. That worked after some finagling (I 
think I had to drop the table and have the model recreate it, but it didn't 
have data yet).

So what is the best method for making incremental changes to databases?

I'm stuck and need some help.

--
Lorin Rivers
Mosasaur: Killer Technical Marketing

512/203.3198 (m)




Re: [web2py] Re: Migrations questions (help!)

2010-11-18 Thread Lorin Rivers
I self-taught hacker (I would never describe myself as a programmer), I found 
rails to be less clear, it seem to be unnecessarily terse. I hate how ruby 
loops, I can never remember the syntax.

I find that DHH's personality flavors the framework (in a bad way) as your 
personality flavors web2py in a positive way.

It's hard to get used to blocks defined by indentation.

I wish there were more examples of simple things like the one I mentioned 
previously.

I find the migrations to not work that well and fail silently.

Overall, I'm loving web2py and growing to appreciate Python.


On Nov 18, 2010, at 15:12 , mdipierro wrote:

> As a rails user, would you share your experience with web2py so far?
> What you like, what you do not, what you think rails is better at?
> We'll defend ourselves but not take any offense. This can help us
> improve.
> 
> Massimo
> 
> On Nov 18, 2:47 pm, Lorin Rivers  wrote:
>> They are not set to false.
>> 
>> I'm coming from a slight rails perspective (some experience with it). In 
>> rails, migrations are sequential. If you want to add a field to a table, you 
>> create a new migration that only does that.
>> 
>> Regarding my question, then, do most people just edit the model (i.e., add a 
>> field, change a field's type, and so on)?
>> 
>> On Nov 18, 2010, at 14:29 , VP wrote:
>> 
>> 
>> 
>>> Unless you have migration set to False, these things should be
>>> automatic.
>> 
>>> On Nov 18, 1:53 pm, Lorin Rivers  wrote:
 My database is PostgreSQL
>> 
 I have tables defined in my ../models/db.py
>> 
 Now I want to add some fields to one of the tables defined there. The 
 table has data in it already.
>> 
 I tried modifying the original table definition but that didn't actually 
 change the table's structure.
>> 
 Where should I make these changes? I have a model (rounding.py) that 
 creates a new table in the database defined in db.py. That worked after 
 some finagling (I think I had to drop the table and have the model 
 recreate it, but it didn't have data yet).
>> 
 So what is the best method for making incremental changes to databases?
>> 
 I'm stuck and need some help.
>> 
 --
 Lorin Rivers
 Mosasaur: Killer Technical Marketing 
 
 512/203.3198 (m)
>> 
>> --
>> Lorin Rivers
>> Mosasaur: Killer Technical Marketing 
>> 
>> 512/203.3198 (m)

-- 
Lorin Rivers
Mosasaur: Killer Technical Marketing 

512/203.3198 (m)




Re: [web2py] Re: Migrations questions (help!)

2010-11-19 Thread Branko Vukelic
On Thu, Nov 18, 2010 at 10:58 PM, mdipierro  wrote:
>
>> I find the migrations to not work that well and fail silently.
>
> there is one catch with migrations. If you use sqlite, you cannot
> change the type of field because sqlite will accept but will not
> actually change the column type. It is because sqlite has limited
> ALTER TABLE support.

The 'correct' way to do this would be to copy the table to a temp
table, drop the original table, define a new one, and then copy data
back. Needless to say, this is far from fool-proof solution. I've been
burned once with migration hell that SQLite creates.

Namely, if you try to preserve the PK column (i.e., copy the PK column
to temp table and restore it later), it tends to stop autoincrementing
the PK column once you start adding new records into the new table
(I'm still not very clear on how exactly this works).


-- 
Branko Vukelić

bg.bra...@gmail.com
stu...@brankovukelic.com

Check out my blog: http://www.brankovukelic.com/
Check out my portfolio: http://www.flickr.com/photos/foxbunny/
Registered Linux user #438078 (http://counter.li.org/)
I hang out on identi.ca: http://identi.ca/foxbunny

Gimp Brushmakers Guild
http://bit.ly/gbg-group


[web2py] Re: Migrations for altering data?

2011-04-15 Thread Massimo Di Pierro
I do not feel the necessity.

What I do is simply version control the files (specifically models).
Any change (whether in the future or reverting to a past version)
result in an automatic migration.

massimo


On Apr 15, 5:58 pm, pbreit  wrote:
> It's not possible to create a migration manually to alter database data, is
> it? Has this capability been discussed? Do people generally just create a
> controller or something?
>
> I was thinking like South and 
> Rails:http://south.aeracode.org/docs/index.htmlhttp://guides.rubyonrails.org/migrations.html


[web2py] Re: Migrations Problem: two fields added, two not added

2011-04-08 Thread Massimo Di Pierro
1) get trunk
2) comment the missing fields
3) run with DAL(...,fake_migrate_all=True)
4) visit appadmin
5) uncomment the missing fields
6) remove fake_migrate_all=True from DAL(...)
7) visit appadmin

did it fix it?



On Apr 8, 2:21 pm, Lennon  wrote:
> I added the follow fields to my table:
>
> Field('rooming_requests','string', length=500, label='Do you have any
> rooming requests?', widget=SQLFORM.widgets.text.widget,
> requires=[IS_LENGTH(500)]),
>
> Field('misc_info','string', length=500, label='Anything else you would
> like us to know?', widget=SQLFORM.widgets.text.widget,
> requires=[IS_LENGTH(500)]),
>
> Field('us_citizen','boolean', label='Are you a US citizen?',
> requires=IS_IN_SET(['T', 'F'],zero='Choose One')),
>
> Field('dietary_restrict','string', length=500, label='Do you have any
> dietary restrictions?', widget=SQLFORM.widgets.text.widget,
> requires=[IS_LENGTH(500)]),
>
> When I did a migrate, the "rooming_requests" field and the "misc_info"
> fields were added to the table file and to the MySQL database but the
> "us_citizen" field and the "dietary_restrict" field was not.
>
> Subsequent migration attempts have had no effect.
>
> Please advise,
>
> ~Lennon


[web2py] Re: Migrations Problem: two fields added, two not added

2011-04-08 Thread Lennon
Editing DAL() like that gets me this error:

Traceback (most recent call last):
  File "C:\Users\Lennon\workspace\web2py_source\gluon\restricted.py",
line 188, in restricted
exec ccode in environment
  File "C:/Users/Lennon/workspace/web2py_source/applications/sos_test/
models/a_db.py", line 55, in 
db = DAL([Removed for Security],fake_migrate_all=True)
TypeError: __init__() got an unexpected keyword argument
'fake_migrate_all'

On Apr 8, 4:04 pm, Massimo Di Pierro 
wrote:
> 1) get trunk
> 2) comment the missing fields
> 3) run with DAL(...,fake_migrate_all=True)
> 4) visit appadmin
> 5) uncomment the missing fields
> 6) remove fake_migrate_all=True from DAL(...)
> 7) visit appadmin
>
> did it fix it?
>
> On Apr 8, 2:21 pm, Lennon  wrote:
>
>
>
>
>
>
>
> > I added the follow fields to my table:
>
> > Field('rooming_requests','string', length=500, label='Do you have any
> > rooming requests?', widget=SQLFORM.widgets.text.widget,
> > requires=[IS_LENGTH(500)]),
>
> > Field('misc_info','string', length=500, label='Anything else you would
> > like us to know?', widget=SQLFORM.widgets.text.widget,
> > requires=[IS_LENGTH(500)]),
>
> > Field('us_citizen','boolean', label='Are you a US citizen?',
> > requires=IS_IN_SET(['T', 'F'],zero='Choose One')),
>
> > Field('dietary_restrict','string', length=500, label='Do you have any
> > dietary restrictions?', widget=SQLFORM.widgets.text.widget,
> > requires=[IS_LENGTH(500)]),
>
> > When I did a migrate, the "rooming_requests" field and the "misc_info"
> > fields were added to the table file and to the MySQL database but the
> > "us_citizen" field and the "dietary_restrict" field was not.
>
> > Subsequent migration attempts have had no effect.
>
> > Please advise,
>
> > ~Lennon


[web2py] Re: migrations using standalone dal.py for a separate python project

2010-08-15 Thread mdipierro
Please use sql.py not dal.py. The latter is an experimental rewrite.
Make sure the DAL(,folder=...) is specified and point to the
location where migration files are (.table)

On 16 Ago, 03:11, Bruno Rocha  wrote:
> I am using DAL for a python Tcl/Tk project
>
> I made a copy of "gluon" folder and I am trying DAL from command shell as:>>> 
> from dal import *
>
> now I have DAL and Field and everything works very well, but not the
> Migrations.
>
> >>>db.define_table('person')
>
> ok I have a person table just with the 
> id>>>db.define_table('person',Field('nome'))
>
> error in sql.py
> invalid table name: person
>
> How can I get Migration working for DAL outside w2p framework?
>
> Tks


Re: [web2py] Re: Migrations Problem: two fields added, two not added

2013-05-09 Thread Manuele Pesenti
Hi!
I got quite the same problem with postgresql. I tried to add a field to
an already defined table but I fot this error:

ProgrammingError: ERRORE:  la colonna
plugin_lookout_fields.table_meta_data non esiste
LINE 1: ...s.field_comment, plugin_lookout_fields.is_active, plugin_loo...

(it says that column plugin_lookout_fields.table_meta_data do not exists
which is the one I've added)

the solution hereunder suggested did not solved... is there a way to
solve this problem?

Thank you very mutch

cheers

Manuele

Il 08/04/11 22:04, Massimo Di Pierro ha scritto:
> 1) get trunk
> 2) comment the missing fields
> 3) run with DAL(...,fake_migrate_all=True)
> 4) visit appadmin
> 5) uncomment the missing fields
> 6) remove fake_migrate_all=True from DAL(...)
> 7) visit appadmin
>
> did it fix it?
>
>
>
> On Apr 8, 2:21 pm, Lennon  wrote:
>> I added the follow fields to my table:
>>
>> Field('rooming_requests','string', length=500, label='Do you have any
>> rooming requests?', widget=SQLFORM.widgets.text.widget,
>> requires=[IS_LENGTH(500)]),
>>
>> Field('misc_info','string', length=500, label='Anything else you would
>> like us to know?', widget=SQLFORM.widgets.text.widget,
>> requires=[IS_LENGTH(500)]),
>>
>> Field('us_citizen','boolean', label='Are you a US citizen?',
>> requires=IS_IN_SET(['T', 'F'],zero='Choose One')),
>>
>> Field('dietary_restrict','string', length=500, label='Do you have any
>> dietary restrictions?', widget=SQLFORM.widgets.text.widget,
>> requires=[IS_LENGTH(500)]),
>>
>> When I did a migrate, the "rooming_requests" field and the "misc_info"
>> fields were added to the table file and to the MySQL database but the
>> "us_citizen" field and the "dietary_restrict" field was not.
>>
>> Subsequent migration attempts have had no effect.
>>
>> Please advise,
>>
>> ~Lennon

-- 

--- 
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.