tarantool / tarantool/doc

upgrade of DROP CONSTRAINT

Open
#3,761 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

3.0 sql
Dominant language
CSS
Stars
15
Forks
49
Avg merge
1d 13h
Merged PRs (30d)
3

Description

Related dev. issue(s): https://github.com/tarantool/tarantool/issues/9112

Product: Tarantool
Since: 3.0
Root document: https://www.tarantool.io/en/doc/latest/reference/reference_sql/sql_statements_and_clauses/#alter-table
SME: @ ImeevMA

Details

Now, instead of just ALTER TABLE table DROP CONSTRAINT constraint; we
have 8 operator variants:

  1. Statement to drop PRIMARY KEY, UNIQUE, tuple FOREIGN NEY or tuple
    CHECK constraints:
ALTER TABLE tab_name DROP CONSTRAINT constr_name;

This statement cannot drop a constraint if constr_name matches
more than one constraint.

  1. Statement to drop field FOREIGN NEY or field CHECK constraints:
ALTER TABLE tab_name DROP CONSTRAINT field_name.constr_name;

This statement cannot drop a constraint if constr_name matches
more than one constraint for the field_name field.

  1. Statement to drop PRIMARY KEY constraint:
ALTER TABLE tab_name DROP CONSTRAINT constr_name PRIMARY KEY;
  1. Statement to drop UNIQUE constraint:
ALTER TABLE tab_name DROP CONSTRAINT constr_name UNIQUE;
  1. Statement to drop tuple FOREIGN KEY constraint:
ALTER TABLE tab_name DROP CONSTRAINT constr_name FOREIGN KEY;
  1. Statement to drop tuple CHECK constraint:
ALTER TABLE tab_name DROP CONSTRAINT constr_name CHECK;
  1. Statement to drop field FOREIGN KEY constraint:
ALTER TABLE tab_name DROP CONSTRAINT field_name.constr_name FOREIGN KEY;
  1. Statement to drop field CHECK constraint:
ALTER TABLE tab_name DROP CONSTRAINT field_name.constr_name CHECK;

Requested by @ ImeevMA in https://github.com/tarantool/tarantool/commit/263777dcdd49dd7c48d4b54d9f5996f7802d9837.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the ALTER TABLE section in the linked Tarantool SQL reference, then compare its DROP CONSTRAINT syntax with the eight variants listed in this issue. Update that section to document the supported forms and their constraint-selection rules; done means all eight statements and ambiguity restrictions are accurately represented.

Written by the indexing model from the issue text.

Assessment

Tech stack
sql
Domain
database, documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.