Split admin dashboard, implement user and booking search
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
|
||||
-- Enable pgcrypto for generating random IDs
|
||||
CREATE EXTENSION IF NOT EXISTS pgcrypto;
|
||||
CREATE EXTENSION IF NOT EXISTS pg_trgm;
|
||||
|
||||
-- =======================================
|
||||
-- ENUMS
|
||||
@@ -355,6 +356,24 @@ CREATE INDEX idx_bookings_start_time_status ON bookings(start_time, status);
|
||||
CREATE INDEX idx_users_created_at ON users(created_at);
|
||||
CREATE INDEX idx_payments_created_at_status ON payments(created_at, status);
|
||||
|
||||
create table images (
|
||||
id uuid primary key default gen_random_uuid(),
|
||||
r2_url text not null,
|
||||
tag_names text[] not null default '{}', -- for searching and filtering
|
||||
created_at timestamptz not null default now()
|
||||
);
|
||||
|
||||
-- only for autocomlpete text
|
||||
create table tags (
|
||||
id serial primary key,
|
||||
name text not null unique
|
||||
);
|
||||
|
||||
-- Indexes
|
||||
create index idx_images_tag_names on images using gin(tag_names);
|
||||
create index idx_images_created_at on images(created_at desc);
|
||||
create index idx_tags_name_trgm on tags using gin (name gin_trgm_ops);
|
||||
|
||||
-- =======================================
|
||||
-- GDPR COMPLIANCE FUNCTIONS
|
||||
-- =======================================
|
||||
|
||||
Reference in New Issue
Block a user