1
0
Fork 0
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:
PeaceCopathe 2013-04-15 22:26:37 +02:00
parent 263d6c6756
commit 51b88e2b42

View file

@ -10,12 +10,15 @@
class db { class db {
var $handle; 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 = new PDO($path);
$this->handle->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $this->handle->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} }
public function getHandle() { public function getHandle()
{
return $this->handle; return $this->handle;
} }
} }