--Module: poll -- hopp-poll-create.sql -- Derechos Reservados (c) 2001 Sandino Araico Sánchez -- Derechos Reservados (c) 2001 Presidencia de la República -- Copyright (c) 2001 Sandino Araico Sánchez All rights reserved -- --COMIENZA LICENCIA EN ESPAÑOL MEXICANO------------------------------------- -- Por éste medio se otroga permiso, libre de cargo, a cualquier persona que -- obtenga una copia de este software y archivos de documentación asociados -- (el "Software"), a utilizar el Software sin restricción, incluyendo sin -- limitación los derechos de usar, copiar, modificar, unir, publicar, -- distribuir y/o vender copias de el Software, y permitir lo mismo a personas -- a quienes les sea entregado el software, siempre y cuando los avisos de -- Derechos reservados y Copyright que aparecen arriba y éste permiso (en -- español y en inglés) aparezcan en todas las copias de el Software y que -- tanto los avisos de Derechos reservados y Copyright que aparecen arriba como -- éste permiso (en español y en inglés) aparezcan en la documentación de -- soporte. -- -- ESTE SOFTWARE SE PROVEE "TAL CUAL", SIN NINGUNA GARANTÍA DE NINGÚN TIPO, -- EXPRESA O IMPLÍCITA, INCLUYENDO PERO NO LIMITÁNDOSE A LAS GARANTÍAS DE -- MERCANTIBILIDAD, ADECUACIÓN PARA UN PROPÓSITO EN PARTICULAR Y NO -- INFRACCIÓN DE LOS DERECHOS DE TERCERAS PARTES. EN NINGÚN MOMENTO EL O LOS -- TITULARES DE LOS DERECHOS DE AUTOR Y COPYRIGHT INCLUIDOS EN ESTE AVISO SERÁN -- RESPONSABLES POR CUALQUIER RECLAMACIÓN O POR CUALQUIER DAÑO ESPECIAL, -- INDIRECTO O CONSECUENTE, O CUALQUIER DAÑO QUE RESULTE DE LA PÉRDIDA DE USO, -- DATOS O GANANCIAS, YA SEA EN UNA ACCIÓN DE CONTRATO, NEGLIGENCIA U OTRA -- ACCIÓN TORTUORIA, RESULTANTE DE O EN CONEXIÓN CON EL USO O DESEMPEÑO DE -- ESTE SOFTWARE. -- -- Excepto que se incluya en éste aviso, no se debe usar el nombre de ningún -- titular de Derechos de autor o Copyright en publicidad o de otra manera -- psra promover la venta, uso u otros tratos en este Software sin previa -- autorización por escrito del titular de Derechos de autor o Copyright. -- --TERMINA LICENCIA---------------------------------------------------------- -- -- --BEGIN LICENSE IN US ENGLISH----------------------------------------------- -- Permission is hereby granted, free of charge, to any person obtaining a -- copy of this software and associated documentation files (the -- "Software"), to deal in the Software without restriction, including -- without limitation the rights to use, copy, modify, merge, publish, -- distribute, and/or sell copies of the Software, and to permit persons -- to whom the Software is furnished to do so, provided that the above -- copyright and "Derechos reservados" notices and this permission notice -- (in spanish and english) appear in all copies of the Software and that both -- the above copyright and "Derechos reservados" notices and this permission -- notice (in spanish and english) appear in supporting documentation. -- -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT -- OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT AND "DERECHOS DE -- AUTOR" HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR -- ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER -- RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF -- CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN -- CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -- -- Except as contained in this notice, the name of a copyright or "Derechos de -- autor" holder shall not be used in advertising or otherwise to promote the -- sale, use or other dealings in this Software without prior written -- authorization of the copyright or "Derechos de autor" holder. -- --END LICENSE--------------------------------------------------------------- -- Changelog: -- 2001-09-18 Sandino Araico Sánchez - poll tables creation sql script create sequence s_poll; create table h_poll ( pll_key int2 constraint pk_pll_key primary key, pll_name varchar(250) constraint nn_pll_name not null, pll_type char constraint nn_pll_type not null, pll_active char constraint nn_pll_active not null ); create index i_pll_active on h_poll(pll_active); grant all on s_poll to nobody; grant all on h_poll to nobody; create sequence s_poll_det; create table h_poll_det( pll_det_key int2 constraint pk_pll_det_key primary key, pll_det_poll int2 constraint nn_pll_det_poll not null, pll_det_option varchar(500) constraint nn_pll_det_option not null, pll_det_order int2 ); alter table h_poll_det add constraint fk_pll_det_poll foreign key (pll_det_poll) references h_poll(pll_key); create index i_pll_det_poll on h_poll_det(pll_det_poll); create index i_pll_det_order on h_poll_det(pll_det_order); grant all on s_poll_det to nobody; grant all on h_poll_det to nobody; create sequence s_poll_cookie; create table h_poll_cookie( pll_coo_key int4 constraint pk_pll_coo_key primary key, pll_coo_poll int2 constraint nn_pll_coo_poll not null, pll_coo_cookie char(32) constraint nn_pll_coo_cookie not null, pll_coo_ip char(15) constraint nn_pll_coo_ip not null, pll_coo_date timestamp constraint nn_pll_coo_date not null ); alter table h_poll_cookie add constraint fk_pll_coo_poll foreign key(pll_coo_poll) references h_poll(pll_key); create index i_pll_coo_poll on h_poll_cookie(pll_coo_poll); create index i_pll_coo_ip on h_poll_cookie(pll_coo_ip); create index i_pll_coo_cookie on h_poll_cookie(pll_coo_cookie); create index i_pll_coo_date on h_poll_cookie(pll_coo_date); grant all on s_poll_cookie to nobody; grant all on h_poll_cookie to nobody; create sequence s_poll_vot; create table h_poll_vot( pll_vot_key int4 constraint pk_pll_vot_key primary key, pll_vot_det int2 constraint nn_pll_vot_det not null, pll_vot_cookie char(32) constraint nn_pll_vot_cookie not null, pll_vot_date timestamp constraint nn_pll_vot_date not null, pll_vot_value int2 ); alter table h_poll_vot add constraint fk_pll_vot_det foreign key(pll_vot_det) references h_poll_det(pll_det_key); --alter table h_poll_vot add constraint fk_pll_vot_cookie foreign key(pll_vot_cookie) references h_poll_cookie(pll_coo_cookie); create index i_pll_vot_det on h_poll_vot(pll_vot_det); create index i_pll_vot_cookie on h_poll_vot(pll_vot_cookie); create index i_pll_vot_date on h_poll_vot(pll_vot_date); grant all on s_poll_vot to nobody; grant all on h_poll_vot to nobody; create sequence s_poll_comment; create table h_poll_comment( pll_com_key int4 constraint pk_pll_com_key primary key, pll_com_poll int2 constraint nn_pll_com_poll not null, pll_com_cookie char(32) constraint nn_pll_com_cookie not null, pll_com_txt text constraint nn_pll_com_txt not null ); alter table h_poll_comment add constraint fk_pll_com_poll foreign key(pll_com_poll) references h_poll(pll_key); --alter table h_poll_comment add constraint fk_pll_com_cookie foreign key(pll_com_cookie) references h_poll_cookie(pll_coo_cookie); create index i_pll_com_poll on h_poll_comment(pll_com_poll); create index i_pll_com_cookie on h_poll_comment(pll_com_cookie); grant all on s_poll_comment to nobody; grant all on h_poll_comment to nobody;