Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add schema public.attendees #178

Merged
merged 4 commits into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 56 additions & 20 deletions apps/web/app/types/generated/supabase.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
export type Json =
| string
| number
| boolean
| null
| { [key: string]: Json | undefined }
| Json[]
export type Json = string | number | boolean | null | { [key: string]: Json | undefined } | Json[]

export type Database = {
graphql_public: {
Expand Down Expand Up @@ -57,6 +51,56 @@ export type Database = {
},
]
}
attendees: {
Row: {
activated_at: string | null
avatar_url: string
created_at: string
display_name: string | null
email: string
id: string
provider: string
receipt_id: string
role: string | null
updated_at: string
user_id: string
}
Insert: {
activated_at?: string | null
avatar_url: string
created_at?: string
display_name?: string | null
email: string
id?: string
provider: string
receipt_id: string
role?: string | null
updated_at?: string
user_id: string
}
Update: {
activated_at?: string | null
avatar_url?: string
created_at?: string
display_name?: string | null
email?: string
id?: string
provider?: string
receipt_id?: string
role?: string | null
updated_at?: string
user_id?: string
}
Relationships: [
{
foreignKeyName: 'attendees_user_id_fkey'
columns: ['user_id']
isOneToOne: false
referencedRelation: 'users'
referencedColumns: ['id']
},
]
}
speakers: {
Row: {
caption_en: string | null
Expand Down Expand Up @@ -570,20 +614,16 @@ export type Tables<
}
? R
: never
: PublicTableNameOrOptions extends keyof (PublicSchema['Tables'] &
PublicSchema['Views'])
? (PublicSchema['Tables'] &
PublicSchema['Views'])[PublicTableNameOrOptions] extends {
: PublicTableNameOrOptions extends keyof (PublicSchema['Tables'] & PublicSchema['Views'])
? (PublicSchema['Tables'] & PublicSchema['Views'])[PublicTableNameOrOptions] extends {
Row: infer R
}
? R
: never
: never

export type TablesInsert<
PublicTableNameOrOptions extends
| keyof PublicSchema['Tables']
| { schema: keyof Database },
PublicTableNameOrOptions extends keyof PublicSchema['Tables'] | { schema: keyof Database },
TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
? keyof Database[PublicTableNameOrOptions['schema']]['Tables']
: never = never,
Expand All @@ -602,9 +642,7 @@ export type TablesInsert<
: never

export type TablesUpdate<
PublicTableNameOrOptions extends
| keyof PublicSchema['Tables']
| { schema: keyof Database },
PublicTableNameOrOptions extends keyof PublicSchema['Tables'] | { schema: keyof Database },
TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
? keyof Database[PublicTableNameOrOptions['schema']]['Tables']
: never = never,
Expand All @@ -623,9 +661,7 @@ export type TablesUpdate<
: never

export type Enums<
PublicEnumNameOrOptions extends
| keyof PublicSchema['Enums']
| { schema: keyof Database },
PublicEnumNameOrOptions extends keyof PublicSchema['Enums'] | { schema: keyof Database },
EnumName extends PublicEnumNameOrOptions extends { schema: keyof Database }
? keyof Database[PublicEnumNameOrOptions['schema']]['Enums']
: never = never,
Expand Down
14 changes: 14 additions & 0 deletions supabase/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,20 @@ create table if not exists public.staffs (
updated_at timestamp with time zone default timezone('utc' :: text, now()) not null
);

create table if not exists public.attendees (
id uuid not null primary key default uuid_generate_v4(),
user_id uuid not null references auth.users on delete cascade,
email varchar(100) not null unique,
avatar_url varchar(500) not null,
provider varchar(20) not null,
display_name varchar(24),
role varchar(16),
receipt_id varchar(20) not null unique,
activated_at timestamp with time zone,
created_at timestamp with time zone default timezone('utc' :: text, now()) not null,
updated_at timestamp with time zone default timezone('utc' :: text, now()) not null
);

-- *** Function definitions ***
create
or replace function public.create_admin_user() returns trigger as $ $ begin -- If user_role is 'admin', insert data into admin_users table
Expand Down