Schema Overview
The database consists of three main tables:- channels: Stores feed/channel configuration and metadata
- items: Stores individual content items (posts, episodes, etc.)
- settings: Stores system settings and customization
channels Table
The channels table stores configuration for your feed(s). In most cases, you’ll have one primary channel.Column Descriptions
id (VARCHAR(11), PRIMARY KEY)Unique identifier for the channel. Generated as an 11-character alphanumeric string. status (
TINYINT)Publication status of the channel:
1: PUBLISHED - Channel is active and visible2: UNPUBLISHED - Channel is hidden but not deleted3: DELETED - Channel is marked for deletion
BOOLEAN, UNIQUE)Indicates if this is the primary channel. Can be
TRUE for one channel or NULL for others. The UNIQUE constraint ensures only one primary channel exists.
data (TEXT)JSON string containing channel metadata including:
- Feed title and description
- Author information
- Custom HTML/CSS templates
- RSS configuration
- Other channel-specific settings
TIMESTAMP)Timestamp when the channel was created. Defaults to current timestamp. updated_at (
TIMESTAMP)Timestamp when the channel was last modified. Defaults to current timestamp.
Indexes
The table has four indexes for query optimization:channels_status: Fast filtering by publication statuschannels_is_primary: Quick lookup of the primary channelchannels_created_at: Chronological orderingchannels_updated_at: Finding recently modified channels
items Table
The items table stores individual content pieces (blog posts, podcast episodes, photos, etc.).Column Descriptions
id (VARCHAR(11), PRIMARY KEY)Unique identifier for the item. Generated as an 11-character alphanumeric string. status (
TINYINT)Publication status of the item:
1: PUBLISHED - Item is visible on the feed2: UNPUBLISHED - Item is saved but hidden3: DELETED - Item is marked for deletion
TEXT)JSON string containing item content and metadata including:
- Title and description
- Content/body text
- Media file references (R2 URLs)
- Enclosures (audio, video)
- Custom fields
- SEO metadata
TIMESTAMP)Publication date/time for the item. This determines the order items appear in the feed. Defaults to current timestamp but can be set to future dates for scheduled publishing. created_at (
TIMESTAMP)Timestamp when the item was first created in the system. Defaults to current timestamp. updated_at (
TIMESTAMP)Timestamp when the item was last modified. Defaults to current timestamp.
Indexes
The table has four indexes for query optimization:items_pub_date: Critical for feed ordering (most recent first)items_created_at: Track when items were addeditems_updated_at: Find recently edited itemsitems_status: Filter by publication status
settings Table
The settings table stores system-wide configuration and customization.Column Descriptions
category (VARCHAR(20), PRIMARY KEY)Unique identifier for the setting category. Acts as the primary key, meaning each category can only have one entry. Common categories include:
- Custom HTML templates
- CSS styles
- Tracking URLs (for analytics)
- System preferences
- Integration settings
TEXT)JSON string or text containing the actual settings data. Structure varies by category. created_at (
TIMESTAMP)Timestamp when the setting was first created. Defaults to current timestamp. updated_at (
TIMESTAMP)Timestamp when the setting was last modified. Defaults to current timestamp.
Data Model Design
JSON Storage Pattern
All three tables use adata column (TEXT type) to store JSON. This provides flexibility:
Advantages:
- Schema flexibility without migrations
- Easy to add new fields
- Simple backup/restore
- Compatible with SQLite limitations
- Cannot index JSON fields directly
- Must parse JSON in application code
- Requires careful data validation
Status Pattern
Both channels and items use the same status enum pattern:1= PUBLISHED2= UNPUBLISHED3= DELETED
Timestamp Tracking
All tables trackcreated_at and updated_at. The items table adds pub_date to separate creation time from publication time, enabling:
- Draft scheduling
- Future-dated posts
- Accurate feed chronology