CREATE TABLE bargeldtransaktion(
    `Oid` BIGINT(19) NOT NULL AUTO_INCREMENT,
	`Tid` INT(10) DEFAULT NULL,
	`IsActive` TINYINT(1) DEFAULT NULL,
	`Notice` VARCHAR(1024) DEFAULT NULL,
	`InsTs` DATETIME DEFAULT NULL,
	`InsUser` VARCHAR(256) DEFAULT NULL,
	`Version` BIGINT(19) DEFAULT NULL,
	`UdpUser` VARCHAR(256) DEFAULT NULL,
	`SystemEntryID` INT(10) DEFAULT NULL,
    `Zahlungstyp` TINYINT(1) DEFAULT NULL,
    `Betrag` DECIMAL(18,10) DEFAULT NULL,
    `Transaktionskassenbestand` DECIMAL(18, 10) DEFAULT NULL,
    `CustomerOid` BIGINT(19) DEFAULT NULL,
    `Zahlungsdatum` DATETIME DEFAULT NULL,
    PRIMARY KEY (`Oid`),
    KEY `BARGELDTRANSAKTION_CUSTOMER_FK` (`CustomerOid`),
    CONSTRAINT `FK_BARGELDTRANSAKTION_CUSTOMER` FOREIGN KEY (`CustomerOid`) REFERENCES `Customer` (`Oid`) ON DELETE NO ACTION ON UPDATE NO ACTION
)ENGINE=INNODB AUTO_INCREMENT=1 DEFAULT CHARSET=LATIN1;

ALTER TABLE customer ADD COLUMN `Auszahlungsintervall` TINYINT(10) DEFAULT NULL;

ALTER TABLE `invoiceitem`
  DROP FOREIGN KEY fk_invoiceitem_scapprovalperiodoid;
  
ALTER TABLE `invoicebase`
  DROP FOREIGN KEY FK_IN_SC2CB;
