CREATE TABLE b_clouds_file_bucket
(
	ID INT(11) NOT NULL auto_increment,
	ACTIVE CHAR(1) DEFAULT 'Y',
	SORT INT(11) DEFAULT 500,
	READ_ONLY CHAR(1) DEFAULT 'N',
	SERVICE_ID VARCHAR(50),
	BUCKET VARCHAR(63),
	LOCATION VARCHAR(50),
	CNAME VARCHAR(100),
	FILE_COUNT INT(11) default 0,
	FILE_SIZE float default 0,
	LAST_FILE_ID INT(11),
	PREFIX VARCHAR(100),
	SETTINGS TEXT,
	FILE_RULES TEXT,
	PRIMARY KEY pk_b_clouds_file_bucket(ID)
);

CREATE TABLE b_clouds_file_upload
(
	ID VARCHAR(32) NOT NULL,
	TIMESTAMP_X TIMESTAMP NOT NULL,
	FILE_PATH VARCHAR(500) NOT NULL,
	TMP_FILE VARCHAR(500) NULL,
	BUCKET_ID INT(11) NOT NULL,
	PART_SIZE INT(11) NOT NULL,
	PART_NO INT(11) NOT NULL,
	PART_FAIL_COUNTER INT(11) NOT NULL,
	NEXT_STEP TEXT,
	PRIMARY KEY pk_b_clouds_file_upload(ID)
);