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

13 lines
452 B
Bash
Executable file

#!/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 TelegramEDT import Base\ntarget_metadata = Base.metadata/" alembic/env.py
fi
alembic revision --autogenerate -m "Auto upgrade"
alembic upgrade head
else
echo "No database !"
fi