Code Duplication    Length = 15-20 lines in 2 locations

includes/class-give-db-logs.php 1 location

@@ 241-260 (lines=20) @@
238
	 *
239
	 * @return void
240
	 */
241
	public function create_table() {
242
		global $wpdb;
243
		$charset_collate = $wpdb->get_charset_collate();
244
245
		$sql = "CREATE TABLE {$this->table_name} (
246
        ID bigint(20) NOT NULL AUTO_INCREMENT,
247
        log_title longtext NOT NULL,
248
        log_content longtext NOT NULL,
249
      	log_parent bigint(20) NOT NULL,
250
        log_type mediumtext NOT NULL,
251
        log_date datetime NOT NULL,
252
        log_date_gmt datetime NOT NULL,
253
        PRIMARY KEY  (ID)
254
        ) {$charset_collate};";
255
256
		require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
257
		dbDelta( $sql );
258
259
		update_option( $this->table_name . '_db_version', $this->version );
260
	}
261
262
263
	/**

includes/class-give-db-sequential-donations.php 1 location

@@ 87-101 (lines=15) @@
84
	 *
85
	 * @return void
86
	 */
87
	public function create_table() {
88
		global $wpdb;
89
		$charset_collate = $wpdb->get_charset_collate();
90
91
		$sql = "CREATE TABLE {$this->table_name} (
92
        id bigint(20) NOT NULL AUTO_INCREMENT,
93
        payment_id bigint(20) NOT NULL,
94
        PRIMARY KEY  (id)
95
        ) {$charset_collate};";
96
97
		require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
98
		dbDelta( $sql );
99
100
		update_option( $this->table_name . '_db_version', $this->version );
101
	}
102
}
103