Skip to content

Missing "RESTRICT" value to declarative schema foreign constraint #27072

Open
@textarea

Description

@textarea
Contributor

Summary (*)

Cannot set a foreign constraint onDelete="RESTRICT" in custom table.

Examples (*)

<constraint xsi:type="foreign"
	referenceId="CUSTOM_TABLE_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID"
	table="custom_table"
	column="customer_id"
	referenceTable="customer_entity"
	referenceColumn="entity_id"
	onDelete="RESTRICT"/>

Proposed solution

Add "RESTRICT" value to foreign constraint referenceOptionsType.

Activity

added
Triage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject it
on Feb 28, 2020
m2-assistant

m2-assistant commented on Feb 28, 2020

@m2-assistant

Hi @textarea. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
    Information on your environment
    Steps to reproduce
    Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, please, review the Magento Contributor Assistant documentation.

@textarea do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • yes
    no

self-assigned this
on Feb 28, 2020
m2-assistant

m2-assistant commented on Feb 28, 2020

@m2-assistant

Hi @dmytro-ch. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

    2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

    3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

    4. Verify that the issue is reproducible on 2.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

    5. Add label Issue: Confirmed once verification is complete.

    6. Make sure that automatic system confirms that report has been added to the backlog.

added
Issue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passed
Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branch
Issue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmed
on Feb 28, 2020
ghost removed
Triage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject it
on Feb 28, 2020
magento-engcom-team

magento-engcom-team commented on Feb 28, 2020

@magento-engcom-team
Contributor

✅ Confirmed by @dmytro-ch
Thank you for verifying the issue. Based on the provided information internal tickets MC-31998 were created

Issue Available: @dmytro-ch, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

6 remaining items

added
Priority: P2A defect with this priority could have functionality issues which are not to expectations.
Severity: S2Major restrictions or short-term circumventions are required until a fix is available.
on Jul 28, 2020
added
CDIssue recommended for the contribution day
on Oct 7, 2020
speller

speller commented on Apr 25, 2024

@speller

Any updates on this issue?

speller

speller commented on Apr 25, 2024

@speller

That's funny how a one-line fix ticket is not being solved for 4 years. Just add the <xs:enumeration value="RESTRICT" /> line to the Setup/Declaration/Schema/etc/constraints/foreign.xsd file and that's it.

moved this to Ready for Development in High Priority Backlogon Aug 19, 2024
thecodecook14

thecodecook14 commented on Feb 26, 2025

@thecodecook14
Contributor

@magento I am working on this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Area: AccountCDIssue recommended for the contribution dayComponent: SetupIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentPriority: P2A defect with this priority could have functionality issues which are not to expectations.Progress: ready for devReproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchSeverity: S2Major restrictions or short-term circumventions are required until a fix is available.Triage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject it

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Participants

    @speller@textarea@sivaschenko@sdzhepa@VladimirZaets

    Issue actions

      Missing "RESTRICT" value to declarative schema foreign constraint · Issue #27072 · magento/magento2