Questions tagged [db-schema]
The db-schema tag has no usage guidance.
17
questions with no upvoted or accepted answers
1
vote
1
answer
166
views
Magento 2: How to increase the column max length?
I want to increase the customer firstname max length so I have updated the length of that column using my custom module dbschema.xml.
After updating the length, I can see the updated length in ...
0
votes
0
answers
4
views
Create a custom component to create display design options in admin and design option dropdown and selected will be displayed on product page
Create a custom component to add/edit/delete and view the detail of design information into admin. Associate the multiple design option to product and show selected design option product detail page.
...
0
votes
1
answer
27
views
How to add new Foriegn Key in existing table in Magento 2.4.5
I am trying to add a new foriegn key in existing table using db_schema.xml but it is not working at all I tried to delete the table and delete module from setup_module table as well but still nothing ...
0
votes
0
answers
14
views
After new compilation , my custom module's table data was reset in magento 2?
I have a custom module with the custom table, When i am doing compilation in some time the table data was completely removing and only the empty data base table is exist.
I created this table using ...
0
votes
1
answer
57
views
Custom order Status on Magento 2 programmatically
I have built a Payment Module and I want to add some custom status on table sales_order_status using etc/db_schema.xml.
Is this possible?
Thank you.
0
votes
1
answer
423
views
Magento 2 - can't add foreign key constraint with declarative schema (db_schema.xml) - Reference column X in reference table Y do not have index
I try to add this table:
MODULE/etc/db_schema.xml:
<?xml version="1.0"?>
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="...
0
votes
0
answers
91
views
Compare DB changes between Magento 2.3.4 and Magento 2.4.3
I am in the middle of a migration process between Magento 2.3.4 and Magento 2.4.3.
Regarding the code changes, I am in a good spot. Everything is under control. However, it is not 100% clear to me how ...
0
votes
1
answer
209
views
setup:db-declaration:generate-whitelist does nothing - no results or errors
M2.4.3-p1. Trying to use db_schema.xml as that appears to be the way forward. setup:upgrade is not adding my tables. setup:db-declaration:generate-whitelist is not generating the whitelist. Basically ...
0
votes
1
answer
413
views
foreign key db_schema.xml automatic renamed to FK_ magento 2
I have this db_schema.xml
<?xml version="1.0"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<schema xmlns:xsi=&...
0
votes
1
answer
837
views
Magento 2 - create a table with foreign key constraint
I try to add this database table.
It has a foreign key constraint to the customer_entity table.
I need to configure it so if the customer is getting deleted that record is also getting deleted.
This ...
0
votes
1
answer
303
views
Magento2: what is the purpose of having db_schema_whitelist.json?
I'm looking for some sort of explanation for the below topics but I'm not able to find the exact answers on the internet.
What is the need for db_schema_whitelist.json? (I have read that this file ...
0
votes
1
answer
138
views
How to filter products out with custom created field on catalog_product_entity
I have added 2 fields in db_schema.xml there created on table catalog_product_entity the challenges for me now are I'm using the one field as custom state and this state is the field I need to filter ...
0
votes
1
answer
353
views
How to update Magento core column from type int to decimal using declarative schema?
I want to update the core table column from type int to decimal.
<column xsi:type="int" name="column_name" padding="10" unsigned="true" nullable="false&...
0
votes
1
answer
230
views
Change type of field in db (table: quote, field: customer_note, current type: varchar, wanted type: text)
I try to change the type of the field customer_note in the quote table from varchar to text. I went the declarative way:
VendorName/Module/etc/db_schema.xml:
<?xml version="1.0" ?>
<...
0
votes
1
answer
38
views
Unable to create table with foreign key?
<table name="profile_products" resource="default" engine="innodb" comment="profile products">
<column xsi:type="smallint" ...
0
votes
1
answer
725
views
How to add created at and updated at column and update it on values save?
I want to add created_at and updated_at columns in a custom table and update both columns on saving the data.
0
votes
1
answer
559
views
Allow tinytext in db_schema.xml magento 2
I'm doing a custom migration from Magento 1.9 to Magento 2.3.4 , in one of the custom module on Magento 1.9 it uses tinytext as table column type, therefore I tried to recreate this module using ...