-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.php
More file actions
20 lines (17 loc) · 691 Bytes
/
init.php
File metadata and controls
20 lines (17 loc) · 691 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?php
class Init
{
const TABLE_NAME = 'notifications';
static function activation()
{
global $wpdb;
$table_name = $wpdb->prefix . self::TABLE_NAME;
$wpdb->query("CREATE TABLE IF NOT EXISTS $table_name (id INT AUTO_INCREMENT NOT NULL, date DATETIME DEFAULT CURRENT_TIMESTAMP, description LONGTEXT NOT NULL, type VARCHAR(255) NOT NULL, action VARCHAR(255) DEFAULT NULL, user_id INT NOT NULL, visualized TINYINT(1) DEFAULT 0, UNIQUE KEY id (id)) $charset_collate;");
}
static function uninstall()
{
global $wpdb;
$table_name = $wpdb->prefix . self::TABLE_NAME;
$wpdb->query("DROP TABLE IF EXISTS $table_name");
}
}