A multipurpose python flask API server and administration SPA
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
344 B

  1. """Database configuration and methods."""
  2. from flask_migrate import upgrade
  3. from flask_sqlalchemy import SQLAlchemy
  4. from sqlalchemy.ext.declarative import DeclarativeMeta
  5. db: SQLAlchemy = SQLAlchemy()
  6. db_model: DeclarativeMeta = db.Model
  7. def init_db() -> None:
  8. """Clear existing data and create new tables."""
  9. upgrade('migrations')