Jump to content

Welcome, Guest!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

  • 0
Manisch

Can't add new category > missing column in database?

Question

Hi there,

I noticed that I can't add new categories on a shop and guess it's probably a migration-error (Database).

After turning on the developer mode it says: ``` Unknown column 'displayfromsub' in 'field list'

INSERT INTO ps_category (nleft, nright, level_depth, active, display_from_sub, id_parent, id_shop_default, is_root_category, position, date_add, date_upd) VALUES ('0', '0', '3', '1', '1', '3', '1', '0', '0', '2018-06-23 11:51:48', '2018-06-23 11:51:48')```

``` Can somebody tell me which SQL command could fix this? :slightlysmilingface:

I found something like this for a similar problem concerning products: ``` ALTER TABLE ps_product ADD pack_stock_type int(11) UNSIGNED DEFAULT '3'; ALTER TABLE ps_product_shop ADD pack_stock_type int(11) UNSIGNED DEFAULT '3'; ALTER TABLE ps_pack ADD id_product_attribute_item int(10) UNSIGNED NOT NULL AFTER id_product_item; ALTER TABLE ps_pack DROP PRIMARY KEY;

Share this post


Link to post
Share on other sites

7 answers to this question

Recommended Posts

  • 0

You can try: ALTER TABLE `ps_category` ADD COLUMN `display_from_sub` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 AFTER `active`;

Share this post


Link to post
Share on other sites
  • 0

Something similar issue I am facing. When i creates first category on fresh installation it is shewing on front end but 2nd category onward there is NO changes on front end.

Share this post


Link to post
Share on other sites
  • 0

After fresh installation, did you deleted the root & home categories?

Share this post


Link to post
Share on other sites
  • 0

You're manipulating the database directly? Uh-oh :-/

It'd be better to create categories using web requests mimicking a manual creation. Or to write some PHP code calling the appropriate methods. Which code to write? See AdminCategoriesController.php

Share this post


Link to post
Share on other sites
  • 0

hi .. this unfortunately does not help when import csv .. when importing csv, an error is always reported.. the first import on clean installation will be fine.. the second import is already faulty..

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...