Open Source Training Seminar FreePBX Paid Support

Ticket #1774 (closed Bugs: fixed)

Opened 2 years ago

Last modified 1 year ago

timeconditions module does not install it's tables on sqlite

Reported by: diego_iastrubni Assigned to: diego_iastrubni
Priority: minor Milestone: 2.3
Component: Time Conditions Version: 2.3-branch
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 timeconditions (
	timeconditions_id INTEGER NOT NULL PRIMARY KEY $autoincrement,
	displayname VARCHAR( 50 ) ,
	time VARCHAR( 100 ) ,
	truegoto VARCHAR( 50 ) ,
	falsegoto VARCHAR( 50 ),
	deptname VARCHAR( 50 )
)";

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

?>

and the uninstall.sql should be (check if the table exists):

DROP TABLE IF EXISTS timeconditions;

Change History

06/20/07 06:05:49 changed by p_lindheimer

  • version changed from 2.2.1 to 2.3-branch.

06/27/07 02:45:28 changed by diego_iastrubni

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

fixed by changeset:4243 and published by changeset:4244

Donate



Support
Download
Develop
Forums
News
Documentation
Paid Support
About

Paid Ads