-- Autogenerated: do not edit this file

#sequence( "CUSTOMER_SEQ" 5 )
#sequence( "BATCH_STAGING_SEQ" 0 )
#sequence( "TRADE_SEQ" 0 )

CREATE TABLE BATCH_STAGING  (
	ID ${BIGINT} $!{IDENTITY} NOT NULL PRIMARY KEY $!{GENERATED},  
	JOB_ID ${BIGINT} NOT NULL,
	VALUE ${BLOB} NOT NULL,
	PROCESSED CHAR(1) NOT NULL
) $!{VOODOO};

CREATE TABLE TRADE  (
	ID ${BIGINT} $!{IDENTITY} NOT NULL PRIMARY KEY $!{GENERATED},  
	VERSION ${BIGINT} $!{NULL},
	ISIN VARCHAR(45) NOT NULL, 
	QUANTITY ${BIGINT} $!{NULL},
	PRICE ${DECIMAL}(8,2) $!{NULL}, 
	CUSTOMER ${VARCHAR}(45) $!{NULL}
) $!{VOODOO};
 
CREATE TABLE CUSTOMER (
	ID ${BIGINT} $!{IDENTITY} NOT NULL PRIMARY KEY $!{GENERATED},  
	VERSION ${BIGINT} $!{NULL},
	NAME ${VARCHAR}(45) $!{NULL},
	CREDIT ${DECIMAL}(10,2) $!{NULL}
) $!{VOODOO};
 
INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (1, 0, 'customer1', 100000);
INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (2, 0, 'customer2', 100000);
INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (3, 0, 'customer3', 100000);
INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (4, 0, 'customer4', 100000);

CREATE TABLE PLAYERS (
	PLAYER_ID CHAR(8) NOT NULL PRIMARY KEY,  
	LAST_NAME ${VARCHAR}(35) NOT NULL,
	FIRST_NAME ${VARCHAR}(25) NOT NULL,
	POS ${VARCHAR}(10) $!{NULL},
	YEAR_OF_BIRTH ${BIGINT} NOT NULL,
	YEAR_DRAFTED ${BIGINT} NOT NULL
) $!{VOODOO};

CREATE TABLE GAMES (
   PLAYER_ID CHAR(8) NOT NULL,
   YEAR_NO      ${BIGINT} NOT NULL,
   TEAM      CHAR(3) NOT NULL,
   WEEK      ${BIGINT} NOT NULL,
   OPPONENT  CHAR(3) $!{NULL},
   COMPLETES ${BIGINT} $!{NULL},
   ATTEMPTS  ${BIGINT} $!{NULL},
   PASSING_YARDS ${BIGINT} $!{NULL},
   PASSING_TD    ${BIGINT} $!{NULL},
   INTERCEPTIONS ${BIGINT} $!{NULL},
   RUSHES ${BIGINT} $!{NULL},
   RUSH_YARDS ${BIGINT} $!{NULL},
   RECEPTIONS ${BIGINT} $!{NULL},
   RECEPTIONS_YARDS ${BIGINT} $!{NULL},
   TOTAL_TD ${BIGINT} $!{NULL}
) $!{VOODOO};

CREATE TABLE PLAYER_SUMMARY  (
		  ID CHAR(8) NOT NULL, 
		  YEAR_NO ${BIGINT} NOT NULL,
		  COMPLETES ${BIGINT} NOT NULL , 
		  ATTEMPTS ${BIGINT} NOT NULL , 
		  PASSING_YARDS ${BIGINT} NOT NULL , 
		  PASSING_TD ${BIGINT} NOT NULL , 
		  INTERCEPTIONS ${BIGINT} NOT NULL , 
		  RUSHES ${BIGINT} NOT NULL , 
		  RUSH_YARDS ${BIGINT} NOT NULL , 
		  RECEPTIONS ${BIGINT} NOT NULL , 
		  RECEPTIONS_YARDS ${BIGINT} NOT NULL , 
		  TOTAL_TD ${BIGINT} NOT NULL
) $!{VOODOO};

CREATE TABLE ERROR_LOG  (
		JOB_NAME CHAR(20) $!{NULL},
		STEP_NAME CHAR(20) $!{NULL},
		MESSAGE VARCHAR(300) NOT NULL
) $!{VOODOO};
