On Saturday, October 8, 2016 at 10:52:53 AM UTC-4, Val K wrote:
>
> Thank you, Anthony!
> But I think, that this fact ( web2py does not migrate changes in
> attributes) makes web2py unsuitable for db-schema development, i.e. I have
> to consider all the details and write holy code at once.
>
I wouldn't say it is unsuitable -- it can handle schema creation and most
aspects of schema migration. For anything else, you can always use an
external tool. Keep in mind, when changing things like "default",
"notnull", and "unique", there are some additional decisions to make (i.e.,
what to do with existing data), so that cannot be handled by a simple table
definition and would instead require an additional interface for specifying
data transformations. Perhaps that kind of functionality could be added in
the future.
The situation gets worse by the fact that migrate is only half-migrate
> without any warnings - it may be better to have a log-file with something
> like "table ... was migrated, but attributes ...... were not changed "
>
There is a call-out in the book in the Migrations section, but sure, maybe
a warning in the sql.log file or elsewhere.
> It would be nice to have something like DAL-construction-mode, when
> changing tables definition causes dropping all tables (except auth_* )
> and recreating from scratch
>
# DAL-construction-mode
[db[table].drop() for table in db.tables if not table.startswith('auth_')]
Anthony
--
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/d/optout.