bbotella commented on code in PR #3562:
URL: https://github.com/apache/cassandra/pull/3562#discussion_r1920266245


##########
doc/modules/cassandra/pages/developing/cql/constraints.adoc:
##########
@@ -0,0 +1,93 @@
+= Constraints
+
+Constraints provide a way of specifying and enforcing conditions at a
+column level in a table schema definition and enforcing them at write time.
+
+== CREATE CONSTRAINT
+
+Constraints can be created within the column definition, or as part
+of the table properties.
+
+The main syntaxis to define a constraint is as follows:
+
+[source,bnf]
+----
+CREATE TABLE keyspace.table (
+       name text,
+       i int CHECK (condition) (AND (condition))*
+       ...,
+
+);
+----
+
+As shown in this syntax, more than one constraint can be defined for a given 
column using the AND keyword.
+
+== ALTER CONSTRAINT
+
+Altering a constraint is done by following the alter column CQL syntax:
+[source,bnf]
+----
+ALTER TABLE [IF EXISTS] <table> ALTER [IF EXISTS] <column> CHECK <condition>;
+----
+
+== DROP CONSTRAINT
+And DROP can be used to drop constraints for a column as well.
+[source,bnf]
+----
+ALTER TABLE [IF EXISTS] <table> ALTER [IF EXISTS] <column> DROP CHECK;

Review Comment:
   That's correct.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to