I've recently wrote a Medium article about migrating the default Sqlite schema to a Mysql or Postgres sever database and I thought I share a code snippet here for others to check!
from peewee import MySQLDatabase, SqliteDatabase
from playhouse.reflection import Introspector
sqlite_db = SqliteDatabase("prodigy.db")
introspector = Introspector.from_database(sqlite_db)
models = introspector.generate_models()
mysql_db = MySQLDatabase(
user="user name",
password="user password",
host="host name",
port=3306,
database="database name",
)
mysql_db.create_tables(list(models.values()))
mysql_db.close()
Happy prodigy coding!