garbagespeak.com/migrations/000001_create_users_table.up.sql

14 lines
412 B
MySQL
Raw Permalink Normal View History

CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
2023-07-25 19:48:30 +00:00
CREATE TABLE IF NOT EXISTS users(
id uuid PRIMARY KEY default uuid_generate_v4(),
username VARCHAR (20) UNIQUE NOT NULL,
password VARCHAR (100) NOT NULL,
email TEXT UNIQUE NOT NULL,
2023-07-25 19:48:30 +00:00
created_at timestamp with time zone DEFAULT now(),
updated_at timestamp with time zone
);
CREATE UNIQUE INDEX IF NOT EXISTS users_id_idx ON public.users USING btree (id);