forked from SMFTricks/Topic-Solved
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatabase.php
More file actions
42 lines (36 loc) · 901 Bytes
/
database.php
File metadata and controls
42 lines (36 loc) · 901 Bytes
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
35
36
37
38
39
40
41
42
<?php
/**
* @package Topic Solved
* @version 1.0
* @author Diego Andrés <diegoandres_cortes@outlook.com>
* @copyright Copyright (c) 2022, SMF Tricks
*/
if (file_exists(dirname(__FILE__) . '/SSI.php') && !defined('SMF'))
require_once(dirname(__FILE__) . '/SSI.php');
elseif (!defined('SMF'))
die('<b>Error:</b> Cannot install - please verify you put this in the same place as SMF\'s index.php.');
global $smcFunc;
if (!isset($smcFunc['db_create_table']))
db_extend('packages');
// Add a column to the topics table
$smcFunc['db_add_column'](
'{db_prefix}topics',
[
'name' => 'is_solved',
'type' => 'tinyint',
'default' => 0,
'unsigned' => true,
'not_null' => true,
]
);
// Add a column to the boards table
$smcFunc['db_add_column'](
'{db_prefix}boards',
[
'name' => 'can_solve',
'type' => 'tinyint',
'default' => 0,
'unsigned' => true,
'not_null' => true,
]
);