Open Source Training Seminar FreePBX Paid Support

Ticket #1776 (closed Bugs: fixed)

Opened 2 years ago

Last modified 1 year ago

manager module does not install it's tables on sqlite

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

Description (Last modified by diego_iastrubni)

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 manager (
        `manager_id` INTEGER NOT NULL  PRIMARY KEY $autoincrement,
        `name` VARCHAR( 15 ) NOT NULL ,
        `secret` VARCHAR( 50 ) ,
        `deny` VARCHAR( 255 ) ,
        `permit` VARCHAR( 255 ) ,
        `read` VARCHAR( 50 ) ,
        `write` VARCHAR( 50 )
)";



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

?>

Change History

02/13/07 23:46:39 changed by diego_iastrubni

  • description changed.

problem:

on mysql5 the "read" and "write" columns must be quoted otherwise the table cannot be created. updated the example.

02/14/07 20:24:59 changed by diego_iastrubni

  • description changed.

lets update the die() line, and explain why it died

06/25/07 05:07:45 changed by p_lindheimer

  • version changed from 2.2.1 to 2.3-branch.

06/27/07 02:22:47 changed by diego_iastrubni

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

fixed by changeset:4239 and published on changeset:4240

Donate



Support
Download
Develop
Forums
News
Documentation
Paid Support
About

Paid Ads