This repository was archived by the owner on Dec 28, 2025. It is now read-only.
forked from HMH6868/rap_chieu_phim_ticket_app
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatabase.sql
More file actions
43 lines (40 loc) · 1.51 KB
/
database.sql
File metadata and controls
43 lines (40 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
-- WARNING: This schema is for context only and is not meant to be run.
-- Table order and constraints may not be valid for execution.
CREATE TABLE public.favorites (
id bigint GENERATED ALWAYS AS IDENTITY NOT NULL,
user_id uuid NOT NULL,
user_email text NOT NULL,
movie_id text NOT NULL,
title text NOT NULL,
poster_url text NOT NULL,
created_at timestamp with time zone DEFAULT now(),
CONSTRAINT favorites_pkey PRIMARY KEY (id),
CONSTRAINT favorites_user_id_fkey FOREIGN KEY (user_id) REFERENCES auth.users(id)
);
CREATE TABLE public.profiles (
id integer NOT NULL DEFAULT nextval('profiles_id_seq'::regclass),
user_id uuid NOT NULL,
email text NOT NULL,
avatar_url text,
created_at timestamp with time zone DEFAULT now(),
updated_at timestamp with time zone DEFAULT now(),
receive_notifications boolean DEFAULT true,
CONSTRAINT profiles_pkey PRIMARY KEY (id),
CONSTRAINT profiles_user_id_fkey FOREIGN KEY (user_id) REFERENCES auth.users(id)
);
CREATE TABLE public.tickets (
id bigint GENERATED ALWAYS AS IDENTITY NOT NULL,
user_id uuid NOT NULL,
user_email text NOT NULL,
movie_id text NOT NULL,
movie_title text NOT NULL,
poster_url text NOT NULL,
seats jsonb NOT NULL,
total_amount numeric NOT NULL,
date_time timestamp with time zone NOT NULL,
theater text NOT NULL,
status text DEFAULT 'active'::text,
created_at timestamp with time zone DEFAULT now(),
CONSTRAINT tickets_pkey PRIMARY KEY (id),
CONSTRAINT tickets_user_id_fkey FOREIGN KEY (user_id) REFERENCES auth.users(id)
);