CREATE TABLE `network_server_links` ( `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL, `integration_id` integer NOT NULL, `server_id` integer NOT NULL, `device_external_id` text NOT NULL, `client_mac` text NOT NULL, `port` integer, `wired` integer DEFAULT true NOT NULL, `updated_at` text NOT NULL, FOREIGN KEY (`integration_id`) REFERENCES `integrations`(`id`) ON UPDATE no action ON DELETE cascade, FOREIGN KEY (`server_id`) REFERENCES `servers`(`id`) ON UPDATE no action ON DELETE cascade ); --> statement-breakpoint CREATE UNIQUE INDEX `network_server_links_unique` ON `network_server_links` (`integration_id`,`server_id`,`client_mac`);