PRAGMA foreign_keys=OFF;--> statement-breakpoint
CREATE TABLE `__new_campaign_logs` (
	`id` integer,
	`from` integer,
	`timestamp` integer NOT NULL,
	`type` text,
	`details` text NOT NULL,
	PRIMARY KEY(`id`, `from`, `timestamp`),
	FOREIGN KEY (`id`) REFERENCES `campaign`(`id`) ON UPDATE cascade ON DELETE cascade,
	FOREIGN KEY (`from`) REFERENCES `campaign_characters`(`character`) ON UPDATE cascade ON DELETE cascade
);
--> statement-breakpoint
INSERT INTO `__new_campaign_logs`("id", "from", "timestamp", "type", "details") SELECT "id", "from", "timestamp", "type", "details" FROM `campaign_logs`;--> statement-breakpoint
DROP TABLE `campaign_logs`;--> statement-breakpoint
ALTER TABLE `__new_campaign_logs` RENAME TO `campaign_logs`;--> statement-breakpoint
PRAGMA foreign_keys=ON;