# Tool per ricreare la tabella contenente la mailing list.
# Utilizzo:
#   sh mlstruct.sh nomeMailingList | mysql nomeDatabase
if [ "X" = "X${1}" ]
then
	exit;
fi
cat << EOF
DROP TABLE IF EXISTS gufi_${1};
CREATE TABLE \`gufi_${1}\` (
\`id\` INT(11) NOT NULL AUTO_INCREMENT,
\`msgid\` VARCHAR( 255 ) NOT NULL ,
\`padre\` VARCHAR( 255 ) ,
\`from\` VARCHAR( 255 ) NOT NULL ,
\`subject\` VARCHAR( 255 ) NOT NULL ,
\`date\` TIMESTAMP NOT NULL ,
\`body\` TEXT NOT NULL ,
\`idthread\` INT NOT NULL ,
\`livellothread\` TINYINT default NULL ,
\`ordinethread\` TINYINT default NULL ,
PRIMARY KEY ( \`id\` ) ,
UNIQUE ( \`msgid\` ),
INDEX ( \`msgid\` ),
INDEX ( \`idthread\` ),
INDEX ( \`ordinethread\` ),
INDEX ( \`idthread\`,\`ordinethread\` ),
INDEX ( \`padre\` ),
FULLTEXT ( \`from\`,\`subject\`,\`body\` )
);
EOF

