From c668b74ed87dfdcefd8c06cf442988d7f9d27ede Mon Sep 17 00:00:00 2001 From: Silversthorn Date: Sun, 22 Aug 2021 10:00:39 +0000 Subject: [PATCH] Update DBCHANGES.md Corrections and Improvement for Create table exemple --- DBCHANGES.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/DBCHANGES.md b/DBCHANGES.md index adcad4ae..749ea3ea 100644 --- a/DBCHANGES.md +++ b/DBCHANGES.md @@ -39,18 +39,21 @@ import peewee def migrate(migrator, database, **kwargs): + db = database + #Copy Paste here the class of the New Table from models.py class NewTable(peewee.Model): my_id = peewee.IntegerField(unique=True, primary_key=True) class Meta: table_name = 'new_table' - database = database - create_table(NewTable) + database = db + + migrator.create_table(NewTable) def rollback(migrator, database, **kwargs): - drop_table('new_table') # Can be model class OR table name + migrator.drop_table('new_table') # Can be model class OR table name ```