27 lines
577 B
Bash
Executable File
27 lines
577 B
Bash
Executable File
#!/bin/bash
|
|
if [ $# -eq 0 ]
|
|
then
|
|
echo "No Arguments supplied"
|
|
exit
|
|
fi
|
|
|
|
echo "creating a new migration"
|
|
./migration.py compare_model_to_db storage.metadata
|
|
|
|
echo "Dump current database state to file"
|
|
./migration.py create_model > oldmodel.py
|
|
|
|
ls db_repository/versions
|
|
echo "Choose a filename for the new migration"
|
|
read filename
|
|
|
|
./migration.py make_update_script_for_model --oldmodel=oldmodel:meta --model=storage:metadata > db_repository/versions/$filename.py
|
|
|
|
cp test.sqlite test.sqlite.bak
|
|
./migration.py test
|
|
rm test.sqlite
|
|
mv test.sqlite.bak test.sqlite
|
|
|
|
|
|
|
|
rm oldmodel.py |