Skip to content

[SOLVED] Add custom column to user model #430

Answered by datamweb
khan-umer asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @khan-umer ,
Please delete file AddCustomColumnForUser.php from path app\Database\Migrations.
Now run command php spark make:migration AddCustomColumnForUser.
Edit this file and add the following:

<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;

// Add custom column for shield
class AddCustomColumnForUser extends Migration
{
    public function up()
    {
        
        $fields = [
            'first_name' => [
                'type'       => 'text',
                'constraint' => '50',
                'null'       => TRUE
            ],
            'last_name' => [
                'type'       => 'VARCHAR',
                'constraint' => '50',
       …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@khan-umer
Comment options

Answer selected by datamweb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants