From a24e806d9705d9c2c3cc8f435b807b3dda0e928c Mon Sep 17 00:00:00 2001 From: Bernardo Botella Corbi Date: Tue, 4 Feb 2025 20:27:14 -0800 Subject: [PATCH] Adds not null documentation --- .../pages/developing/cql/constraints.adoc | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/doc/modules/cassandra/pages/developing/cql/constraints.adoc b/doc/modules/cassandra/pages/developing/cql/constraints.adoc index e6a76dbe7d3b..840caccd23b9 100644 --- a/doc/modules/cassandra/pages/developing/cql/constraints.adoc +++ b/doc/modules/cassandra/pages/developing/cql/constraints.adoc @@ -91,3 +91,26 @@ Finally, the constraint can be removed: ---- ALTER TABLE keyspace.table ALTER name DROP CHECK; ---- + +=== NOT_NULL CONSTRAINT + +Defines a condition that checks if a column is null. + +---- +CREATE TABLE keyspace.table ( + name text CHECK NOT_NULL + ..., +); +---- + +Altering that constraint can be done with: + +---- +ALTER TABLE keyspace.table ALTER name CHECK NOT_NULL; +---- + +Finally, the constraint can be removed: + +---- +ALTER TABLE keyspace.table ALTER name DROP CHECK; +----