DROP TABLE IF EXISTS `safes`;
CREATE TABLE `safes` (
                         `id` int NOT NULL AUTO_INCREMENT,
                         `user_id` int NOT NULL,
                         `staff_id` int NOT NULL,
                         `code` varchar(20) NOT NULL,
                         `name` varchar(150) NOT NULL,
                         `guid` varchar(250) NOT NULL,
                         `safe_tip` varchar(10) NOT NULL,
                         `safe_group` varchar(50) NOT NULL COMMENT 'safe:kasa, bank:banka hesabı, pos: pos hesapları, company:şirket ortakları hesabı, credit: kredi kartları hesabı, oncredit:veresiye hesapları',
                         `branch` int NOT NULL,
                         `status` tinyint(1) NOT NULL DEFAULT '1',
                         `currency_id` int NOT NULL,
                         `total` decimal(15,6) NOT NULL,
                         `before_total` decimal(15,6) NOT NULL,
                         `term_day` int NOT NULL,
                         `edit_date` datetime NOT NULL,
                         `insert_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
                         PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb3;