CREATE TABLE `bridge_intents` (
	`id` int AUTO_INCREMENT NOT NULL,
	`fromChainId` int NOT NULL,
	`senderAddress` varchar(64) NOT NULL,
	`xicReceiveAddress` varchar(64) NOT NULL,
	`expectedUsdt` decimal(20,6),
	`matched` boolean NOT NULL DEFAULT false,
	`matchedOrderId` int,
	`createdAt` timestamp NOT NULL DEFAULT (now()),
	CONSTRAINT `bridge_intents_id` PRIMARY KEY(`id`)
);
--> statement-breakpoint
ALTER TABLE `bridge_orders` MODIFY COLUMN `toChainId` int NOT NULL DEFAULT 56;--> statement-breakpoint
ALTER TABLE `bridge_orders` MODIFY COLUMN `toToken` varchar(32) NOT NULL DEFAULT 'XIC';--> statement-breakpoint
ALTER TABLE `bridge_orders` MODIFY COLUMN `status` enum('pending','confirmed','distributed','failed') NOT NULL DEFAULT 'pending';--> statement-breakpoint
ALTER TABLE `bridge_orders` ADD `xicReceiveAddress` varchar(64);--> statement-breakpoint
ALTER TABLE `bridge_orders` ADD `confirmedAt` timestamp;--> statement-breakpoint
ALTER TABLE `bridge_orders` ADD `distributedAt` timestamp;--> statement-breakpoint
ALTER TABLE `bridge_orders` ADD `distributeTxHash` varchar(128);--> statement-breakpoint
ALTER TABLE `bridge_orders` ADD `blockNumber` bigint;--> statement-breakpoint
ALTER TABLE `bridge_orders` ADD `updatedAt` timestamp DEFAULT (now()) NOT NULL ON UPDATE CURRENT_TIMESTAMP;