CREATE TABLE `token` ( `device_id` text PRIMARY KEY NOT NULL, `token` text NOT NULL, `username` text, `last_connected_at` text DEFAULT (CURRENT_TIMESTAMP) ); --> statement-breakpoint CREATE TABLE `watch_status` ( `device_id` text NOT NULL, `title_id` integer NOT NULL, `watch_status` text NOT NULL, PRIMARY KEY(`device_id`, `title_id`), FOREIGN KEY (`device_id`) REFERENCES `token`(`device_id`) ON UPDATE no action ON DELETE no action );