Skip to content

Instantly share code, notes, and snippets.

@rickalday
Last active August 15, 2024 16:14
Show Gist options
  • Save rickalday/44d51bde7f7b660daba2dfcadda23eeb to your computer and use it in GitHub Desktop.
Save rickalday/44d51bde7f7b660daba2dfcadda23eeb to your computer and use it in GitHub Desktop.
SQL commands to create some GiveWP tables
-- Change the wp_ prefix to match the WP prefix on your site
-- Create give_comments table
CREATE TABLE wp_give_comments (
comment_ID bigint(20) NOT NULL AUTO_INCREMENT,
user_id bigint(20) NOT NULL,
comment_content longtext NOT NULL,
comment_parent mediumtext NOT NULL,
comment_type mediumtext NOT NULL,
comment_date datetime NOT NULL,
comment_date_gmt datetime NOT NULL,
PRIMARY KEY (comment_ID)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci;
-- Create give_commentmeta table
CREATE TABLE wp_give_commentmeta (
meta_id bigint(20) NOT NULL AUTO_INCREMENT,
give_comment_id bigint(20) NOT NULL,
meta_key varchar(255) DEFAULT NULL,
meta_value longtext,
PRIMARY KEY (meta_id),
KEY give_comment_id (give_comment_id),
KEY meta_key (meta_key(191))
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci;
-- Create wp_give_sessions table
CREATE TABLE wp_give_sessions (
session_id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
session_key char(32) NOT NULL,
session_value longtext NOT NULL,
session_expiry BIGINT UNSIGNED NOT NULL,
PRIMARY KEY (session_key),
UNIQUE KEY session_id (session_id)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci;
-- Create wp_give_formmeta table
CREATE TABLE wp_give_formmeta (
meta_id bigint(20) NOT NULL AUTO_INCREMENT,
form_id bigint(20) NOT NULL,
meta_key varchar(255) DEFAULT NULL,
meta_value longtext,
PRIMARY KEY (meta_id),
KEY form_id (form_id),
KEY meta_key (meta_key(191))
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci;
-- Crete wp_give_donationmeta table
CREATE TABLE wp_give_donationmeta (
meta_id bigint(20) NOT NULL AUTO_INCREMENT,
donation_id bigint(20) NOT NULL,
meta_key varchar(255) DEFAULT NULL,
meta_value longtext,
PRIMARY KEY (meta_id),
KEY donation_id (donation_id),
KEY meta_key (meta_key(191))
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci;
-- Create wp_give_sequential_ordering table
CREATE TABLE wp_give_sequential_ordering (
id bigint(20) NOT NULL AUTO_INCREMENT,
payment_id bigint(20) NOT NULL,
PRIMARY KEY (id)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci;
-- Add phone column to donors table
ALTER TABLE wp_give_donors ADD COLUMN `phone` varchar(50) NOT NULL DEFAULT '' AFTER `name`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment