ajout des tables sql

This commit is contained in:
Antonin 2025-04-22 16:13:17 +02:00
parent c1b1987f6e
commit 267168dbd5
2 changed files with 669 additions and 0 deletions

View file

@ -0,0 +1,221 @@
SET session_replication_role = replica;
--
-- PostgreSQL database dump
--
-- Dumped from database version 15.8
-- Dumped by pg_dump version 15.8
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
--
-- Data for Name: audit_log_entries; Type: TABLE DATA; Schema: auth; Owner: supabase_auth_admin
--
--
-- Data for Name: flow_state; Type: TABLE DATA; Schema: auth; Owner: supabase_auth_admin
--
--
-- Data for Name: users; Type: TABLE DATA; Schema: auth; Owner: supabase_auth_admin
--
--
-- Data for Name: identities; Type: TABLE DATA; Schema: auth; Owner: supabase_auth_admin
--
--
-- Data for Name: instances; Type: TABLE DATA; Schema: auth; Owner: supabase_auth_admin
--
--
-- Data for Name: sessions; Type: TABLE DATA; Schema: auth; Owner: supabase_auth_admin
--
--
-- Data for Name: mfa_amr_claims; Type: TABLE DATA; Schema: auth; Owner: supabase_auth_admin
--
--
-- Data for Name: mfa_factors; Type: TABLE DATA; Schema: auth; Owner: supabase_auth_admin
--
--
-- Data for Name: mfa_challenges; Type: TABLE DATA; Schema: auth; Owner: supabase_auth_admin
--
--
-- Data for Name: one_time_tokens; Type: TABLE DATA; Schema: auth; Owner: supabase_auth_admin
--
--
-- Data for Name: refresh_tokens; Type: TABLE DATA; Schema: auth; Owner: supabase_auth_admin
--
--
-- Data for Name: sso_providers; Type: TABLE DATA; Schema: auth; Owner: supabase_auth_admin
--
--
-- Data for Name: saml_providers; Type: TABLE DATA; Schema: auth; Owner: supabase_auth_admin
--
--
-- Data for Name: saml_relay_states; Type: TABLE DATA; Schema: auth; Owner: supabase_auth_admin
--
--
-- Data for Name: sso_domains; Type: TABLE DATA; Schema: auth; Owner: supabase_auth_admin
--
--
-- Data for Name: code; Type: TABLE DATA; Schema: public; Owner: postgres
--
INSERT INTO "public"."code" ("id", "code") VALUES
('5e8aa84a-f770-4eaa-ba0a-545297ec4d64', 'code_test');
--
-- Data for Name: joueur; Type: TABLE DATA; Schema: public; Owner: postgres
--
--
-- Data for Name: équipe; Type: TABLE DATA; Schema: public; Owner: postgres
--
--
-- Data for Name: equipe-joueur; Type: TABLE DATA; Schema: public; Owner: postgres
--
--
-- Data for Name: flag; Type: TABLE DATA; Schema: public; Owner: postgres
--
--
-- Data for Name: flag-trouve; Type: TABLE DATA; Schema: public; Owner: postgres
--
--
-- Data for Name: indice; Type: TABLE DATA; Schema: public; Owner: postgres
--
--
-- Data for Name: indice-equipe; Type: TABLE DATA; Schema: public; Owner: postgres
--
--
-- Data for Name: buckets; Type: TABLE DATA; Schema: storage; Owner: supabase_storage_admin
--
--
-- Data for Name: objects; Type: TABLE DATA; Schema: storage; Owner: supabase_storage_admin
--
--
-- Data for Name: prefixes; Type: TABLE DATA; Schema: storage; Owner: supabase_storage_admin
--
--
-- Data for Name: s3_multipart_uploads; Type: TABLE DATA; Schema: storage; Owner: supabase_storage_admin
--
--
-- Data for Name: s3_multipart_uploads_parts; Type: TABLE DATA; Schema: storage; Owner: supabase_storage_admin
--
--
-- Data for Name: hooks; Type: TABLE DATA; Schema: supabase_functions; Owner: supabase_functions_admin
--
--
-- Data for Name: secrets; Type: TABLE DATA; Schema: vault; Owner: supabase_admin
--
--
-- Name: refresh_tokens_id_seq; Type: SEQUENCE SET; Schema: auth; Owner: supabase_auth_admin
--
SELECT pg_catalog.setval('"auth"."refresh_tokens_id_seq"', 1, false);
--
-- Name: hooks_id_seq; Type: SEQUENCE SET; Schema: supabase_functions; Owner: supabase_functions_admin
--
SELECT pg_catalog.setval('"supabase_functions"."hooks_id_seq"', 1, false);
--
-- PostgreSQL database dump complete
--
RESET ALL;

View file

@ -0,0 +1,448 @@
create table "public"."code" (
"id" uuid not null default gen_random_uuid(),
"code" text not null
);
create table "public"."equipe-joueur" (
"id_equipe" uuid not null default gen_random_uuid(),
"id_joueur" uuid not null default gen_random_uuid()
);
create table "public"."flag" (
"id_flag" uuid not null default gen_random_uuid(),
"valeur_flag" text not null,
"point" bigint not null,
"predecesseur" text,
"successeur" text
);
create table "public"."flag-trouve" (
"id_flag" uuid not null default gen_random_uuid(),
"id_equipe" uuid not null default gen_random_uuid()
);
create table "public"."indice" (
"id_indice" uuid not null default gen_random_uuid(),
"penalite" bigint not null,
"text_indice" text not null
);
create table "public"."indice-equipe" (
"id_equipe" uuid not null default gen_random_uuid(),
"id_indice" uuid not null default gen_random_uuid()
);
create table "public"."joueur" (
"uuid" uuid not null default auth.uid(),
"created_at" timestamp with time zone not null default now(),
"prenom" text not null,
"pseudo" text not null
);
create table "public"."équipe" (
"id_equipe" uuid not null default gen_random_uuid(),
"created_at" timestamp with time zone not null default now(),
"nom_equipe" text not null
);
CREATE UNIQUE INDEX code_pkey ON public.code USING btree (id);
CREATE UNIQUE INDEX "equipe-joueur_pkey" ON public."equipe-joueur" USING btree (id_equipe, id_joueur);
CREATE UNIQUE INDEX "flag-trouve_pkey" ON public."flag-trouve" USING btree (id_flag, id_equipe);
CREATE UNIQUE INDEX flag_pkey ON public.flag USING btree (id_flag);
CREATE UNIQUE INDEX "indice-equipe_pkey" ON public."indice-equipe" USING btree (id_equipe, id_indice);
CREATE UNIQUE INDEX indice_pkey ON public.indice USING btree (id_indice);
CREATE UNIQUE INDEX joueur_pkey ON public.joueur USING btree (uuid);
CREATE UNIQUE INDEX "équipe_pkey" ON public."équipe" USING btree (id_equipe);
alter table "public"."code" add constraint "code_pkey" PRIMARY KEY using index "code_pkey";
alter table "public"."equipe-joueur" add constraint "equipe-joueur_pkey" PRIMARY KEY using index "equipe-joueur_pkey";
alter table "public"."flag" add constraint "flag_pkey" PRIMARY KEY using index "flag_pkey";
alter table "public"."flag-trouve" add constraint "flag-trouve_pkey" PRIMARY KEY using index "flag-trouve_pkey";
alter table "public"."indice" add constraint "indice_pkey" PRIMARY KEY using index "indice_pkey";
alter table "public"."indice-equipe" add constraint "indice-equipe_pkey" PRIMARY KEY using index "indice-equipe_pkey";
alter table "public"."joueur" add constraint "joueur_pkey" PRIMARY KEY using index "joueur_pkey";
alter table "public"."équipe" add constraint "équipe_pkey" PRIMARY KEY using index "équipe_pkey";
alter table "public"."equipe-joueur" add constraint "equipe-joueur_id_equipe_fkey" FOREIGN KEY (id_equipe) REFERENCES "équipe"(id_equipe) not valid;
alter table "public"."equipe-joueur" validate constraint "equipe-joueur_id_equipe_fkey";
alter table "public"."equipe-joueur" add constraint "equipe-joueur_id_joueur_fkey" FOREIGN KEY (id_joueur) REFERENCES joueur(uuid) not valid;
alter table "public"."equipe-joueur" validate constraint "equipe-joueur_id_joueur_fkey";
alter table "public"."flag-trouve" add constraint "flag-trouve_id_equipe_fkey" FOREIGN KEY (id_equipe) REFERENCES "équipe"(id_equipe) not valid;
alter table "public"."flag-trouve" validate constraint "flag-trouve_id_equipe_fkey";
alter table "public"."flag-trouve" add constraint "flag-trouve_id_flag_fkey" FOREIGN KEY (id_flag) REFERENCES flag(id_flag) not valid;
alter table "public"."flag-trouve" validate constraint "flag-trouve_id_flag_fkey";
alter table "public"."indice-equipe" add constraint "indice-equipe_id_equipe_fkey" FOREIGN KEY (id_equipe) REFERENCES "équipe"(id_equipe) not valid;
alter table "public"."indice-equipe" validate constraint "indice-equipe_id_equipe_fkey";
alter table "public"."indice-equipe" add constraint "indice-equipe_id_indice_fkey" FOREIGN KEY (id_indice) REFERENCES indice(id_indice) not valid;
alter table "public"."indice-equipe" validate constraint "indice-equipe_id_indice_fkey";
grant delete on table "public"."code" to "anon";
grant insert on table "public"."code" to "anon";
grant references on table "public"."code" to "anon";
grant select on table "public"."code" to "anon";
grant trigger on table "public"."code" to "anon";
grant truncate on table "public"."code" to "anon";
grant update on table "public"."code" to "anon";
grant delete on table "public"."code" to "authenticated";
grant insert on table "public"."code" to "authenticated";
grant references on table "public"."code" to "authenticated";
grant select on table "public"."code" to "authenticated";
grant trigger on table "public"."code" to "authenticated";
grant truncate on table "public"."code" to "authenticated";
grant update on table "public"."code" to "authenticated";
grant delete on table "public"."code" to "service_role";
grant insert on table "public"."code" to "service_role";
grant references on table "public"."code" to "service_role";
grant select on table "public"."code" to "service_role";
grant trigger on table "public"."code" to "service_role";
grant truncate on table "public"."code" to "service_role";
grant update on table "public"."code" to "service_role";
grant delete on table "public"."equipe-joueur" to "anon";
grant insert on table "public"."equipe-joueur" to "anon";
grant references on table "public"."equipe-joueur" to "anon";
grant select on table "public"."equipe-joueur" to "anon";
grant trigger on table "public"."equipe-joueur" to "anon";
grant truncate on table "public"."equipe-joueur" to "anon";
grant update on table "public"."equipe-joueur" to "anon";
grant delete on table "public"."equipe-joueur" to "authenticated";
grant insert on table "public"."equipe-joueur" to "authenticated";
grant references on table "public"."equipe-joueur" to "authenticated";
grant select on table "public"."equipe-joueur" to "authenticated";
grant trigger on table "public"."equipe-joueur" to "authenticated";
grant truncate on table "public"."equipe-joueur" to "authenticated";
grant update on table "public"."equipe-joueur" to "authenticated";
grant delete on table "public"."equipe-joueur" to "service_role";
grant insert on table "public"."equipe-joueur" to "service_role";
grant references on table "public"."equipe-joueur" to "service_role";
grant select on table "public"."equipe-joueur" to "service_role";
grant trigger on table "public"."equipe-joueur" to "service_role";
grant truncate on table "public"."equipe-joueur" to "service_role";
grant update on table "public"."equipe-joueur" to "service_role";
grant delete on table "public"."flag" to "anon";
grant insert on table "public"."flag" to "anon";
grant references on table "public"."flag" to "anon";
grant select on table "public"."flag" to "anon";
grant trigger on table "public"."flag" to "anon";
grant truncate on table "public"."flag" to "anon";
grant update on table "public"."flag" to "anon";
grant delete on table "public"."flag" to "authenticated";
grant insert on table "public"."flag" to "authenticated";
grant references on table "public"."flag" to "authenticated";
grant select on table "public"."flag" to "authenticated";
grant trigger on table "public"."flag" to "authenticated";
grant truncate on table "public"."flag" to "authenticated";
grant update on table "public"."flag" to "authenticated";
grant delete on table "public"."flag" to "service_role";
grant insert on table "public"."flag" to "service_role";
grant references on table "public"."flag" to "service_role";
grant select on table "public"."flag" to "service_role";
grant trigger on table "public"."flag" to "service_role";
grant truncate on table "public"."flag" to "service_role";
grant update on table "public"."flag" to "service_role";
grant delete on table "public"."flag-trouve" to "anon";
grant insert on table "public"."flag-trouve" to "anon";
grant references on table "public"."flag-trouve" to "anon";
grant select on table "public"."flag-trouve" to "anon";
grant trigger on table "public"."flag-trouve" to "anon";
grant truncate on table "public"."flag-trouve" to "anon";
grant update on table "public"."flag-trouve" to "anon";
grant delete on table "public"."flag-trouve" to "authenticated";
grant insert on table "public"."flag-trouve" to "authenticated";
grant references on table "public"."flag-trouve" to "authenticated";
grant select on table "public"."flag-trouve" to "authenticated";
grant trigger on table "public"."flag-trouve" to "authenticated";
grant truncate on table "public"."flag-trouve" to "authenticated";
grant update on table "public"."flag-trouve" to "authenticated";
grant delete on table "public"."flag-trouve" to "service_role";
grant insert on table "public"."flag-trouve" to "service_role";
grant references on table "public"."flag-trouve" to "service_role";
grant select on table "public"."flag-trouve" to "service_role";
grant trigger on table "public"."flag-trouve" to "service_role";
grant truncate on table "public"."flag-trouve" to "service_role";
grant update on table "public"."flag-trouve" to "service_role";
grant delete on table "public"."indice" to "anon";
grant insert on table "public"."indice" to "anon";
grant references on table "public"."indice" to "anon";
grant select on table "public"."indice" to "anon";
grant trigger on table "public"."indice" to "anon";
grant truncate on table "public"."indice" to "anon";
grant update on table "public"."indice" to "anon";
grant delete on table "public"."indice" to "authenticated";
grant insert on table "public"."indice" to "authenticated";
grant references on table "public"."indice" to "authenticated";
grant select on table "public"."indice" to "authenticated";
grant trigger on table "public"."indice" to "authenticated";
grant truncate on table "public"."indice" to "authenticated";
grant update on table "public"."indice" to "authenticated";
grant delete on table "public"."indice" to "service_role";
grant insert on table "public"."indice" to "service_role";
grant references on table "public"."indice" to "service_role";
grant select on table "public"."indice" to "service_role";
grant trigger on table "public"."indice" to "service_role";
grant truncate on table "public"."indice" to "service_role";
grant update on table "public"."indice" to "service_role";
grant delete on table "public"."indice-equipe" to "anon";
grant insert on table "public"."indice-equipe" to "anon";
grant references on table "public"."indice-equipe" to "anon";
grant select on table "public"."indice-equipe" to "anon";
grant trigger on table "public"."indice-equipe" to "anon";
grant truncate on table "public"."indice-equipe" to "anon";
grant update on table "public"."indice-equipe" to "anon";
grant delete on table "public"."indice-equipe" to "authenticated";
grant insert on table "public"."indice-equipe" to "authenticated";
grant references on table "public"."indice-equipe" to "authenticated";
grant select on table "public"."indice-equipe" to "authenticated";
grant trigger on table "public"."indice-equipe" to "authenticated";
grant truncate on table "public"."indice-equipe" to "authenticated";
grant update on table "public"."indice-equipe" to "authenticated";
grant delete on table "public"."indice-equipe" to "service_role";
grant insert on table "public"."indice-equipe" to "service_role";
grant references on table "public"."indice-equipe" to "service_role";
grant select on table "public"."indice-equipe" to "service_role";
grant trigger on table "public"."indice-equipe" to "service_role";
grant truncate on table "public"."indice-equipe" to "service_role";
grant update on table "public"."indice-equipe" to "service_role";
grant delete on table "public"."joueur" to "anon";
grant insert on table "public"."joueur" to "anon";
grant references on table "public"."joueur" to "anon";
grant select on table "public"."joueur" to "anon";
grant trigger on table "public"."joueur" to "anon";
grant truncate on table "public"."joueur" to "anon";
grant update on table "public"."joueur" to "anon";
grant delete on table "public"."joueur" to "authenticated";
grant insert on table "public"."joueur" to "authenticated";
grant references on table "public"."joueur" to "authenticated";
grant select on table "public"."joueur" to "authenticated";
grant trigger on table "public"."joueur" to "authenticated";
grant truncate on table "public"."joueur" to "authenticated";
grant update on table "public"."joueur" to "authenticated";
grant delete on table "public"."joueur" to "service_role";
grant insert on table "public"."joueur" to "service_role";
grant references on table "public"."joueur" to "service_role";
grant select on table "public"."joueur" to "service_role";
grant trigger on table "public"."joueur" to "service_role";
grant truncate on table "public"."joueur" to "service_role";
grant update on table "public"."joueur" to "service_role";
grant delete on table "public"."équipe" to "anon";
grant insert on table "public"."équipe" to "anon";
grant references on table "public"."équipe" to "anon";
grant select on table "public"."équipe" to "anon";
grant trigger on table "public"."équipe" to "anon";
grant truncate on table "public"."équipe" to "anon";
grant update on table "public"."équipe" to "anon";
grant delete on table "public"."équipe" to "authenticated";
grant insert on table "public"."équipe" to "authenticated";
grant references on table "public"."équipe" to "authenticated";
grant select on table "public"."équipe" to "authenticated";
grant trigger on table "public"."équipe" to "authenticated";
grant truncate on table "public"."équipe" to "authenticated";
grant update on table "public"."équipe" to "authenticated";
grant delete on table "public"."équipe" to "service_role";
grant insert on table "public"."équipe" to "service_role";
grant references on table "public"."équipe" to "service_role";
grant select on table "public"."équipe" to "service_role";
grant trigger on table "public"."équipe" to "service_role";
grant truncate on table "public"."équipe" to "service_role";
grant update on table "public"."équipe" to "service_role";