From b13d199928e63d206f984d9a60ae5ee36832a576 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 26 May 2012 09:54:02 +0200 Subject: [PATCH] postgre fix --- htdocs/application/controllers/main.php | 2 ++ htdocs/application/models/pastes.php | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/application/controllers/main.php b/htdocs/application/controllers/main.php index c3e1b3a..167fe07 100755 --- a/htdocs/application/controllers/main.php +++ b/htdocs/application/controllers/main.php @@ -54,6 +54,7 @@ class Main extends CI_Controller ) , 'session_data' => array( 'type' => 'TEXT', + 'null' => TRUE, ) , ); $this->dbforge->add_field($fields); @@ -106,6 +107,7 @@ class Main extends CI_Controller 'type' => 'TINYINT', 'constraint' => 1, 'unsigned' => TRUE, + 'default' => 0, ) , 'snipurl' => array( 'type' => 'VARCHAR', diff --git a/htdocs/application/models/pastes.php b/htdocs/application/models/pastes.php index 9166d40..76515ba 100755 --- a/htdocs/application/models/pastes.php +++ b/htdocs/application/models/pastes.php @@ -39,7 +39,6 @@ class Pastes extends CI_Model function createPaste() { - $data['id'] = NULL; $data['created'] = time(); //this is SO evil… saving the «raw» data with htmlspecialchars :-( (but I have to leave this, because of backwards-compatibility) @@ -94,7 +93,7 @@ class Pastes extends CI_Model if ($this->input->post('expire') == 0) { - $data['expire'] = '0000-00-00 00:00:00'; + $data['expire'] = 0; } else {