You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CREATE EXTENSION IF NOT EXISTS "pgcrypto";
CREATE TYPE IF NOT EXISTS user_status AS ENUM ('active', 'inactive', 'suspended');
CREATE TYPE IF NOT EXISTS session_status_type AS ENUM ('active','revoked','updated');
CREATE TYPE IF NOT EXISTS company_type AS ENUM ('online_store', 'physical_store', 'multichannel_store');
CREATE TABLE IF NOT EXISTS roles (
id SERIAL PRIMARY KEY,
name VARCHAR(100) UNIQUE NOT NULL,
permission_codes TEXT[] NOT NULL DEFAULT '{}',
is_system_role BOOLEAN NOT NULL DEFAULT FALSE,
created_at TIMESTAMPTZ DEFAULT NOW(),
updated_at TIMESTAMPTZ DEFAULT NOW());
and use docker to run migration in docker-compose :
Activity
sopermaf commentedon Dec 17, 2025
The error message is correct. This is invalid syntax, and not an issue with the
migratetool itself, but rather the SQL script.You can't use
IF NOT EXISTSwithCREATE TYPEhttps://www.postgresql.org/docs/current/sql-createtype.html