When I am running a migration from command line I am getting the response
Application In Production! *
Do you really wish to run this command?
This is a fresh laravel install and I am running migrate for the first time. If I give a response y to the above prompt, I am getting
[Illuminate\DatabaseQueryException]
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'test.users' doesn't exist (SQL: alter table users add id int unsigned not null auto_increment primary key, add username varchar(255) not null, add password varchar(255) not null, add created_at timestamp default 0 not null, add updated_at timestamp default 0 not null)
Migration file
public function up()
{
Schema::table('users', function(Blueprint $table)
{
$table->increments('id');
$table->string('username')->unique();
$table->string('password');
$table->timestamps();
});
}
There is no table named 'users' in your database yet, you should use 'Schema::create' but not 'Schema:table'
mkblade said:
There is no table named 'users' in your database yet, you should use 'Schema::create' but not 'Schema:table'
I have solved that problem. But my main problem is that i am getting the Application in production prompt whenever i am running a migration.
Does it happen if you put the application in maintenance mode ?
artisan down
Then
migrate
Then
artisan up
This prompt is for your safety. Doing operations on the database in a production environment, you should be very careful. The solution is to set the environment to non-production, or use --force flag.
php artisan migrate --force
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community