Clear existing data and create new tables.
()
| 31 | |
| 32 | |
| 33 | def init_db(): |
| 34 | """Clear existing data and create new tables.""" |
| 35 | db = get_db() |
| 36 | |
| 37 | with current_app.open_resource("schema.sql") as f: |
| 38 | db.executescript(f.read().decode("utf8")) |
| 39 | |
| 40 | |
| 41 | @click.command("init-db") |