/*
SQLyog Community v13.2.1 (64 bit)
MySQL - 10.1.37-MariaDB : Database - inv
*********************************************************************
*/

/*!40101 SET NAMES utf8 */;

/*!40101 SET SQL_MODE=''*/;

/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/`inv` /*!40100 DEFAULT CHARACTER SET latin1 */;

USE `inv`;

/*Table structure for table `invoice_items` */

DROP TABLE IF EXISTS `invoice_items`;

CREATE TABLE `invoice_items` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `invoice_id` int(11) DEFAULT NULL,
  `item_name` varchar(255) DEFAULT NULL,
  `quantity` int(11) DEFAULT NULL,
  `rate` decimal(10,2) DEFAULT NULL,
  `amount` decimal(10,2) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `invoice_id` (`invoice_id`),
  CONSTRAINT `invoice_items_ibfk_1` FOREIGN KEY (`invoice_id`) REFERENCES `invoices` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;

/*Data for the table `invoice_items` */

insert  into `invoice_items`(`id`,`invoice_id`,`item_name`,`quantity`,`rate`,`amount`) values 
(1,1,'pAPER DHSD',12,10.00,120.00),
(2,1,'ff',10,1.00,10.00),
(3,2,'pAPER DHSD',12,102.00,1224.00),
(4,2,'asdasd',223,234.00,52182.00),
(5,3,'paper back book',1,10.00,10.00),
(6,3,'brekout',2,10.00,20.00);

/*Table structure for table `invoices` */

DROP TABLE IF EXISTS `invoices`;

CREATE TABLE `invoices` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `email` varchar(255) DEFAULT NULL,
  `contact` varchar(100) DEFAULT NULL,
  `logo_path` varchar(255) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `status` varchar(20) DEFAULT 'unpaid',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;

/*Data for the table `invoices` */

insert  into `invoices`(`id`,`email`,`contact`,`logo_path`,`created_at`,`status`) values 
(1,'atif.zaidyk152148@gmail.com','+2213123123)(!@321','uploads/1745878824_Asset 1@4x (12) (1).webp','2025-04-29 03:20:24','unpaid'),
(2,'atif.zaidyk152148@gmail.com','+2213123123)(!@321','uploads/1745878961_Asset 1@4x (12) (1).webp','2025-04-29 03:22:41','unpaid'),
(3,'atif.zaidyk152148@gmail.com','+1-7654-87678','uploads/1745880041_V-2.jpg','2025-04-29 03:40:41','paid');

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
