- Add videodb PHP/MySQL media collection manager (Blu-ray, DVD, CD) - Dockerfile: PHP 8.1 + Apache with GD/mysqli/exif extensions - docker-compose.yml: app on port 6761 + MySQL 8.0 with health checks - docker-entrypoint.sh: auto-generates config.inc.php from env vars, waits for MySQL, initializes DB schema idempotently - init-db.php: CLI schema installer using app's own prefix_query() logic - Persistent volumes for DB, cache, and cover images Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
36 lines
677 B
PHP
36 lines
677 B
PHP
<?php
|
|
/**
|
|
* Database conversion script for DB v20
|
|
*
|
|
* @package Setup
|
|
* @author Andreas Goetz <cpuidle@gmx.net>
|
|
* @version $Id: upgrade_v20.php,v 1.1 2007/01/04 16:14:16 andig2 Exp $
|
|
*/
|
|
|
|
|
|
/*
|
|
* Userseen data migration
|
|
*/
|
|
|
|
$sql = 'SELECT owner_id, seen
|
|
FROM videodata
|
|
WHERE seen > 0';
|
|
$set = runSQL($sql, $dbh, true);
|
|
if ($set === false) return(false);
|
|
|
|
foreach ($set as $row)
|
|
{
|
|
// don't convert fishy data
|
|
if (!empty($row['user_id']))
|
|
{
|
|
$sql = "REPLACE INTO ".TBL_USERSEEN." SET user_id=".$row['owner_id'].", video_id=".$row['id'];
|
|
|
|
if (runSQL($sql, $dbh) === false) return(false);
|
|
}
|
|
}
|
|
|
|
// signal success
|
|
return true;
|
|
|
|
?>
|