Code Duplication    Length = 5-5 lines in 4 locations

driver/mysqli.php 1 location

@@ 116-120 (lines=5) @@
113
	 */
114
	public function create_fulltext_index($column = 'topic_title')
115
	{
116
		if (!$this->is_index($column))
117
		{
118
			$sql = 'ALTER TABLE ' . TOPICS_TABLE . ' ADD FULLTEXT (' . $column . ')';
119
			$this->db->sql_query($sql);
120
		}
121
	}
122
123
	/**

migrations/release_1_1_0_data.php 2 locations

@@ 65-69 (lines=5) @@
62
		$driver = $this->get_driver();
63
64
		// FULLTEXT is supported and topic_title IS NOT an index
65
		if ($driver->is_supported() && !$driver->is_index('topic_title'))
66
		{
67
			$sql = 'ALTER TABLE ' . TOPICS_TABLE . ' ADD FULLTEXT (topic_title)';
68
			$this->db->sql_query($sql);
69
		}
70
	}
71
72
	/**
@@ 80-84 (lines=5) @@
77
		$driver = $this->get_driver();
78
79
		// FULLTEXT is supported and topic_title IS an index
80
		if ($driver->is_supported() && $driver->is_index('topic_title'))
81
		{
82
			$sql = 'ALTER TABLE ' . TOPICS_TABLE . ' DROP INDEX topic_title';
83
			$this->db->sql_query($sql);
84
		}
85
	}
86
87
	/**

migrations/release_1_3_0_fulltext.php 1 location

@@ 51-55 (lines=5) @@
48
		$driver = new \vse\similartopics\driver\mysqli($this->db);
49
50
		// Drop the FULLTEXT index
51
		if ($driver->is_index('topic_title'))
52
		{
53
			$sql = 'ALTER TABLE ' . TOPICS_TABLE . ' DROP INDEX topic_title';
54
			$this->db->sql_query($sql);
55
		}
56
57
		// Revert the storage engine back to its original setting
58
		$sql = 'ALTER TABLE ' . TOPICS_TABLE . ' ENGINE = ' . $this->db->sql_escape(strtoupper($this->config['similar_topics_fulltext']));