/**
 * $Id: example.sql,v 1.7 2003/03/26 08:26:28 courou Exp $
 *
 * Author     : courou&#64;users.sourceforge.net
 * Website    : http://allreponse.ath.cx
 *
 * Support    : http://sourceforge.net/projects/myphpmoney/
 * CVS        : http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/myphpmoney/
 */
 
/*---------------------------------------------------------------------*/
/* Table : MPM_user                                                    */
/*---------------------------------------------------------------------*/
CREATE TABLE IF NOT EXISTS MPM_user
(
   USERID                    	  BIGINT(20)                     	NOT NULL,
   LOGIN_NAME               	  VARCHAR(30)                    	NOT NULL,
   PWD                            BLOB                           	NOT NULL,
   COUNTRY_VAL                    BLOB                           	NOT NULL,
   LANG_VAL         	          BLOB                           	NOT NULL,
   GRAPH                      	  BLOB                           	NOT NULL,
   VISIT                	  DATETIME                       	NOT NULL,
   LASTVISIT2         		  DATETIME                       	NOT NULL,
   LASTVISIT               	  DATETIME                       	NOT NULL,   
   EMAIL                          VARCHAR(30)                    	NOT NULL,
   FIRSTNAME                      VARCHAR(30)                    	NOT NULL,
   LASTNAME                       VARCHAR(30)                    	NOT NULL,
   OTHER                          VARCHAR(30)                    	NOT NULL,      
UNIQUE KEY PK_MPM_user (USERID)   
)type = MyISAM;

/*---------------------------------------------------------------------*/
/* Table : MPM_third                                                   */
/*---------------------------------------------------------------------*/
CREATE TABLE IF NOT EXISTS MPM_third
(
   THIRDID                        BIGINT(20)                     	NOT NULL,
   CATID                   	  BIGINT(20)                     	NOT NULL,
   USERID                    	  BIGINT(20)                     	NOT NULL,
   THIRD                          BLOB                           	NOT NULL,
UNIQUE KEY PK_MPM_third (THIRDID),
KEY FK_MPM_third_1 (CATID),
KEY FK_MPM_third_2 (USERID)
)type = MyISAM;

/*---------------------------------------------------------------------*/
/* Table : MPM_part                                                    */
/*---------------------------------------------------------------------*/
CREATE TABLE IF NOT EXISTS MPM_part
(
   CATID                   	  BIGINT(20)                     	NOT NULL,
   USERID                    	  BIGINT(20)                     	NOT NULL,
   CAT                      	  BLOB                           	NOT NULL,
KEY FK_MPM_part (USERID)	
)type = MyISAM;

/*---------------------------------------------------------------------*/
/* Table : MPM_op                                                      */
/*---------------------------------------------------------------------*/
CREATE TABLE IF NOT EXISTS MPM_op
(
   OPID                      	  BIGINT(20)                     	NOT NULL,
   NUMID                          BLOB    			 	NOT NULL,
   TEMPID                         INTEGER(1)                     	NOT NULL,
   VALID_OP                       INTEGER(1)                     	NOT NULL,
   USERID             	          BIGINT(20)                     	NOT NULL,
   DATES                          DATE                           	NOT NULL,
   CAT                      	  BIGINT(20)                     	NOT NULL,
   THIRD                          BIGINT(20)                     	NOT NULL,
   COREL                          BIGINT(20)                     	NOT NULL,
   COMMENTS                   	  BLOB                           	NOT NULL,
   OUT                            BLOB                           	NOT NULL,
   IMP                        	  BLOB                           	NOT NULL,
   ACCOUNT                        BLOB                           	NOT NULL,
   BALANCE                        BLOB                           	NOT NULL,
   PERIOD                    	  INTEGER(1)                     	NOT NULL,   
UNIQUE KEY PK_MPM_op (OPID),
KEY FK_MPM_op (USERID)      
)type = MyISAM;

/*---------------------------------------------------------------------*/
/* Table : MPM_acct                                                    */
/*---------------------------------------------------------------------*/
CREATE TABLE IF NOT EXISTS MPM_acct
(
   ACCOUNTID               	  BIGINT(20)                     	NOT NULL,
   USERID                    	  BIGINT(20)                     	NOT NULL,
   ACCOUNT                        BLOB                           	NOT NULL,
UNIQUE KEY PK_MPM_acct (ACCOUNTID),
KEY FK_MPM_acct (USERID)
)type = MyISAM;

/*---------------------------------------------------------------------*/
/* Table : MPM_order                                                  */
/*---------------------------------------------------------------------*/
CREATE TABLE IF NOT EXISTS MPM_order
(
   USERID                         BIGINT(20)                     	NOT NULL,
   ORDERBY                        BLOB                           	NOT NULL,
UNIQUE KEY PK_MPM_order (USERID)
)type = MyISAM;

/*---------------------------------------------------------------------*/
/* Table : active_sessions                                             */
/*---------------------------------------------------------------------*/
CREATE TABLE IF NOT EXISTS active_sessions
(
   sid                           VARCHAR(32)                     	NOT NULL,
   name                          VARCHAR(32)                     	NOT NULL,
   val                           TEXT                            	        ,
   changed                       VARCHAR(14)                     	NOT NULL,
PRIMARY KEY (name, sid),
KEY changed (changed)
)type = MyISAM;
