Db Cache components

This commit is contained in:
Daniel Brendel
2024-04-05 22:02:12 +02:00
parent f4a6c09fc9
commit 98e3e3fc64
3 changed files with 258 additions and 0 deletions

View File

@ -0,0 +1,49 @@
<?php
/*
Asatru PHP - Migration vor Caching
*/
class CacheModel_Migration {
private $database = null;
private $connection = null;
/**
* Construct class and store PDO connection handle
*
* @param \PDO $pdo
* @return void
*/
public function __construct($pdo)
{
$this->connection = $pdo;
}
/**
* Called when the table shall be created or modified
*
* @return void
*/
public function up()
{
$this->database = new Asatru\Database\Migration('CacheModel', $this->connection);
$this->database->drop();
$this->database->add('id INT NOT NULL AUTO_INCREMENT PRIMARY KEY');
$this->database->add('ident VARCHAR(260) NOT NULL');
$this->database->add('value BLOB NULL');
$this->database->add('updated_at TIMESTAMP');
$this->database->add('created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP');
$this->database->create();
}
/**
* Called when the table shall be dropped
*
* @return void
*/
public function down()
{
$this->database = new Asatru\Database\Migration('Cache', $this->connection);
$this->database->drop();
}
}

View File

@ -1 +1,4 @@
47f3d3306fbd25715600db55b33b1542293ab5eb593205d6f5884bcaafa5d9a4627c76af04b684962c99a9518ef6b3d10e983203f6b5a8576912445d8f285fb7
cd19e5ec4a12d40d8d3ecdf267ef890e80fdd94ab28f81fddeb0c12b6f6b88773157e469c2d693abd4583e18b9b5a126c3fcecd6c07f4374c6c6e2837166b2ec