Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [declarative-schema]

Declarative setup is based on database structure declarations, and is used in projects such as Doctrine. Schema files declare what the database structure should be, and Magento determines the differences between the current table structure and what it should be. These differences can be represented with atomic SQL operations.

2
votes
0answers
20 views

setup:upgrade SQL error after update from 2.2.8 to 2.3.1

What could be the reason for this error on bin/magento setup:upgrade after updating from 2.2.8 to 2.3.1? SQLSTATE[42000]: Syntax error or access violation: 1061 Duplicate key name '...
0
votes
1answer
10 views

Magento 2.3 - How add new column/field to sales_shipment table

I need to add a new column/field (total_volume) to sales_shipment table. I know that I can use two approaches to do this, but what is the best? The first approach is to use the "Extension Attributes"....
2
votes
3answers
38 views

How to add foreign key in db_schema.xml

I'm using magento 2.3 to create a custom module, i tried to create database tables for my custom module in etc/db_schema.xml like this: <table comment="province Table" engine="innodb" name="...
0
votes
2answers
46 views

Migrate to declarative schema

people. I'm trying to migrate to declarative schema on my module with magento v2.3.1. But when i'm running php bin/magento setup:install --convert-old-scripts=1 it doesn't generates any db_schema.xml. ...
0
votes
1answer
22 views

Declarative schema approach to make customer's lastname optional

With pre-2.3 Magento versions we were able to write UpgradeData code and make customer's lastname optional as mentioned here: Magento 2 : How to make “lastname ” optional in customer registration form?...
6
votes
2answers
119 views

Empty Collection :: CollectionFactory Approach and getCollection approach both give empty result

I have created a table in my database using db_schema.xml and then populated that table with sql insert commands directly in mysql workbench. My model code is <?php namespace Lmap\...
0
votes
0answers
30 views

Upgrade schema script is not working with magento 2.1.3?

I have upgraded my magento version from 2.1.6 to 2.3.1. There is a custom module which is using upgradeschema but in magento 2.3.1. this is not working. Could anyone help me with this ?
2
votes
2answers
32 views

Magento 2.3 What are the profits of using db_schema.xml instead of using setup script?

Magento 2.3 used db_schema.xml instead of setup script. What are the benefits of using db_schema.xml over setup script?
1
vote
3answers
178 views

Magento 2.3 - How to add custom column to customer_entity table

I'm creating a Referral Program module, and I want to create a custom column inside the customer_entity table. The column is referred_by and it's a foreign key that as a relation with the ...
2
votes
1answer
96 views

Drop column on declarative schema not working as expected

I was playing on Magento 2.3 with Declarative Schema, and everything works very well when I added a new column do db_schema.xml and did a setup:upgrade. However, when removing a column node from XML ...
1
vote
1answer
26 views

Add new Order Statuses to Magento 2.3 using declarative scheme approach

I need to add several order statuses. Could not found info how to implement it via Data Patches
1
vote
1answer
243 views

Magento 2.3 : How to create product attribute via declarative schema

How to create product attribute in Magento 2.3 via declarative schema. I have tried below code but the input element is not visible on the form. <?php namespace Rokanthemes\Updates\Setup\Patch\...
1
vote
1answer
79 views

Magento 2.3 - Need detail about some newly introduced feature

I need to know about some of the newly introduced featured of Magento 2.3 GraphQL Declarative DB Schema Asynchronous and Bulk Web API There are few blogs information but not elaborating properly. I ...
3
votes
2answers
288 views

Magento 2.3 use of `db_schema_whitelist.json` file in etc directory of each module

What is the use of db_schema_whitelist.json located in Magento Catalog etc directory? In Magento 2.3 version, I found db_schema_whitelist.json and db_schema.xml files, in the Magento_Catalog module. ...
2
votes
0answers
63 views

Uninstalling extension

Up to versions 2.2 (including it) you could uninstall modules installed via composer and when you did that the method uninstall from Setup/Uninstall.php will be executed. Basically this was the place ...