sql: support constraint drop
Extend <ALTER TABLE> statement to drop table constraints by their names. Closes #4120 @TarantoolBot document Title: Drop table constraints in SQL Now, it is possible to drop table constraints (PRIMARY KEY, UNIQUE, FOREIGN KEY, CHECK) using <ALTER TABLE table_name DROP CONSTRAINT constraint_name> statement by their names. For example: tarantool> box.execute([[CREATE TABLE test ( a INTEGER PRIMARY KEY, b INTEGER, CONSTRAINT cnstr CHECK (a >= 0) );]]) --- - row_count: 1 ... tarantool> box.execute('ALTER TABLE test DROP CONSTRAINT cnstr;') --- - row_count: 1 ... The same for all the other constraints.
Showing
- src/box/constraint_id.h 1 addition, 0 deletionssrc/box/constraint_id.h
- src/box/sql/build.c 44 additions, 22 deletionssrc/box/sql/build.c
- src/box/sql/parse.y 2 additions, 2 deletionssrc/box/sql/parse.y
- src/box/sql/parse_def.h 6 additions, 5 deletionssrc/box/sql/parse_def.h
- src/box/sql/sqlInt.h 5 additions, 2 deletionssrc/box/sql/sqlInt.h
- test/sql/constraint.result 81 additions, 0 deletionstest/sql/constraint.result
- test/sql/constraint.test.lua 28 additions, 0 deletionstest/sql/constraint.test.lua
Loading
Please register or sign in to comment