CREATE TABLE PMD_RUN_ID (
	RUN_ID INTEGER
);

INSERT INTO PMD_RUN_ID (RUN_ID) VALUES (1);
	
CREATE TABLE PMD_RUNS (
	RUN_ID INTEGER PRIMARY KEY,
	PROJECT_ID INTEGER,
	RUN_DATE DATETIME
);

CREATE TABLE PMD_VIOLATIONS (
	VIOLATION_ID INTEGER AUTO_INCREMENT PRIMARY KEY,
	RUN_ID INTEGER REFERENCES PMD_RUNS.RUN_ID,
	RULE VARCHAR(100),
	FILENAME VARCHAR(100),
	LINE_NUMBER INTEGER,
	PACKAGE VARCHAR(100),
	CLASS VARCHAR(100),
	DESCRIPTION VARCHAR(255)
);

CREATE TABLE PMD_METRICS (
	METRIC_ID INTEGER AUTO_INCREMENT PRIMARY KEY,
	RUN_ID INTEGER REFERENCES PMD_RUNS.RUN_ID,
	METRIC VARCHAR(100),
	LOW DOUBLE,
	HIGH DOUBLE,
	AVERAGE DOUBLE,
	DEVIATION DOUBLE
);


	