create 2 primary and 1 increment with yii2 migration

$this->createTable('post', [
            'id_post'       => $this->integer()->notNull(),
            'id_kategor'       => $this->integer()->notNull(),
            'keterangan'        => $this->string(),
            'link'              => $this->string(),
            'id_user'           => $this->integer(),
            'created_at'        => $this->integer(),
            'updated_at'        => $this->integer(),
        ]);
        $this->addPrimaryKey('id_post', 'post', ['id_post', 'id_kategori']);
        $this->alterColumn('post', 'id_post', $this->Integer().' NOT NULL AUTO_INCREMENT');
     

Komentar

Postingan populer dari blog ini

cara menampilkan perulangan pada textbox menggunakan vb.net 2008