mirror of
https://github.com/wallabag/wallabag.git
synced 2025-09-15 18:57:05 +00:00
Création Table auto table 'entries'
Création de la tabe automatiquement si elle n'existe pas. Permet de repartir à zéro uniquement en supprimant le répertoire db.
This commit is contained in:
parent
263d6c6756
commit
51b88e2b42
1 changed files with 5 additions and 2 deletions
|
@ -10,12 +10,15 @@
|
|||
|
||||
class db {
|
||||
var $handle;
|
||||
function __construct($path) {
|
||||
function __construct($path)
|
||||
{
|
||||
$this->handle->exec('CREATE TABLE IF NOT EXISTS "entries" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL UNIQUE , "title" VARCHAR, "url" VARCHAR UNIQUE , "is_read" INTEGER DEFAULT 0, "is_fav" INTEGER DEFAULT 0, "content" BLOB)');
|
||||
$this->handle = new PDO($path);
|
||||
$this->handle->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
}
|
||||
|
||||
public function getHandle() {
|
||||
public function getHandle()
|
||||
{
|
||||
return $this->handle;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue