# Error creating table:line 1:63 no viable alternative at input 'text'

**URL:** <https://forum.scylladb.com/t/error-creating-table-line-1-63-no-viable-alternative-at-input-text/1285>\
**Category:** ScyllaDB\
**Tags:** data-model\
**Created:** [February 7, 2024, 6:38am UTC](https://forum.scylladb.com/t/error-creating-table-line-1-63-no-viable-alternative-at-input-text/1285 "2024-02-07T06:38:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dhairya\_srv](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.scylladb.com/dhairya_srv/32/644_2.png) [@dhairya\_srv](https://forum.scylladb.com/u/dhairya_srv)\
**Post date:** [February 7, 2024, 6:38am UTC](https://forum.scylladb.com/t/error-creating-table-line-1-63-no-viable-alternative-at-input-text/1285/1 "2024-02-07T06:38:47Z")

</div>

Here is my code for the Create table query

```auto
Session.Query("CREATE TABLE IF NOT EXISTS todo (id uuid PRIMARY KEY, username text UNIQUE, title text, description text, status text, created_at timestamp, updated_at timestamp);").Exec()

```

And i am encountering the type mismatch error-  
“Connected to DB successfully  
2024/02/07 11:52:34 Error creating table:line 1:63 no viable alternative at input ‘text’”  
the output states that my database connection is successful but the create table query has a type mismatch. Please help

---

<div class="post-metadata">

**Author:** ![Botond\_Denes](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.scylladb.com/botond_denes/32/163_2.png) [@Botond\_Denes](https://forum.scylladb.com/u/Botond_Denes)\
**Post date:** [February 7, 2024, 6:49am UTC](https://forum.scylladb.com/t/error-creating-table-line-1-63-no-viable-alternative-at-input-text/1285/2 "2024-02-07T06:49:59Z")

</div>

CQL does not have an `UNIQUE` column attribute. Remove this and you should be fine.

If you want a column to be unique, make it part of the primary key, keys are unique by definition:

- If you need the column to be globally unique, make it part of the partition key, note that this means you will have to provide this column in all queries.
- If you need the column to be unique in a single partition, you can make it part of the clustering key.

---

<div class="post-metadata">

**Author:** ![dhairya\_srv](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.scylladb.com/dhairya_srv/32/644_2.png) [@dhairya\_srv](https://forum.scylladb.com/u/dhairya_srv)\
**Post date:** [February 7, 2024, 11:14am UTC](https://forum.scylladb.com/t/error-creating-table-line-1-63-no-viable-alternative-at-input-text/1285/4 "2024-02-07T11:14:35Z")

</div>

It worked, thanks a lot!
