trepa/migrations/20240703103050_accounts.up.sql
2025-02-20 12:09:38 +00:00

14 lines
No EOL
503 B
SQL

CREATE TABLE IF NOT EXISTS public.accounts
(
id integer NOT NULL GENERATED ALWAYS AS IDENTITY,
username text NOT NULL,
password text NOT NULL,
role_id smallint NOT NULL DEFAULT '1'::smallint,
created_at timestamp without time zone NOT NULL DEFAULT now(),
updated_at timestamp without time zone NOT NULL DEFAULT now(),
CONSTRAINT accounts_pkey PRIMARY KEY (id),
CONSTRAINT accounts_username_key UNIQUE (username)
);
ALTER TABLE IF EXISTS public.accounts
OWNER to dev;