CREATE TABLE pigeonhole_questions (
	pigeonhole_question_id int NOT NULL ,
	resource_id int NOT NULL ,
	notes_big_string_id int NOT NULL ,
	ordinal int NOT NULL,
	available int NOT NULL,
	weight decimal(6,3) NOT NULL ,
	CONSTRAINT PK_pigeonhole_questions PRIMARY KEY
	(
		pigeonhole_question_id
	),
	CONSTRAINT FK_ph_questions_to_objects FOREIGN KEY
	(
		pigeonhole_question_id
	) REFERENCES objects (
		id
	),
	CONSTRAINT FK_phquestions_to_resources FOREIGN KEY
	(
		resource_id
	) REFERENCES resources (
		resource_id
	),
	CONSTRAINT FK_notes_to_big_strings FOREIGN KEY
	(
		notes_big_string_id
	) REFERENCES big_strings (
		big_string_id
	)
)
GO


INSERT INTO classes (type, db_name, table_name, java_class)
	VALUES(34,	'building2', 'pigeonhole_questions', 'org.bodington.assessment.PigeonHoleQuestion')
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(34, 1, 'pigeonhole_question_id', 'setPigeonHoleQuestionId', 'getPigeonHoleQuestionId', '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(34, 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(34, 3, 'notes_big_string_id', 'setNotesBigStringId', 'getNotesBigStringId', '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(34, 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(34, 5, 'available', 'setAvailable', 'getAvailable', '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(34, 6, 'weight', 'setWeight', 'getWeight', 'java.math.BigDecimal', 'java.math.BigDecimal', 0, null, null, null )
GO

