DROP TABLE asset_details;

DROP TABLE asset_management;

CREATE TABLE `asset_details` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `asset_name` varchar(255) NOT NULL,
  `asset_id` varchar(255) NOT NULL,
  `type` varchar(255) DEFAULT NULL,
  `brand` varchar(255) DEFAULT NULL,
  `model` varchar(255) DEFAULT NULL,
  `serial_number` varchar(255) DEFAULT NULL,
  `vendor` varchar(255) DEFAULT NULL,
  `category` varchar(255) DEFAULT NULL,
  `cost` varchar(255) DEFAULT NULL,
  `location` varchar(255) DEFAULT NULL,
  `start_date` date DEFAULT NULL,
  `end_date` date DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci

CREATE TABLE `asset_management` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `asset_details_id` bigint(20) unsigned DEFAULT NULL,
  `assign_user_id` bigint(20) unsigned DEFAULT NULL,
  `status` enum('Unassigned','Assigned','Returned') NOT NULL DEFAULT 'Unassigned',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `asset_management_asset_details_id_foreign` (`asset_details_id`),
  KEY `asset_management_assign_user_id_foreign` (`assign_user_id`),
  CONSTRAINT `asset_management_asset_details_id_foreign` FOREIGN KEY (`asset_details_id`) REFERENCES `asset_details` (`id`) ON DELETE CASCADE,
  CONSTRAINT `asset_management_assign_user_id_foreign` FOREIGN KEY (`assign_user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci