crater
crater copied to clipboard
DB should be empty error, but the database migrations happened. Can't get to next step.
Describe the bug I created a blank crater db, got to the Site URL & Database step of installation and saw the database should be empty error when clicking Save & Continue. Went into MySQL Workbench, and the tables had been populated. Dropped all tables from crater db, and tried again. Got the internet connectivity issue, so restarted the installation and got the empty database error (with all the tables re-populated). Is there a way to skip this step? It's creating them, but not recognizing it.
Expected behavior I expected to drop the tables, restart the setup wizard and move to the next step. It just re-populates the tables and gives me an error about the db should be empty.
Screenshots
Please complete the following information:
- Crater version: 5.0.6
- PHP version: 8.0.12
- Database type and version: mysql 8.0.17 innodb
Optional info
- OS: Mac OS Catalina 10.15.7
- Browser: brave (shields down), also tried safari with same cycle of errors
I tried to do a video, but it was too large. If I try to run php artisan migrate, all the tables are created in the crater db. It's like the wizard stops halfway through creating all the tables. Is there a manual way to get around this step?
Try create an empty file with the name "database_created" in the /storage/app folder of the installation.
That still brings me to the installation wizard, but now I get CSRF Mismatch and another error when trying to continue from the database page.

Ok, I see it tends to just migrate 4 tables, companies, currencies, users, and migrations. Then I get an error that sql_require_primary_key must be false, yet I don't know how to set that up on a managed digital ocean cluster. Is there something we can change in the migrations to make this work even with that enabled? I'm assuming, based on the order of migration file creation, that the problem might be in the password resets (which would be next on the list, no?)
I wasn't able to resolve the issue on my local machine's testing setup but I WAS able to resolve it on my hosted machine by doing the following:
Changed the following code in crater/database/migrations/2014_10_12_100000_create_password_resets_table.php:
- Added the line to set sql_require_primary_key to false.
- changed $table->string('email')->index(); to $table->string('email')->primary();
public function up() { \Illuminate\Support\Facades\DB::statement('SET SESSION sql_require_primary_key=0'); Schema::create('password_resets', function (Blueprint $table) { $table->string('email')->primary(); $table->string('token'); $table->timestamp('created_at')->nullable(); }); }
- from the terminal in the crater folder, ran
php artisan config:cache
Once I did this, I was able to successfully get through to setting up my user and company information using the installation wizard.
Hi I did everything as described above, but it didn't work for me... Maybe there is an error in the file crater/database/migrations/2014_10_12_100000_create_password_resets_table.php?
Or what else can I try to make the installation continue ? Thanks
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreatePasswordResetsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
\Illuminate\Support\Facades\DB::statement('SET SESSION sql_require_primary_key=0');
Schema::create('password_resets', function (Blueprint $table) {
$table->string('email')->primary();
$table->string('token');
$table->timestamp('created_at')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('password_resets');
}
}
Got exactly the same issue. Can't install the application because of this.
same issue. it looks like it populated all the databases. but then it says error and when I try to continue it says the database should be empty. If I delete everything in the database, it does the same thing. create all the tables, then error
Please check this video for installation steps: https://www.youtube.com/watch?v=waheY7LHBdc