CREATE TABLE text_questions (
	text_question_id int NOT NULL ,
	resource_id int NOT NULL ,
	question_big_string_id int NOT NULL ,
	explanation_big_string_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_text_questions PRIMARY KEY
	(
		text_question_id
	),
	CONSTRAINT FK_t_questions_to_objects FOREIGN KEY
	(
		text_question_id
	) REFERENCES objects (
		id
	),
	CONSTRAINT FK_t_questions_to_resources FOREIGN KEY
	(
		resource_id
	) REFERENCES resources (
		resource_id
	),
	CONSTRAINT FK_tq_question_to_big_strings FOREIGN KEY
	(
		question_big_string_id
	) REFERENCES big_strings (
		big_string_id
	),
	CONSTRAINT FK_tq_explan_to_big_strings FOREIGN KEY
	(
		explanation_big_string_id
	) REFERENCES big_strings (
		big_string_id
	),
	CONSTRAINT FK_tq_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(42,	'building2', 'text_questions', 'org.bodington.assessment.TextQuestion')
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(42, 1, 'text_question_id', 'setTextQuestionId', 'getTextQuestionId', '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(42, 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(42, 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(42, 4, 'explanation_big_string_id', 'setExplanationBigStringId', 'getExplanationBigStringId', '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(42, 5, '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(42, 6, '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(42, 7, '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(42, 8, 'weight', 'setWeight', 'getWeight', 'java.math.BigDecimal', 'java.math.BigDecimal', 0, null, null, null )
GO

