-
Notifications
You must be signed in to change notification settings - Fork 254
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds database schema definition for SMF 2.1 to ./other/Schema
Signed-off-by: Jon Stovell <[email protected]>
- Loading branch information
1 parent
2a8c9c9
commit 1eb4cce
Showing
71 changed files
with
11,331 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
<?php | ||
|
||
/** | ||
* Simple Machines Forum (SMF) | ||
* | ||
* @package SMF | ||
* @author Simple Machines https://www.simplemachines.org | ||
* @copyright 2023 Simple Machines and individual contributors | ||
* @license https://www.simplemachines.org/about/smf/license.php BSD | ||
* | ||
* @version 3.0 Alpha 1 | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace SMF\Db\Schema\v3_0; | ||
|
||
use SMF\Db\Schema\Column; | ||
use SMF\Db\Schema\Index; | ||
use SMF\Db\Schema\Table; | ||
|
||
/** | ||
* Defines all the properties for a database table. | ||
*/ | ||
class AdminInfoFiles extends Table | ||
{ | ||
/******************* | ||
* Public properties | ||
*******************/ | ||
|
||
/** | ||
* @var array | ||
* | ||
* Data used to populate the table during install. | ||
*/ | ||
public array $initial_data = [ | ||
[ | ||
'id_file' => 1, | ||
'filename' => 'current-version.js', | ||
'path' => '/smf/', | ||
'parameters' => 'version=%3$s', | ||
'data' => '', | ||
'filetype' => 'text/javascript', | ||
], | ||
[ | ||
'id_file' => 2, | ||
'filename' => 'detailed-version.js', | ||
'path' => '/smf/', | ||
'parameters' => 'language=%1$s&version=%3$s', | ||
'data' => '', | ||
'filetype' => 'text/javascript', | ||
], | ||
[ | ||
'id_file' => 3, | ||
'filename' => 'latest-news.js', | ||
'path' => '/smf/', | ||
'parameters' => 'language=%1$s&format=%2$s', | ||
'data' => '', | ||
'filetype' => 'text/javascript', | ||
], | ||
[ | ||
'id_file' => 4, | ||
'filename' => 'latest-versions.txt', | ||
'path' => '/smf/', | ||
'parameters' => 'version=%3$s', | ||
'data' => '', | ||
'filetype' => 'text/plain', | ||
], | ||
]; | ||
|
||
/**************** | ||
* Public methods | ||
****************/ | ||
|
||
/** | ||
* Constructor. | ||
*/ | ||
public function __construct() | ||
{ | ||
$this->name = 'admin_info_files'; | ||
|
||
$this->columns = [ | ||
new Column( | ||
name: 'id_file', | ||
type: 'tinyint', | ||
unsigned: true, | ||
auto: true, | ||
), | ||
new Column( | ||
name: 'filename', | ||
type: 'varchar', | ||
size: 255, | ||
not_null: true, | ||
default: '', | ||
), | ||
new Column( | ||
name: 'path', | ||
type: 'varchar', | ||
size: 255, | ||
not_null: true, | ||
default: '', | ||
), | ||
new Column( | ||
name: 'parameters', | ||
type: 'varchar', | ||
size: 255, | ||
not_null: true, | ||
default: '', | ||
), | ||
new Column( | ||
name: 'data', | ||
type: 'text', | ||
not_null: true, | ||
), | ||
new Column( | ||
name: 'filetype', | ||
type: 'varchar', | ||
size: 255, | ||
not_null: true, | ||
default: '', | ||
), | ||
]; | ||
|
||
$this->indices = [ | ||
new Index( | ||
type: 'primary', | ||
columns: [ | ||
'id_file', | ||
], | ||
), | ||
new Index( | ||
name: 'idx_filename', | ||
columns: [ | ||
'filename(30)', | ||
], | ||
), | ||
]; | ||
} | ||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
<?php | ||
|
||
/** | ||
* Simple Machines Forum (SMF) | ||
* | ||
* @package SMF | ||
* @author Simple Machines https://www.simplemachines.org | ||
* @copyright 2023 Simple Machines and individual contributors | ||
* @license https://www.simplemachines.org/about/smf/license.php BSD | ||
* | ||
* @version 3.0 Alpha 1 | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace SMF\Db\Schema\v3_0; | ||
|
||
use SMF\Db\Schema\Column; | ||
use SMF\Db\Schema\Table; | ||
|
||
/** | ||
* Defines all the properties for a database table. | ||
*/ | ||
class ApprovalQueue extends Table | ||
{ | ||
/******************* | ||
* Public properties | ||
*******************/ | ||
|
||
/** | ||
* @var array | ||
* | ||
* Data used to populate the table during install. | ||
*/ | ||
public array $initial_data = []; | ||
|
||
/**************** | ||
* Public methods | ||
****************/ | ||
|
||
/** | ||
* Constructor. | ||
*/ | ||
public function __construct() | ||
{ | ||
$this->name = 'approval_queue'; | ||
|
||
$this->columns = [ | ||
new Column( | ||
name: 'id_msg', | ||
type: 'int', | ||
unsigned: true, | ||
not_null: true, | ||
default: 0, | ||
), | ||
new Column( | ||
name: 'id_attach', | ||
type: 'int', | ||
unsigned: true, | ||
not_null: true, | ||
default: 0, | ||
), | ||
new Column( | ||
name: 'id_event', | ||
type: 'smallint', | ||
unsigned: true, | ||
not_null: true, | ||
default: 0, | ||
), | ||
]; | ||
} | ||
} | ||
|
||
?> |
Oops, something went wrong.