CREATE TABLE questionnaires (
	questionnaire_id int NOT NULL ,
	questionnaire_flags tinyint NOT NULL,
	deadline TIMESTAMP,
	CONSTRAINT PK_questionnaires PRIMARY KEY
	(
		questionnaire_id
	),
	CONSTRAINT FK_questionnaires_to_resources FOREIGN KEY
	(
		questionnaire_id
	) REFERENCES resources (
		resource_id
	)
)
GO


INSERT INTO classes (type, super_type, db_name, table_name, java_class)
	VALUES(37, 10, 'building2', 'questionnaires', 'org.bodington.assessment.Questionnaire')
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(37, 1, 'questionnaire_id', 'setQuestionnaireId', 'getQuestionnaireId', '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(37, 2, 'questionnaire_flags', 'setQuestionnaireFlags', 'getQuestionnaireFlags', 'byte', 'byte', 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(37, 3, 'deadline', 'setDeadline', 'getDeadline', 'java.sql.Timestamp', 'java.sql.Timestamp', 0, null, null, null )
GO

