USE internationaliser;
/**
  * bundles, information commont to a set of translations for one language/country/variant
  * This controls which bundles a given translator or proofreader has access to.
  */
DROP TABLE IF EXISTS bundles;
CREATE TABLE bundles (
  /**
   * a unique serial number assigned to each unique combination
   * of uniqueProjectID/bundlename/language/country
   */
   uniqueBundleID INTEGER NOT NULL AUTO_INCREMENT,
  /**
    * short 8-char name for project. All lower case. Do not confuse with package name.
    */
   uniqueProjectID VARCHAR( 8 ) NOT NULL,
   /**
    * package name of the Bundle. Which package this these translations are for.
    * Dotted package name.
    */
   packageName VARCHAR( 100 ) NOT NULL,
   /**
    * name of the bundle, not including the _sr_YU_CYR.properties, or the package.
    * Normally the name will start with an upper case letter. Must be a valid file name
    * on any platform you use for source development.
    * It will become the name of the properties file XXXX_sr_YU_CRY.properties.
    * Converted to lower case, it must be a valid Java identifier
    * used in source code as xxxx.getString( "YYY" );  Must be unique within package.
    */
   resourceBundleBase VARCHAR( 50 ) NOT NULL,
   /**
    * language of locale, 2-char abbreviation, lower case.
    */
   language CHAR ( 2 ) NOT NULL,
   /**
    * country of locale, 2-char abbreviation, all caps, possibly blank.
    */
   country CHAR ( 2 ) NOT NULL,
   /**
    * variant of locale, 3-char abbreviation, all caps, possibly blank.
    */
   variant CHAR ( 2 ) NOT NULL,
   /**
    * We look up bundles by uniqueBundleID
    * We also use uniqueBundleID to link in other tables
    * to link to this information.
    */
   PRIMARY KEY( uniqueBundleID ),
   INDEX ByBundleParts( uniqueProjectID, packageName, resourceBundleBase, language, country, variant),
   FOREIGN KEY( uniqueProjectID, packageName, resourceBundleBase ) REFERENCES resourceBundles( uniqueProjectID, packageName, resourceBundleBase )
   );
