Laravel migration and seeding error

I'm just starting to use the Laravel structure and its command line. However, I have problems with migration and seeding opportunities.

I am developing on a WAMP server on a 64-bit Windows 7 OS.

The database name is "laravel" with the following two tables:

  • Migration
  • of users

The user table contains the following columns:

  • ID
  • name
  • Email
  • Username
  • password

I used the command line to create the migration stored in app\database\migrations\2014_06_24_221654_test.php. I also created migration and batch fields in the migration table.

Then I want to put the email in this table, so I used DatabaseSeeder.php\ seed in the database folder.

<?php class DatabaseSeeder extends Seeder {

public function run()
{
    $this->call('UserTableSeeder');

    $this->command->info('User table seeded!');
}

}

class UserTableSeeder extends Seeder {

protected $fillable = array('email');

public function run()
{


    User::create(array('email' => 'jishadp369@gmail.com'));
}

}

?>

Then I used the following command to seed the database

php artisan db:seed

However, I got the following exception:

 [Illuminate\Database\QueryException]

 SQLSTATE[42S22]: Column not found: 1054 Unknown column 'updated_at' in 'field
 list' (SQL: insert into `users` (`email`, `updated_at`, `created_at`) values (ji
 shadp369@gmail.com, 2014-06-25 00:23:48, 2014-06-25 00:23:48))

? ?

+4
1

, .

.

- $this->timestamps = true . false . - , :

public $timestamps = false; 

, .

+10

Source: https://habr.com/ru/post/1545830/


All Articles