Add podgrab featureset

This commit is contained in:
Cody Cook 2025-06-16 22:55:39 -07:00
commit 233dd5b5c0
33 changed files with 2315 additions and 125 deletions

View file

@ -0,0 +1,33 @@
"""
Migration script to add tags field to the podcasts table.
"""
import sqlite3
import os
from flask import current_app
def run_migration():
"""
Run the migration to add the tags field to the podcasts table.
"""
# Get the database path from the app config
db_path = current_app.config['SQLALCHEMY_DATABASE_URI'].replace('sqlite:///', '')
# Connect to the database
conn = sqlite3.connect(db_path)
cursor = conn.cursor()
# Check if the tags column already exists in the podcasts table
cursor.execute("PRAGMA table_info(podcasts)")
columns = [column[1] for column in cursor.fetchall()]
# Add the tags column if it doesn't exist
if 'tags' not in columns:
print("Adding 'tags' column to podcasts table...")
cursor.execute("ALTER TABLE podcasts ADD COLUMN tags TEXT")
# Commit the changes and close the connection
conn.commit()
conn.close()
print("Podcast tags migration completed successfully!")
return True