Code Duplication    Length = 18-23 lines in 2 locations

includes/class-give-db-donor-meta.php 1 location

@@ 90-107 (lines=18) @@
87
	 *
88
	 * @return void
89
	 */
90
	public function create_table() {
91
92
		require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
93
94
		$sql = "CREATE TABLE {$this->table_name} (
95
			meta_id bigint(20) NOT NULL AUTO_INCREMENT,
96
			donor_id bigint(20) NOT NULL,
97
			meta_key varchar(255) DEFAULT NULL,
98
			meta_value longtext,
99
			PRIMARY KEY  (meta_id),
100
			KEY donor_id (donor_id),
101
			KEY meta_key (meta_key)
102
			) CHARACTER SET utf8 COLLATE utf8_general_ci;";
103
104
		dbDelta( $sql );
105
106
		update_option( $this->table_name . '_db_version', $this->version );
107
	}
108
109
	/**
110
	 * Add backward compatibility for old table name

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

@@ 665-687 (lines=23) @@
662
	 *
663
	 * @return void
664
	 */
665
	public function create_table() {
666
667
		require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
668
669
		$sql = "CREATE TABLE " . $this->table_name . " (
670
		id bigint(20) NOT NULL AUTO_INCREMENT,
671
		user_id bigint(20) NOT NULL,
672
		email varchar(50) NOT NULL,
673
		name mediumtext NOT NULL,
674
		purchase_value mediumtext NOT NULL,
675
		purchase_count bigint(20) NOT NULL,
676
		payment_ids longtext NOT NULL,
677
		notes longtext NOT NULL,
678
		date_created datetime NOT NULL,
679
		PRIMARY KEY  (id),
680
		UNIQUE KEY email (email),
681
		KEY user (user_id)
682
		) CHARACTER SET utf8 COLLATE utf8_general_ci;";
683
684
		dbDelta( $sql );
685
686
		update_option( $this->table_name . '_db_version', $this->version );
687
	}
688
689
	/**
690
	 * Add backward compatibility for old table name