CREATE TABLE pigeonhole_entries (
	pigeonhole_entry_id int NOT NULL,
	resource_id int NOT NULL,
	user_id int NOT NULL,
	marker_user_id int,
	uploaded_file_id int NOT NULL,
	feedback_big_string_id int NOT NULL,
	comments_big_string_id int NOT NULL,
	status int NOT NULL,
	mark int,
	adjusted_mark int,
	when_saved TIMESTAMP,
	when_marked TIMESTAMP,
	CONSTRAINT PK_pigeonhole_entries PRIMARY KEY
	(
		pigeonhole_entry_id
	),
	CONSTRAINT FK_pigeonhole_entry_to_objects FOREIGN KEY
	(
		pigeonhole_entry_id
	) REFERENCES objects (
		id
	),
	CONSTRAINT FK_ph_entry_to_resources FOREIGN KEY
	(
		resource_id
	) REFERENCES resources (
		resource_id
	),
	CONSTRAINT FK_pigeonhole_entry_to_users FOREIGN KEY
	(
		user_id
	) REFERENCES users (
		user_id
	),
	CONSTRAINT FK_ph_entry_to_uploaded_files FOREIGN KEY
	(
		uploaded_file_id
	) REFERENCES uploaded_files (
		uploaded_file_id
	),
	CONSTRAINT FK_f_phe_to_big_strings FOREIGN KEY
	(
		feedback_big_string_id
	) REFERENCES big_strings (
		big_string_id
	),
	CONSTRAINT FK_c_phe_to_big_strings FOREIGN KEY
	(
		comments_big_string_id
	) REFERENCES big_strings (
		big_string_id
	)
)
GO


INSERT INTO classes (type, db_name, table_name, java_class)
	VALUES(35,	'building2', 'pigeonhole_entries', 'org.bodington.assessment.PigeonHoleEntry')
GO

INSERT INTO fields (type, sequence, field, set_method_name, get_method_name, set_java_class, get_java_class, flags, foreign_type, set_method_name_foreign, get_method_name_foreign )
	VALUES(35, 1, 'pigeonhole_entry_id', 'setPigeonHoleEntryId', 'getPigeonHoleEntryId', 'org.bodington.database.PrimaryKey', 'org.bodington.database.PrimaryKey', 1, null, null, null )
GO

INSERT INTO fields (type, sequence, field, set_method_name, get_method_name, set_java_class, get_java_class, flags, foreign_type, set_method_name_foreign, get_method_name_foreign )
	VALUES(35, 2, 'resource_id', 'setResourceId', 'getResourceId', 'org.bodington.database.PrimaryKey', 'org.bodington.database.PrimaryKey', 0, null, null, null )
GO

INSERT INTO fields (type, sequence, field, set_method_name, get_method_name, set_java_class, get_java_class, flags, foreign_type, set_method_name_foreign, get_method_name_foreign )
	VALUES(35, 3, 'user_id', 'setUserId', 'getUserId', 'org.bodington.database.PrimaryKey', 'org.bodington.database.PrimaryKey', 0, null, null, null )
GO

INSERT INTO fields (type, sequence, field, set_method_name, get_method_name, set_java_class, get_java_class, flags, foreign_type, set_method_name_foreign, get_method_name_foreign )
	VALUES(35, 4, 'marker_user_id', 'setMarkerUserId', 'getMarkerUserId', 'org.bodington.database.PrimaryKey', 'org.bodington.database.PrimaryKey', 0, null, null, null )
GO

INSERT INTO fields (type, sequence, field, set_method_name, get_method_name, set_java_class, get_java_class, flags, foreign_type, set_method_name_foreign, get_method_name_foreign )
	VALUES(35, 5, 'uploaded_file_id', 'setUploadedFileId', 'getUploadedFileId', 'org.bodington.database.PrimaryKey', 'org.bodington.database.PrimaryKey', 0, null, null, null )
GO

INSERT INTO fields (type, sequence, field, set_method_name, get_method_name, set_java_class, get_java_class, flags, foreign_type, set_method_name_foreign, get_method_name_foreign )
	VALUES(35, 6, 'feedback_big_string_id', 'setFeedbackBigStringId', 'getFeedbackBigStringId', 'org.bodington.database.PrimaryKey', 'org.bodington.database.PrimaryKey', 0, null, null, null )
GO

INSERT INTO fields (type, sequence, field, set_method_name, get_method_name, set_java_class, get_java_class, flags, foreign_type, set_method_name_foreign, get_method_name_foreign )
	VALUES(35, 7, 'comments_big_string_id', 'setCommentsBigStringId', 'getCommentsBigStringId', 'org.bodington.database.PrimaryKey', 'org.bodington.database.PrimaryKey', 0, null, null, null )
GO

INSERT INTO fields (type, sequence, field, set_method_name, get_method_name, set_java_class, get_java_class, flags, foreign_type, set_method_name_foreign, get_method_name_foreign )
	VALUES(35, 8, 'status', 'setStatus', 'getStatus', 'int', 'int', 0, null, null, null )
GO

INSERT INTO fields (type, sequence, field, set_method_name, get_method_name, set_java_class, get_java_class, flags, foreign_type, set_method_name_foreign, get_method_name_foreign )
	VALUES(35, 9, 'mark', 'setMark', 'getMark', 'java.lang.Integer', 'java.lang.Integer', 0, null, null, null )
GO

INSERT INTO fields (type, sequence, field, set_method_name, get_method_name, set_java_class, get_java_class, flags, foreign_type, set_method_name_foreign, get_method_name_foreign )
	VALUES(35, 10, 'adjusted_mark', 'setAdjustedMark', 'getAdjustedMark', 'java.lang.Integer', 'java.lang.Integer', 0, null, null, null )
GO

INSERT INTO fields (type, sequence, field, set_method_name, get_method_name, set_java_class, get_java_class, flags, foreign_type, set_method_name_foreign, get_method_name_foreign )
	VALUES(35, 11, 'when_saved', 'setWhenSaved', 'getWhenSaved', 'java.sql.Timestamp', 'java.sql.Timestamp', 0, null, null, null )
GO

INSERT INTO fields (type, sequence, field, set_method_name, get_method_name, set_java_class, get_java_class, flags, foreign_type, set_method_name_foreign, get_method_name_foreign )
	VALUES(35, 12, 'when_marked', 'setWhenMarked', 'getWhenMarked', 'java.sql.Timestamp', 'java.sql.Timestamp', 0, null, null, null )
GO



