DROP TABLE IF EXISTS `GRP_UST`;
CREATE TABLE `GRP_UST` (
 `idx` INT NOT NULL ,
`gueltig` ENUM ( 'NEIN', 'JA' ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`gueltig_von` DATETIME NOT NULL ,
`gueltig_bis` DATETIME NOT NULL ,
`hist_an_zeit` DATETIME NOT NULL ,
`hist_an_user` VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`hist_ae_zeit` DATETIME NOT NULL ,
`hist_ae_user` VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`hist_lo_zeit` DATETIME NOT NULL ,
`hist_lo_user` VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`name` VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`bezeichnung` VARCHAR(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`bezeichnung2` VARCHAR(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`ust` DOUBLE NOT NULL 
) ENGINE = INNODB;
ALTER TABLE `GRP_UST` ADD PRIMARY KEY ( `idx` );
ALTER TABLE `GRP_UST` CHANGE `idx` `idx` INT( 11 ) NOT NULL AUTO_INCREMENT;
ALTER TABLE `GRP_UST`  DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
DROP TABLE IF EXISTS `USER`;
CREATE TABLE `USER` (
 `idx` INT NOT NULL ,
`gueltig` ENUM ( 'NEIN', 'JA' ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`gueltig_von` DATETIME NOT NULL ,
`gueltig_bis` DATETIME NOT NULL ,
`hist_an_zeit` DATETIME NOT NULL ,
`hist_an_user` VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`hist_ae_zeit` DATETIME NOT NULL ,
`hist_ae_user` VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`hist_lo_zeit` DATETIME NOT NULL ,
`hist_lo_user` VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`login` VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`vor_name` VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`nach_name` VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`passwd` VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL 
) ENGINE = INNODB;
ALTER TABLE `USER` ADD PRIMARY KEY ( `idx` );
ALTER TABLE `USER` CHANGE `idx` `idx` INT( 11 ) NOT NULL AUTO_INCREMENT;
ALTER TABLE `USER`  DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
DROP TABLE IF EXISTS `ART`;
CREATE TABLE `ART` (
 `idx` INT NOT NULL ,
`gueltig` ENUM ( 'NEIN', 'JA' ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`gueltig_von` DATETIME NOT NULL ,
`gueltig_bis` DATETIME NOT NULL ,
`hist_an_zeit` DATETIME NOT NULL ,
`hist_an_user` VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`hist_ae_zeit` DATETIME NOT NULL ,
`hist_ae_user` VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`hist_lo_zeit` DATETIME NOT NULL ,
`hist_lo_user` VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`artnr` VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`bezeichnung` VARCHAR(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`bezeichnung2` VARCHAR(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`gruppe_ust` VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`gruppe_ust_idx` INT NOT NULL 
) ENGINE = INNODB;
ALTER TABLE `ART` ADD PRIMARY KEY ( `idx` );
ALTER TABLE `ART` CHANGE `idx` `idx` INT( 11 ) NOT NULL AUTO_INCREMENT;
ALTER TABLE `ART`  DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
DROP TABLE IF EXISTS `GRP_ART`;
CREATE TABLE `GRP_ART` (
 `idx` INT NOT NULL ,
`name` VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`bezeichnung` VARCHAR(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`bezeichnung2` VARCHAR(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`art_artnr` VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`art_idx` INT NOT NULL 
) ENGINE = INNODB;
ALTER TABLE `GRP_ART` ADD PRIMARY KEY ( `idx` );
ALTER TABLE `GRP_ART` CHANGE `idx` `idx` INT( 11 ) NOT NULL AUTO_INCREMENT;
ALTER TABLE `GRP_ART`  DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
DROP TABLE IF EXISTS `LAYOUTK`;
CREATE TABLE `LAYOUTK` (
 `idx` INT NOT NULL ,
`name` VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`width` INT NOT NULL ,
`height` INT NOT NULL ,
`color` INT NOT NULL 
) ENGINE = INNODB;
ALTER TABLE `LAYOUTK` ADD PRIMARY KEY ( `idx` );
ALTER TABLE `LAYOUTK` CHANGE `idx` `idx` INT( 11 ) NOT NULL AUTO_INCREMENT;
ALTER TABLE `LAYOUTK`  DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
DROP TABLE IF EXISTS `LAYOUTP`;
CREATE TABLE `LAYOUTP` (
 `idx` INT NOT NULL ,
`layout_idx` INT NOT NULL ,
`label_name` VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`label_x` INT NOT NULL ,
`label_y` INT NOT NULL ,
`label_width` INT NOT NULL ,
`label_height` INT NOT NULL ,
`label_color` INT NOT NULL ,
`label_icon` VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL 
) ENGINE = INNODB;
ALTER TABLE `LAYOUTP` ADD PRIMARY KEY ( `idx` );
ALTER TABLE `LAYOUTP` CHANGE `idx` `idx` INT( 11 ) NOT NULL AUTO_INCREMENT;
ALTER TABLE `LAYOUTP`  DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
DROP TABLE IF EXISTS `BONLINE`;
CREATE TABLE `BONLINE` (
 `idx` INT NOT NULL ,
`gueltig` ENUM ( 'NEIN', 'JA' ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`gueltig_von` DATETIME NOT NULL ,
`gueltig_bis` DATETIME NOT NULL ,
`hist_an_zeit` DATETIME NOT NULL ,
`hist_an_user` VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`hist_ae_zeit` DATETIME NOT NULL ,
`hist_ae_user` VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`hist_lo_zeit` DATETIME NOT NULL ,
`hist_lo_user` VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`user` VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`user_idx` INT NOT NULL ,
`artnr` VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`artnr_idx` INT NOT NULL ,
`bill_printed` ENUM ( 'NEIN', 'JA' ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`bill_number` VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`layoutk_idx` INT NOT NULL ,
`layoutk_name` VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`layoutp_idx` INT NOT NULL ,
`layoutp_label_name` VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`tagesabschluss` ENUM ( 'NEIN', 'JA' ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`abschl_zeit` DATETIME NOT NULL ,
`abschl_user_idx` INT NOT NULL ,
`abschl_user_name` VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`storniert` ENUM ( 'NEIN', 'JA' ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`storno_user` VARCHAR(256) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`storno_user_idx` INT NOT NULL ,
`anzahl` INT NOT NULL ,
`preis_idx` INT NOT NULL ,
`preis` DOUBLE NOT NULL ,
`bar_bezahlt` DOUBLE NOT NULL ,
`sonst_bezahlt` DOUBLE NOT NULL ,
`sonst_art_name` VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`sonst_art_idx` INT NOT NULL ,
`bezahlt` ENUM ( 'NEIN', 'JA' ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL 
) ENGINE = INNODB;
ALTER TABLE `BONLINE` ADD PRIMARY KEY ( `idx` );
ALTER TABLE `BONLINE` CHANGE `idx` `idx` INT( 11 ) NOT NULL AUTO_INCREMENT;
ALTER TABLE `BONLINE`  DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
DROP TABLE IF EXISTS `PREIS`;
CREATE TABLE `PREIS` (
 `idx` INT NOT NULL ,
`gueltig` ENUM ( 'NEIN', 'JA' ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`gueltig_von` DATETIME NOT NULL ,
`gueltig_bis` DATETIME NOT NULL ,
`hist_an_zeit` DATETIME NOT NULL ,
`hist_an_user` VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`hist_ae_zeit` DATETIME NOT NULL ,
`hist_ae_user` VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`hist_lo_zeit` DATETIME NOT NULL ,
`hist_lo_user` VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`art_artnr` VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`art_idx` INT NOT NULL ,
`preis` DOUBLE NOT NULL ,
`bezeichnung` VARCHAR(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`bezeichnung2` VARCHAR(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`gutschein` ENUM ( 'NEIN', 'JA' ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`menuepreis` ENUM ( 'NEIN', 'JA' ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL 
) ENGINE = INNODB;
ALTER TABLE `PREIS` ADD PRIMARY KEY ( `idx` );
ALTER TABLE `PREIS` CHANGE `idx` `idx` INT( 11 ) NOT NULL AUTO_INCREMENT;
ALTER TABLE `PREIS`  DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
DROP TABLE IF EXISTS `SONST_ART`;
CREATE TABLE `SONST_ART` (
 `idx` INT NOT NULL ,
`gueltig` ENUM ( 'NEIN', 'JA' ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`gueltig_von` DATETIME NOT NULL ,
`gueltig_bis` DATETIME NOT NULL ,
`hist_an_zeit` DATETIME NOT NULL ,
`hist_an_user` VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`hist_ae_zeit` DATETIME NOT NULL ,
`hist_ae_user` VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`hist_lo_zeit` DATETIME NOT NULL ,
`hist_lo_user` VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`name` VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`bezeichnung` VARCHAR(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`bezeichnung2` VARCHAR(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`wert` DOUBLE NOT NULL 
) ENGINE = INNODB;
ALTER TABLE `SONST_ART` ADD PRIMARY KEY ( `idx` );
ALTER TABLE `SONST_ART` CHANGE `idx` `idx` INT( 11 ) NOT NULL AUTO_INCREMENT;
ALTER TABLE `SONST_ART`  DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
DROP TABLE IF EXISTS `LANG`;
CREATE TABLE `LANG` (
 `idx` INT NOT NULL ,
`system` VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`type` VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`orig` VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`trans` VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL 
) ENGINE = INNODB;
ALTER TABLE `LANG` ADD PRIMARY KEY ( `idx` );
ALTER TABLE `LANG` CHANGE `idx` `idx` INT( 11 ) NOT NULL AUTO_INCREMENT;
ALTER TABLE `LANG`  DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;

