-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Sep 03, 2025 at 09:07 PM
-- Server version: 10.4.28-MariaDB
-- PHP Version: 8.0.28

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Database: `car_showroom`
--

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

--
-- Table structure for table `sale_payments`
--

CREATE TABLE `sale_payments` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `sale_id` bigint(20) UNSIGNED NOT NULL,
  `payment_date` date NOT NULL DEFAULT curdate(),
  `amount` decimal(12,0) NOT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `sale_payments`
--

INSERT INTO `sale_payments` (`id`, `sale_id`, `payment_date`, `amount`, `created_at`, `updated_at`) VALUES
(2, 18, '2025-08-23', 1030000, '2025-08-23 07:12:07', '2025-08-23 12:25:28'),
(3, 18, '2025-08-23', 1000, '2025-08-23 07:13:33', '2025-08-23 07:13:33'),
(4, 18, '2025-08-23', 5000, '2025-08-23 07:13:50', '2025-08-23 07:13:50'),
(5, 18, '2025-08-23', 10000, '2025-08-23 07:59:19', '2025-08-23 07:59:19'),
(7, 18, '2025-01-01', 5, '2025-08-23 17:52:12', '2025-08-23 17:52:12'),
(8, 18, '2025-08-23', 5, '2025-08-23 17:53:27', '2025-08-23 17:53:27'),
(9, 18, '2025-12-31', 5, '2025-08-23 17:55:21', '2025-08-23 17:55:21'),
(10, 18, '2025-08-23', 5, '2025-08-23 17:57:18', '2025-08-23 17:57:18'),
(11, 50, '2025-08-30', 50000, '2025-08-30 13:26:32', '2025-08-30 13:26:32'),
(12, 34, '2025-08-30', 2000000, '2025-08-30 15:02:38', '2025-08-30 15:02:38');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `sale_payments`
--
ALTER TABLE `sale_payments`
  ADD PRIMARY KEY (`id`),
  ADD KEY `sale_payments_sale_id_foreign` (`sale_id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `sale_payments`
--
ALTER TABLE `sale_payments`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `sale_payments`
--
ALTER TABLE `sale_payments`
  ADD CONSTRAINT `sale_payments_sale_id_foreign` FOREIGN KEY (`sale_id`) REFERENCES `car_sales` (`id`) ON DELETE CASCADE;
COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
