Welcome Guest, Not a member yet? Register   Sign In
Dbforge alter add column always create NOT NULL field
#1

Hi!

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 ?
Reply


Messages In This Thread
Dbforge alter add column always create NOT NULL field - by madaweb - 06-22-2016, 11:34 PM



Theme © iAndrew 2016 - Forum software by © MyBB