21 lines
486 B
Python
21 lines
486 B
Python
import sqlite3 as sql
|
|
from pathlib import Path
|
|
|
|
from src.database import Database
|
|
|
|
p = Path("devtests_test_migrations.db")
|
|
if p.exists():
|
|
p.unlink()
|
|
|
|
print("Creating Database at", p)
|
|
db = Database(db_path=p)
|
|
|
|
conn = sql.connect(p)
|
|
c = conn.cursor()
|
|
c.execute("SELECT name FROM sqlite_master WHERE type='table'")
|
|
print("Tables:", sorted([r[0] for r in c.fetchall()]))
|
|
|
|
c.execute("SELECT id, applied_at FROM schema_migrations")
|
|
print("Migrations applied:", c.fetchall())
|
|
conn.close()
|