-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ac233de
commit b1fe472
Showing
4 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
create table public.profiles ( | ||
id bigint generated by default as identity primary key, | ||
email text not null, | ||
first_name text | ||
); | ||
|
||
create or replace function public.handle_new_user() | ||
returns trigger as $$ | ||
begin | ||
insert into public.profiles (id, email, first_name) | ||
values ( | ||
new.id, | ||
new.email, | ||
new.raw_user_meta_data ->> 'first_name' | ||
); | ||
return new; | ||
end; | ||
$$ language plpgsql security definer; | ||
|
||
|
||
create table public.book_library ( | ||
id bigint generated by default as identity primary key, | ||
user_id uuid references auth.users not null, | ||
g_id text not null, | ||
title text, | ||
authors text, | ||
thumbnail text, | ||
categories text, | ||
rating float, | ||
insertedAt timestamp with time zone default timezone('utc'::text, now()) not null | ||
); | ||
|
||
create table public.book_wishlist ( | ||
id bigint generated by default as identity primary key, | ||
user_id uuid references auth.users not null, | ||
g_id text not null, | ||
title text, | ||
authors text, | ||
thumbnail text, | ||
categories text, | ||
rating float, | ||
insertedAt timestamp with time zone default timezone('utc'::text, now()) not null | ||
); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
b1fe472
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs: