--
-- THe patI18n Module MySQL requires two tables, use these statements
-- to create them.
--
-- The table's names are pretty random. You probably want to name them 
-- differently. Each set of tables (two tables) can store translations
-- for multiple text-domains. Later on, the patI18n_Module_MySQL may use
-- only a single set of tables. Still, if you want to separate 
-- translations in additional table sets, simply add as many modules as 
-- there are table sets.
--
-- One table -- here named i18nmsg -- contains all original untranslated 
-- messaged (in language "C"). The column names are fix, they are hard-coded 
-- the module MySQL. 
-- 
-- "mid" is the primary key, "domain" is the textdomain (in Gettext-context).
-- "msg" contains the message itself, "md5" is its md5-sum. In "created" there
-- is the timestamp when this record was added. In case this message is a plural
-- form of another messsage, "singular" contains the id of the singular form 
-- message. 
--
-- The other table -- here i18ntrans -- contains translations for of the above 
-- described messages for each language and optonal for different plural forms.
-- Here "mid" referes to the message in the other table., "created" is the 
-- timestamp (as above), "tras" the translated message string. Of course, "lang"
-- contains the language code. The column "min" is used for plural forms. it tells
-- from what count of plural (usually 2) this plural form applies. This way
-- it is possible to provide miltiple plural forms.
--
-- Also the table engine can also be INNODB or whatever suits you. With INNODB
-- you also can provide foreign key-relations etc. 
--

DROP TABLE IF EXISTS `i18nmsg`; 
CREATE TABLE `i18nmsg` (
    `mid` int(11) NOT NULL auto_increment,
    `singular` int(11) NULL default NULL,
    `created` datetime NOT NULL default '0000-00-00 00:00:00',
    `domain` char(32) NOT NULL,
    `md5` char(32) NOT NULL,
    `msg` blob NOT NULL,
  PRIMARY KEY (`mid`),
  KEY (`md5`),
  KEY (`domain`)
) 
ENGINE=MyISAM
DEFAULT CHARSET=utf8 COMMENT='i18n messages';

DROP TABLE IF EXISTS `i18ntrans`;
CREATE TABLE i18ntrans (
    `mid`int(11) NOT NULL,
    `created` datetime NOT NULL default '0000-00-00 00:00:00',
    `lang` char(5) NOT NULL default 'en',
    `trans` blob NOT NULL,
    `min`int(11) NOT NULL default 0,
  KEY (`mid`),
  KEY (`lang`)    
)
ENGINE=MyISAM
DEFAULT CHARSET=utf8 COMMENT='i18n translations';
