CodeIgniter Forums
Postgres schema - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Postgres schema (/showthread.php?tid=78512)



Postgres schema - okatse - 02-01-2021

How add schama in migration 
$this->db->schama not work.
Add schama name to table name "test.prod" gives error becouse 
CONSTRAINT "pk_test"."name" PRIMARY KEY("name")

PHP Code:
class AddProd extends Migration
{
    public function up()
    {

        $this->forge->addField([
            'name'        => ['type' => 'varchar''constraint' => 128],
        ]);
        
        $this
->forge->addKey(['name'], true);
        $attributes = ['ENGINE' => 'InnoDB'];
        $this->db->schema 'test';
        $this->forge->createTable('test.prod'true$attributes);