CREATE TABLE peer_mark_questions (
	peer_mark_question_id int NOT NULL ,
	resource_id int NOT NULL ,
	question_big_string_id int NOT NULL ,
	ordinal int NOT NULL,
	available int NOT NULL,

	CONSTRAINT PK_peerm_questions PRIMARY KEY
	(
		peer_mark_question_id
	),
	CONSTRAINT FK_peerm_questions_to_objects FOREIGN KEY
	(
		peer_mark_question_id
	) REFERENCES objects (
		id
	),
	CONSTRAINT FK_peerm_questions_to_resources FOREIGN KEY
	(
		resource_id
	) REFERENCES resources (
		resource_id
	),
	CONSTRAINT FK_peerm_question_to_big_strings FOREIGN KEY
	(
		question_big_string_id
	) REFERENCES big_strings (
		big_string_id
	)
)
GO


INSERT INTO classes (type, db_name, table_name, java_class)
	VALUES(301,	'building2', 'peer_mark_questions', 'org.bodington.assessment.PeerMarkerQuestion')
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(301, 1, 'peer_mark_question_id', 'setPeerMarkerQuestionId', 'getPeerMarkerQuestionId', '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(301, 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(301, 3, 'question_big_string_id', 'setQuestionBigStringId', 'getQuestionBigStringId', '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(301, 4, 'ordinal', 'setOrdinal', 'getOrdinal', '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(301, 5, 'available', 'setAvailable', 'getAvailable', 'int', 'int', 0, null, null, null )
GO
