-
Notifications
You must be signed in to change notification settings - Fork 1
/
enable.php
34 lines (30 loc) · 989 Bytes
/
enable.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
// Included?
if (!defined('IN_FROG')) { exit(); }
AutoLoader::addFolder(dirname(__FILE__) . '/models');
$table_name = TABLE_PREFIX.PageMetadata::TABLE_NAME;
// Connection
$pdo = Record::getConnection();
$driver = strtolower($pdo->getAttribute(Record::ATTR_DRIVER_NAME));
if ($driver == 'mysql') {
// Create table
$pdo->exec("CREATE TABLE $table_name (
id int(11) unsigned NOT NULL AUTO_INCREMENT,
visible tinyint(1) unsigned NOT NULL DEFAULT '1',
page_id int(11) unsigned NOT NULL,
keyword varchar(255) NOT NULL,
value varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;");
}
else if ($driver == 'sqlite') {
// Create table
$pdo->exec("CREATE TABLE $table_name (
id INTEGER PRIMARY KEY AUTOINCREMENT,
visible CHAR(1) NOT NULL DEFAULT '1',
page_id INTEGER NOT NULL,
keyword VARCHAR(255) NOT NULL,
value VARCHAR(255) DEFAULT NULL
)");
}
?>