2016-07-26 23:02:42 +00:00
SET NAMES utf8 ;
SET time_zone = ' +00:00 ' ;
DROP TABLE IF EXISTS ` osulb_scores ` ;
CREATE TABLE ` osulb_scores ` (
` osu_id ` bigint ( 255 ) unsigned NOT NULL ,
` fii_id ` bigint ( 255 ) unsigned NOT NULL ,
` last_update ` int ( 11 ) unsigned NOT NULL ,
` osu_name ` varchar ( 16 ) COLLATE utf8_bin NOT NULL ,
` fii_name ` varchar ( 16 ) COLLATE utf8_bin NOT NULL ,
` osu_mode ` tinyint ( 1 ) unsigned NOT NULL ,
` osu_count300 ` int ( 11 ) unsigned NOT NULL ,
` osu_count100 ` int ( 11 ) unsigned NOT NULL ,
` osu_count50 ` int ( 11 ) unsigned NOT NULL ,
` osu_playcount ` int ( 11 ) unsigned NOT NULL ,
` osu_ranked_score ` bigint ( 255 ) unsigned NOT NULL ,
` osu_total_score ` bigint ( 255 ) unsigned NOT NULL ,
` osu_pp_rank ` bigint ( 255 ) unsigned NOT NULL ,
` osu_level ` float unsigned NOT NULL ,
` osu_pp_raw ` float unsigned NOT NULL ,
` osu_accuracy ` float NOT NULL ,
` osu_count_rank_ss ` int ( 11 ) NOT NULL ,
` osu_count_rank_s ` int ( 11 ) NOT NULL ,
` osu_count_rank_a ` int ( 11 ) NOT NULL ,
` osu_country ` char ( 2 ) COLLATE utf8_bin NOT NULL
) ENGINE = InnoDB DEFAULT CHARSET = utf8 COLLATE = utf8_bin ;
DROP TABLE IF EXISTS ` sakura_actioncodes ` ;
CREATE TABLE ` sakura_actioncodes ` (
2016-02-25 16:06:29 +00:00
` code_action ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' Action identifier so the backend knows what to do. ' ,
` user_id ` bigint ( 255 ) unsigned NOT NULL COMMENT ' ID of the user that would be affected by this action ' ,
` action_code ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' The URL key for using this code. '
2015-09-07 20:53:47 +00:00
) ENGINE = InnoDB DEFAULT CHARSET = utf8 COLLATE = utf8_bin ;
2015-05-24 22:06:53 +00:00
2016-07-26 23:02:42 +00:00
DROP TABLE IF EXISTS ` sakura_apikeys ` ;
CREATE TABLE ` sakura_apikeys ` (
` id ` bigint ( 128 ) unsigned NOT NULL AUTO_INCREMENT COMMENT ' Automatically generated ID by MySQL for management. ' ,
` owner ` bigint ( 128 ) unsigned NOT NULL COMMENT ' ID of user that owns this API key. ' ,
` apikey ` varchar ( 32 ) COLLATE utf8_bin NOT NULL COMMENT ' The API key. ' ,
PRIMARY KEY ( ` id ` )
) ENGINE = InnoDB DEFAULT CHARSET = utf8 COLLATE = utf8_bin ;
DROP TABLE IF EXISTS ` sakura_bans ` ;
CREATE TABLE ` sakura_bans ` (
` ban_id ` bigint ( 255 ) unsigned NOT NULL AUTO_INCREMENT COMMENT ' Automatically generated ID by MySQL for management. ' ,
` user_id ` bigint ( 255 ) unsigned NOT NULL COMMENT ' ID of user that was banned, 0 for just an IP ban. ' ,
` ban_begin ` int ( 11 ) unsigned NOT NULL COMMENT ' Timestamp when the user was banned. ' ,
` ban_end ` int ( 11 ) unsigned NOT NULL COMMENT ' Timestamp when the user should regain access to the site. ' ,
` ban_reason ` varchar ( 512 ) COLLATE utf8_bin DEFAULT NULL COMMENT ' Reason given for the ban. ' ,
` ban_moderator ` bigint ( 255 ) unsigned NOT NULL COMMENT ' ID of moderator that banned this user, ' ,
PRIMARY KEY ( ` ban_id ` )
) ENGINE = InnoDB DEFAULT CHARSET = utf8 COLLATE = utf8_bin ;
2015-05-24 22:06:53 +00:00
2015-03-08 09:42:01 +00:00
2016-07-26 23:02:42 +00:00
DROP TABLE IF EXISTS ` sakura_comments ` ;
CREATE TABLE ` sakura_comments ` (
2016-02-25 16:06:29 +00:00
` comment_id ` bigint ( 255 ) unsigned NOT NULL AUTO_INCREMENT COMMENT ' MySQL Generated ID used for sorting. ' ,
2015-09-23 20:45:42 +00:00
` comment_category ` varchar ( 32 ) COLLATE utf8_bin NOT NULL COMMENT ' Comment category. ' ,
2016-02-25 16:06:29 +00:00
` comment_timestamp ` int ( 11 ) unsigned NOT NULL COMMENT ' Timestamp of when this comment was posted. ' ,
` comment_poster ` bigint ( 255 ) unsigned NOT NULL COMMENT ' User ID of the poster. ' ,
` comment_reply_to ` bigint ( 255 ) unsigned NOT NULL DEFAULT ' 0 ' COMMENT ' ID of the comment this comment is a reply to ' ,
` comment_text ` text COLLATE utf8_bin NOT NULL COMMENT ' Content of the comment. ' ,
PRIMARY KEY ( ` comment_id ` )
2016-07-26 23:02:42 +00:00
) ENGINE = InnoDB AUTO_INCREMENT = 84 DEFAULT CHARSET = utf8 COLLATE = utf8_bin ;
2015-12-24 16:04:49 +00:00
2015-09-23 20:45:42 +00:00
2016-07-26 23:02:42 +00:00
DROP TABLE IF EXISTS ` sakura_comment_votes ` ;
CREATE TABLE ` sakura_comment_votes ` (
2016-02-25 16:06:29 +00:00
` vote_comment ` bigint ( 255 ) unsigned NOT NULL COMMENT ' ID of the comment that was voted on. ' ,
` vote_user ` bigint ( 255 ) unsigned NOT NULL COMMENT ' ID of the voter. ' ,
` vote_state ` tinyint ( 1 ) unsigned NOT NULL COMMENT ' 0 = dislike, 1 = like. '
2015-10-10 21:17:50 +00:00
) ENGINE = InnoDB DEFAULT CHARSET = utf8 COLLATE = utf8_bin ;
2015-12-24 16:04:49 +00:00
2016-07-26 23:02:42 +00:00
DROP TABLE IF EXISTS ` sakura_config ` ;
CREATE TABLE ` sakura_config ` (
2015-06-29 12:40:00 +00:00
` config_name ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' Array key for configuration value ' ,
2016-02-25 16:06:29 +00:00
` config_value ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' The value, obviously. ' ,
UNIQUE KEY ` config_name ` ( ` config_name ` )
2015-03-08 09:42:01 +00:00
) ENGINE = InnoDB DEFAULT CHARSET = utf8 COLLATE = utf8_bin ;
2015-07-05 15:03:58 +00:00
2016-07-26 23:02:42 +00:00
DROP TABLE IF EXISTS ` sakura_emoticons ` ;
CREATE TABLE ` sakura_emoticons ` (
2015-07-05 15:03:58 +00:00
` emote_string ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' String to catch and replace ' ,
` emote_path ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' Path to the image file relative to the content domain. '
) ENGINE = InnoDB DEFAULT CHARSET = utf8 COLLATE = utf8_bin ;
2015-09-06 01:04:55 +00:00
2016-07-26 23:02:42 +00:00
DROP TABLE IF EXISTS ` sakura_error_log ` ;
CREATE TABLE ` sakura_error_log ` (
2015-10-10 21:17:50 +00:00
` error_id ` varchar ( 32 ) COLLATE utf8_bin NOT NULL COMMENT ' An ID that is created when an error occurs. ' ,
` error_timestamp ` varchar ( 128 ) COLLATE utf8_bin NOT NULL COMMENT ' A datestring from when the error occurred. ' ,
2016-02-25 16:06:29 +00:00
` error_revision ` int ( 16 ) unsigned NOT NULL COMMENT ' Sakura Revision number. ' ,
` error_type ` int ( 16 ) unsigned NOT NULL COMMENT ' The PHP error type of this error. ' ,
` error_line ` int ( 32 ) unsigned NOT NULL COMMENT ' The line that caused this error. ' ,
2015-09-07 20:53:47 +00:00
` error_string ` varchar ( 512 ) COLLATE utf8_bin NOT NULL COMMENT ' PHP '' s description of this error. ' ,
` error_file ` varchar ( 512 ) COLLATE utf8_bin NOT NULL COMMENT ' The file in which this error occurred. ' ,
2015-10-10 21:17:50 +00:00
` error_backtrace ` text COLLATE utf8_bin NOT NULL COMMENT ' A full base64 and json encoded backtrace containing all environment data. '
2015-09-06 01:04:55 +00:00
) ENGINE = InnoDB DEFAULT CHARSET = utf8 COLLATE = utf8_bin ;
2015-12-24 16:04:49 +00:00
2016-07-26 23:02:42 +00:00
DROP TABLE IF EXISTS ` sakura_faq ` ;
CREATE TABLE ` sakura_faq ` (
2016-02-25 16:06:29 +00:00
` faq_id ` bigint ( 128 ) unsigned NOT NULL AUTO_INCREMENT COMMENT ' MySQL Generated ID used for sorting. ' ,
2015-10-10 21:17:50 +00:00
` faq_shorthand ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' Used for linking directly to a question. ' ,
` faq_question ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' The question. ' ,
2016-02-25 16:06:29 +00:00
` faq_answer ` text COLLATE utf8_bin NOT NULL COMMENT ' The answer. ' ,
PRIMARY KEY ( ` faq_id ` )
2015-09-07 20:53:47 +00:00
) ENGINE = InnoDB DEFAULT CHARSET = utf8 COLLATE = utf8_bin ;
2015-05-24 22:06:53 +00:00
2016-07-26 23:02:42 +00:00
DROP TABLE IF EXISTS ` sakura_forums ` ;
CREATE TABLE ` sakura_forums ` (
2016-02-25 16:06:29 +00:00
` forum_id ` bigint ( 255 ) unsigned NOT NULL AUTO_INCREMENT COMMENT ' MySQL Generated ID used for sorting. ' ,
` forum_order ` bigint ( 255 ) unsigned NOT NULL COMMENT ' Forum sorting order. ' ,
2015-06-29 12:40:00 +00:00
` forum_name ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' Display name of the forum. ' ,
` forum_desc ` text COLLATE utf8_bin NOT NULL COMMENT ' Description of the forum. ' ,
` forum_link ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' If set forum will display as a link. ' ,
2016-02-25 16:06:29 +00:00
` forum_category ` bigint ( 255 ) unsigned NOT NULL DEFAULT ' 0 ' COMMENT ' ID of the category this forum falls under. ' ,
` forum_type ` tinyint ( 4 ) unsigned NOT NULL DEFAULT ' 0 ' COMMENT ' Forum type, 0 for regular board, 1 for category and 2 for link. ' ,
` forum_icon ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' Display icon for the forum. ' ,
PRIMARY KEY ( ` forum_id ` )
2016-07-26 23:02:42 +00:00
) ENGINE = InnoDB AUTO_INCREMENT = 31 DEFAULT CHARSET = utf8 COLLATE = utf8_bin ;
2015-12-24 16:04:49 +00:00
2015-05-24 22:06:53 +00:00
2016-07-26 23:02:42 +00:00
DROP TABLE IF EXISTS ` sakura_forum_permissions ` ;
CREATE TABLE ` sakura_forum_permissions ` (
2016-02-25 16:06:29 +00:00
` forum_id ` bigint ( 255 ) unsigned NOT NULL COMMENT ' Forum ID ' ,
` rank_id ` bigint ( 128 ) unsigned NOT NULL COMMENT ' Rank ID, leave 0 for a user ' ,
` user_id ` bigint ( 255 ) unsigned NOT NULL COMMENT ' User ID, leave 0 for a rank ' ,
2015-10-10 21:17:50 +00:00
` forum_perms ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' Forum action permission string '
) ENGINE = InnoDB DEFAULT CHARSET = utf8 COLLATE = utf8_bin ;
2015-12-24 16:04:49 +00:00
2016-07-26 23:02:42 +00:00
DROP TABLE IF EXISTS ` sakura_friends ` ;
CREATE TABLE ` sakura_friends ` (
2016-02-25 16:06:29 +00:00
` user_id ` bigint ( 255 ) unsigned NOT NULL COMMENT ' ID of the user that added the friend. ' ,
` friend_id ` bigint ( 255 ) unsigned NOT NULL COMMENT ' ID of the user that was added as a friend. ' ,
2016-07-26 23:02:42 +00:00
` friend_timestamp ` int ( 11 ) unsigned NOT NULL COMMENT ' Timestamp of action. '
2015-04-01 17:27:42 +00:00
) ENGINE = InnoDB DEFAULT CHARSET = utf8 COLLATE = utf8_bin ;
2016-07-26 23:02:42 +00:00
DROP TABLE IF EXISTS ` sakura_infopages ` ;
CREATE TABLE ` sakura_infopages ` (
2015-10-10 21:17:50 +00:00
` page_shorthand ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' Name used for calling this page up in the /r/URL ' ,
` page_title ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' Title displayed on the top of the page ' ,
` page_content ` text COLLATE utf8_bin NOT NULL COMMENT ' Content of the page '
2015-03-08 09:42:01 +00:00
) ENGINE = InnoDB DEFAULT CHARSET = utf8 COLLATE = utf8_bin ;
2015-05-05 06:24:19 +00:00
2016-07-26 23:02:42 +00:00
DROP TABLE IF EXISTS ` sakura_login_attempts ` ;
CREATE TABLE ` sakura_login_attempts ` (
2016-02-25 16:06:29 +00:00
` attempt_id ` bigint ( 255 ) unsigned NOT NULL AUTO_INCREMENT COMMENT ' MySQL Generated ID used for sorting. ' ,
` attempt_success ` tinyint ( 1 ) unsigned NOT NULL COMMENT ' Success boolean. ' ,
` attempt_timestamp ` int ( 11 ) unsigned NOT NULL COMMENT ' Unix timestamp of the event. ' ,
2016-07-26 23:02:42 +00:00
` attempt_ip ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' IP that made this attempt. ' ,
2016-02-25 16:06:29 +00:00
` user_id ` bigint ( 255 ) unsigned NOT NULL COMMENT ' ID of the user that was attempted to log in to. ' ,
PRIMARY KEY ( ` attempt_id ` )
2016-07-26 23:02:42 +00:00
) ENGINE = InnoDB AUTO_INCREMENT = 596 DEFAULT CHARSET = utf8 COLLATE = utf8_bin ;
DROP TABLE IF EXISTS ` sakura_messages ` ;
CREATE TABLE ` sakura_messages ` (
` id ` bigint ( 128 ) unsigned NOT NULL AUTO_INCREMENT COMMENT ' Automatically generated ID by MySQL for management. ' ,
` from_user ` bigint ( 255 ) unsigned NOT NULL COMMENT ' ID of the user that sent this message. ' ,
` to_user ` bigint ( 255 ) unsigned NOT NULL COMMENT ' ID of user that should receive this message. ' ,
` read ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' IDs of users who read this message. ' ,
` deleted ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' Indicator if one of the parties deleted the message, if it is already 1 the script will remove this row. ' ,
` timestamp ` int ( 11 ) unsigned NOT NULL COMMENT ' Timestamp of the time this message was sent ' ,
` subject ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' Title of the message ' ,
` content ` text COLLATE utf8_bin NOT NULL COMMENT ' Contents of the message. ' ,
PRIMARY KEY ( ` id ` )
) ENGINE = InnoDB DEFAULT CHARSET = utf8 COLLATE = utf8_bin ;
2015-05-05 06:24:19 +00:00
2015-05-24 22:06:53 +00:00
2016-07-26 23:02:42 +00:00
DROP TABLE IF EXISTS ` sakura_news ` ;
CREATE TABLE ` sakura_news ` (
2016-02-25 16:06:29 +00:00
` news_id ` bigint ( 255 ) unsigned NOT NULL AUTO_INCREMENT COMMENT ' Automatically generated ID by MySQL for management. ' ,
2015-10-10 21:17:50 +00:00
` news_category ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' Category ID. ' ,
2016-02-25 16:06:29 +00:00
` user_id ` bigint ( 255 ) unsigned NOT NULL COMMENT ' ID of user who posted this news message. ' ,
` news_timestamp ` int ( 11 ) unsigned NOT NULL COMMENT ' News post timestamp. ' ,
2015-10-10 21:17:50 +00:00
` news_title ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' Title of the post. ' ,
2016-02-25 16:06:29 +00:00
` news_content ` text COLLATE utf8_bin NOT NULL COMMENT ' Contents of the post ' ,
PRIMARY KEY ( ` news_id ` )
2016-07-26 23:02:42 +00:00
) ENGINE = InnoDB AUTO_INCREMENT = 44 DEFAULT CHARSET = utf8 COLLATE = utf8_bin ;
2016-02-25 16:06:29 +00:00
2015-12-24 16:04:49 +00:00
2016-07-26 23:02:42 +00:00
DROP TABLE IF EXISTS ` sakura_notifications ` ;
CREATE TABLE ` sakura_notifications ` (
2016-02-25 16:06:29 +00:00
` alert_id ` bigint ( 255 ) unsigned NOT NULL AUTO_INCREMENT COMMENT ' Automatically generated ID by MySQL for management. ' ,
` user_id ` bigint ( 255 ) unsigned NOT NULL DEFAULT ' 0 ' COMMENT ' User ID this notification is intended for. ' ,
` alert_timestamp ` int ( 11 ) unsigned NOT NULL DEFAULT ' 0 ' COMMENT ' Timestamp when this notification was created. ' ,
` alert_read ` tinyint ( 1 ) unsigned NOT NULL DEFAULT ' 0 ' COMMENT ' Toggle for unread and read. ' ,
` alert_sound ` tinyint ( 1 ) unsigned NOT NULL DEFAULT ' 0 ' COMMENT ' Toggle if a sound should be played upon receiving the notification. ' ,
2015-10-10 21:17:50 +00:00
` alert_title ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' Title displayed on the notification. ' ,
` alert_text ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' Text displayed. ' ,
` alert_link ` varchar ( 255 ) COLLATE utf8_bin DEFAULT NULL COMMENT ' Link (empty for no link). ' ,
` alert_img ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' Image path, prefix with font: to use a font class instead of an image. ' ,
2016-02-25 16:06:29 +00:00
` alert_timeout ` int ( 16 ) unsigned NOT NULL DEFAULT ' 0 ' COMMENT ' How long the notification should stay on screen in milliseconds, 0 for forever. ' ,
2016-07-26 23:02:42 +00:00
PRIMARY KEY ( ` alert_id ` )
) ENGINE = InnoDB AUTO_INCREMENT = 160 DEFAULT CHARSET = utf8 COLLATE = utf8_bin ;
2015-06-29 12:40:00 +00:00
2015-12-24 16:04:49 +00:00
2016-07-26 23:02:42 +00:00
DROP TABLE IF EXISTS ` sakura_optionfields ` ;
CREATE TABLE ` sakura_optionfields ` (
2015-10-10 21:17:50 +00:00
` option_id ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' Unique identifier for accessing this option. ' ,
` option_name ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' Description of the field in a proper way. ' ,
` option_description ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' Longer description of the option. ' ,
` option_type ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' Type attribute in the input element. ' ,
2016-02-25 16:06:29 +00:00
` option_permission ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' The minimum permission level this option requires. ' ,
UNIQUE KEY ` id ` ( ` option_id ` )
2015-08-21 22:07:45 +00:00
) ENGINE = InnoDB DEFAULT CHARSET = utf8 COLLATE = utf8_bin ;
2016-07-26 23:02:42 +00:00
DROP TABLE IF EXISTS ` sakura_permissions ` ;
CREATE TABLE ` sakura_permissions ` (
2016-02-25 16:06:29 +00:00
` rank_id ` bigint ( 255 ) unsigned NOT NULL DEFAULT ' 0 ' COMMENT ' ID of the rank this permissions set is used for. ' ,
` user_id ` bigint ( 255 ) unsigned NOT NULL DEFAULT ' 0 ' COMMENT ' ID of the user this permissions set is used for. ' ,
2015-10-10 21:17:50 +00:00
` permissions_site ` varchar ( 255 ) COLLATE utf8_bin NOT NULL DEFAULT ' 0 ' COMMENT ' Site permissions. ' ,
2016-02-25 16:06:29 +00:00
` permissions_manage ` varchar ( 255 ) COLLATE utf8_bin NOT NULL DEFAULT ' 0 ' COMMENT ' Site management permissions '
2015-05-24 22:06:53 +00:00
) ENGINE = InnoDB DEFAULT CHARSET = utf8 COLLATE = utf8_bin ;
2015-12-24 16:04:49 +00:00
2016-07-26 23:02:42 +00:00
DROP TABLE IF EXISTS ` sakura_posts ` ;
CREATE TABLE ` sakura_posts ` (
2016-02-25 16:06:29 +00:00
` post_id ` bigint ( 255 ) unsigned NOT NULL AUTO_INCREMENT COMMENT ' MySQL Generated ID used for sorting. ' ,
` topic_id ` bigint ( 255 ) unsigned NOT NULL DEFAULT ' 0 ' COMMENT ' ID of topic this post is a part of. ' ,
` forum_id ` bigint ( 255 ) unsigned NOT NULL DEFAULT ' 0 ' COMMENT ' ID of forum this was posted in. ' ,
` poster_id ` bigint ( 255 ) unsigned DEFAULT ' 0 ' COMMENT ' ID of poster of this post. ' ,
2015-06-29 12:40:00 +00:00
` poster_ip ` varchar ( 40 ) COLLATE utf8_bin NOT NULL COMMENT ' IP of poster. ' ,
2016-02-25 16:06:29 +00:00
` post_time ` int ( 11 ) unsigned NOT NULL DEFAULT ' 0 ' COMMENT ' Time this post was made. ' ,
2015-06-29 12:40:00 +00:00
` post_subject ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' Subject of the post. ' ,
` post_text ` text COLLATE utf8_bin NOT NULL COMMENT ' Contents of the post. ' ,
2016-02-25 16:06:29 +00:00
` post_edit_time ` int ( 11 ) unsigned NOT NULL DEFAULT ' 0 ' COMMENT ' Time this post was last edited. ' ,
2015-06-29 12:40:00 +00:00
` post_edit_reason ` varchar ( 255 ) COLLATE utf8_bin DEFAULT NULL COMMENT ' Reason this was edited. ' ,
2016-02-25 16:06:29 +00:00
` post_edit_user ` int ( 255 ) unsigned NOT NULL DEFAULT ' 0 ' COMMENT ' ID of user that edited. ' ,
2016-07-26 23:02:42 +00:00
PRIMARY KEY ( ` post_id ` )
) ENGINE = InnoDB AUTO_INCREMENT = 1208 DEFAULT CHARSET = utf8 COLLATE = utf8_bin ;
2015-07-01 01:00:56 +00:00
2015-12-24 16:04:49 +00:00
2016-07-26 23:02:42 +00:00
DROP TABLE IF EXISTS ` sakura_premium ` ;
CREATE TABLE ` sakura_premium ` (
2016-02-25 16:06:29 +00:00
` user_id ` bigint ( 255 ) unsigned NOT NULL COMMENT ' ID of the user that purchased Tenshi. ' ,
` premium_start ` int ( 11 ) unsigned NOT NULL COMMENT ' Timestamp of first purchase. ' ,
` premium_expire ` int ( 11 ) unsigned NOT NULL COMMENT ' Expiration timestamp. ' ,
UNIQUE KEY ` uid ` ( ` user_id ` )
2015-05-24 22:06:53 +00:00
) ENGINE = InnoDB DEFAULT CHARSET = utf8 COLLATE = utf8_bin ;
2016-07-26 23:02:42 +00:00
DROP TABLE IF EXISTS ` sakura_premium_log ` ;
CREATE TABLE ` sakura_premium_log ` (
2016-02-25 16:06:29 +00:00
` transaction_id ` int ( 16 ) unsigned NOT NULL AUTO_INCREMENT COMMENT ' MySQL Generated ID used for sorting. ' ,
` user_id ` bigint ( 255 ) unsigned NOT NULL COMMENT ' User ID of purchaser ' ,
2015-10-10 21:17:50 +00:00
` transaction_amount ` float NOT NULL COMMENT ' Amount that was transferred. ' ,
2016-02-25 16:06:29 +00:00
` transaction_date ` int ( 11 ) unsigned NOT NULL COMMENT ' Date when the purchase was made. ' ,
` transaction_comment ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' A short description of the action taken. ' ,
PRIMARY KEY ( ` transaction_id ` )
2016-07-26 23:02:42 +00:00
) ENGINE = InnoDB AUTO_INCREMENT = 11 DEFAULT CHARSET = utf8 COLLATE = utf8_bin ;
2015-09-05 16:11:04 +00:00
2015-12-24 16:04:49 +00:00
2016-07-26 23:02:42 +00:00
DROP TABLE IF EXISTS ` sakura_profilefields ` ;
CREATE TABLE ` sakura_profilefields ` (
2016-02-25 16:06:29 +00:00
` field_id ` int ( 64 ) unsigned NOT NULL AUTO_INCREMENT COMMENT ' ID used for ordering on the userpage. ' ,
2015-10-10 21:17:50 +00:00
` field_name ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' Name of the field. ' ,
` field_type ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' Type attribute in the input element. ' ,
2016-02-25 16:06:29 +00:00
` field_link ` tinyint ( 1 ) unsigned NOT NULL COMMENT ' Set if this value should be put in a href. ' ,
2015-10-10 21:17:50 +00:00
` field_linkformat ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' If the form is a link how should it be formatted? {{ VAL }} gets replace with the value. ' ,
` field_description ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' Description of the field displayed in the control panel. ' ,
2016-02-25 16:06:29 +00:00
` field_additional ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' Undocumented JSON array containing special options if needed (probably only going to be used for the YouTube field). ' ,
PRIMARY KEY ( ` field_id ` )
2016-07-26 23:02:42 +00:00
) ENGINE = InnoDB AUTO_INCREMENT = 16 DEFAULT CHARSET = utf8 COLLATE = utf8_bin ;
2015-09-07 20:53:47 +00:00
2015-12-24 16:04:49 +00:00
2016-07-26 23:02:42 +00:00
DROP TABLE IF EXISTS ` sakura_ranks ` ;
CREATE TABLE ` sakura_ranks ` (
2016-02-25 16:06:29 +00:00
` rank_id ` bigint ( 128 ) unsigned NOT NULL AUTO_INCREMENT COMMENT ' Automatically generated ID by MySQL for management. ' ,
` rank_hierarchy ` int ( 11 ) unsigned NOT NULL COMMENT ' Rank hierarchy. ' ,
2015-10-10 21:17:50 +00:00
` rank_name ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' Display name of the rank. ' ,
` rank_multiple ` varchar ( 10 ) COLLATE utf8_bin DEFAULT NULL COMMENT ' Used when addressing this rank as a multiple ' ,
2016-02-25 16:06:29 +00:00
` rank_hidden ` tinyint ( 1 ) unsigned NOT NULL DEFAULT ' 0 ' COMMENT ' Don '' t show any public links to this rank. ' ,
2015-10-10 21:17:50 +00:00
` rank_colour ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' Colour used for the username of a member of this rank. ' ,
` rank_description ` text COLLATE utf8_bin NOT NULL COMMENT ' A description of what a user of this rank can do/is supposed to do. ' ,
2016-02-25 16:06:29 +00:00
` rank_title ` varchar ( 64 ) COLLATE utf8_bin NOT NULL COMMENT ' Default user title if user has none set. ' ,
PRIMARY KEY ( ` rank_id ` )
2016-07-26 23:02:42 +00:00
) ENGINE = InnoDB AUTO_INCREMENT = 12 DEFAULT CHARSET = utf8 COLLATE = utf8_bin ;
2015-09-07 20:53:47 +00:00
2016-02-25 16:06:29 +00:00
2016-07-26 23:02:42 +00:00
DROP TABLE IF EXISTS ` sakura_reports ` ;
CREATE TABLE ` sakura_reports ` (
2016-02-25 16:06:29 +00:00
` id ` bigint ( 255 ) unsigned NOT NULL AUTO_INCREMENT COMMENT ' MySQL Generated ID used for sorting. ' ,
` type ` int ( 32 ) unsigned NOT NULL COMMENT ' Report type, entirely handled on the script side. ' ,
` issuer ` bigint ( 255 ) unsigned NOT NULL COMMENT ' ID of the person who issued this report. ' ,
` subject ` bigint ( 255 ) unsigned NOT NULL COMMENT ' ID pointing out what was reported (a more accurate description isn '' t possible due to the type column). ' ,
2015-06-29 12:40:00 +00:00
` title ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' A quick description of this report. ' ,
` description ` text COLLATE utf8_bin NOT NULL COMMENT ' And a detailed description. ' ,
2016-02-25 16:06:29 +00:00
` reviewed ` bigint ( 255 ) unsigned NOT NULL DEFAULT ' 0 ' COMMENT ' ID of the moderator that reviewed this report. ' ,
PRIMARY KEY ( ` id ` )
2015-05-24 22:06:53 +00:00
) ENGINE = InnoDB DEFAULT CHARSET = utf8 COLLATE = utf8_bin ;
2016-07-26 23:02:42 +00:00
DROP TABLE IF EXISTS ` sakura_sessions ` ;
CREATE TABLE ` sakura_sessions ` (
2016-02-25 16:06:29 +00:00
` session_id ` bigint ( 255 ) unsigned NOT NULL AUTO_INCREMENT COMMENT ' Automatically generated ID by MySQL for management. ' ,
` user_id ` bigint ( 255 ) unsigned NOT NULL COMMENT ' ID of the user this session is spawned for. ' ,
2016-07-26 23:02:42 +00:00
` user_ip ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' IP of the user this session is spawned for. ' ,
2015-10-10 21:17:50 +00:00
` user_agent ` varchar ( 255 ) COLLATE utf8_bin DEFAULT NULL COMMENT ' User agent of the user this session is spawned for. ' ,
` session_key ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' Session key, allow direct access to the user '' s account. ' ,
2016-02-25 16:06:29 +00:00
` session_start ` int ( 16 ) unsigned NOT NULL COMMENT ' The timestamp for when the session was started. ' ,
` session_expire ` int ( 16 ) unsigned NOT NULL COMMENT ' The timestamp for when this session should end, -1 for permanent. ' ,
` session_remember ` tinyint ( 1 ) unsigned NOT NULL DEFAULT ' 0 ' COMMENT ' If set to 1 session will be extended each time a page is loaded. ' ,
2016-07-26 23:02:42 +00:00
PRIMARY KEY ( ` session_id ` )
) ENGINE = InnoDB AUTO_INCREMENT = 109 DEFAULT CHARSET = utf8 COLLATE = utf8_bin ;
2015-12-24 16:04:49 +00:00
2015-05-24 22:06:53 +00:00
2016-07-26 23:02:42 +00:00
DROP TABLE IF EXISTS ` sakura_topics ` ;
CREATE TABLE ` sakura_topics ` (
2016-02-25 16:06:29 +00:00
` topic_id ` bigint ( 255 ) unsigned NOT NULL AUTO_INCREMENT COMMENT ' MySQL Generated ID used for sorting. ' ,
` forum_id ` bigint ( 255 ) unsigned NOT NULL DEFAULT ' 0 ' COMMENT ' ID of forum this topic was created in. ' ,
` topic_hidden ` tinyint ( 1 ) unsigned NOT NULL DEFAULT ' 0 ' COMMENT ' Boolean to set the topic as hidden. ' ,
2015-06-29 12:40:00 +00:00
` topic_title ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' Title of the topic. ' ,
2016-02-25 16:06:29 +00:00
` topic_time ` int ( 11 ) unsigned NOT NULL DEFAULT ' 0 ' COMMENT ' Timestamp when the topic was created. ' ,
` topic_time_limit ` int ( 11 ) unsigned NOT NULL DEFAULT ' 0 ' COMMENT ' After how long a topic should be locked. ' ,
` topic_views ` bigint ( 255 ) unsigned NOT NULL DEFAULT ' 0 ' COMMENT ' Amount of times the topic has been viewed. ' ,
` topic_status ` tinyint ( 3 ) unsigned NOT NULL DEFAULT ' 0 ' COMMENT ' Status of topic. ' ,
` topic_status_change ` int ( 11 ) unsigned NOT NULL DEFAULT ' 0 ' COMMENT ' Date the topic status was changed (used for deletion cooldown as well). ' ,
` topic_type ` tinyint ( 3 ) unsigned NOT NULL DEFAULT ' 0 ' COMMENT ' Type of the topic. ' ,
` topic_last_reply ` int ( 11 ) unsigned NOT NULL DEFAULT ' 0 ' COMMENT ' Timestamp of when the last reply made to this thread. ' ,
` topic_old_forum ` bigint ( 255 ) unsigned NOT NULL DEFAULT ' 0 ' COMMENT ' Pre-move forum id. ' ,
2016-07-26 23:02:42 +00:00
PRIMARY KEY ( ` topic_id ` )
) ENGINE = InnoDB AUTO_INCREMENT = 191 DEFAULT CHARSET = utf8 COLLATE = utf8_bin ;
2015-12-24 16:04:49 +00:00
2016-07-26 23:02:42 +00:00
DROP TABLE IF EXISTS ` sakura_topics_track ` ;
CREATE TABLE ` sakura_topics_track ` (
` user_id ` bigint ( 255 ) unsigned NOT NULL COMMENT ' ID of the user this row applies to. ' ,
` topic_id ` bigint ( 255 ) unsigned NOT NULL COMMENT ' ID of the thread in question. ' ,
` forum_id ` bigint ( 255 ) unsigned NOT NULL COMMENT ' ID of the forum in question. ' ,
2016-02-25 16:06:29 +00:00
` mark_time ` int ( 11 ) unsigned NOT NULL DEFAULT ' 0 ' COMMENT ' Timestamp of the event. '
2015-12-24 16:04:49 +00:00
) ENGINE = InnoDB DEFAULT CHARSET = utf8 COLLATE = utf8_bin ;
2016-02-25 16:06:29 +00:00
2016-07-26 23:02:42 +00:00
DROP TABLE IF EXISTS ` sakura_uploads ` ;
CREATE TABLE ` sakura_uploads ` (
2016-02-25 16:06:29 +00:00
` file_id ` bigint ( 255 ) unsigned NOT NULL AUTO_INCREMENT COMMENT ' Automatically generated value for management ' ,
` user_id ` bigint ( 255 ) unsigned NOT NULL COMMENT ' ID of the user that uploaded the file ' ,
2016-07-26 23:02:42 +00:00
` file_data ` longblob ,
2016-02-25 16:06:29 +00:00
` file_name ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' Name of the file ' ,
` file_mime ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' Static mime type of the file ' ,
` file_time ` int ( 11 ) unsigned NOT NULL COMMENT ' Timestamp of when the file was uploaded ' ,
` file_expire ` int ( 11 ) unsigned NOT NULL COMMENT ' When should the file be removed, 0 for never ' ,
PRIMARY KEY ( ` file_id ` )
2016-07-26 23:02:42 +00:00
) ENGINE = InnoDB AUTO_INCREMENT = 3 DEFAULT CHARSET = utf8 COLLATE = utf8_bin ;
2016-02-25 16:06:29 +00:00
2015-12-24 16:04:49 +00:00
2016-07-26 23:02:42 +00:00
DROP TABLE IF EXISTS ` sakura_username_history ` ;
CREATE TABLE ` sakura_username_history ` (
2016-02-25 16:06:29 +00:00
` change_id ` int ( 11 ) unsigned NOT NULL AUTO_INCREMENT COMMENT ' Identifier ' ,
` change_time ` int ( 11 ) unsigned NOT NULL COMMENT ' Timestamp of change ' ,
` user_id ` bigint ( 255 ) unsigned NOT NULL COMMENT ' User ID ' ,
2015-09-23 20:45:42 +00:00
` username_new ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' New username ' ,
` username_new_clean ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' Clean new username ' ,
` username_old ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' Old username ' ,
2016-02-25 16:06:29 +00:00
` username_old_clean ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' Clean old username ' ,
PRIMARY KEY ( ` change_id ` )
2016-07-26 23:02:42 +00:00
) ENGINE = InnoDB AUTO_INCREMENT = 36 DEFAULT CHARSET = utf8 COLLATE = utf8_bin ;
2015-12-24 16:04:49 +00:00
2015-09-23 20:45:42 +00:00
2016-07-26 23:02:42 +00:00
DROP TABLE IF EXISTS ` sakura_users ` ;
CREATE TABLE ` sakura_users ` (
2016-02-25 16:06:29 +00:00
` user_id ` bigint ( 255 ) unsigned NOT NULL AUTO_INCREMENT COMMENT ' Automatically generated ID by MySQL for management. ' ,
2015-06-29 12:40:00 +00:00
` username ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' Username set at registration. ' ,
` username_clean ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' A more cleaned up version of the username for backend usage. ' ,
` password_hash ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' Hashing algo used for the password hash. ' ,
` password_salt ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' Salt used for the password hash. ' ,
` password_algo ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' Algorithm used for the password hash. ' ,
2016-02-25 16:06:29 +00:00
` password_iter ` int ( 11 ) unsigned NOT NULL COMMENT ' Password hash iterations. ' ,
` password_chan ` int ( 11 ) unsigned NOT NULL DEFAULT ' 0 ' COMMENT ' Last time the user changed their password. ' ,
2015-06-29 12:40:00 +00:00
` email ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' E-mail of the user for password restoring etc. ' ,
2016-02-25 16:06:29 +00:00
` rank_main ` mediumint ( 4 ) unsigned NOT NULL DEFAULT ' 0 ' COMMENT ' Main rank of the user. ' ,
2015-10-10 21:17:50 +00:00
` user_colour ` varchar ( 255 ) COLLATE utf8_bin DEFAULT NULL COMMENT ' Additional name colour, when empty colour defaults to group colour. ' ,
2016-07-26 23:02:42 +00:00
` register_ip ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' IP used for the creation of this account. ' ,
` last_ip ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' Last IP that was used to log into this account. ' ,
2015-10-10 21:17:50 +00:00
` user_title ` varchar ( 64 ) COLLATE utf8_bin DEFAULT NULL COMMENT ' Custom user title of the user, when empty reverts to their derault group name. ' ,
2016-02-25 16:06:29 +00:00
` user_registered ` int ( 11 ) unsigned NOT NULL DEFAULT ' 0 ' COMMENT ' Timestamp of account creation. ' ,
` user_last_online ` int ( 11 ) unsigned NOT NULL DEFAULT ' 0 ' COMMENT ' Last time anything was done on this account. ' ,
` user_birthday ` date NOT NULL DEFAULT ' 0000-00-00 ' COMMENT ' Birthdate of the user. ' ,
` user_country ` char ( 2 ) COLLATE utf8_bin NOT NULL DEFAULT ' XX ' COMMENT ' Contains ISO 3166 country code of user '' s registration location. ' ,
` user_avatar ` bigint ( 255 ) unsigned NOT NULL DEFAULT ' 0 ' COMMENT ' ID of the avatar in the uploads table. ' ,
` user_background ` bigint ( 255 ) unsigned NOT NULL DEFAULT ' 0 ' COMMENT ' ID of the background in the uploads table. ' ,
` user_header ` bigint ( 255 ) unsigned NOT NULL DEFAULT ' 0 ' COMMENT ' ID of the profile header in the uploads table. ' ,
` user_page ` longtext COLLATE utf8_bin COMMENT ' Contents of the userpage. ' ,
` user_signature ` text COLLATE utf8_bin COMMENT ' Signature displayed below forum posts. ' ,
2016-07-26 23:02:42 +00:00
` password ` varchar ( 255 ) COLLATE utf8_bin DEFAULT NULL ,
2016-02-25 16:06:29 +00:00
PRIMARY KEY ( ` user_id ` ) ,
UNIQUE KEY ` username_clean ` ( ` username_clean ` )
2016-07-26 23:02:42 +00:00
) ENGINE = InnoDB AUTO_INCREMENT = 481 DEFAULT CHARSET = utf8 COLLATE = utf8_bin ;
2016-02-25 16:06:29 +00:00
2016-07-26 23:02:42 +00:00
DROP TABLE IF EXISTS ` sakura_user_optionfields ` ;
CREATE TABLE ` sakura_user_optionfields ` (
2016-02-25 16:06:29 +00:00
` user_id ` bigint ( 255 ) unsigned NOT NULL COMMENT ' User this field applies to ' ,
` field_name ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' Identifier of the field ' ,
` field_value ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' Value of the field '
) ENGINE = InnoDB DEFAULT CHARSET = utf8 COLLATE = utf8_bin ;
2016-07-26 23:02:42 +00:00
DROP TABLE IF EXISTS ` sakura_user_profilefields ` ;
CREATE TABLE ` sakura_user_profilefields ` (
2016-02-25 16:06:29 +00:00
` user_id ` bigint ( 255 ) unsigned NOT NULL COMMENT ' User this field applies to ' ,
` field_name ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' Identifier of the field ' ,
` field_value ` varchar ( 255 ) COLLATE utf8_bin NOT NULL COMMENT ' Value of the field '
) ENGINE = InnoDB DEFAULT CHARSET = utf8 COLLATE = utf8_bin ;
2016-07-26 23:02:42 +00:00
DROP TABLE IF EXISTS ` sakura_user_ranks ` ;
CREATE TABLE ` sakura_user_ranks ` (
2016-02-25 16:06:29 +00:00
` user_id ` bigint ( 255 ) unsigned NOT NULL ,
` rank_id ` bigint ( 128 ) unsigned NOT NULL
) ENGINE = InnoDB DEFAULT CHARSET = utf8 COLLATE = utf8_bin ;
2016-07-26 23:02:42 +00:00
DROP TABLE IF EXISTS ` sakura_warnings ` ;
CREATE TABLE ` sakura_warnings ` (
2016-02-25 16:06:29 +00:00
` warning_id ` bigint ( 255 ) unsigned NOT NULL AUTO_INCREMENT COMMENT ' Automatically generated ID by MySQL for management. ' ,
` user_id ` bigint ( 255 ) unsigned NOT NULL COMMENT ' ID of user that was warned. ' ,
` moderator_id ` bigint ( 255 ) unsigned NOT NULL COMMENT ' ID of the user that issued the warning. ' ,
` warning_issued ` int ( 16 ) unsigned NOT NULL COMMENT ' Timestamp of the date the warning was issued. ' ,
` warning_expires ` int ( 16 ) unsigned NOT NULL COMMENT ' Timstamp when the warning should expire, 0 for a permanent warning. ' ,
` warning_action ` tinyint ( 1 ) unsigned DEFAULT NULL COMMENT ' Action taken. ' ,
` warning_reason ` varchar ( 512 ) COLLATE utf8_bin DEFAULT NULL COMMENT ' Reason for the warning. ' ,
2016-07-26 23:02:42 +00:00
PRIMARY KEY ( ` warning_id ` )
2016-02-25 16:06:29 +00:00
) ENGINE = InnoDB DEFAULT CHARSET = utf8 COLLATE = utf8_bin ;