Somewhat automate types and stuff.
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
create table profiles (
|
||||
id uuid references auth.users on delete cascade not null primary key,
|
||||
updated_at timestamp with time zone,
|
||||
email text,
|
||||
email text unique,
|
||||
full_name text,
|
||||
avatar_url text,
|
||||
provider text,
|
||||
@ -35,7 +35,7 @@ begin
|
||||
new.id,
|
||||
new.email,
|
||||
new.raw_user_meta_data->>'full_name',
|
||||
new.raw_user_meta_data->>'avatar_url'
|
||||
new.raw_user_meta_data->>'avatar_url',
|
||||
new.raw_user_meta_data->>'provider',
|
||||
now()
|
||||
);
|
||||
@ -58,7 +58,6 @@ create policy "Avatar images are publicly accessible." on storage.objects
|
||||
create policy "Anyone can upload an avatar." on storage.objects
|
||||
for insert with check (bucket_id = 'avatars');
|
||||
|
||||
|
||||
-- -- Create a table for public statuses
|
||||
-- CREATE TABLE statuses (
|
||||
-- id uuid DEFAULT gen_random_uuid() PRIMARY KEY,
|
||||
@ -66,8 +65,7 @@ create policy "Anyone can upload an avatar." on storage.objects
|
||||
-- updated_by_id uuid REFERENCES auth.users ON DELETE SET NULL DEFAULT auth.uid(),
|
||||
-- created_at timestamp with time zone DEFAULT now() NOT NULL,
|
||||
-- status text NOT NULL,
|
||||
-- CONSTRAINT status_length CHECK (char_length(status) >= 3 AND char_length(status) <= 80),
|
||||
-- CONSTRAINT statuses_user_id_fkey FOREIGN KEY (user_id) REFERENCES profiles(id) ON DELETE CASCADE
|
||||
-- CONSTRAINT status_length CHECK (char_length(status) >= 3 AND char_length(status) <= 80)
|
||||
-- );
|
||||
|
||||
-- -- Set up Row Level Security (RLS)
|
||||
|
Reference in New Issue
Block a user