Qrydb
Qrydb
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 25, 2021 at 12:50 PM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.3.18
--
-- Database: `firadb`
--
-- --------------------------------------------------------
--
-- Table structure for table `barang`
--
--
-- Dumping data for table `barang`
--
-- --------------------------------------------------------
--
-- Table structure for table `barang_org`
--
--
-- Dumping data for table `barang_org`
--
-- --------------------------------------------------------
--
-- Table structure for table `grouplvlmdl`
--
-- --------------------------------------------------------
--
-- Table structure for table `kategori`
--
--
-- Dumping data for table `kategori`
--
-- --------------------------------------------------------
--
-- Table structure for table `level`
--
CREATE TABLE `level` (
`idlevel` tinyint(2) NOT NULL,
`lvl` varchar(35) NOT NULL,
`aktif` enum('Y','N') NOT NULL,
`CreatedBy` varchar(15) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `level`
--
-- --------------------------------------------------------
--
-- Table structure for table `lgnhistories`
--
--
-- Dumping data for table `lgnhistories`
--
-- --------------------------------------------------------
--
-- Table structure for table `menu`
--
--
-- Dumping data for table `menu`
--
INSERT INTO `menu` (`menuID`, `menu`, `aktif`, `sort`) VALUES
(1, 'Data Master', 'Y', 2),
(2, 'Transaksi', 'Y', 3),
(3, 'Laporan', 'Y', 4),
(5, 'My Account', 'Y', 1),
(6, 'Settings', 'Y', 5);
-- --------------------------------------------------------
--
-- Table structure for table `modul`
--
--
-- Dumping data for table `modul`
--
-- --------------------------------------------------------
--
-- Table structure for table `ms_csstatus`
--
--
-- Dumping data for table `ms_csstatus`
--
--
-- Table structure for table `ms_custsup`
--
--
-- Dumping data for table `ms_custsup`
--
-- --------------------------------------------------------
--
-- Table structure for table `ms_trxstatus`
--
--
-- Dumping data for table `ms_trxstatus`
--
-- --------------------------------------------------------
--
-- Table structure for table `pembelian`
--
CREATE TABLE `pembelian` (
`kdPembelian` varchar(20) NOT NULL,
`no_nota` varchar(20) NOT NULL,
`total_pembelian` decimal(10,2) NOT NULL,
`kdsup` smallint(1) NOT NULL,
`userID` varchar(15) NOT NULL,
`tgl_input` datetime NOT NULL DEFAULT current_timestamp(),
`tgl_beli` date NOT NULL,
`ids` tinyint(1) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `pembeliandtl`
--
--
-- Dumping data for table `pembeliandtl`
--
--
-- Triggers `pembeliandtl`
--
DELIMITER $$
CREATE TRIGGER `T_UpdStok_AD_Pembelian` AFTER DELETE ON `pembeliandtl` FOR EACH ROW
BEGIN
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `T_UpdStok_AI_Pembelian` AFTER INSERT ON `pembeliandtl` FOR EACH ROW
BEGIN
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `T_UpdStok_AU_Pembelian` AFTER UPDATE ON `pembeliandtl` FOR EACH ROW
BEGIN
END
$$
DELIMITER ;
-- --------------------------------------------------------
--
-- Table structure for table `penjualan`
--
--
-- Dumping data for table `penjualan`
--
--
-- Table structure for table `penjualandtl`
--
--
-- Dumping data for table `penjualandtl`
--
--
-- Triggers `penjualandtl`
--
DELIMITER $$
CREATE TRIGGER `T_UpdStok_AD_Penjualan` AFTER DELETE ON `penjualandtl` FOR EACH ROW
BEGIN
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `T_UpdStok_AI_Penjualan` AFTER INSERT ON `penjualandtl` FOR EACH ROW
BEGIN
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `T_UpdStok_AU_Penjualan` AFTER UPDATE ON `penjualandtl` FOR EACH ROW
BEGIN
END
$$
DELIMITER ;
-- --------------------------------------------------------
--
-- Table structure for table `rptparam`
--
--
-- Dumping data for table `rptparam`
--
-- --------------------------------------------------------
--
-- Table structure for table `settings`
--
--
-- Dumping data for table `settings`
--
-- --------------------------------------------------------
--
-- Table structure for table `suplier`
--
--
-- Dumping data for table `suplier`
--
-- --------------------------------------------------------
--
-- Table structure for table `unit`
--
--
-- Dumping data for table `unit`
--
--
-- Table structure for table `users`
--
--
-- Dumping data for table `users`
--
-- --------------------------------------------------------
--
-- Table structure for table `vpenjualandtl`
--
--
-- Indexes for dumped tables
--
--
-- Indexes for table `barang`
--
ALTER TABLE `barang`
ADD PRIMARY KEY (`idbarang`);
--
-- Indexes for table `kategori`
--
ALTER TABLE `kategori`
ADD PRIMARY KEY (`idkat`);
--
-- Indexes for table `ms_csstatus`
--
ALTER TABLE `ms_csstatus`
ADD PRIMARY KEY (`idcsstatus`);
--
-- Indexes for table `ms_custsup`
--
ALTER TABLE `ms_custsup`
ADD PRIMARY KEY (`csid`),
ADD KEY `csstatus` (`csstatus`);
--
-- Indexes for table `ms_trxstatus`
--
ALTER TABLE `ms_trxstatus`
ADD PRIMARY KEY (`idtrxstatus`);
--
-- Indexes for table `penjualan`
--
ALTER TABLE `penjualan`
ADD KEY `mstrxstatus` (`mstrxstatus`),
ADD KEY `customer` (`customer`);
--
-- Indexes for table `penjualandtl`
--
ALTER TABLE `penjualandtl`
ADD PRIMARY KEY (`idDtlPenjualan`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `barang`
--
ALTER TABLE `barang`
MODIFY `idbarang` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1070;
--
-- AUTO_INCREMENT for table `kategori`
--
ALTER TABLE `kategori`
MODIFY `idkat` tinyint(3) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
--
-- AUTO_INCREMENT for table `ms_csstatus`
--
ALTER TABLE `ms_csstatus`
MODIFY `idcsstatus` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `ms_custsup`
--
ALTER TABLE `ms_custsup`
MODIFY `csid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `ms_trxstatus`
--
ALTER TABLE `ms_trxstatus`
MODIFY `idtrxstatus` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `penjualandtl`
--
ALTER TABLE `penjualandtl`
MODIFY `idDtlPenjualan` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=27;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `ms_custsup`
--
ALTER TABLE `ms_custsup`
ADD CONSTRAINT `ms_custsup_ibfk_1` FOREIGN KEY (`csstatus`) REFERENCES
`ms_csstatus` (`idcsstatus`);
--
-- Constraints for table `penjualan`
--
ALTER TABLE `penjualan`
ADD CONSTRAINT `penjualan_ibfk_1` FOREIGN KEY (`mstrxstatus`) REFERENCES
`ms_trxstatus` (`idtrxstatus`),
ADD CONSTRAINT `penjualan_ibfk_2` FOREIGN KEY (`customer`) REFERENCES
`ms_custsup` (`csid`);
COMMIT;