コード例 #1
0
ファイル: config.database.php プロジェクト: iantidy/rest-api
function createPublishTable()
{
    global $config_db;
    $sql = "CREATE TABLE IF NOT EXISTS db_tables (" . "id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT," . "Name TEXT NOT NULL," . "Desc TEXT," . "pkField TEXT NOT NULL," . "ConnID INT NOT NULL," . "Public INT," . "Private INT," . "Enabled INT," . "createDate DATE," . "createdBy TEXT," . "updateDate DATE," . "updatedBy TEXT" . ")";
    // $this->showMessage($sql);
    $config_db->exec($sql);
    /*
     * Access Type
     * 0 = None
     * 1 = Read-Only
     * 2 = Read-Write
     * 3 = Write-Only
     * Used for Public and Private Fields
     */
    addVersionRecord('db_tables');
}
コード例 #2
0
ファイル: class.settings.php プロジェクト: iantidy/rest-api
/**
 * Create the settings table
 * @global database $config_db
 */
function createSettings()
{
    global $config_db;
    $sql = "CREATE TABLE IF NOT EXISTS settings (" . "id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT," . "Name TEXT NOT NULL," . "Value TEXT NOT NULL," . "createDate DATE," . "createdBy TEXT," . "updateDate DATE," . "updatedBy TEXT" . ")";
    // $this->showMessage($sql);
    $config_db->exec($sql);
    addVersionRecord('settings');
    // Set Default Values
    // Default to use API Token
    $sql = "INSERT INTO settings (" . "Name, " . "Value, " . "createDate, " . "createdBy, " . "updateDate, " . "updatedBy" . ") VALUES (" . "'useAPIKey', " . "'True', " . "'" . date("Y-m-d") . "', " . "'DEFAULT', " . "'" . date("Y-m-d") . "', " . "'DEFAULT')";
    $config_db->exec($sql);
    // Default Max Records to 50
    $sql = "INSERT INTO settings (" . "Name, " . "Value, " . "createDate, " . "createdBy, " . "updateDate, " . "updatedBy" . ") VALUES (" . "'maxRecords', " . "'50', " . "'" . date("Y-m-d") . "', " . "'DEFAULT', " . "'" . date("Y-m-d") . "', " . "'DEFAULT')";
    $config_db->exec($sql);
}