tubearr/drizzle/0005_monitoring_playlists.sql
John Lightner 4606dce553 feat: Tubearr — full project state through M006/S01
Migrated git root from W:/programming/Projects/ to W:/programming/Projects/Tubearr/.
Previous history preserved in Tubearr-full-backup.bundle at parent directory.

Completed milestones: M001 through M005
Active: M006/S02 (Add Channel UX)
2026-03-24 20:20:10 -05:00

23 lines
No EOL
1.1 KiB
SQL

CREATE TABLE `content_playlist` (
`content_item_id` integer NOT NULL,
`playlist_id` integer NOT NULL,
PRIMARY KEY(`content_item_id`, `playlist_id`),
FOREIGN KEY (`content_item_id`) REFERENCES `content_items`(`id`) ON UPDATE no action ON DELETE cascade,
FOREIGN KEY (`playlist_id`) REFERENCES `playlists`(`id`) ON UPDATE no action ON DELETE cascade
);
--> statement-breakpoint
CREATE TABLE `playlists` (
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
`creator_id` integer NOT NULL,
`platform_playlist_id` text NOT NULL,
`title` text NOT NULL,
`position` integer DEFAULT 0 NOT NULL,
`created_at` text DEFAULT (datetime('now')) NOT NULL,
`updated_at` text DEFAULT (datetime('now')) NOT NULL,
FOREIGN KEY (`creator_id`) REFERENCES `creators`(`id`) ON UPDATE no action ON DELETE cascade
);
--> statement-breakpoint
ALTER TABLE `content_items` ADD `published_at` text;--> statement-breakpoint
ALTER TABLE `content_items` ADD `downloaded_at` text;--> statement-breakpoint
ALTER TABLE `content_items` ADD `monitored` integer DEFAULT true NOT NULL;--> statement-breakpoint
ALTER TABLE `creators` ADD `monitoring_mode` text DEFAULT 'all' NOT NULL;