summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql')
-rw-r--r--sql/INSTALL4
-rwxr-xr-xsql/create_db.sh1
-rwxr-xr-xsql/upgrade_from_1.0_to_1.1.sh26
3 files changed, 31 insertions, 0 deletions
diff --git a/sql/INSTALL b/sql/INSTALL
index 340d656..624a1c8 100644
--- a/sql/INSTALL
+++ b/sql/INSTALL
@@ -1,2 +1,6 @@
Run the ./create_db.sh shell script to create the database. You will have to
enter the MySQL root user password when prompted.
+
+If you are upgrading from a previous version run the appropriate upgrade script:
+
+upgrade_from_1.0_to_1.1.sh - Upgrade from V1.0 to V1.1
diff --git a/sql/create_db.sh b/sql/create_db.sh
index 69639db..9d55d63 100755
--- a/sql/create_db.sh
+++ b/sql/create_db.sh
@@ -52,6 +52,7 @@ grant all on *.* to '$uname'@'localhost' identified by '$pword';
create table pm_store
(
id int not null auto_increment,
+ display int not null,
description varchar(1024) not null,
groupname varchar(512) not null,
username varchar(512) not null,
diff --git a/sql/upgrade_from_1.0_to_1.1.sh b/sql/upgrade_from_1.0_to_1.1.sh
new file mode 100755
index 0000000..78c1468
--- /dev/null
+++ b/sql/upgrade_from_1.0_to_1.1.sh
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+dbname="passman"
+echo "Name of database to use [$dbname]:"
+read x
+
+if [ "$x" ] ; then
+ dbname=$x
+fi
+
+script=/tmp/$$
+rm -f $script
+touch $script
+
+cat >> $script << END_OF_SQL
+
+use $dbname;
+alter table pm_store add column display int not null;
+update pm_store set display = id;
+
+END_OF_SQL
+
+cat -n $script
+mysql -u root -p < $script
+
+rm -f $script