mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-06-27 00:59:18 +02:00
Rename Liens étudiant·e, add link name + edit dialog
- Rename 'Accès étudiant·e' → 'Liens étudiant·e' in acces.php - Add 'name' column to share_links (schema.sql + ALTER TABLE migration) - ShareLink::create() now accepts optional parameter - Add ShareLink::update() method for name/password/expiration - Add 'update' action to acces-etudiante.php controller - Remove Visiter (play) button; row click opens link in new tab - Add edit dialog with name, password, expiration fields - Add pen icon button to open edit dialog per row - Add Nom column to table (also in archived links section)
This commit is contained in:
@@ -29,12 +29,26 @@ class Database
|
||||
$this->pdo->exec('PRAGMA journal_mode = WAL');
|
||||
$this->pdo->exec('PRAGMA synchronous = NORMAL');
|
||||
$this->pdo->exec('PRAGMA cache_size = -8000');
|
||||
$this->runMigrations();
|
||||
} catch (PDOException $e) {
|
||||
error_log('Database connection failed: ' . $e->getMessage());
|
||||
throw new Exception('Impossible de se connecter à la base de données.');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Run one-off schema migrations.
|
||||
*/
|
||||
private function runMigrations(): void
|
||||
{
|
||||
// Add 'name' column to share_links if missing
|
||||
try {
|
||||
$this->pdo->exec("ALTER TABLE share_links ADD COLUMN name TEXT");
|
||||
} catch (\PDOException $e) {
|
||||
// Column already exists — ignore
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine database path.
|
||||
* Priority: explicit override → APP_ROOT /storage/xamxam.db.
|
||||
|
||||
Reference in New Issue
Block a user