Skip to content

Commit 7f592a0

Browse files
committed
Makes the example a bit more interesting - with constraints
1 parent 460695e commit 7f592a0

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

example/next-storage/README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,14 @@
88

99
```sql
1010
create table public.profiles (
11-
id uuid references auth.users not null primary key,
11+
id uuid references auth.users not null,
1212
username text unique,
1313
avatar_url text,
14-
dob date
14+
dob date,
15+
16+
primary key (id),
17+
unique(username),
18+
constraint username_length check (char_length(username) >= 3)
1519
);
1620
alter table profiles enable row level security;
1721
create policy "Public profiles are viewable by everyone." on profiles for select using (true);

example/next-storage/components/Account.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export default function Account({ session }: { session: AuthSession }) {
105105
throw error
106106
}
107107
} catch (error) {
108-
console.log('error', error.message)
108+
alert(error.message)
109109
}
110110
}
111111

0 commit comments

Comments
 (0)