-
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
Showing
3 changed files
with
70 additions
and
1 deletion.
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,11 @@ | ||
create table public."Task" ( | ||
id bigint generated by default as identity, | ||
created_at timestamp with time zone null default now(), | ||
text text null, | ||
user_id uuid not null, | ||
finished boolean null default false, | ||
constraint Task_pkey primary key (id), | ||
constraint Task_user_id_fkey foreign key (user_id) references auth.users (id) on delete cascade | ||
) tablespace pg_default; | ||
|
||
CREATE POLICY "Enable all for users based on user_id" ON "public"."Task" AS PERMISSIVE FOR ALL TO public USING (auth.uid() = user_id) WITH CHECK (auth.uid() = user_id) |
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
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,57 @@ | ||
export type Json = | ||
| string | ||
| number | ||
| boolean | ||
| null | ||
| { [key: string]: Json | undefined } | ||
| Json[]; | ||
|
||
export interface Database { | ||
public: { | ||
Tables: { | ||
Task: { | ||
Row: { | ||
created_at: string | null; | ||
finished: boolean | null; | ||
id: number; | ||
text: string | null; | ||
user_id: string; | ||
}; | ||
Insert: { | ||
created_at?: string | null; | ||
finished?: boolean | null; | ||
id?: number; | ||
text?: string | null; | ||
user_id: string; | ||
}; | ||
Update: { | ||
created_at?: string | null; | ||
finished?: boolean | null; | ||
id?: number; | ||
text?: string | null; | ||
user_id?: string; | ||
}; | ||
Relationships: [ | ||
{ | ||
foreignKeyName: "Task_user_id_fkey"; | ||
columns: ["user_id"]; | ||
referencedRelation: "users"; | ||
referencedColumns: ["id"]; | ||
}, | ||
]; | ||
}; | ||
}; | ||
Views: { | ||
[_ in never]: never; | ||
}; | ||
Functions: { | ||
[_ in never]: never; | ||
}; | ||
Enums: { | ||
[_ in never]: never; | ||
}; | ||
CompositeTypes: { | ||
[_ in never]: never; | ||
}; | ||
}; | ||
} |