1
0
Fork 0
This repository has been archived on 2024-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
TelegramEDT/update.sh

14 lines
445 B
Bash
Raw Normal View History

2019-12-25 21:33:52 +01:00
#!/bin/bash
if [ -f edt.db ]; then
if [ ! -d alembic ]; then
alembic init alembic
sed -i '/sqlalchemy.url/s/= .*/= sqlite:\/\/\/edt.db/' alembic.ini
sed -i "/target_metadata = None/s/target_metadata.*/import os, sys\nsys.path.append(os.getcwd())\nfrom base import Base\ntarget_metadata = Base.metadata/" alembic/env.py
fi
alembic revision --autogenerate -m "Auto upgrade"
alembic upgrade head
else
echo "No database !"
fi