Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [db-schema]

The tag has no usage guidance.

15 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2 votes
1 answer
282 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 ...
MagentoDev's user avatar
1 vote
0 answers
18 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 ...
Mujahidh's user avatar
  • 2,793
1 vote
1 answer
93 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.
phpDev's user avatar
  • 11
0 votes
1 answer
62 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 ...
Syed Hassan Zamir's user avatar
0 votes
1 answer
787 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="...
Black's user avatar
  • 3,369
0 votes
1 answer
309 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 ...
Adam Lavery's user avatar
0 votes
1 answer
687 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=&...
fudu's user avatar
  • 1,288
0 votes
1 answer
1k 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 ...
Black's user avatar
  • 3,369
0 votes
1 answer
446 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 ...
MagentoDev's user avatar
0 votes
1 answer
339 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 ...
ParisNakitaKejser's user avatar
0 votes
1 answer
487 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&...
Sri's user avatar
  • 1
0 votes
1 answer
331 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" ?> <...
Hawkeye_00's user avatar
0 votes
1 answer
54 views

Unable to create table with foreign key?

<table name="profile_products" resource="default" engine="innodb" comment="profile products"> <column xsi:type="smallint" ...
bagish's user avatar
  • 1
0 votes
1 answer
1k 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.
Kazim Noorani's user avatar
0 votes
1 answer
920 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 ...
jojo's user avatar
  • 39