
 =======================================
 Bookmark4U Database Upgrade Instruction
 =======================================

 Notice!
 -=-=-=-
  o Please read INSTALL.txt first if you want to upgrade your
    Bookmark4U to a higher version.

  o Backup your bookmark database before upgrading it.
    In MySQL, you can backup your database as follow:

     $ mysqldump [-u user] [-p] database > backup.sql


 Version 1.8.4
 -=-=-=-=-=-=-
   o No requirement to change the database
   o Bug Fix for v1.8.3 and v1.8.2
     http://bookmark4u.sourceforge.net/board/read.php?table=board&no=485

 Version 1.8.3
 -=-=-=-=-=-=-
   o No requirement to change the database

 Version 1.8.2
 -=-=-=-=-=-=-
   o Add MEMO table into database.
     Refer to sql/db.*.sql for the definition of MEMO table.

 Version 1.8.1
 -=-=-=-=-=-=-
   o Add ADDRESS table into database.
     Refer to sql/db.*.sql for the definition of ADDRESS table.

 Version 1.8.0
 -=-=-=-=-=-=-
   o From this version, some fields are added into users' bookmark tables.
    There are two methods to update database table structure.
    One way is to use mysql command line tool, and the other is to use
    database configuration tool. The latter is strongly recommended.

   (Manually)

     To modify user's table structure:

     mysql> select user from PASSWD;
     +-------+
     | user  |
     +-------+
     | user1 |
     | user2 |
     +-------+
     mysql> ALTER TABLE [BM4U_]user1 ADD COLUMN icon CHAR(80);
     mysql> UPDATE [BM4U_]user1 SET icon='';
     mysql> ALTER TABLE [BM4U_]user1 ADD COLUMN lnid INTEGER;
     mysql> ALTER TABLE [BM4U_]user1 ADD COLUMN uid INTEGER;
     mysql> ALTER TABLE [BM4U_]user1 ADD COLUMN rtime INTEGER DEFAULT -1;
     mysql> UPDATE [BM4U_]user1 SET rtime='-1';

     where [BM4U_] is the user table prefix.

     Repeat this modification for all users(user1, user2) in the PASSWD table.


   (Using Database Configuration Tool)

     Open http://yourhost/path/to/bm4u/admin/config.php page.
     In the step 5, the tool checks users' bookmark tables in the database.
     If some tables require to be upgraded, error messages are printed:

       Step 5. Checking users' bookmark tables ... 
       Checking user1's bookmark table(BM4U_user1) ... Fail.
       Checking user1's bookmark table(BM4U_user1) ... Fail.
       You have problems in some users' database tables

     followed by SQL command execution blocks.
       +------------------------------+
       | SQL commands                 +
       +------------------------------+
             [[ Execute Above ]]

  Click the 'Execute Above' button one after another.
  After updating all tables, you can see the followin message.

    Congratulation!! You have successfully configured Bookmark4U!!


 Version 1.7.4
 -=-=-=-=-=-=-
   o No requirement to change the database

 Version 1.7.3
 -=-=-=-=-=-=-
   o No requirement to change the database

 Version 1.7.2
 -=-=-=-=-=-=-
  As an administrator, you can accept or deny of a creation of account.
  To use this feature, set the following variable in your inc/config.php

    $conf[registration_verify] = 1;

  And you are required to add an additional table(PASSWD_TEMP)
  and a row in the PASSWD table for the administrator.

  Refer the sql/db.mysql.sql for the definition of PASSWD_TEMP table.

  # temporary password table (for un-allowed user, same definition with PASSWD)
  CREATE TABLE PASSWD_TEMP (
    user      CHAR(20) NOT NULL PRIMARY KEY,    # user login name
    uid       INTEGER NOT NULL AUTO_INCREMENT,  # user ID (integer)
    passwd    CHAR(20),    # encrypted password
    name      CHAR(40),    # user real name
    email     CHAR(50),    # email address
    lastlogin DATETIME,    # last login time
    lastip    CHAR(15),    # last login IP
    logincnt  INTEGER,     # login counter
    rdate     DATETIME,    # registration date and time
    KEY(uid)
  );

  Add a row for administrator into PASSWD table with initial password 'test'.

  INSERT INTO PASSWD SET user='admin', uid=0, passwd=PASSWORD('test'),
  rdate=NOW();

  To login as an administrator, open http://.../path/to/bm4u/admin/ page.

 Version 1.7.1
 -=-=-=-=-=-=-
   o No requirement to change the database

 Version 1.7.0
 -=-=-=-=-=-=-
   o Add CALENDAR table into database.
     Refer to sql/db.*.sql for the definition of CALENDAR table.

 Version 1.6.2
 -=-=-=-=-=-=-
   o (optional) Prefix to user bookmark database table name
     If you want to prefix to the user bookmark database table name,
     edit the inc/config.php to set $conf[userdb_prefix].

     inc/config.php:
       $conf[userdb_prefix] = "BM4U_";  # prefix of user bookmark table name
       #$conf[userdb_prefix] = "";      # comment out this line

     And change the database table name for all existing users.

       mysql> select user from PASSWD;
       +-------+
       | user  |
       +-------+
       | user1 |
       | user2 |
       +-------+
       mysql> alter table user1 rename BM4U_user1;
       mysql> alter table user2 rename BM4U_user2;
       mysql> show tables;
       +----------------------+
       | Tables_in_bookmark4u |
       +----------------------+
       | BM4U_user1           |
       | BM4U_user2           |
       | CONFIG               |
       | PASSWD               |
       | TRASH                |
       +----------------------+

     If you don't want this, just set $conf[userdb_prefix] = "".

 Version 1.6.1
 -=-=-=-=-=-=-
   o No requirement to change the database

 Version 1.6.0
 -=-=-=-=-=-=-
   o Add TRASH table into database.
     Refer to sql/db.*.sql for the definition of TRASH.

 Version 1.5.x
 -=-=-=-=-=-=-
   o No requirement to change the database

 Version 1.4
 -=-=-=-=-=-
   o Add CONFIG table into database
     Refer to sql/db.*.sql for the definition of CONFIG,
     and add entries for existing users into CONFIG.

 Version 1.0 - 1.3
 -=-=-=-=-=-=-=-=-
   o No requirement to change the database

-- UPGRADE.txt
