Completed
Push — master ( 2f6701...a7b61e )
by Khoa
05:19
created

bbook_schema::get_schema_bbook_words()   A

Complexity

Conditions 1
Paths 1

Duplication

Lines 0
Ratio 0 %

Size

Total Lines 5
Code Lines 2

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/**
3
* This file is part of the VinaBB.vn package.
4
*
5
* @copyright (c) VinaBB <vinabb.vn>
6
* @license GNU General Public License, version 2 (GPL-2.0)
7
*/
8
9
namespace vinabb\web\migrations\v10x;
10
11
use phpbb\db\migration\migration;
12
13
/**
14
* Database schema for BBook
15
*/
16
class bbook_schema extends migration
17
{
18
	/**
19
	* Update schema
20
	*
21
	* @return array
22
	*/
23
	public function update_schema()
24
	{
25
		return [
26
			'add_tables' => [
27
				$this->table_prefix . 'bbook_books'		=> $this->get_schema_bbook_books(),
28
				$this->table_prefix . 'bbook_chapters'	=> $this->get_schema_bbook_chapters(),
29
				$this->table_prefix . 'bbook_words'		=> $this->get_schema_bbook_words()
30
			]
31
		];
32
	}
33
34
	/**
35
	* Get schema for the table: _bbook_books
36
	*
37
	* @return array
38
	*/
39
	protected function get_schema_bbook_books()
40
	{
41
		return [
42
			'COLUMNS' => [
43
				'book_id'		=> ['UINT', null, 'auto_increment'],
44
				'bb_type'		=> ['USINT', 0],
45
				'book_name'		=> ['VCHAR_UNI', '', 'true_sort'],
46
				'book_name_seo'	=> ['VCHAR', ''],
47
				'book_lang'		=> ['VCHAR:30', ''],
48
				'book_icon'		=> ['VCHAR', ''],
49
				'book_img'		=> ['VCHAR', ''],
50
				'book_desc'		=> ['VCHAR_UNI', ''],
51
				'book_order'	=> ['USINT', 0]
52
			],
53
			'PRIMARY_KEY' => 'book_id'
54
		];
55
	}
56
57
	/**
58
	* Get schema for the table: _bbook_chapters
59
	*
60
	* @return array
61
	*/
62
	protected function get_schema_bbook_chapters()
63
	{
64
		return [
65
			'COLUMNS' => [
66
				'chapter_id'			=> ['UINT', null, 'auto_increment'],
67
				'parent_id'				=> ['UINT', 0],
68
				'left_id'				=> ['UINT', 0],
69
				'right_id'				=> ['UINT', 0],
70
				'chapter_parents'		=> ['MTEXT_UNI', ''],
71
				'chapter_name'			=> ['VCHAR_UNI', ''],
72
				'chapter_name_seo'		=> ['VCHAR', ''],
73
				'chapter_text'			=> ['TEXT_UNI', ''],
74
				'chapter_text_uid'		=> ['VCHAR:8', ''],
75
				'chapter_text_bitfield'	=> ['VCHAR:255', ''],
76
				'chapter_text_options'	=> ['UINT:11', 0],
77
				'chapter_added'			=> ['TIMESTAMP', 0],
78
				'chapter_updated'		=> ['TIMESTAMP', 0]
79
			],
80
			'PRIMARY_KEY' => 'chapter_id'
81
		];
82
	}
83
84
	/**
85
	* Get schema for the table: _bbook_words
86
	*
87
	* @return array
88
	*/
89
	protected function get_schema_bbook_words()
90
	{
91
		return [
92
		];
93
	}
94
}
95