8 – DBupdate schema update can’t rename table because it already exists –

I recently updated a couple of modules and core:
To Drupal 8.8.6
Modules updated: metatag, Search API, Feeds, External Links and EntityQueue.

There was a small hiccup that broke the site, so I re-pulled files into our development environment and tried again. Everything seems to run smoothly until doing the Database update at update.php. There are 6 pending updates that cannot be done because of an error thrown:

Failed: DrupalCoreEntityEntityStorageException: Exception thrown while performing a schema update. Cannot rename tmp_431b95entity_subqueue_field_data to entity_subqueue_field_data: table entity_subqueue_field_data already exists. in DrupalCoreEntitySqlSqlContentEntityStorage->wrapSchemaException() (line 1615 of /var/lib/nginx/website/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).

Not sure which update caused the issue, though probably EntityQueue. Caches cleared and tried again with no luck.

What are the steps to overcoming this? And is there a way to update the other five database changes, so I can get everything but the one issue resolved?

If it helps, the outstanding edits that are outstanding and not getting applied:

entityqueue module
    •   8004 - Add the publishing status field to subqueues.
    •   8005 - Add the revision metadata fields to subqueues.
    •   Update subqueues to be revisionable and translatable.
    •   Remove the obsolete 'reverse_in_admin' queue setting.
metatag module
    •   8108 - Need to clear caches after updating from 8.x-1.12.
extlink module
    •   Forces a cache rebuild in order to add new `extlink.setting_save.subscriber`.
feeds module
    •   Replace deprecated action ID's for 'update_non_existent' setting.
search_api module
    •   Re-save Search API index configurations to fix dependencies.

magento2 – Database schema realted change reverted

I have one of my Magento 2 projects running with version 2.3.3. There are so many simple products for one single configurable product sue to which the SKU length issue occurred. TO solve I have taken all possible steps

1) Override file : MagentoCatalogModelProductAttributeBackendSku and change const SKU_MAX_LENGTH = 255;

Check below code for this

<?php
namespace CustomSkusizeModelProductAttributeBackend;


class Sku extends MagentoCatalogModelProductAttributeBackendSku
{
    /**
     * Maximum SKU string length
     *
     * @var string
     */
    const SKU_MAX_LENGTH = 255;


    /**
     * Validate SKU
     *
     * @param Product $object
     * @return bool
     * @throws MagentoFrameworkExceptionLocalizedException
     * @throws MagentoFrameworkExceptionLocalizedException
     */
    public function validate($object)
    {
        $attrCode = $this->getAttribute()->getAttributeCode();
        $value = $object->getData($attrCode);
        if ($this->getAttribute()->getIsRequired() && strlen($value) === 0) {
            throw new MagentoFrameworkExceptionLocalizedException(
                __('The "%1" attribute value is empty. Set the attribute and try again.', $attrCode)
            );
        }

        if ($this->string->strlen($object->getSku()) > self::SKU_MAX_LENGTH) {
            throw new MagentoFrameworkExceptionLocalizedException(
                __('SKU length should be %1 characters maximum.', self::SKU_MAX_LENGTH)
            );
        }
        return true;
    }

    /**
     * Generate and set unique SKU to product
     *
     * @param Product $object
     * @return void
     */
    protected function _generateUniqueSku($object)
    {
        $attribute = $this->getAttribute();
        $entity = $attribute->getEntity();
        $attributeValue = $object->getData($attribute->getAttributeCode());
        $increment = null;
        while (!$entity->checkAttributeUniqueValue($attribute, $object)) {
            if ($increment === null) {
                $increment = $this->_getLastSimilarAttributeValueIncrement($attribute, $object);
            }
            $sku = trim($attributeValue);
            if (strlen($sku . '-' . ++$increment) > self::SKU_MAX_LENGTH) {
                $sku = substr($sku, 0, -strlen($increment) - 1);
            }
            $sku = $sku . '-' . $increment;
            $object->setData($attribute->getAttributeCode(), $sku);
        }
    }

2) Change eav_attribute table , find sku in attribute_code and change frontend_class

3) Change different tables column’s length to 255 containing sku like catalog_product_entity , inventory_low_stock_notification_configuration , inventory_reservation , inventory_source_item

Above 2 steps are working fine. But for last steps whenever I run “setup:upgrade” , its again revert to 64 length (For all tables)

So that I have created Installation schema also for same

namespace CustomSkusizeSetup;
use MagentoFrameworkSetupInstallSchemaInterface;
use MagentoFrameworkSetupModuleContextInterface;
use MagentoFrameworkSetupSchemaSetupInterface;
class InstallSchema implements InstallSchemaInterface
{
  public function install(SchemaSetupInterface $setup, ModuleContextInterface $context)
  {
            $setup->startSetup();

            $setup->getConnection()->changeColumn(
                            $setup->getTable('catalog_product_entity'),
                            'sku',
                            'sku',
                            (
                                            'type' => MagentoFrameworkDBDdlTable::TYPE_TEXT,
                                            'length' => 225
                            )
            );

            $setup->getConnection()->changeColumn(
                            $setup->getTable('inventory_low_stock_notification_configuration'),
                            'sku',
                            'sku',
                            (
                                            'type' => MagentoFrameworkDBDdlTable::TYPE_TEXT,
                                            'length' => 225
                            )
            );

            $setup->getConnection()->changeColumn(
                            $setup->getTable('inventory_reservation'),
                            'sku',
                            'sku',
                            (
                                            'type' => MagentoFrameworkDBDdlTable::TYPE_TEXT,
                                            'length' => 225
                            )
            );

            $setup->getConnection()->changeColumn(
                            $setup->getTable('inventory_source_item'),
                            'sku',
                            'sku',
                            (
                                            'type' => MagentoFrameworkDBDdlTable::TYPE_TEXT,
                                            'length' => 225
                            )
            );






  }
}

After this when I run “setup:upgrade” first time, its working fine and above all table’s sku column remain with 255 length

But if I execute same command again then its again reverted to 64

I also tried schema patch

<?php
/**
* Copyright © 2019 Magenest. All rights reserved.
* See COPYING.txt for license details.
*/
namespace CustomSkusizeSetupPatchSchema;


use MagentoFrameworkDBDdlTable;
use MagentoFrameworkSetupPatchSchemaPatchInterface;
use MagentoFrameworkSetupModuleDataSetupInterface;


class ChangeColumn implements SchemaPatchInterface
{
   private $moduleDataSetup;


   public function __construct(
       ModuleDataSetupInterface $moduleDataSetup
   ) {
       $this->moduleDataSetup = $moduleDataSetup;
   }


   public static function getDependencies()
   {
       return ();
   }


   public function getAliases()
   {
       return ();
   }


   public function apply()
   {
       $this->moduleDataSetup->startSetup();


       $this->moduleDataSetup->getConnection()->changeColumn(
         $this->moduleDataSetup->getTable('catalog_product_entity'),
         'sku',
         'sku',
         (
             'type' => MagentoFrameworkDBDdlTable::TYPE_TEXT,
             'length' => 225,             
             'comment' => 'Product sku lenght is 225'
         )
     );


       $this->moduleDataSetup->getConnection()->changeColumn(
         $this->moduleDataSetup->getTable('inventory_low_stock_notification_configuration'),
         'sku',
         'sku',
         (
             'type' => MagentoFrameworkDBDdlTable::TYPE_TEXT,
             'length' => 225,             
             'comment' => 'Product sku lenght is 225'
         )
     );

       $this->moduleDataSetup->getConnection()->changeColumn(
         $this->moduleDataSetup->getTable('inventory_reservation'),
         'sku',
         'sku',
         (
             'type' => MagentoFrameworkDBDdlTable::TYPE_TEXT,
             'length' => 225,             
             'comment' => 'Product sku lenght is 225'
         )
     );

       $this->moduleDataSetup->getConnection()->changeColumn(
         $this->moduleDataSetup->getTable('inventory_source_item'),
         'sku',
         'sku',
         (
             'type' => MagentoFrameworkDBDdlTable::TYPE_TEXT,
             'length' => 225,             
             'comment' => 'Product sku lenght is 225'
         )
     );


       $this->moduleDataSetup->endSetup();
   }
}

Still same issue. How can I achieve this please help.

postgresql – Non-Super user permissions required to allow a user to create a schema within a database that is owned newly created user

I’m able to run the following as postgres or any other user which has SUPERUSER (“dba1” has SUPERUSER in this case)

psql -U dba1 dev << SQL
create user udev1;
create schema udev1 authorization udev1;
SQL

what is the minimal set of discrete privileges required for dba1 which would enable dba1 to create a new user “udev2” and a schema owned by that user “udev2” in the dev database?

sqlite – How to query/join tables where foreign key constraint is set in schema

I’m relatively new to sqlite and databases in general.
I’ve successfully setup a schema of 4 tables, each having a foreign key pointing to its parent table. The schema also has the foreign key constraint set on the child keys.

Performing a query where every table is joined with the SELECT * FROM…JOIN…ON ……… works without issue, but it is laborious manually connecting the keys.

My question is: Is it possible to perform a query/join of the tables without the ON statement which links each parent/child key relationship? Since this was already established in the schema definition, this seems to be redundant. I’m trying to simplify the sql command and make use of the parent/child relationship already defined. When I perform said query but omit the ON statements, the results are not what I expected. Any guidance is appreciated.

schema.org – Schema Markup for Sub-Brand Product Website

I am trying to improve my website’s SEO by getting our results to appear in the Knowledge Graph. The challenge I am having is that the website is for a product sold by a sub-brand of a larger organisation. What would be the best way to categorise this in Schema markup? Currently it is not appearing by using the sub-brand name in “Organization“,”name“.

For example, what would the website markup be for PlayStation being part of the larger organisation of Sony? Are there defined categories for this in Schema?

date – Is it possible to set timezone for a schema – Postgresql

No.

You can either set the timezone at database level, or at session level (… or directly when accessing a date-like datatype, using the at time zone construct).

From the documentation:

The TimeZone configuration parameter can be set in the file postgresql.conf, or in any of the other standard ways described in Chapter 19. There are also some special ways to set it:

  • The SQL command SET TIME ZONE sets the time zone for the session. This is an alternative spelling of SET TIMEZONE TO with a more SQL-spec-compatible syntax.

  • The PGTZ environment variable is used by libpq clients to send a SET TIME ZONE command to the server upon connection.

permissions – SQL Server Grant CRUD to Users on One Schema

Is this the right approach?

This is the correct approach, users with that role will only be able to perform CRUD operations on objects in the training schema and nothing else. This is the least privilege approach and is correct.

True least privilege would actually be assigning permissions to only the specific objects in that schema, but as you’ve indicated users should have access to all objects, then applying permissions schema-wide is appropriate.

I do not want them to have any other permissions on any other object
outside that schema

You may not actually want this. Consider the public server role. For any object that does not have explicit permissions (GRANT or DENY), permissions are inherited from the public role for a user (any user, all users).

Since you cannot revoke public membership from a user, you would need to explicitly DENY permission on every single object just to prevent users from seeing the object listed in Management Studio – is this really necessary? They have no access beyond seeing the object exists, users still cannot interact with them.

Public access grants users, by default, nothing more than access to a few system catalog views to allow all users to view the name and definition of basic objects and some basic DB/Server info (see this article for more info).

Google Search Console – Article Schema Error with "Name" and "Publisher

I am using the OceanWp WordPress theme and I have activated the scheme option from the theme panel. When I checked the structure data via a structured data tool, the whole diagram works correctly but the diagram of the article gives these errors (in the screenshot below). I am using the free version of the theme and there is no support for me. I have no knowledge about coding, etc., but help me solve the problem.

Here is the screenshot.
enter description of image here

SharePoint 2016 search schema – An unknown error has occurred

We have a SharePoint 2016 server farm on site composed of 3 servers (application and search + wfe + database). We recently found that enterprise search was not working. When looking at the analysis logs under the search service application, the following error was reported and the analysis did not work:

The content processing pipeline could not process the item

There have been comments on the Internet suggesting that this could be due to a problem with the Matedata Manged property mappings, but when you click on the search scheme in Search Administration, it displays the following error without displaying the managed properties.

An unknown error has occurred.

We tried to restart the search host service and the time service, but that did not help.

Any help in solving the problem is greatly appreciated.

oracle 18c – How do you connect to a schema in a PDB (other than the SYS schema)?

Using Oracle 18c on RedHat Linux 8

Connecting to CDB as "SYS", I cannot understand how to connect to a schema in the PDB other than "SYS". Maybe I don't understand CDB / PDB architecture well enough.

Here is what I tried after logging into the Oracle 18c CDB as "SYS" (using sqlplus sys as sysdba):

ALTER SESSION SET CONTAINER= PDB;
conn myschema/mypasswd

and I also tried (direct from CDB)

conn myschema/mypasswd@PDB;

Both approaches fail to connect to the scheme myschema in the APB. In other words, I am still "SYS" in the APB.

Are there any suggestions / explanations on how to fix this problem?
Should i configure some kind of access from CDB to PDB for schema myschema?