-- AlterTable
ALTER TABLE `customer_receipts` ADD COLUMN `created_by` BIGINT UNSIGNED NULL;

-- AlterTable
ALTER TABLE `customers` ADD COLUMN `created_by` BIGINT UNSIGNED NULL;

-- AlterTable
ALTER TABLE `districts` ADD COLUMN `created_by` BIGINT UNSIGNED NULL;

-- AlterTable
ALTER TABLE `expenses` ADD COLUMN `created_by` BIGINT UNSIGNED NULL;

-- AlterTable
ALTER TABLE `purchase_returns` ADD COLUMN `created_by` BIGINT UNSIGNED NULL;

-- AlterTable
ALTER TABLE `purchases` ADD COLUMN `created_by` BIGINT UNSIGNED NULL;

-- AlterTable
ALTER TABLE `quotation_items` ADD COLUMN `created_by` BIGINT UNSIGNED NULL;

-- AlterTable
ALTER TABLE `quotations` ADD COLUMN `created_by` BIGINT UNSIGNED NULL;

-- AlterTable
ALTER TABLE `sale_items` ADD COLUMN `created_by` BIGINT UNSIGNED NULL;

-- AlterTable
ALTER TABLE `sale_returns` ADD COLUMN `created_by` BIGINT UNSIGNED NULL;

-- AlterTable
ALTER TABLE `sales` ADD COLUMN `created_by` BIGINT UNSIGNED NULL;

-- AlterTable
ALTER TABLE `shops` ADD COLUMN `created_by` BIGINT UNSIGNED NULL;

-- AlterTable
ALTER TABLE `states` ADD COLUMN `created_by` BIGINT UNSIGNED NULL;

-- AlterTable
ALTER TABLE `stock_spoilages` ADD COLUMN `created_by` BIGINT UNSIGNED NULL;

-- AlterTable
ALTER TABLE `supplier_payments` ADD COLUMN `created_by` BIGINT UNSIGNED NULL;

-- AlterTable
ALTER TABLE `suppliers` ADD COLUMN `created_by` BIGINT UNSIGNED NULL;

-- AlterTable
ALTER TABLE `upi` ADD COLUMN `created_by` BIGINT UNSIGNED NULL;

-- AlterTable
ALTER TABLE `vegetables` ADD COLUMN `created_by` BIGINT UNSIGNED NULL;

-- AddForeignKey
ALTER TABLE `states` ADD CONSTRAINT `states_created_by_fkey` FOREIGN KEY (`created_by`) REFERENCES `users`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `districts` ADD CONSTRAINT `districts_created_by_fkey` FOREIGN KEY (`created_by`) REFERENCES `users`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `vegetables` ADD CONSTRAINT `vegetables_created_by_fkey` FOREIGN KEY (`created_by`) REFERENCES `users`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `customers` ADD CONSTRAINT `customers_created_by_fkey` FOREIGN KEY (`created_by`) REFERENCES `users`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `suppliers` ADD CONSTRAINT `suppliers_created_by_fkey` FOREIGN KEY (`created_by`) REFERENCES `users`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `supplier_payments` ADD CONSTRAINT `supplier_payments_created_by_fkey` FOREIGN KEY (`created_by`) REFERENCES `users`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `upi` ADD CONSTRAINT `upi_created_by_fkey` FOREIGN KEY (`created_by`) REFERENCES `users`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `purchases` ADD CONSTRAINT `purchases_created_by_fkey` FOREIGN KEY (`created_by`) REFERENCES `users`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `shops` ADD CONSTRAINT `shops_created_by_fkey` FOREIGN KEY (`created_by`) REFERENCES `users`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `sales` ADD CONSTRAINT `sales_created_by_fkey` FOREIGN KEY (`created_by`) REFERENCES `users`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `sale_items` ADD CONSTRAINT `sale_items_created_by_fkey` FOREIGN KEY (`created_by`) REFERENCES `users`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `customer_receipts` ADD CONSTRAINT `customer_receipts_created_by_fkey` FOREIGN KEY (`created_by`) REFERENCES `users`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `expenses` ADD CONSTRAINT `expenses_created_by_fkey` FOREIGN KEY (`created_by`) REFERENCES `users`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `stock_spoilages` ADD CONSTRAINT `stock_spoilages_created_by_fkey` FOREIGN KEY (`created_by`) REFERENCES `users`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `sale_returns` ADD CONSTRAINT `sale_returns_created_by_fkey` FOREIGN KEY (`created_by`) REFERENCES `users`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `quotations` ADD CONSTRAINT `quotations_created_by_fkey` FOREIGN KEY (`created_by`) REFERENCES `users`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `quotation_items` ADD CONSTRAINT `quotation_items_created_by_fkey` FOREIGN KEY (`created_by`) REFERENCES `users`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `purchase_returns` ADD CONSTRAINT `purchase_returns_created_by_fkey` FOREIGN KEY (`created_by`) REFERENCES `users`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
