trepa/migrations/20240703103050_accounts.up.sql

11 lines
446 B
MySQL
Raw Normal View History

2024-12-30 22:29:16 +01:00
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)
);