skip to Main Content

I want to create an enum column in a Supabase table. Supabase uses Postgres under the hood, so I understand that technically it is possible if I do it manually using SQL. But is there any way I can do it via the frontend in an easier manner?

2

Answers


  1. Supabase engineer here — Thanks for the query! You are right that Supabase uses Postgres under the hood and that it can be done via the SQL editor on the Supabase dashboard or directly against the database by using psql.

    To my knowledge we don’t have a way of entering enum types via the frontend as of yet. We will relay this piece of feedback to the frontend team though.

    Let us know if you have any further questions.

    Login or Signup to reply.
  2. I struggled with this a bit (haven’t used SQL in years).

    Here is how you can do it, by doing it using SQL directly from the SQL Editor.

    CREATE TYPE employment_status_enum AS ENUM (
      'Active',
      'Inactive'
    );
    
    ALTER TABLE "employee"
    ADD COLUMN employment_status employment_status_enum 
    DEFAULT 'Inactive';
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search