Commit 8c214e38 authored by Benjamin Rokseth's avatar Benjamin Rokseth
Browse files

Add purresaker table to installer install_once

parent 4cff8451
......@@ -200,35 +200,36 @@ EOF
EXIT_CODE=$?
fi
# VERSION=17.1105000
# if expr "$CURRENTDBVERSION" '<=' "$VERSION" 1>/dev/null ; then
# echo "Setting up purresaker tables ..."
# cat <<-EOF | koha-mysql $(koha-list --enabled)
# /*
# * create table purresaker and purresaker_issues (unless exists)
# */
# CREATE TABLE IF NOT EXISTS purresaker (
# purre_id int(16) NOT NULL AUTO_INCREMENT,
# nets_id varchar(100),
# amount double,
# borrowernumber int(11) NOT NULL,
# status enum('open','reserved','captured') DEFAULT 'open',
# done tinyint(1) NOT NULL DEFAULT 0,
# timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
# PRIMARY KEY (purre_id),
# KEY purre_borroweridx (borrowernumber)
# ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
# CREATE TABLE IF NOT EXISTS purresaker_issues (
# purre_id int(16),
# issue_id int(11) NOT NULL,
# PRIMARY KEY (purre_id,issue_id),
# CONSTRAINT purreid_fk_1 FOREIGN KEY (purre_id) REFERENCES purresaker (purre_id) ON UPDATE CASCADE
# ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
# EOF
# EXIT_CODE=$?
# fi
VERSION=17.1105000
if expr "$CURRENTDBVERSION" '<=' "$VERSION" 1>/dev/null ; then
echo "Setting up purresaker tables ..."
cat <<-EOF | koha-mysql $(koha-list --enabled)
/*
* create table purresaker and purresaker_issues (unless exists)
*/
CREATE TABLE IF NOT EXISTS purresaker (
purre_id int(16) NOT NULL AUTO_INCREMENT,
nets_id varchar(100),
amount double,
borrowernumber int(11) NOT NULL,
status enum('open','reserved','captured') DEFAULT 'open',
done tinyint(1) NOT NULL DEFAULT 0,
created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (purre_id),
KEY purre_borroweridx (borrowernumber)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS purresaker_issues (
purre_id int(16),
issue_id int(11) NOT NULL,
PRIMARY KEY (purre_id,issue_id),
CONSTRAINT purreid_fk_1 FOREIGN KEY (purre_id) REFERENCES purresaker (purre_id) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
EOF
EXIT_CODE=$?
fi
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment