Ticket #1777 (closed Bugs: fixed)

Opened 2 years ago

Last modified 1 year ago

inventorydb does not install it's tables on sqlite

Reported by: diego_iastrubni Assigned to: diego_iastrubni
Priority: minor Milestone: 2.2
Component: Other Module Version: 2.2.1
Keywords: sqlite Cc:
Confirmation: SVN Revision (if applicable):
Backend Engine: All Backend Engine Version:

Description

The install.sql does not work on sqlite. Same as ticket:1773. The correct code is:

<?php
global $db;
global $amp_conf;

$autoincrement = (($amp_conf["AMPDBENGINE"] == "sqlite") || ($amp_conf["AMPDBENGINE"] == "sqlite3")) ? "AUTOINCREMENT":"AUTO_INCREMENT";

$sql = "CREATE TABLE IF NOT EXISTS inventorydb (
        id INTEGER NOT NULL PRIMARY KEY $autoincrement,
        empnum varchar(10) null,
        empname varchar(20) not null,
        building varchar(150) null,
        floor varchar(10) null,
        room varchar(10) null,
        section varchar(6) null,
        cubicle varchar(6) null,
        desk varchar(6) null,
        exten  varchar(8) null,
        phusername varchar(10) null,
        phpassword varchar(10) null,
        mac varchar(18) null,
        serial varchar(20) null,
        device varchar(20) null,
        distdate varchar(10) null,
        ip varchar(14) null,
        pbxbox varchar(20) null,
        extrainfo varchar(256) null
)";


$check = $db->query($sql);
if(DB::IsError($check)) {
        die("Can not create `inventorydb` table\n");
}

?>

The uninstall.sql script must be modified (check if tne table is available)

DROP TABLE IF EXISTS inventorydb;

Change History

02/18/07 03:13:58 changed by vgster

  • priority changed from blocker to minor.

06/19/07 16:59:12 changed by p_lindheimer

  • status changed from new to closed.
  • resolution set to fixed.
Donate



Support
Download
Develop
Forums
News
Documentation
Paid Support
About

Paid Ads