-
Notifications
You must be signed in to change notification settings - Fork 38
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
Cannot run command to create flat table #24
Comments
What version of php and laravel are you using . |
Try running now |
I still get the same error. I am using laravel 5.7.14 and PHP 7.2.4. I have the following attributes in the SQL Server (not mysql) database: accessible_furniture_shape when i run the query php artisan eav:compile:entity product, it creates a class with syntax errors. It adds $table->(''); and $table->string(),... (''); $table->string()('accessible_furniture_shape')->nullable(); $table->string()('item_weight_kg')->nullable(); $table->string()('strength_options')->nullable(); $table->string()('size')->nullable()->default('s'); $table->string()('length')->nullable(); $table->string()('width')->nullable(); $table->string()('item_weight_g')->nullable(); $table->int('featured_product')->nullable(); $table->string()('garden_tool_type')->nullable(); $table->int('garden_stool_arms')->nullable(); $table->string()('color_options')->nullable(); $table->string()('garden_tools_material')->nullable(); $table->string()('weight')->nullable(); $table->string()('tags')->nullable(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::drop('product_flat'); } } |
Can you check if you have the latest code. |
Hi sunel , Happy new Year! Yes, I've updated the code but I am still having problems creating the 'product_flat' migration file. I am using a MS_SQL Database. When I run the command "php artisan eav:compile:entity product" it creates a migration file with errors. See the screenshot below. In addition to all the attributes columns, can you please tell me what other columns should exist in the flat table so I can create them manually? Many thanks. The migration file created: The attributes table: The entities table: |
Ok so this issue is in MS SQL. I have never tested this package in MS SQL. I will try to test it. Mean while here what the /**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::dropIfExists('products_flat');
Schema::create('products_flat', function (Blueprint $table) {
$table->integer('id')->unsigned();
$table->integer('entity_id')->unsigned();
$table->integer('attribute_set_id')->unsigned();
$table->timestamp('created_at')->nullable();
$table->timestamp('updated_at')->nullable();
$table->string('sku', 191)->nullable();
$table->string('name', 191)->nullable();
$table->boolean('search')->nullable();
$table->text('description')->nullable();
$table->point('location')->nullable();
$table->dateTimeTz('located_at')->nullable();
});
} Here is where this needs to be fixed. Let me know if where able to find the issue I presume the information_schema has different result. |
It gave me error :(:) SQLSTATE[IMSSP]: Tried to bind parameter number 2101. SQL Server supports a maximum of 2100 parameters. I have additional columns in my product table (not in the eav tables), including name, description, metakeywords, ... |
Yes, Flat table are normalized form of all the tables. |
@sunel hey, i found this error ocured when i added no attributes to the entity. I use only static attributes for initial. eav/src/Flat/Entity/Complier.php Line 158 in 51d6404
Please update it like "if there are no attributes then adding no "," after the schema".
Thanks !! |
When I run the command 'php artisan eav:compile:entity product' to create the flat table I get the following error:
Compiling
product
entity.Creating flat table for
products
.in C:\Websites\eavproject\database/migrations/eav/products_flat.php
Found 14 attributes.
In products_flat.php line 18:
syntax error, unexpected '(', expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$'
And it creates the products_flat.php with the following syntax errors:
....
....
public function up()
{
Schema::dropIfExists('products_flat');
Schema::create('products_flat', function (Blueprint $table) {
$table->('');
$table->string()('accessible_furniture_shape')->nullable();
$table->string()('item_weight_kg')->nullable();
$table->string()('strength_options')->nullable();
$table->string()('size')->nullable()->default('s');
$table->string()('length')->nullable();
$table->string()('width')->nullable();
$table->string()('item_weight_g')->nullable();
$table->int('featured_product')->nullable();
$table->string()('garden_tool_type')->nullable();
$table->string()('accessible_furniture_material')->nullable();
$table->int('garden_stool_arms')->nullable();
$table->string()('color_options')->nullable();
$table->string()('garden_tools_material')->nullable();
$table->string()('weight')->nullable();
});
}
.....
Any idea why is this happening? Thanks.
The text was updated successfully, but these errors were encountered: