YesNoOk
#1
3 Replies
Jul 27
2012

Database changes

July 27, 2012, 01:05:13 | by Nightwish
This topic documents all database changes made:

All changes relative to a stock SMF 2.0 database structure are documented in table-changes.sql which can be found in the source repository.

Commit 105e4a625cd163e584b8903278254e0d7217ee0c - added IPv6 support (ported from SMF 2.1 development branch).

Changes made to table ban_items:
Code: (mysql)
#
# Table structure for table `ban_items`
#

CREATE TABLE {$db_prefix}ban_items (
  id_ban mediumint(8) unsigned NOT NULL auto_increment,
  id_ban_group smallint(5) unsigned NOT NULL default '0',
  ip_low1 smallint(255) unsigned NOT NULL default '0',
  ip_high1 smallint(255) unsigned NOT NULL default '0',
  ip_low2 smallint(255) unsigned NOT NULL default '0',
  ip_high2 smallint(255) unsigned NOT NULL default '0',
  ip_low3 smallint(255) unsigned NOT NULL default '0',
  ip_high3 smallint(255) unsigned NOT NULL default '0',
  ip_low4 smallint(255) unsigned NOT NULL default '0',
  ip_high4 smallint(255) unsigned NOT NULL default '0',
  ip_low5 smallint(255) unsigned NOT NULL default '0',
  ip_high5 smallint(255) unsigned NOT NULL default '0',
  ip_low6 smallint(255) unsigned NOT NULL default '0',
  ip_high6 smallint(255) unsigned NOT NULL default '0',
  ip_low7 smallint(255) unsigned NOT NULL default '0',
  ip_high7 smallint(255) unsigned NOT NULL default '0',
  ip_low8 smallint(255) unsigned NOT NULL default '0',
  ip_high8 smallint(255) unsigned NOT NULL default '0',
  hostname varchar(255) NOT NULL default '',
  email_address varchar(255) NOT NULL default '',
  id_member mediumint(8) unsigned NOT NULL default '0',
  hits mediumint(8) unsigned NOT NULL default '0',
  PRIMARY KEY (id_ban),
  KEY id_ban_group (id_ban_group)
) ENGINE=MyISAM;
Last Edit: May 22, 2015, 21:43:55} by Nightwish
 

Nightwish,  July 27, 2012, 04:44:04
Re: Database changes #2
Commit 53a87994a49b58f4bd7f64f0bfd11e421a195cad, changes to the rating system requires changes to {db_prefix}likes.
Code: (mysql)
ALTER TABLE {db_prefix}likes MODIFY rtype VARCHAR(60) NOT NULL DEFAULT '1';
ALTER TABLE {db_prefix}likes ADD comment VARCHAR(255) NOT NULL DEFAULT '' AFTER rtype;
ALTER TABLE {db_prefix}likes ADD KEY rtype(rtype);
Nightwish,  February 24, 2013, 15:26:15
Re: Database changes #3
https://github.com/silvercircle/SMF/commit/79dad0a832024a19e3cc01c7cc11f5144e40fe2b

Code: (mysql)
ALTER TABLE {$db_prefix}membergroups ADD rating_pool int(10) unsigned NOT NULL default '0';

Add rating points pool to member groups. A rating may or may not cost a given number of points and the pool specifies the number of points a member can spend on rating posts within a given period of time (usually, one day).

Rating costs are totally optional - ratings can have their costs set to 0 in which case they can be used without any limitations, but costs may be useful to avoid "rating abuse" in any form.

If a user is member in multiple member groups, the highest pool value of these groups is the effective one.

Ratings which cost more points than the member currently can spend, cannot be used.

NOTE: This is WIP, not everything works (yet).
Last Edit: February 24, 2013, 15:30:13 by Nightwish
Nightwish,  March 22, 2013, 16:52:08
Re: Database changes New #4
Columns likes_received and likes_given are removed from the member table.
Code: (mysql)
ALTER TABLE {$db_prefix}members DROP likes_given;
ALTER TABLE {$db_prefix}members DROP likes_received;

They have been replaced with ratings_given and ratings_received respectively. Both are TEXT columns and their purpose is to record more details rating stats for each member.

The column ratings_given records all ratings the member has given to other member's posts. Likewise, ratings_received records stats for all ratings a member has received.

Code: (mysql)
ALTER TABLE {$db_prefix}members ADD ratings_given text NOT NULL default '';
ALTER TABLE {$db_prefix}members ADD ratings_received text NOT NULL default '';


      Posted: April 20, 2013, 14:37:43
Commit: 5af5274549272b72ef1e15bc6e1f720a0475b72c
Code: (mysql)
ALTER TABLE {db_prefix}prefixes ADD css VARCHAR(20) NOT NULL default '';
This field holds the css class(es) used to format the prefix. It allows to apply backgrounds (or even images) to topic prefixes in the message index display.

The CSS classes can be defined in the override CSS for any given theme.
Last Edit: May 22, 2013, 08:08:57 by Nightwish
0 Members and 1 Guest are viewing this.