aboutsummaryrefslogtreecommitdiffstats
path: root/fix_database.sh
diff options
context:
space:
mode:
authorGuillaume Horel <guillaume.horel@gmail.com>2013-09-17 21:44:00 -0400
committerGuillaume Horel <guillaume.horel@gmail.com>2013-09-17 21:44:00 -0400
commitfdd2199d01c46416a9befb537d882d83836b6243 (patch)
tree932e273a61743edf1a94de57c9b3b872afe15e2c /fix_database.sh
parentd237f6a3d075f5731b56d15b12fc028fc035960d (diff)
downloadfamille-flask-fdd2199d01c46416a9befb537d882d83836b6243.tar.gz
Update schema of the database
since sqlite3 doesn't have support for alter besides renaming a table we use some sed fu to fix the dump
Diffstat (limited to 'fix_database.sh')
-rwxr-xr-xfix_database.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/fix_database.sh b/fix_database.sh
new file mode 100755
index 0000000..3427233
--- /dev/null
+++ b/fix_database.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+echo '.dump'|sqlite3 famille.db>famille.sql
+sed -i -e 's/string/text/' \
+ -e 's/address_line1/address\_line1 text/' \
+ -e 's/address_line2/address\_line2 text/' \
+ -e 's/address_city_line/address_city_line text/' famille.sql
+sqlite3 famille-fixed.db<famille.sql