CREATE TABLE IF NOT EXISTS `customers` (
  `id` INT AUTO_INCREMENT PRIMARY KEY,
  `companyName` VARCHAR(255) NOT NULL,
  `contactPerson` VARCHAR(255),
  `email` VARCHAR(255),
  `phone` VARCHAR(255),
  `address` TEXT,
  `billingAddress` TEXT,
  `taxId` VARCHAR(255),
  `paymentTerms` INT DEFAULT 30,
  `currency` VARCHAR(10) DEFAULT 'USD',
  `notes` TEXT,
  `createdBy` INT,
  `createdAt` DATETIME DEFAULT CURRENT_TIMESTAMP,
  FOREIGN KEY (`createdBy`) REFERENCES `users`(`id`) ON DELETE SET NULL
);