Новости | FAQ | Авторы | Документация | В действии | Библиотека |
Инструменты | Полезные ссылки | Хостинги | Скачать | Примеры | Форум |
Sanja v.2 30.09.2004 20:48
/*==============================================================*/ /* Table: cati_surveys */ /*==============================================================*/ create table cati_surveys ( survey_id int(10) unsigned not null, title text not null, created datetime, status enum('production','devel','disabled'), expires datetime ); alter table cati_surveys add primary key (survey_id); insert into cati_surveys values( '1', 'Тестовый опрос', NOW(), 'devel', '') ); /*==============================================================*/ /* Table: cati_questions */ /*==============================================================*/ create table cati_questions ( survey_id int(10) unsigned not null, question_id int(10) unsigned not null, caption text, hint text, mandatory enum('y','n'), maxvariants int, type enum('checkbox','radio') ); alter table cati_questions add primary key (question_id); insert into cati_questions values( '1', '1', 'Вы завтракаете по утрам?', '', 'n', '1', 'radio' ); insert into cati_questions values( '1', '2', 'На завтрак вы чаще всего едите...', '', 'y', '', 'checkbox' ); insert into cati_questions values( '1', '1', 'Ваше кредо?', '', 'y', '', 'radio' ); /*==============================================================*/ /* Table: cati_questionvariants */ /*==============================================================*/ create table cati_questionvariants ( question_id int(10) unsigned not null, variant_id int(10) unsigned not null, caption text not null, type enum('simple','textfield','textarea'), ischecked enum('y','n'), hint text ); alter table cati_questionvariants add primary key (variant_id); insert into cati_questionvariants values('1','1','Да','simple','n',''); insert into cati_questionvariants values('1','2','Нет','simple','n',''); insert into cati_questionvariants values('2','3','Яичницу','simple','n',''); insert into cati_questionvariants values('2','4','Творог','simple','n','В любой форме - сырники, запеканки, свежий'); insert into cati_questionvariants values('2','5','Хлопья','simple','n',''); insert into cati_questionvariants values('3','6','','textarea','n','Впишите'); /*==============================================================*/ /* Table: cati_filters */ /*==============================================================*/ create table cati_filters ( survey_id int(10) unsigned not null, question_id int(10) unsigned not null, filter_id int(10) unsigned not null, filter text, target text, ); alter table cati_filters add primary key (filter_id); insert into cati_filters values( '1','1','1','def $variant2','3' ); /*==============================================================*/ /* Table: cati_quotas */ /*==============================================================*/ create table cati_quotas ( ); /*==============================================================*/ /* Table: cati_results */ /*==============================================================*/ create table cati_results ( );