Code Duplication    Length = 52-52 lines in 2 locations

migrations/v10x/m5_end_date.php 1 location

@@ 13-64 (lines=52) @@
10
11
namespace phpbb\ads\migrations\v10x;
12
13
class m5_end_date extends \phpbb\db\migration\migration
14
{
15
	/**
16
	* {@inheritDoc}
17
	*/
18
	public function effectively_installed()
19
	{
20
		return $this->db_tools->sql_column_exists($this->table_prefix . 'ads', 'ad_end_date');
21
	}
22
23
	/**
24
	* {@inheritDoc}
25
	*/
26
	static public function depends_on()
27
	{
28
		return array('\phpbb\ads\migrations\v10x\m1_initial_schema');
29
	}
30
31
	/**
32
	* Add the end date to ads table
33
	*
34
	* @return array Array of table schema
35
	* @access public
36
	*/
37
	public function update_schema()
38
	{
39
		return array(
40
			'add_columns' => array(
41
				$this->table_prefix . 'ads' => array(
42
					'ad_end_date' => array('TIMESTAMP', 0),
43
				),
44
			),
45
		);
46
	}
47
48
	/**
49
	* Drop the end date from ads table
50
	*
51
	* @return array Array of table schema
52
	* @access public
53
	*/
54
	public function revert_schema()
55
	{
56
		return array(
57
			'drop_columns' => array(
58
				$this->table_prefix . 'ads' => array(
59
					'ad_end_date',
60
				),
61
			),
62
		);
63
	}
64
}
65

migrations/v10x/m8_priority.php 1 location

@@ 13-64 (lines=52) @@
10
11
namespace phpbb\ads\migrations\v10x;
12
13
class m8_priority extends \phpbb\db\migration\migration
14
{
15
	/**
16
	* {@inheritDoc}
17
	*/
18
	public function effectively_installed()
19
	{
20
		return $this->db_tools->sql_column_exists($this->table_prefix . 'ads', 'ad_priority');
21
	}
22
23
	/**
24
	* {@inheritDoc}
25
	*/
26
	static public function depends_on()
27
	{
28
		return array('\phpbb\ads\migrations\v10x\m1_initial_schema');
29
	}
30
31
	/**
32
	* Add the priority to ads table
33
	*
34
	* @return array Array of table schema
35
	* @access public
36
	*/
37
	public function update_schema()
38
	{
39
		return array(
40
			'add_columns' => array(
41
				$this->table_prefix . 'ads' => array(
42
					'ad_priority' => array('TINT:2', 5),
43
				),
44
			),
45
		);
46
	}
47
48
	/**
49
	* Drop the priority from ads table
50
	*
51
	* @return array Array of table schema
52
	* @access public
53
	*/
54
	public function revert_schema()
55
	{
56
		return array(
57
			'drop_columns' => array(
58
				$this->table_prefix . 'ads' => array(
59
					'ad_priority',
60
				),
61
			),
62
		);
63
	}
64
}
65