
CREATE TABLE `hourly_pay_insouts` (
  `entry_id` BIGINT(20) NOT NULL,
	`for_datetime` DATETIME NULL,
	`pay_ins` DECIMAL(18, 2) NULL,
	`pay_outs` DECIMAL(18, 2) NULL,
	`datetime_ran` DATETIME NULL,
	`eod_id` BIGINT(20) NOT NULL,
	`version` VARCHAR(20) NOT NULL,
	`api_sync` VARCHAR(1) NULL,
  PRIMARY KEY (`entry_id`)
)
  COLLATE='latin1_swedish_ci'
  ENGINE=MyISAM;

-- --------------------------------------------------------

--
-- Table structure for table `hourly_gross`
--

CREATE TABLE `hourly_gross` (
  `entry_id` BIGINT(20) NOT NULL,
	`for_datetime` DATETIME NULL,
	`grosstotal` DECIMAL(18, 2) NULL,
	`grosstotal_cc` DECIMAL(18, 2) NULL,
	`flags` NCHAR(1) NULL,
	`datetime_added` DATETIME NULL,
	`taxtotal` DECIMAL(18, 2) NULL,
	`taxtotal_cc` DECIMAL(18, 2) NULL,
	`nettotal` DECIMAL(18, 2) NULL,
	`nettotal_cc` DECIMAL(18, 2) NULL,
	`discounts` DECIMAL(18, 2) NULL,
	`discountscc` DECIMAL(18, 2) NULL,
	`comps` DECIMAL(18, 2) NULL,
	`orders_count` BIGINT(20) NULL,
	`eod_id` BIGINT(20) NOT NULL,
	`version` VARCHAR(20) NOT NULL,
	`api_sync` VARCHAR(1) NULL,
  PRIMARY KEY (`entry_id`)
)
  COLLATE='latin1_swedish_ci'
  ENGINE=MyISAM;

-- --------------------------------------------------------

--
-- Table structure for table `hourly_giftcard_sales`
--

CREATE TABLE `hourly_giftcard_sales` (
  `for_datetime` DATETIME NULL,
	`gc_sells_total` DECIMAL(18, 2) NULL,
	`gc_sells_totalcc` DECIMAL(18, 2) NULL,
	`gc_sells_count` BIGINT(20) NULL,
	`datetime_added` DATETIME NULL,
	`flags` VARCHAR(300) NULL,
	`entry_id` BIGINT(20) NOT NULL,
	`eod_id` BIGINT(20) NOT NULL,
	`version` VARCHAR(20) NOT NULL,
	`api_sync` VARCHAR(1) NULL,
  PRIMARY KEY (`entry_id`)
)
  COLLATE='latin1_swedish_ci'
  ENGINE=MyISAM;

-- --------------------------------------------------------

--
-- Table structure for table `hourly_fees`
--

CREATE TABLE `hourly_fees` (
  `entry_id` BIGINT(20) NOT NULL,
	`for_datetime` DATETIME NULL,
	`total_fees` DECIMAL(18, 2) NULL,
	`datetime_ran` DATETIME NULL,
	`eod_id` BIGINT(20) NOT NULL,
	`version` VARCHAR(20) NOT NULL,
	`api_sync` VARCHAR(1) NULL,
  PRIMARY KEY (`entry_id`)
)
  COLLATE='latin1_swedish_ci'
  ENGINE=MyISAM;

-- --------------------------------------------------------

--
-- Table structure for table `hourly_category_sales`
--

CREATE TABLE `hourly_category_sales` (
  `entry_id` BIGINT(20) NOT NULL,
	`for_date` DATETIME NULL,
	`cat_id` BIGINT(20) NULL,
	`total` DECIMAL(18, 2) NULL,
	`totalcc` DECIMAL(18, 2) NULL,
	`flags` NCHAR(10) NULL,
	`datetime_added` DATETIME NULL,
	`eod_id` BIGINT(20) NOT NULL,
	`comps` DECIMAL(10, 2) NOT NULL,
	`version` VARCHAR(20) NOT NULL,
	`counts_sold` BIGINT(20) NULL,
	`api_sync` VARCHAR(1) NULL,
  PRIMARY KEY (`entry_id`)
)
  COLLATE='latin1_swedish_ci'
  ENGINE=MyISAM;

-- --------------------------------------------------------

--
-- Table structure for table `daily_pre_sir`
--

CREATE TABLE `daily_pre_sir` (
  `entry_id` BIGINT(20) NOT NULL,
	`for_datetime` DATETIME NULL,
	`emp_id` BIGINT(20) NULL,
	`type` NCHAR(1) NULL,
	`amount` DECIMAL(18, 2) NULL,
	`datetime_ran` DATETIME NULL,
	`version` VARCHAR(20) NOT NULL,
	`eod_id` BIGINT(20) NOT NULL,
	`api_sync` VARCHAR(1) NULL,
  PRIMARY KEY (`entry_id`)
)
  COLLATE='latin1_swedish_ci'
  ENGINE=MyISAM;

-- --------------------------------------------------------

--
-- Table structure for table `daily_post_sir`
--

CREATE TABLE `daily_post_sir` (
  `entry_id` BIGINT(20) NOT NULL,
	`for_datetime` DATETIME NULL,
	`emp_id` BIGINT(20) NULL,
	`type` NCHAR(1) NULL,
	`amount` DECIMAL(18, 2) NULL,
	`datetime_ran` DATETIME NULL,
	`version` VARCHAR(20) NOT NULL,
	`eod_id` BIGINT(20) NOT NULL,
	`api_sync` VARCHAR(1) NULL,
  PRIMARY KEY (`entry_id`)
)
  COLLATE='latin1_swedish_ci'
  ENGINE=MyISAM;

-- --------------------------------------------------------

--
-- Table structure for table `daily_comp_report`
--

CREATE TABLE `daily_comp_report` (
  `entry_id` BIGINT(20) NOT NULL,
	`for_datetime` DATETIME NULL,
	`emp_id` BIGINT(20) NULL,
	`type` NCHAR(1) NULL,
	`amount` DECIMAL(18, 2) NULL,
	`datetime_ran` DATETIME NULL,
	`version` VARCHAR(20) NOT NULL,
	`api_sync` VARCHAR(1) NULL,
  PRIMARY KEY (`entry_id`)
)
  COLLATE='latin1_swedish_ci'
  ENGINE=MyISAM;





/* Triggers */
/*DELIMITER |
CREATE TRIGGER `log_delete_admins` AFTER DELETE ON `employees_admin` FOR EACH ROW BEGIN
	IF @disable_triggers IS NULL THEN
		INSERT INTO sync_delete (syncID, syncPK, syncTable)
			VALUES (old.employee_id, 'employee_id', 'employees_admin');
	END IF;
END |

CREATE TRIGGER `log_delete_e2j` BEFORE DELETE ON `employees_employee2job` FOR EACH ROW BEGIN
	IF @disable_triggers IS NULL THEN
		INSERT INTO sync_delete (syncID, syncPK, syncTable)
			VALUES (old.row_id, 'row_id', 'employees_employee2job');
	END IF;
END |

CREATE TRIGGER log_delete_jobs AFTER DELETE ON employees_jobs FOR EACH ROW BEGIN
	IF @disable_triggers IS NULL THEN
		INSERT INTO sync_delete (syncID, syncPK, syncTable)
		VALUES (old.job_id, 'job_id', 'employees_jobs');
	END IF;
END |

CREATE TRIGGER log_delete_jobs_privs AFTER DELETE ON employees_jobs_privaledges FOR EACH ROW BEGIN
	IF @disable_triggers IS NULL THEN
		INSERT INTO sync_delete (syncID, syncPK, syncTable)
		VALUES (old.job_id, 'job_id', 'employees_jobs_privaledges');
	END IF;
END |

CREATE TRIGGER log_delete_passwords AFTER DELETE ON employees_passwords FOR EACH ROW BEGIN
	IF @disable_triggers IS NULL THEN
		INSERT INTO sync_delete (syncID, syncPK, syncTable)
		VALUES (old.password_id, 'password_id', 'employees_passwords');
	END IF;
END |*/
DELIMITER ;


