This commit is contained in:
Executable
+10
@@ -0,0 +1,10 @@
|
||||
import os
|
||||
import psycopg
|
||||
from pathlib import Path
|
||||
|
||||
url = os.getenv("DATABASE_URL", "postgresql://messenger:messenger@postgres:5432/messenger")
|
||||
with psycopg.connect(url) as conn:
|
||||
for path in sorted(Path("migrations").glob("*.sql")):
|
||||
conn.execute(path.read_text())
|
||||
conn.commit()
|
||||
print("migrations applied")
|
||||
Reference in New Issue
Block a user