Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 122 additions & 0 deletions Sources/Db/Schema/v1_0/Attachments.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
<?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 3
*/

declare(strict_types=1);

namespace SMF\Db\Schema\v1_0;

use SMF\Db\Schema\Column;
use SMF\Db\Schema\DbIndex;
use SMF\Db\Schema\Table;

/**
* Defines all the properties for a database table.
*/
class Attachments extends Table
{
/****************
* Public methods
****************/

/**
* Constructor.
*/
public function __construct()
{
$this->name = 'attachments';

$this->columns = [
'ID_ATTACH' => new Column(
name: 'ID_ATTACH',
type: 'int',
unsigned: true,
not_null: true,
auto: true,
),
'ID_MSG' => new Column(
name: 'ID_MSG',
type: 'int',
unsigned: true,
not_null: true,
default: 0,
),
'ID_MEMBER' => new Column(
name: 'ID_MEMBER',
type: 'int',
unsigned: true,
not_null: true,
default: 0,
),
'filename' => new Column(
name: 'filename',
type: 'tinytext',
not_null: true,
default: '',
),
'file_hash' => new Column(
name: 'file_hash',
type: 'varchar',
size: 40,
not_null: true,
default: '',
),
'size' => new Column(
name: 'size',
type: 'int',
unsigned: true,
not_null: true,
default: 0,
),
'downloads' => new Column(
name: 'downloads',
type: 'mediumint',
unsigned: true,
not_null: true,
default: 0,
),
];

$this->indexes = [
'primary' => new DbIndex(
type: 'primary',
columns: [
[
'name' => 'ID_ATTACH',
],
],
),
'ID_MEMBER' => new DbIndex(
type: 'unique',
name: 'ID_MEMBER',
columns: [
[
'name' => 'ID_MEMBER',
],
[
'name' => 'ID_ATTACH',
],
],
),
'ID_MSG' => new DbIndex(
name: 'ID_MSG',
columns: [
[
'name' => 'ID_MSG',
],
],
),
];

parent::__construct();
}
}
174 changes: 174 additions & 0 deletions Sources/Db/Schema/v1_0/Banned.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
<?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 3
*/

declare(strict_types=1);

namespace SMF\Db\Schema\v1_0;

use SMF\Db\Schema\Column;
use SMF\Db\Schema\DbIndex;
use SMF\Db\Schema\Table;

/**
* Defines all the properties for a database table.
*/
class Banned extends Table
{
/****************
* Public methods
****************/

/**
* Constructor.
*/
public function __construct()
{
$this->name = 'banned';

$this->columns = [
'ID_BAN' => new Column(
name: 'ID_BAN',
type: 'mediumint',
unsigned: true,
not_null: true,
auto: true,
),
'ban_type' => new Column(
name: 'ban_type',
type: 'varchar',
size: 30,
not_null: true,
default: '',
),
'ip_low1' => new Column(
name: 'ip_low1',
type: 'tinyint',
unsigned: true,
not_null: true,
default: 0,
),
'ip_high1' => new Column(
name: 'ip_high1',
type: 'tinyint',
unsigned: true,
not_null: true,
default: 0,
),
'ip_low2' => new Column(
name: 'ip_low2',
type: 'tinyint',
unsigned: true,
not_null: true,
default: 0,
),
'ip_high2' => new Column(
name: 'ip_high2',
type: 'tinyint',
unsigned: true,
not_null: true,
default: 0,
),
'ip_low3' => new Column(
name: 'ip_low3',
type: 'tinyint',
unsigned: true,
not_null: true,
default: 0,
),
'ip_high3' => new Column(
name: 'ip_high3',
type: 'tinyint',
unsigned: true,
not_null: true,
default: 0,
),
'ip_low4' => new Column(
name: 'ip_low4',
type: 'tinyint',
unsigned: true,
not_null: true,
default: 0,
),
'ip_high4' => new Column(
name: 'ip_high4',
type: 'tinyint',
unsigned: true,
not_null: true,
default: 0,
),
'hostname' => new Column(
name: 'hostname',
type: 'tinytext',
not_null: true,
default: '',
),
'email_address' => new Column(
name: 'email_address',
type: 'tinytext',
not_null: true,
default: '',
),
'ID_MEMBER' => new Column(
name: 'ID_MEMBER',
type: 'mediumint',
unsigned: true,
not_null: true,
default: 0,
),
'ban_time' => new Column(
name: 'ban_time',
type: 'int',
unsigned: true,
not_null: true,
default: 0,
),
'expire_time' => new Column(
name: 'expire_time',
type: 'int',
unsigned: true,
),
'restriction_type' => new Column(
name: 'restriction_type',
type: 'varchar',
size: 30,
not_null: true,
default: '',
),
'reason' => new Column(
name: 'reason',
type: 'tinytext',
not_null: true,
default: '',
),
'notes' => new Column(
name: 'notes',
type: 'text',
not_null: true,
default: '',
),
];

$this->indexes = [
'primary' => new DbIndex(
type: 'primary',
columns: [
[
'name' => 'ID_BAN',
],
],
),
];

parent::__construct();
}
}
Loading
Loading