klen / peewee_migrate

Simple migration engine for Peewee
MIT License
358 stars 86 forks source link

What about the DB creation? #35

Open paulocheque opened 7 years ago

paulocheque commented 7 years ago

If we use Peewee without peewee_migrate, we would just execute this: db.create_tables([Model1, Model2])

So, if we use peewee_migrate, we should avoid this command and only use peewee_migrate, right?

Also, does Peewee_Migrate use Peewee (http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#migrate) for migrations, right? Any doc about how to create the migration files?

Thanks

Thorbijoern commented 6 years ago

So, if we use peewee_migrate, we should avoid this command and only use peewee_migrate, right?

basically yes... but it's not completely needed on the first create of the database, for future migrations you should stick to peewee-migrate.

Also, does Peewee_Migrate use Peewee [...] for migrations, right?

yes, peewee-migrate uses the migration features of peewee playhouse.

Any doc about how to create the migration files?

could you atleast read the readme.md? you can create a blank migration file with pw_migrate create. the available functions are listed in the blank migration file and work pretty much like the migrate functions of playhouse.