Welcome Guest, Not a member yet? Register   Sign In
Postgres schema
#1

(This post was last modified: 02-01-2021, 05:10 AM by okatse.)

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); 
Reply




Theme © iAndrew 2016 - Forum software by © MyBB