06-22-2016, 11:34 PM
Hi!
The query of ALTER TABLE ADD COLUMN is automatically concatened by NOT NULL in CodeIgniter working with PostgreSQL
So I always got an error message when there is already data inside the table: i'm using a french computer
ERREUR: la colonne « location » contient des valeurs NULL
ALTER TABLE "data"."circuits" ADD "location" integer NOT NULL
How to avoid this ?
The query of ALTER TABLE ADD COLUMN is automatically concatened by NOT NULL in CodeIgniter working with PostgreSQL
PHP Code:
$this->dbforge = new CI_DB_postgre_forge;
$sql = $this->dbforge->_alter_table('ADD',
'data.circuits',
'location',
'integer');
$this->db->query($sql);
So I always got an error message when there is already data inside the table: i'm using a french computer
ERREUR: la colonne « location » contient des valeurs NULL
ALTER TABLE "data"."circuits" ADD "location" integer NOT NULL
How to avoid this ?