tentative database work

This commit is contained in:
Matthew Exon 2019-07-24 06:48:23 +01:00 committed by Matthew Exon
parent 9395990ab8
commit 423e016d8e
2 changed files with 5 additions and 0 deletions

View file

@ -24,6 +24,7 @@ CREATE TABLE IF NOT EXISTS `retriever_item` (
CREATE TABLE IF NOT EXISTS `retriever_resource` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`contact-id` int(10) unsigned NOT NULL DEFAULT '0',
`type` char(255) NULL DEFAULT NULL,
`binary` int(1) NOT NULL DEFAULT 0,
`url` varchar(800) CHARACTER SET ascii COLLATE ascii_bin NOT NULL,

View file

@ -41,6 +41,10 @@ function retriever_install() {
q("ALTER TABLE `retriever_item` ADD INDEX `item-uid` (`item-uid`)");
Config::set('retriever', 'dbversion', '0.12');
}
/* if (Config::get('retriever', 'dbversion') == '0.12') { */
/* q("ALTER TABLE `retriever_resource` ADD COLUMN `contact-id` int(10) unsigned NULL AFTER `id`"); */
/* Config::set('retriever', 'dbversion', '0.13'); */
/* } */
if (Config::get('retriever', 'dbversion') != '0.12') {
$schema = file_get_contents(dirname(__file__).'/database.sql');
$arr = explode(';', $schema);