Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration error #12

Closed
FMpoli opened this issue Jun 21, 2024 · 1 comment
Closed

Migration error #12

FMpoli opened this issue Jun 21, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@FMpoli
Copy link

FMpoli commented Jun 21, 2024

After generating the migrations, I try to migrate but get this error

 BadMethodCallException 

  Method Illuminate\Database\Schema\Blueprint::int does not exist.

  at vendor/laravel/framework/src/Illuminate/Macroable/Traits/Macroable.php:112
    108▕      */
    109▕     public function __call($method, $parameters)
    110▕     {
    111▕         if (! static::hasMacro($method)) {
  ➜ 112▕             throw new BadMethodCallException(sprintf(
    113▕                 'Method %s::%s does not exist.', static::class, $method
    114▕             ));
    115▕         }
    116▕ 

  1   Modules/Wharehouse/database/migrations/2024_06_21_07_0606_1111_create_wharehouse_products_table.php:23
      Illuminate\Database\Schema\Blueprint::__call("int")
      +4 vendor frames 

  6   Modules/Wharehouse/database/migrations/2024_06_21_07_0606_1111_create_wharehouse_products_table.php:14
      Illuminate\Support\Facades\Facade::__callStatic("create")

the problem is in the migrations created

auto generated (with error)

Schema::create('wharehouse_categories', function (Blueprint $table) {
            $table->id();
            $table->string("name");
            $table->string("slug");
            $table->int("parent_id")->nullable();
            $table->timestamps();
        });

corrected

Schema::create('wharehouse_categories', function (Blueprint $table) {
           $table->id();
           $table->string("name");
           $table->string("slug");
           $table->integer("parent_id")->nullable();
           $table->timestamps();
       });
       ```
       int-> integer
3x1io added a commit that referenced this issue Jun 22, 2024
@3x1io
Copy link
Member

3x1io commented Jun 22, 2024

fixed

@3x1io 3x1io added the bug Something isn't working label Jun 22, 2024
@3x1io 3x1io closed this as completed Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants