[PonyORM-list] Changing schema during development?

Alexander Kozlovsky alexander.kozlovsky at gmail.com
Mon Oct 2 21:45:34 UTC 2017


Hi Tobiah!

Soon we will release a migration tool which should help with updating the
database schema.

Until this, during the early stage of development you can drop all tables
and re-create them:

    # update_db.py

    from models import db
    from settings import db_params
    from initial_data import populate_database

    db.bind(**db_params)
    db.generate_mapping(check_tables=False)
    db.drop_all_tables(with_all_data=True)
    db.create_tables()
    populate_database()


Best regards,
Alexander Kozlovsky


On Tue, Oct 3, 2017 at 12:05 AM, Tobiah <toby at tobiah.org> wrote:

> I'm new to ORMs in general.  I used the online tool to
> create a set of entities and used the resulting python
> class set in a python program to automatically generate
> a mysql database.
>
> Now I've decided that I want to change one of my 'int' types to
> a 'str'.  I did this in the corresponding class and re-ran
> the program, but my database field type was not updated.
> How does one normally handle a changing schema during
> development?  Do you have to puff the database and rebuild
> every time there is a change?
>
> Also, does anyone ever somehow generate the Pony classes at
> runtime based on introspection of the database?
>
>
> Thanks,
>
>
> Tobiah
> _______________________________________________
> ponyorm-list mailing list
> ponyorm-list at ponyorm.com
> /ponyorm-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </ponyorm-list/attachments/20171003/f72e1e1f/attachment.html>


More information about the ponyorm-list mailing list