Index: lams_tool_survey/db/sql/table-schema.sql
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_survey/db/sql/table-schema.sql,v
diff -u -r1.1 -r1.2
--- lams_tool_survey/db/sql/table-schema.sql	12 Sep 2006 04:15:18 -0000	1.1
+++ lams_tool_survey/db/sql/table-schema.sql	13 Sep 2006 07:20:17 -0000	1.2
@@ -1,36 +1,34 @@
-alter table tl_lasurv11_attachment drop foreign key FK1E7009430E79035;
-alter table tl_lasurv11_item_instruction drop foreign key FKA5665013980570ED;
-alter table tl_lasurv11_item_log drop foreign key FK63195BC938BF8DFE;
-alter table tl_lasurv11_item_log drop foreign key FK63195BC941F9365D;
-alter table tl_lasurv11_survey drop foreign key FK89093BF758092FB;
-alter table tl_lasurv11_survey_item drop foreign key FKF52D1F9330E79035;
-alter table tl_lasurv11_survey_item drop foreign key FKF52D1F93EC0D3147;
-alter table tl_lasurv11_survey_item drop foreign key FKF52D1F93758092FB;
-alter table tl_lasurv11_session drop foreign key FK24AA78C530E79035;
-alter table tl_lasurv11_user drop foreign key FK30113BFC30E79035;
-alter table tl_lasurv11_user drop foreign key FK30113BFCEC0D3147;
+alter table tl_lasurv11_answer drop foreign key FK6DAAFE3BB1423DC1;
+alter table tl_lasurv11_answer drop foreign key FK6DAAFE3BAE4CB69;
+alter table tl_lasurv11_attachment drop foreign key FKD92A9120D14146E5;
+alter table tl_lasurv11_option drop foreign key FK85AB46F282152886;
+alter table tl_lasurv11_question drop foreign key FK872D4F23D14146E5;
+alter table tl_lasurv11_question drop foreign key FK872D4F23E4C99A5F;
+alter table tl_lasurv11_session drop foreign key FKF08793B9D14146E5;
+alter table tl_lasurv11_survey drop foreign key FK8CC465D7E4C99A5F;
+alter table tl_lasurv11_user drop foreign key FK633F25884F803F63;
+alter table tl_lasurv11_user drop foreign key FK633F2588D14146E5;
+drop table if exists tl_lasurv11_answer;
 drop table if exists tl_lasurv11_attachment;
-drop table if exists tl_lasurv11_item_instruction;
-drop table if exists tl_lasurv11_item_log;
-drop table if exists tl_lasurv11_survey;
-drop table if exists tl_lasurv11_survey_item;
+drop table if exists tl_lasurv11_option;
+drop table if exists tl_lasurv11_question;
 drop table if exists tl_lasurv11_session;
+drop table if exists tl_lasurv11_survey;
 drop table if exists tl_lasurv11_user;
+create table tl_lasurv11_answer (uid bigint not null auto_increment, survey_item_uid bigint, user_uid bigint, session_id bigint, answer_choices varchar(255), udpate_date datetime, answer_text varchar(255), primary key (uid));
 create table tl_lasurv11_attachment (uid bigint not null auto_increment, file_version_id bigint, file_type varchar(255), file_name varchar(255), file_uuid bigint, create_date datetime, survey_uid bigint, primary key (uid));
-create table tl_lasurv11_item_instruction (uid bigint not null auto_increment, description varchar(255), sequence_id integer, item_uid bigint, primary key (uid));
-create table tl_lasurv11_item_log (uid bigint not null auto_increment, access_date datetime, survey_item_uid bigint, user_uid bigint, complete bit, session_id bigint, primary key (uid));
-create table tl_lasurv11_survey (uid bigint not null auto_increment, create_date datetime, update_date datetime, create_by bigint, title varchar(255), run_offline bit, lock_on_finished bit, instructions text, online_instructions text, offline_instructions text, content_in_use bit, define_later bit, content_id bigint unique, allow_add_files bit, allow_add_urls bit, mini_view_survey_number integer, allow_auto_run bit, reflect_instructions varchar(255), reflect_on_activity bit, primary key (uid));
-create table tl_lasurv11_survey_item (uid bigint not null auto_increment, file_uuid bigint, file_version_id bigint, description varchar(255), ims_schema varchar(255), init_item varchar(255), organization_xml text, title varchar(255), url text, create_by bigint, create_date datetime, create_by_author bit, is_hide bit, item_type smallint, file_type varchar(255), file_name varchar(255), open_url_new_window bit, survey_uid bigint, session_uid bigint, primary key (uid));
-create table tl_lasurv11_session (uid bigint not null auto_increment, session_end_date datetime, session_start_date datetime, status integer, survey_uid bigint, session_id bigint, session_name varchar(250), primary key (uid));
+create table tl_lasurv11_option (uid bigint not null auto_increment, description varchar(255), sequence_id integer, option_uid bigint, primary key (uid));
+create table tl_lasurv11_question (uid bigint not null auto_increment, description varchar(255), create_by bigint, create_date datetime, question_type smallint, append_text bit, compulsory bit, max_answers integer, survey_uid bigint, primary key (uid));
+create table tl_lasurv11_session (uid bigint not null auto_increment, session_end_date datetime, session_start_date datetime, survey_uid bigint, session_id bigint, session_name varchar(250), primary key (uid));
+create table tl_lasurv11_survey (uid bigint not null auto_increment, create_date datetime, update_date datetime, create_by bigint, title varchar(255), run_offline bit, lock_on_finished bit, instructions text, online_instructions text, offline_instructions text, content_in_use bit, define_later bit, content_id bigint unique, reflect_instructions varchar(255), reflect_on_activity bit, show_questions_on_one_page bit, primary key (uid));
 create table tl_lasurv11_user (uid bigint not null auto_increment, user_id bigint, last_name varchar(255), first_name varchar(255), login_name varchar(255), session_uid bigint, survey_uid bigint, session_finished bit, primary key (uid));
-alter table tl_lasurv11_attachment add index FK1E7009430E79035 (survey_uid), add constraint FK1E7009430E79035 foreign key (survey_uid) references tl_lasurv11_survey (uid);
-alter table tl_lasurv11_item_instruction add index FKA5665013980570ED (item_uid), add constraint FKA5665013980570ED foreign key (item_uid) references tl_lasurv11_survey_item (uid);
-alter table tl_lasurv11_item_log add index FK63195BC938BF8DFE (survey_item_uid), add constraint FK63195BC938BF8DFE foreign key (survey_item_uid) references tl_lasurv11_survey_item (uid);
-alter table tl_lasurv11_item_log add index FK63195BC941F9365D (user_uid), add constraint FK63195BC941F9365D foreign key (user_uid) references tl_lasurv11_user (uid);
-alter table tl_lasurv11_survey add index FK89093BF758092FB (create_by), add constraint FK89093BF758092FB foreign key (create_by) references tl_lasurv11_user (uid);
-alter table tl_lasurv11_survey_item add index FKF52D1F9330E79035 (survey_uid), add constraint FKF52D1F9330E79035 foreign key (survey_uid) references tl_lasurv11_survey (uid);
-alter table tl_lasurv11_survey_item add index FKF52D1F93EC0D3147 (session_uid), add constraint FKF52D1F93EC0D3147 foreign key (session_uid) references tl_lasurv11_session (uid);
-alter table tl_lasurv11_survey_item add index FKF52D1F93758092FB (create_by), add constraint FKF52D1F93758092FB foreign key (create_by) references tl_lasurv11_user (uid);
-alter table tl_lasurv11_session add index FK24AA78C530E79035 (survey_uid), add constraint FK24AA78C530E79035 foreign key (survey_uid) references tl_lasurv11_survey (uid);
-alter table tl_lasurv11_user add index FK30113BFC30E79035 (survey_uid), add constraint FK30113BFC30E79035 foreign key (survey_uid) references tl_lasurv11_survey (uid);
-alter table tl_lasurv11_user add index FK30113BFCEC0D3147 (session_uid), add constraint FK30113BFCEC0D3147 foreign key (session_uid) references tl_lasurv11_session (uid);
+alter table tl_lasurv11_answer add index FK6DAAFE3BB1423DC1 (user_uid), add constraint FK6DAAFE3BB1423DC1 foreign key (user_uid) references tl_lasurv11_user (uid);
+alter table tl_lasurv11_answer add index FK6DAAFE3BAE4CB69 (survey_item_uid), add constraint FK6DAAFE3BAE4CB69 foreign key (survey_item_uid) references tl_lasurv11_question (uid);
+alter table tl_lasurv11_attachment add index FKD92A9120D14146E5 (survey_uid), add constraint FKD92A9120D14146E5 foreign key (survey_uid) references tl_lasurv11_survey (uid);
+alter table tl_lasurv11_option add index FK85AB46F282152886 (option_uid), add constraint FK85AB46F282152886 foreign key (option_uid) references tl_lasurv11_question (uid);
+alter table tl_lasurv11_question add index FK872D4F23D14146E5 (survey_uid), add constraint FK872D4F23D14146E5 foreign key (survey_uid) references tl_lasurv11_survey (uid);
+alter table tl_lasurv11_question add index FK872D4F23E4C99A5F (create_by), add constraint FK872D4F23E4C99A5F foreign key (create_by) references tl_lasurv11_user (uid);
+alter table tl_lasurv11_session add index FKF08793B9D14146E5 (survey_uid), add constraint FKF08793B9D14146E5 foreign key (survey_uid) references tl_lasurv11_survey (uid);
+alter table tl_lasurv11_survey add index FK8CC465D7E4C99A5F (create_by), add constraint FK8CC465D7E4C99A5F foreign key (create_by) references tl_lasurv11_user (uid);
+alter table tl_lasurv11_user add index FK633F25884F803F63 (session_uid), add constraint FK633F25884F803F63 foreign key (session_uid) references tl_lasurv11_session (uid);
+alter table tl_lasurv11_user add index FK633F2588D14146E5 (survey_uid), add constraint FK633F2588D14146E5 foreign key (survey_uid) references tl_lasurv11_survey (uid);
