feat: create route to store FCM token
This commit is contained in:
20
drizzle/0003_puzzling_nightmare.sql
Normal file
20
drizzle/0003_puzzling_nightmare.sql
Normal file
@@ -0,0 +1,20 @@
|
||||
-- Custom SQL migration file, put you code below! --
|
||||
DROP TABLE `watch_status`;
|
||||
--> statement-breakpoint
|
||||
DROP TABLE `token`;
|
||||
--> statement-breakpoint
|
||||
|
||||
CREATE TABLE `token` (
|
||||
`device_id` text NOT NULL,
|
||||
`token` text NOT NULL UNIQUE ON CONFLICT FAIL,
|
||||
`username` text,
|
||||
`last_connected_at` text DEFAULT (CURRENT_TIMESTAMP),
|
||||
PRIMARY KEY(`device_id`) ON CONFLICT REPLACE
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE `watch_status` (
|
||||
`device_id` text NOT NULL,
|
||||
`title_id` integer NOT NULL,
|
||||
PRIMARY KEY(`device_id`, `title_id`),
|
||||
FOREIGN KEY (`device_id`) REFERENCES `token`(`device_id`) ON UPDATE no action ON DELETE no action
|
||||
);
|
||||
Reference in New Issue
Block a user