ariga / atlas

Manage your database schema as code

Home Page:https://atlasgo.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Create citext type column

enrique-fernandez-polo opened this issue · comments

Hello there!

I am trying to create a table with a citext column

schema "public" {}

extension "citext" {
  schema  = schema.public
}

table "accounts" {
  schema = schema.public
  column "email" {
    type = citext
  }
}

I am getting the following error

Unknown column.type; There is no type named "citext". Did you mean "text"?

I've tried this without success

table "accounts" {
  schema = schema.public
  column "email" {
    type = extension.citext
  }
}

Any advice? Thanks in advance!

Hey! Non-standard and user-defined types can be defined using the sql expression as follows: sql("citext").

Cool!! I had to update the CLI too. I guess this is one of the latest features.

Thanks!