diff --git a/config.ts b/config.ts index f879701275..7de739b74d 100644 --- a/config.ts +++ b/config.ts @@ -8,7 +8,7 @@ import { DigitalOceanSpaces } from './src/utils/cdn/classes/DigitalOceanSpaces'; import { createColorfulComputeImageColorStats15 } from './src/utils/image/palette/15/createColorfulComputeImageColorStats15'; import { IComputeImageColorStats } from './src/utils/image/utils/IImageColorStats'; import { isRunningInBrowser } from './src/utils/isRunningInWhatever'; -import { isPrivateNetwork } from './src/utils/validators/isPrivateNetwork'; +import { isUrlOnPrivateNetwork } from './src/utils/validators/isUrlOnPrivateNetwork'; import { validateUuid } from './src/utils/validators/validateUuid'; export const APP_VERSION = packageJson.version; @@ -25,9 +25,10 @@ const config = ConfigChecker.from({ }); export const NEXT_PUBLIC_URL = config.get('NEXT_PUBLIC_URL').url().required().value; -export const IS_DEVELOPMENT = isPrivateNetwork( - NEXT_PUBLIC_URL.hostname, -); /* <- TODO: Maybe pass NODE_ENV and not assume that local is automatically dev */ +export const IS_DEVELOPMENT = + isUrlOnPrivateNetwork( + NEXT_PUBLIC_URL, + ); /* <- TODO: Maybe pass NODE_ENV and not assume that local is automatically dev */ export const IS_PRODUCTION = !IS_DEVELOPMENT; if (isRunningInBrowser()) { @@ -51,6 +52,13 @@ export const NEXT_PUBLIC_DEBUG = config.get('NEXT_PUBLIC_DEBUG').boolean().value */ export const SPEED = 1; // 1 / 5; +export const IS_VERIFIED_EMAIL_REQUIRED = { + CREATE: false, + EDIT: false, + LIKE: false, + PUBLISH: true, +} as const; + export const NEXT_PUBLIC_SUPABASE_URL = config.get('NEXT_PUBLIC_SUPABASE_URL').url().required().value; export const NEXT_PUBLIC_SUPABASE_ANON_KEY = config.get('NEXT_PUBLIC_SUPABASE_ANON_KEY').required().value; export const SUPABASE_SERVICE_ROLE_KEY = config.get('SUPABASE_SERVICE_ROLE_KEY').value; @@ -69,12 +77,19 @@ export const OPENAI_API_KEY = config.get('OPENAI_API_KEY').value; export const AZURE_COMPUTER_VISION_ENDPOINT = config.get('AZURE_COMPUTER_VISION_ENDPOINT').url().value; export const AZURE_COMPUTER_VISION_KEY = config.get('AZURE_COMPUTER_VISION_KEY').value; +// Note: Not using token because it is invalidated so often +export const INSTAGRAM_USERNAME = config.get('INSTAGRAM_USERNAME').value; +export const INSTAGRAM_PASSWORD = config.get('INSTAGRAM_PASSWORD').value; + export const EXPORT_OPTIONS = { isExported: false, publicUrl: NEXT_PUBLIC_URL, }; export const FONTS = [ + // TODO: !! [🧠] Better system for fonts + // TODO: Put in separate file + //----------[ Manually picked ]--- 'Montserrat', 'Poppins', 'Open Sans', @@ -96,7 +111,717 @@ export const FONTS = [ 'Cinzel', 'Cinzel Decorative', 'Cormorant Garamond', - // TODO: !! List more + + //----------[ List all ]--- + // @see https://github.com/honeysilvas/google-fonts + // TODO: This list is not complete (or not up to date) because for example 'Barlow Condensed' is missing + 'ABeeZee', + 'Abel', + 'Abril Fatface', + 'Aclonica', + 'Acme', + 'Actor', + 'Adamina', + 'Advent Pro', + 'Aguafina Script', + 'Akronim', + 'Aladin', + 'Aldrich', + 'Alef', + 'Alegreya', + 'Alegreya SC', + 'Alegreya Sans', + 'Alegreya Sans SC', + 'Alex Brush', + 'Alfa Slab One', + 'Alice', + 'Alike', + 'Alike Angular', + 'Allan', + 'Allerta', + 'Allerta Stencil', + 'Allura', + 'Almendra', + 'Almendra Display', + 'Almendra SC', + 'Amarante', + 'Amaranth', + 'Amatic SC', + 'Amethysta', + 'Amiri', + 'Anaheim', + 'Andada', + 'Andika', + 'Angkor', + 'Annie Use Your Telescope', + 'Anonymous Pro', + 'Antic', + 'Antic Didone', + 'Antic Slab', + 'Anton', + 'Arapey', + 'Arbutus', + 'Arbutus Slab', + 'Architects Daughter', + 'Archivo Black', + 'Archivo Narrow', + 'Arimo', + 'Arizonia', + 'Armata', + 'Artifika', + 'Arvo', + 'Asap', + 'Asset', + 'Astloch', + 'Asul', + 'Atomic Age', + 'Aubrey', + 'Audiowide', + 'Autour One', + 'Average', + 'Average Sans', + 'Averia Gruesa Libre', + 'Averia Libre', + 'Averia Sans Libre', + 'Averia Serif Libre', + 'Bad Script', + 'Balthazar', + 'Bangers', + 'Basic', + 'Battambang', + 'Baumans', + 'Bayon', + 'Belgrano', + 'Belleza', + 'BenchNine', + 'Bentham', + 'Berkshire Swash', + 'Bevan', + 'Bigelow Rules', + 'Bigshot One', + 'Bilbo', + 'Bilbo Swash Caps', + 'Biryani', + 'Bitter', + 'Black Ops One', + 'Bokor', + 'Bonbon', + 'Boogaloo', + 'Bowlby One', + 'Bowlby One SC', + 'Brawler', + 'Bree Serif', + 'Bubblegum Sans', + 'Bubbler One', + 'Buda', + 'Buenard', + 'Butcherman', + 'Butterfly Kids', + 'Cabin', + 'Cabin Condensed', + 'Cabin Sketch', + 'Caesar Dressing', + 'Cagliostro', + 'Calligraffitti', + 'Cambay', + 'Cambo', + 'Candal', + 'Cantarell', + 'Cantata One', + 'Cantora One', + 'Capriola', + 'Cardo', + 'Carme', + 'Carrois Gothic', + 'Carrois Gothic SC', + 'Carter One', + 'Caudex', + 'Cedarville Cursive', + 'Ceviche One', + 'Changa One', + 'Chango', + 'Chau Philomene One', + 'Chela One', + 'Chelsea Market', + 'Chenla', + 'Cherry Cream Soda', + 'Cherry Swash', + 'Chewy', + 'Chicle', + 'Chivo', + 'Cinzel', + 'Cinzel Decorative', + 'Clicker Script', + 'Coda', + 'Coda Caption', + 'Codystar', + 'Combo', + 'Comfortaa', + 'Coming Soon', + 'Concert One', + 'Condiment', + 'Content', + 'Contrail One', + 'Convergence', + 'Cookie', + 'Copse', + 'Corben', + 'Courgette', + 'Cousine', + 'Coustard', + 'Covered By Your Grace', + 'Crafty Girls', + 'Creepster', + 'Crete Round', + 'Crimson Text', + 'Croissant One', + 'Crushed', + 'Cuprum', + 'Cutive', + 'Cutive Mono', + 'Damion', + 'Dancing Script', + 'Dangrek', + 'Dawning of a New Day', + 'Days One', + 'Dekko', + 'Delius', + 'Delius Swash Caps', + 'Delius Unicase', + 'Della Respira', + 'Denk One', + 'Devonshire', + 'Dhurjati', + 'Didact Gothic', + 'Diplomata', + 'Diplomata SC', + 'Domine', + 'Donegal One', + 'Doppio One', + 'Dorsa', + 'Dosis', + 'Dr Sugiyama', + 'Droid Sans', + 'Droid Sans Mono', + 'Droid Serif', + 'Duru Sans', + 'Dynalight', + 'EB Garamond', + 'Eagle Lake', + 'Eater', + 'Economica', + 'Ek Mukta', + 'Electrolize', + 'Elsie', + 'Elsie Swash Caps', + 'Emblema One', + 'Emilys Candy', + 'Engagement', + 'Englebert', + 'Enriqueta', + 'Erica One', + 'Esteban', + 'Euphoria Script', + 'Ewert', + 'Exo', + 'Exo 2', + 'Expletus Sans', + 'Fanwood Text', + 'Fascinate', + 'Fascinate Inline', + 'Faster One', + 'Fasthand', + 'Fauna One', + 'Federant', + 'Federo', + 'Felipa', + 'Fenix', + 'Finger Paint', + 'Fira Mono', + 'Fira Sans', + 'Fjalla One', + 'Fjord One', + 'Flamenco', + 'Flavors', + 'Fondamento', + 'Fontdiner Swanky', + 'Forum', + 'Francois One', + 'Freckle Face', + 'Fredericka the Great', + 'Fredoka One', + 'Freehand', + 'Fresca', + 'Frijole', + 'Fruktur', + 'Fugaz One', + 'GFS Didot', + 'GFS Neohellenic', + 'Gabriela', + 'Gafata', + 'Galdeano', + 'Galindo', + 'Gentium Basic', + 'Gentium Book Basic', + 'Geo', + 'Geostar', + 'Geostar Fill', + 'Germania One', + 'Gidugu', + 'Gilda Display', + 'Give You Glory', + 'Glass Antiqua', + 'Glegoo', + 'Gloria Hallelujah', + 'Goblin One', + 'Gochi Hand', + 'Gorditas', + 'Goudy Bookletter 1911', + 'Graduate', + 'Grand Hotel', + 'Gravitas One', + 'Great Vibes', + 'Griffy', + 'Gruppo', + 'Gudea', + 'Gurajada', + 'Habibi', + 'Halant', + 'Hammersmith One', + 'Hanalei', + 'Hanalei Fill', + 'Handlee', + 'Hanuman', + 'Happy Monkey', + 'Headland One', + 'Henny Penny', + 'Herr Von Muellerhoff', + 'Hind', + 'Holtwood One SC', + 'Homemade Apple', + 'Homenaje', + 'IM Fell DW Pica', + 'IM Fell DW Pica SC', + 'IM Fell Double Pica', + 'IM Fell Double Pica SC', + 'IM Fell English', + 'IM Fell English SC', + 'IM Fell French Canon', + 'IM Fell French Canon SC', + 'IM Fell Great Primer', + 'IM Fell Great Primer SC', + 'Iceberg', + 'Iceland', + 'Imprima', + 'Inconsolata', + 'Inder', + 'Indie Flower', + 'Inika', + 'Irish Grover', + 'Istok Web', + 'Italiana', + 'Italianno', + 'Jacques Francois', + 'Jacques Francois Shadow', + 'Jaldi', + 'Jim Nightshade', + 'Jockey One', + 'Jolly Lodger', + 'Josefin Sans', + 'Josefin Slab', + 'Joti One', + 'Judson', + 'Julee', + 'Julius Sans One', + 'Junge', + 'Jura', + 'Just Another Hand', + 'Just Me Again Down Here', + 'Kalam', + 'Kameron', + 'Kantumruy', + 'Karla', + 'Karma', + 'Kaushan Script', + 'Kavoon', + 'Kdam Thmor', + 'Keania One', + 'Kelly Slab', + 'Kenia', + 'Khand', + 'Khmer', + 'Khula', + 'Kite One', + 'Knewave', + 'Kotta One', + 'Koulen', + 'Kranky', + 'Kreon', + 'Kristi', + 'Krona One', + 'La Belle Aurore', + 'Laila', + 'Lakki Reddy', + 'Lancelot', + 'Lateef', + 'Lato', + 'League Script', + 'Leckerli One', + 'Ledger', + 'Lekton', + 'Lemon', + 'Libre Baskerville', + 'Life Savers', + 'Lilita One', + 'Lily Script One', + 'Limelight', + 'Linden Hill', + 'Lobster', + 'Lobster Two', + 'Londrina Outline', + 'Londrina Shadow', + 'Londrina Sketch', + 'Londrina Solid', + 'Lora', + 'Love Ya Like A Sister', + 'Loved by the King', + 'Lovers Quarrel', + 'Luckiest Guy', + 'Lusitana', + 'Lustria', + 'Macondo', + 'Macondo Swash Caps', + 'Magra', + 'Maiden Orange', + 'Mako', + 'Mallanna', + 'Mandali', + 'Marcellus', + 'Marcellus SC', + 'Marck Script', + 'Margarine', + 'Marko One', + 'Marmelad', + 'Martel', + 'Martel Sans', + 'Marvel', + 'Mate', + 'Mate SC', + 'Maven Pro', + 'McLaren', + 'Meddon', + 'MedievalSharp', + 'Medula One', + 'Megrim', + 'Meie Script', + 'Merienda', + 'Merienda One', + 'Merriweather', + 'Merriweather Sans', + 'Metal', + 'Metal Mania', + 'Metamorphous', + 'Metrophobic', + 'Michroma', + 'Milonga', + 'Miltonian', + 'Miltonian Tattoo', + 'Miniver', + 'Miss Fajardose', + 'Modak', + 'Modern Antiqua', + 'Molengo', + 'Molle', + 'Monda', + 'Monofett', + 'Monoton', + 'Monsieur La Doulaise', + 'Montaga', + 'Montez', + 'Montserrat', + 'Montserrat Alternates', + 'Montserrat Subrayada', + 'Moul', + 'Moulpali', + 'Mountains of Christmas', + 'Mouse Memoirs', + 'Mr Bedfort', + 'Mr Dafoe', + 'Mr De Haviland', + 'Mrs Saint Delafield', + 'Mrs Sheppards', + 'Muli', + 'Mystery Quest', + 'NTR', + 'Neucha', + 'Neuton', + 'New Rocker', + 'News Cycle', + 'Niconne', + 'Nixie One', + 'Nobile', + 'Nokora', + 'Norican', + 'Nosifer', + 'Nothing You Could Do', + 'Noticia Text', + 'Noto Sans', + 'Noto Serif', + 'Nova Cut', + 'Nova Flat', + 'Nova Mono', + 'Nova Oval', + 'Nova Round', + 'Nova Script', + 'Nova Slim', + 'Nova Square', + 'Numans', + 'Nunito', + 'Odor Mean Chey', + 'Offside', + 'Old Standard TT', + 'Oldenburg', + 'Oleo Script', + 'Oleo Script Swash Caps', + 'Open Sans', + 'Open Sans Condensed', + 'Oranienbaum', + 'Orbitron', + 'Oregano', + 'Orienta', + 'Original Surfer', + 'Oswald', + 'Over the Rainbow', + 'Overlock', + 'Overlock SC', + 'Ovo', + 'Oxygen', + 'Oxygen Mono', + 'PT Mono', + 'PT Sans', + 'PT Sans Caption', + 'PT Sans Narrow', + 'PT Serif', + 'PT Serif Caption', + 'Pacifico', + 'Palanquin', + 'Palanquin Dark', + 'Paprika', + 'Parisienne', + 'Passero One', + 'Passion One', + 'Pathway Gothic One', + 'Patrick Hand', + 'Patrick Hand SC', + 'Patua One', + 'Paytone One', + 'Peddana', + 'Peralta', + 'Permanent Marker', + 'Petit Formal Script', + 'Petrona', + 'Philosopher', + 'Piedra', + 'Pinyon Script', + 'Pirata One', + 'Plaster', + 'Play', + 'Playball', + 'Playfair Display', + 'Playfair Display SC', + 'Podkova', + 'Poiret One', + 'Poller One', + 'Poly', + 'Pompiere', + 'Pontano Sans', + 'Port Lligat Sans', + 'Port Lligat Slab', + 'Pragati Narrow', + 'Prata', + 'Preahvihear', + 'Press Start 2P', + 'Princess Sofia', + 'Prociono', + 'Prosto One', + 'Puritan', + 'Purple Purse', + 'Quando', + 'Quantico', + 'Quattrocento', + 'Quattrocento Sans', + 'Questrial', + 'Quicksand', + 'Quintessential', + 'Qwigley', + 'Racing Sans One', + 'Radley', + 'Rajdhani', + 'Raleway', + 'Raleway Dots', + 'Ramabhadra', + 'Ramaraja', + 'Rambla', + 'Rammetto One', + 'Ranchers', + 'Rancho', + 'Ranga', + 'Rationale', + 'Ravi Prakash', + 'Redressed', + 'Reenie Beanie', + 'Revalia', + 'Ribeye', + 'Ribeye Marrow', + 'Righteous', + 'Risque', + 'Roboto', + 'Roboto Condensed', + 'Roboto Slab', + 'Rochester', + 'Rock Salt', + 'Rokkitt', + 'Romanesco', + 'Ropa Sans', + 'Rosario', + 'Rosarivo', + 'Rouge Script', + 'Rozha One', + 'Rubik Mono One', + 'Rubik One', + 'Ruda', + 'Rufina', + 'Ruge Boogie', + 'Ruluko', + 'Rum Raisin', + 'Ruslan Display', + 'Russo One', + 'Ruthie', + 'Rye', + 'Sacramento', + 'Sail', + 'Salsa', + 'Sanchez', + 'Sancreek', + 'Sansita One', + 'Sarina', + 'Sarpanch', + 'Satisfy', + 'Scada', + 'Scheherazade', + 'Schoolbell', + 'Seaweed Script', + 'Sevillana', + 'Seymour One', + 'Shadows Into Light', + 'Shadows Into Light Two', + 'Shanti', + 'Share', + 'Share Tech', + 'Share Tech Mono', + 'Shojumaru', + 'Short Stack', + 'Siemreap', + 'Sigmar One', + 'Signika', + 'Signika Negative', + 'Simonetta', + 'Sintony', + 'Sirin Stencil', + 'Six Caps', + 'Skranji', + 'Slabo 13px', + 'Slabo 27px', + 'Slackey', + 'Smokum', + 'Smythe', + 'Sniglet', + 'Snippet', + 'Snowburst One', + 'Sofadi One', + 'Sofia', + 'Sonsie One', + 'Sorts Mill Goudy', + 'Source Code Pro', + 'Source Sans Pro', + 'Source Serif Pro', + 'Special Elite', + 'Spicy Rice', + 'Spinnaker', + 'Spirax', + 'Squada One', + 'Sree Krushnadevaraya', + 'Stalemate', + 'Stalinist One', + 'Stardos Stencil', + 'Stint Ultra Condensed', + 'Stint Ultra Expanded', + 'Stoke', + 'Strait', + 'Sue Ellen Francisco', + 'Sunshiney', + 'Supermercado One', + 'Suranna', + 'Suravaram', + 'Suwannaphum', + 'Swanky and Moo Moo', + 'Syncopate', + 'Tangerine', + 'Taprom', + 'Tauri', + 'Teko', + 'Telex', + 'Tenali Ramakrishna', + 'Tenor Sans', + 'Text Me One', + 'The Girl Next Door', + 'Tienne', + 'Timmana', + 'Tinos', + 'Titan One', + 'Titillium Web', + 'Trade Winds', + 'Trocchi', + 'Trochut', + 'Trykker', + 'Tulpen One', + 'Ubuntu', + 'Ubuntu Condensed', + 'Ubuntu Mono', + 'Ultra', + 'Uncial Antiqua', + 'Underdog', + 'Unica One', + 'UnifrakturCook', + 'UnifrakturMaguntia', + 'Unkempt', + 'Unlock', + 'Unna', + 'VT323', + 'Vampiro One', + 'Varela', + 'Varela Round', + 'Vast Shadow', + 'Vesper Libre', + 'Vibur', + 'Vidaloka', + 'Viga', + 'Voces', + 'Volkhov', + 'Vollkorn', + 'Voltaire', + 'Waiting for the Sunrise', + 'Wallpoet', + 'Walter Turncoat', + 'Warnes', + 'Wellfleet', + 'Wendy One', + 'Wire One', + 'Yanone Kaffeesatz', + 'Yellowtail', + 'Yeseva One', + 'Yesteryear', + 'Zeyada', ] as const; export const COPILOT_PLACEHOLDERS: Array = [ @@ -137,6 +862,10 @@ export const COPILOT_PLACEHOLDERS: Array = [ 'Add pricing table', ]; +export const INSTAGRAM_PLACEHOLDERS: Array = ['_1_2i_', 'pavolhejny', 'michelangelato.zmrzlinarna'].flatMap( + (username) => [username, `@${username}`, `https://www.instagram.com/${username}/`], +); + export const MAX_CHARS_IN_TITLE = 'Futuristic Cityscape Wallpaper'.length - 7; // 'Tvořím něco z ničeho nic' // 'Futuristic Cityscape Wallpaper' diff --git a/database/dumps/structure.dump.pgsql b/database/dumps/structure.dump.pgsql index a9a1c4660b..63ae545e20 100644 --- a/database/dumps/structure.dump.pgsql +++ b/database/dumps/structure.dump.pgsql @@ -1,3667 +1,3774 @@ --- --- PostgreSQL database dump --- - --- Dumped from database version 15.1 (Ubuntu 15.1-1.pgdg20.04+1) --- Dumped by pg_dump version 15.3 - -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; - --- --- Name: auth; Type: SCHEMA; Schema: -; Owner: supabase_admin --- - -CREATE SCHEMA auth; - - -ALTER SCHEMA auth OWNER TO supabase_admin; - --- --- Name: extensions; Type: SCHEMA; Schema: -; Owner: postgres --- - -CREATE SCHEMA extensions; - - -ALTER SCHEMA extensions OWNER TO postgres; - --- --- Name: graphql; Type: SCHEMA; Schema: -; Owner: supabase_admin --- - -CREATE SCHEMA graphql; - - -ALTER SCHEMA graphql OWNER TO supabase_admin; - --- --- Name: graphql_public; Type: SCHEMA; Schema: -; Owner: supabase_admin --- - -CREATE SCHEMA graphql_public; - - -ALTER SCHEMA graphql_public OWNER TO supabase_admin; - --- --- Name: pgbouncer; Type: SCHEMA; Schema: -; Owner: pgbouncer --- - -CREATE SCHEMA pgbouncer; - - -ALTER SCHEMA pgbouncer OWNER TO pgbouncer; - --- --- Name: pgsodium; Type: SCHEMA; Schema: -; Owner: supabase_admin --- - -CREATE SCHEMA pgsodium; - - -ALTER SCHEMA pgsodium OWNER TO supabase_admin; - --- --- Name: pgsodium; Type: EXTENSION; Schema: -; Owner: - --- - -CREATE EXTENSION IF NOT EXISTS pgsodium WITH SCHEMA pgsodium; - - --- --- Name: EXTENSION pgsodium; Type: COMMENT; Schema: -; Owner: --- - -COMMENT ON EXTENSION pgsodium IS 'Pgsodium is a modern cryptography library for Postgres.'; - - --- --- Name: realtime; Type: SCHEMA; Schema: -; Owner: supabase_admin --- - -CREATE SCHEMA realtime; - - -ALTER SCHEMA realtime OWNER TO supabase_admin; - --- --- Name: storage; Type: SCHEMA; Schema: -; Owner: supabase_admin --- - -CREATE SCHEMA storage; - - -ALTER SCHEMA storage OWNER TO supabase_admin; - --- --- Name: vault; Type: SCHEMA; Schema: -; Owner: supabase_admin --- - -CREATE SCHEMA vault; - - -ALTER SCHEMA vault OWNER TO supabase_admin; - --- --- Name: pg_graphql; Type: EXTENSION; Schema: -; Owner: - --- - -CREATE EXTENSION IF NOT EXISTS pg_graphql WITH SCHEMA graphql; - - --- --- Name: EXTENSION pg_graphql; Type: COMMENT; Schema: -; Owner: --- - -COMMENT ON EXTENSION pg_graphql IS 'pg_graphql: GraphQL support'; - - --- --- Name: pg_stat_statements; Type: EXTENSION; Schema: -; Owner: - --- - -CREATE EXTENSION IF NOT EXISTS pg_stat_statements WITH SCHEMA extensions; - - --- --- Name: EXTENSION pg_stat_statements; Type: COMMENT; Schema: -; Owner: --- - -COMMENT ON EXTENSION pg_stat_statements IS 'track planning and execution statistics of all SQL statements executed'; - - --- --- Name: pgcrypto; Type: EXTENSION; Schema: -; Owner: - --- - -CREATE EXTENSION IF NOT EXISTS pgcrypto WITH SCHEMA extensions; - - --- --- Name: EXTENSION pgcrypto; Type: COMMENT; Schema: -; Owner: --- - -COMMENT ON EXTENSION pgcrypto IS 'cryptographic functions'; - - --- --- Name: pgjwt; Type: EXTENSION; Schema: -; Owner: - --- - -CREATE EXTENSION IF NOT EXISTS pgjwt WITH SCHEMA extensions; - - --- --- Name: EXTENSION pgjwt; Type: COMMENT; Schema: -; Owner: --- - -COMMENT ON EXTENSION pgjwt IS 'JSON Web Token API for Postgresql'; - - --- --- Name: supabase_vault; Type: EXTENSION; Schema: -; Owner: - --- - -CREATE EXTENSION IF NOT EXISTS supabase_vault WITH SCHEMA vault; - - --- --- Name: EXTENSION supabase_vault; Type: COMMENT; Schema: -; Owner: --- - -COMMENT ON EXTENSION supabase_vault IS 'Supabase Vault Extension'; - - --- --- Name: uuid-ossp; Type: EXTENSION; Schema: -; Owner: - --- - -CREATE EXTENSION IF NOT EXISTS "uuid-ossp" WITH SCHEMA extensions; - - --- --- Name: EXTENSION "uuid-ossp"; Type: COMMENT; Schema: -; Owner: --- - -COMMENT ON EXTENSION "uuid-ossp" IS 'generate universally unique identifiers (UUIDs)'; - - --- --- Name: aal_level; Type: TYPE; Schema: auth; Owner: supabase_auth_admin --- - -CREATE TYPE auth.aal_level AS ENUM ( - 'aal1', - 'aal2', - 'aal3' -); - - -ALTER TYPE auth.aal_level OWNER TO supabase_auth_admin; - --- --- Name: code_challenge_method; Type: TYPE; Schema: auth; Owner: supabase_auth_admin --- - -CREATE TYPE auth.code_challenge_method AS ENUM ( - 's256', - 'plain' -); - - -ALTER TYPE auth.code_challenge_method OWNER TO supabase_auth_admin; - --- --- Name: factor_status; Type: TYPE; Schema: auth; Owner: supabase_auth_admin --- - -CREATE TYPE auth.factor_status AS ENUM ( - 'unverified', - 'verified' -); - - -ALTER TYPE auth.factor_status OWNER TO supabase_auth_admin; - --- --- Name: factor_type; Type: TYPE; Schema: auth; Owner: supabase_auth_admin --- - -CREATE TYPE auth.factor_type AS ENUM ( - 'totp', - 'webauthn' -); - - -ALTER TYPE auth.factor_type OWNER TO supabase_auth_admin; - --- --- Name: email(); Type: FUNCTION; Schema: auth; Owner: supabase_auth_admin --- - -CREATE FUNCTION auth.email() RETURNS text - LANGUAGE sql STABLE - AS $$ - select - coalesce( - nullif(current_setting('request.jwt.claim.email', true), ''), - (nullif(current_setting('request.jwt.claims', true), '')::jsonb ->> 'email') - )::text -$$; - - -ALTER FUNCTION auth.email() OWNER TO supabase_auth_admin; - --- --- Name: FUNCTION email(); Type: COMMENT; Schema: auth; Owner: supabase_auth_admin --- - -COMMENT ON FUNCTION auth.email() IS 'Deprecated. Use auth.jwt() -> ''email'' instead.'; - - --- --- Name: jwt(); Type: FUNCTION; Schema: auth; Owner: supabase_auth_admin --- - -CREATE FUNCTION auth.jwt() RETURNS jsonb - LANGUAGE sql STABLE - AS $$ - select - coalesce( - nullif(current_setting('request.jwt.claim', true), ''), - nullif(current_setting('request.jwt.claims', true), '') - )::jsonb -$$; - - -ALTER FUNCTION auth.jwt() OWNER TO supabase_auth_admin; - --- --- Name: role(); Type: FUNCTION; Schema: auth; Owner: supabase_auth_admin --- - -CREATE FUNCTION auth.role() RETURNS text - LANGUAGE sql STABLE - AS $$ - select - coalesce( - nullif(current_setting('request.jwt.claim.role', true), ''), - (nullif(current_setting('request.jwt.claims', true), '')::jsonb ->> 'role') - )::text -$$; - - -ALTER FUNCTION auth.role() OWNER TO supabase_auth_admin; - --- --- Name: FUNCTION role(); Type: COMMENT; Schema: auth; Owner: supabase_auth_admin --- - -COMMENT ON FUNCTION auth.role() IS 'Deprecated. Use auth.jwt() -> ''role'' instead.'; - - --- --- Name: uid(); Type: FUNCTION; Schema: auth; Owner: supabase_auth_admin --- - -CREATE FUNCTION auth.uid() RETURNS uuid - LANGUAGE sql STABLE - AS $$ - select - coalesce( - nullif(current_setting('request.jwt.claim.sub', true), ''), - (nullif(current_setting('request.jwt.claims', true), '')::jsonb ->> 'sub') - )::uuid -$$; - - -ALTER FUNCTION auth.uid() OWNER TO supabase_auth_admin; - --- --- Name: FUNCTION uid(); Type: COMMENT; Schema: auth; Owner: supabase_auth_admin --- - -COMMENT ON FUNCTION auth.uid() IS 'Deprecated. Use auth.jwt() -> ''sub'' instead.'; - - --- --- Name: grant_pg_cron_access(); Type: FUNCTION; Schema: extensions; Owner: postgres --- - -CREATE FUNCTION extensions.grant_pg_cron_access() RETURNS event_trigger - LANGUAGE plpgsql - AS $$ -DECLARE - schema_is_cron bool; -BEGIN - schema_is_cron = ( - SELECT n.nspname = 'cron' - FROM pg_event_trigger_ddl_commands() AS ev - LEFT JOIN pg_catalog.pg_namespace AS n - ON ev.objid = n.oid - ); - - IF schema_is_cron - THEN - grant usage on schema cron to postgres with grant option; - - alter default privileges in schema cron grant all on tables to postgres with grant option; - alter default privileges in schema cron grant all on functions to postgres with grant option; - alter default privileges in schema cron grant all on sequences to postgres with grant option; - - alter default privileges for user supabase_admin in schema cron grant all - on sequences to postgres with grant option; - alter default privileges for user supabase_admin in schema cron grant all - on tables to postgres with grant option; - alter default privileges for user supabase_admin in schema cron grant all - on functions to postgres with grant option; - - grant all privileges on all tables in schema cron to postgres with grant option; - - END IF; - -END; -$$; - - -ALTER FUNCTION extensions.grant_pg_cron_access() OWNER TO postgres; - --- --- Name: FUNCTION grant_pg_cron_access(); Type: COMMENT; Schema: extensions; Owner: postgres --- - -COMMENT ON FUNCTION extensions.grant_pg_cron_access() IS 'Grants access to pg_cron'; - - --- --- Name: grant_pg_graphql_access(); Type: FUNCTION; Schema: extensions; Owner: supabase_admin --- - -CREATE FUNCTION extensions.grant_pg_graphql_access() RETURNS event_trigger - LANGUAGE plpgsql - AS $_$ -DECLARE - func_is_graphql_resolve bool; -BEGIN - func_is_graphql_resolve = ( - SELECT n.proname = 'resolve' - FROM pg_event_trigger_ddl_commands() AS ev - LEFT JOIN pg_catalog.pg_proc AS n - ON ev.objid = n.oid - ); - - IF func_is_graphql_resolve - THEN - -- Update public wrapper to pass all arguments through to the pg_graphql resolve func - DROP FUNCTION IF EXISTS graphql_public.graphql; - create or replace function graphql_public.graphql( - "operationName" text default null, - query text default null, - variables jsonb default null, - extensions jsonb default null - ) - returns jsonb - language sql - as $$ - select graphql.resolve( - query := query, - variables := coalesce(variables, '{}'), - "operationName" := "operationName", - extensions := extensions - ); - $$; - - -- This hook executes when `graphql.resolve` is created. That is not necessarily the last - -- function in the extension so we need to grant permissions on existing entities AND - -- update default permissions to any others that are created after `graphql.resolve` - grant usage on schema graphql to postgres, anon, authenticated, service_role; - grant select on all tables in schema graphql to postgres, anon, authenticated, service_role; - grant execute on all functions in schema graphql to postgres, anon, authenticated, service_role; - grant all on all sequences in schema graphql to postgres, anon, authenticated, service_role; - alter default privileges in schema graphql grant all on tables to postgres, anon, authenticated, service_role; - alter default privileges in schema graphql grant all on functions to postgres, anon, authenticated, service_role; - alter default privileges in schema graphql grant all on sequences to postgres, anon, authenticated, service_role; - END IF; - -END; -$_$; - - -ALTER FUNCTION extensions.grant_pg_graphql_access() OWNER TO supabase_admin; - --- --- Name: FUNCTION grant_pg_graphql_access(); Type: COMMENT; Schema: extensions; Owner: supabase_admin --- - -COMMENT ON FUNCTION extensions.grant_pg_graphql_access() IS 'Grants access to pg_graphql'; - - --- --- Name: grant_pg_net_access(); Type: FUNCTION; Schema: extensions; Owner: postgres --- - -CREATE FUNCTION extensions.grant_pg_net_access() RETURNS event_trigger - LANGUAGE plpgsql - AS $$ -BEGIN - IF EXISTS ( - SELECT 1 - FROM pg_event_trigger_ddl_commands() AS ev - JOIN pg_extension AS ext - ON ev.objid = ext.oid - WHERE ext.extname = 'pg_net' - ) - THEN - IF NOT EXISTS ( - SELECT 1 - FROM pg_roles - WHERE rolname = 'supabase_functions_admin' - ) - THEN - CREATE USER supabase_functions_admin NOINHERIT CREATEROLE LOGIN NOREPLICATION; - END IF; - - GRANT USAGE ON SCHEMA net TO supabase_functions_admin, postgres, anon, authenticated, service_role; - - ALTER function net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) SECURITY DEFINER; - ALTER function net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) SECURITY DEFINER; - - ALTER function net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) SET search_path = net; - ALTER function net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) SET search_path = net; - - REVOKE ALL ON FUNCTION net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) FROM PUBLIC; - REVOKE ALL ON FUNCTION net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) FROM PUBLIC; - - GRANT EXECUTE ON FUNCTION net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) TO supabase_functions_admin, postgres, anon, authenticated, service_role; - GRANT EXECUTE ON FUNCTION net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) TO supabase_functions_admin, postgres, anon, authenticated, service_role; - END IF; -END; -$$; - - -ALTER FUNCTION extensions.grant_pg_net_access() OWNER TO postgres; - --- --- Name: FUNCTION grant_pg_net_access(); Type: COMMENT; Schema: extensions; Owner: postgres --- - -COMMENT ON FUNCTION extensions.grant_pg_net_access() IS 'Grants access to pg_net'; - - --- --- Name: pgrst_ddl_watch(); Type: FUNCTION; Schema: extensions; Owner: supabase_admin --- - -CREATE FUNCTION extensions.pgrst_ddl_watch() RETURNS event_trigger - LANGUAGE plpgsql - AS $$ -DECLARE - cmd record; -BEGIN - FOR cmd IN SELECT * FROM pg_event_trigger_ddl_commands() - LOOP - IF cmd.command_tag IN ( - 'CREATE SCHEMA', 'ALTER SCHEMA' - , 'CREATE TABLE', 'CREATE TABLE AS', 'SELECT INTO', 'ALTER TABLE' - , 'CREATE FOREIGN TABLE', 'ALTER FOREIGN TABLE' - , 'CREATE VIEW', 'ALTER VIEW' - , 'CREATE MATERIALIZED VIEW', 'ALTER MATERIALIZED VIEW' - , 'CREATE FUNCTION', 'ALTER FUNCTION' - , 'CREATE TRIGGER' - , 'CREATE TYPE', 'ALTER TYPE' - , 'CREATE RULE' - , 'COMMENT' - ) - -- don't notify in case of CREATE TEMP table or other objects created on pg_temp - AND cmd.schema_name is distinct from 'pg_temp' - THEN - NOTIFY pgrst, 'reload schema'; - END IF; - END LOOP; -END; $$; - - -ALTER FUNCTION extensions.pgrst_ddl_watch() OWNER TO supabase_admin; - --- --- Name: pgrst_drop_watch(); Type: FUNCTION; Schema: extensions; Owner: supabase_admin --- - -CREATE FUNCTION extensions.pgrst_drop_watch() RETURNS event_trigger - LANGUAGE plpgsql - AS $$ -DECLARE - obj record; -BEGIN - FOR obj IN SELECT * FROM pg_event_trigger_dropped_objects() - LOOP - IF obj.object_type IN ( - 'schema' - , 'table' - , 'foreign table' - , 'view' - , 'materialized view' - , 'function' - , 'trigger' - , 'type' - , 'rule' - ) - AND obj.is_temporary IS false -- no pg_temp objects - THEN - NOTIFY pgrst, 'reload schema'; - END IF; - END LOOP; -END; $$; - - -ALTER FUNCTION extensions.pgrst_drop_watch() OWNER TO supabase_admin; - --- --- Name: set_graphql_placeholder(); Type: FUNCTION; Schema: extensions; Owner: supabase_admin --- - -CREATE FUNCTION extensions.set_graphql_placeholder() RETURNS event_trigger - LANGUAGE plpgsql - AS $_$ - DECLARE - graphql_is_dropped bool; - BEGIN - graphql_is_dropped = ( - SELECT ev.schema_name = 'graphql_public' - FROM pg_event_trigger_dropped_objects() AS ev - WHERE ev.schema_name = 'graphql_public' - ); - - IF graphql_is_dropped - THEN - create or replace function graphql_public.graphql( - "operationName" text default null, - query text default null, - variables jsonb default null, - extensions jsonb default null - ) - returns jsonb - language plpgsql - as $$ - DECLARE - server_version float; - BEGIN - server_version = (SELECT (SPLIT_PART((select version()), ' ', 2))::float); - - IF server_version >= 14 THEN - RETURN jsonb_build_object( - 'errors', jsonb_build_array( - jsonb_build_object( - 'message', 'pg_graphql extension is not enabled.' - ) - ) - ); - ELSE - RETURN jsonb_build_object( - 'errors', jsonb_build_array( - jsonb_build_object( - 'message', 'pg_graphql is only available on projects running Postgres 14 onwards.' - ) - ) - ); - END IF; - END; - $$; - END IF; - - END; -$_$; - - -ALTER FUNCTION extensions.set_graphql_placeholder() OWNER TO supabase_admin; - --- --- Name: FUNCTION set_graphql_placeholder(); Type: COMMENT; Schema: extensions; Owner: supabase_admin --- - -COMMENT ON FUNCTION extensions.set_graphql_placeholder() IS 'Reintroduces placeholder function for graphql_public.graphql'; - - --- --- Name: get_auth(text); Type: FUNCTION; Schema: pgbouncer; Owner: postgres --- - -CREATE FUNCTION pgbouncer.get_auth(p_usename text) RETURNS TABLE(username text, password text) - LANGUAGE plpgsql SECURITY DEFINER - AS $$ -BEGIN - RAISE WARNING 'PgBouncer auth request: %', p_usename; - - RETURN QUERY - SELECT usename::TEXT, passwd::TEXT FROM pg_catalog.pg_shadow - WHERE usename = p_usename; -END; -$$; - - -ALTER FUNCTION pgbouncer.get_auth(p_usename text) OWNER TO postgres; - --- --- Name: can_insert_object(text, text, uuid, jsonb); Type: FUNCTION; Schema: storage; Owner: supabase_storage_admin --- - -CREATE FUNCTION storage.can_insert_object(bucketid text, name text, owner uuid, metadata jsonb) RETURNS void - LANGUAGE plpgsql - AS $$ -BEGIN - INSERT INTO "storage"."objects" ("bucket_id", "name", "owner", "metadata") VALUES (bucketid, name, owner, metadata); - -- hack to rollback the successful insert - RAISE sqlstate 'PT200' using - message = 'ROLLBACK', - detail = 'rollback successful insert'; -END -$$; - - -ALTER FUNCTION storage.can_insert_object(bucketid text, name text, owner uuid, metadata jsonb) OWNER TO supabase_storage_admin; - --- --- Name: extension(text); Type: FUNCTION; Schema: storage; Owner: supabase_storage_admin --- - -CREATE FUNCTION storage.extension(name text) RETURNS text - LANGUAGE plpgsql - AS $$ -DECLARE -_parts text[]; -_filename text; -BEGIN - select string_to_array(name, '/') into _parts; - select _parts[array_length(_parts,1)] into _filename; - -- @todo return the last part instead of 2 - return split_part(_filename, '.', 2); -END -$$; - - -ALTER FUNCTION storage.extension(name text) OWNER TO supabase_storage_admin; - --- --- Name: filename(text); Type: FUNCTION; Schema: storage; Owner: supabase_storage_admin --- - -CREATE FUNCTION storage.filename(name text) RETURNS text - LANGUAGE plpgsql - AS $$ -DECLARE -_parts text[]; -BEGIN - select string_to_array(name, '/') into _parts; - return _parts[array_length(_parts,1)]; -END -$$; - - -ALTER FUNCTION storage.filename(name text) OWNER TO supabase_storage_admin; - --- --- Name: foldername(text); Type: FUNCTION; Schema: storage; Owner: supabase_storage_admin --- - -CREATE FUNCTION storage.foldername(name text) RETURNS text[] - LANGUAGE plpgsql - AS $$ -DECLARE -_parts text[]; -BEGIN - select string_to_array(name, '/') into _parts; - return _parts[1:array_length(_parts,1)-1]; -END -$$; - - -ALTER FUNCTION storage.foldername(name text) OWNER TO supabase_storage_admin; - --- --- Name: get_size_by_bucket(); Type: FUNCTION; Schema: storage; Owner: supabase_storage_admin --- - -CREATE FUNCTION storage.get_size_by_bucket() RETURNS TABLE(size bigint, bucket_id text) - LANGUAGE plpgsql - AS $$ -BEGIN - return query - select sum((metadata->>'size')::int) as size, obj.bucket_id - from "storage".objects as obj - group by obj.bucket_id; -END -$$; - - -ALTER FUNCTION storage.get_size_by_bucket() OWNER TO supabase_storage_admin; - --- --- Name: search(text, text, integer, integer, integer, text, text, text); Type: FUNCTION; Schema: storage; Owner: supabase_storage_admin --- - -CREATE FUNCTION storage.search(prefix text, bucketname text, limits integer DEFAULT 100, levels integer DEFAULT 1, offsets integer DEFAULT 0, search text DEFAULT ''::text, sortcolumn text DEFAULT 'name'::text, sortorder text DEFAULT 'asc'::text) RETURNS TABLE(name text, id uuid, updated_at timestamp with time zone, created_at timestamp with time zone, last_accessed_at timestamp with time zone, metadata jsonb) - LANGUAGE plpgsql STABLE - AS $_$ -declare - v_order_by text; - v_sort_order text; -begin - case - when sortcolumn = 'name' then - v_order_by = 'name'; - when sortcolumn = 'updated_at' then - v_order_by = 'updated_at'; - when sortcolumn = 'created_at' then - v_order_by = 'created_at'; - when sortcolumn = 'last_accessed_at' then - v_order_by = 'last_accessed_at'; - else - v_order_by = 'name'; - end case; - - case - when sortorder = 'asc' then - v_sort_order = 'asc'; - when sortorder = 'desc' then - v_sort_order = 'desc'; - else - v_sort_order = 'asc'; - end case; - - v_order_by = v_order_by || ' ' || v_sort_order; - - return query execute - 'with folders as ( - select path_tokens[$1] as folder - from storage.objects - where objects.name ilike $2 || $3 || ''%'' - and bucket_id = $4 - and array_length(regexp_split_to_array(objects.name, ''/''), 1) <> $1 - group by folder - order by folder ' || v_sort_order || ' - ) - (select folder as "name", - null as id, - null as updated_at, - null as created_at, - null as last_accessed_at, - null as metadata from folders) - union all - (select path_tokens[$1] as "name", - id, - updated_at, - created_at, - last_accessed_at, - metadata - from storage.objects - where objects.name ilike $2 || $3 || ''%'' - and bucket_id = $4 - and array_length(regexp_split_to_array(objects.name, ''/''), 1) = $1 - order by ' || v_order_by || ') - limit $5 - offset $6' using levels, prefix, search, bucketname, limits, offsets; -end; -$_$; - - -ALTER FUNCTION storage.search(prefix text, bucketname text, limits integer, levels integer, offsets integer, search text, sortcolumn text, sortorder text) OWNER TO supabase_storage_admin; - --- --- Name: update_updated_at_column(); Type: FUNCTION; Schema: storage; Owner: supabase_storage_admin --- - -CREATE FUNCTION storage.update_updated_at_column() RETURNS trigger - LANGUAGE plpgsql - AS $$ -BEGIN - NEW.updated_at = now(); - RETURN NEW; -END; -$$; - - -ALTER FUNCTION storage.update_updated_at_column() OWNER TO supabase_storage_admin; - --- --- Name: secrets_encrypt_secret_secret(); Type: FUNCTION; Schema: vault; Owner: supabase_admin --- - -CREATE FUNCTION vault.secrets_encrypt_secret_secret() RETURNS trigger - LANGUAGE plpgsql - AS $$ - BEGIN - new.secret = CASE WHEN new.secret IS NULL THEN NULL ELSE - CASE WHEN new.key_id IS NULL THEN NULL ELSE pg_catalog.encode( - pgsodium.crypto_aead_det_encrypt( - pg_catalog.convert_to(new.secret, 'utf8'), - pg_catalog.convert_to((new.id::text || new.description::text || new.created_at::text || new.updated_at::text)::text, 'utf8'), - new.key_id::uuid, - new.nonce - ), - 'base64') END END; - RETURN new; - END; - $$; - - -ALTER FUNCTION vault.secrets_encrypt_secret_secret() OWNER TO supabase_admin; - -SET default_tablespace = ''; - -SET default_table_access_method = heap; - --- --- Name: audit_log_entries; Type: TABLE; Schema: auth; Owner: supabase_auth_admin --- - -CREATE TABLE auth.audit_log_entries ( - instance_id uuid, - id uuid NOT NULL, - payload json, - created_at timestamp with time zone, - ip_address character varying(64) DEFAULT ''::character varying NOT NULL -); - - -ALTER TABLE auth.audit_log_entries OWNER TO supabase_auth_admin; - --- --- Name: TABLE audit_log_entries; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin --- - -COMMENT ON TABLE auth.audit_log_entries IS 'Auth: Audit trail for user actions.'; - - --- --- Name: flow_state; Type: TABLE; Schema: auth; Owner: supabase_auth_admin --- - -CREATE TABLE auth.flow_state ( - id uuid NOT NULL, - user_id uuid, - auth_code text NOT NULL, - code_challenge_method auth.code_challenge_method NOT NULL, - code_challenge text NOT NULL, - provider_type text NOT NULL, - provider_access_token text, - provider_refresh_token text, - created_at timestamp with time zone, - updated_at timestamp with time zone, - authentication_method text NOT NULL -); - - -ALTER TABLE auth.flow_state OWNER TO supabase_auth_admin; - --- --- Name: TABLE flow_state; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin --- - -COMMENT ON TABLE auth.flow_state IS 'stores metadata for pkce logins'; - - --- --- Name: identities; Type: TABLE; Schema: auth; Owner: supabase_auth_admin --- - -CREATE TABLE auth.identities ( - id text NOT NULL, - user_id uuid NOT NULL, - identity_data jsonb NOT NULL, - provider text NOT NULL, - last_sign_in_at timestamp with time zone, - created_at timestamp with time zone, - updated_at timestamp with time zone, - email text GENERATED ALWAYS AS (lower((identity_data ->> 'email'::text))) STORED -); - - -ALTER TABLE auth.identities OWNER TO supabase_auth_admin; - --- --- Name: TABLE identities; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin --- - -COMMENT ON TABLE auth.identities IS 'Auth: Stores identities associated to a user.'; - - --- --- Name: COLUMN identities.email; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin --- - -COMMENT ON COLUMN auth.identities.email IS 'Auth: Email is a generated column that references the optional email property in the identity_data'; - - --- --- Name: instances; Type: TABLE; Schema: auth; Owner: supabase_auth_admin --- - -CREATE TABLE auth.instances ( - id uuid NOT NULL, - uuid uuid, - raw_base_config text, - created_at timestamp with time zone, - updated_at timestamp with time zone -); - - -ALTER TABLE auth.instances OWNER TO supabase_auth_admin; - --- --- Name: TABLE instances; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin --- - -COMMENT ON TABLE auth.instances IS 'Auth: Manages users across multiple sites.'; - - --- --- Name: mfa_amr_claims; Type: TABLE; Schema: auth; Owner: supabase_auth_admin --- - -CREATE TABLE auth.mfa_amr_claims ( - session_id uuid NOT NULL, - created_at timestamp with time zone NOT NULL, - updated_at timestamp with time zone NOT NULL, - authentication_method text NOT NULL, - id uuid NOT NULL -); - - -ALTER TABLE auth.mfa_amr_claims OWNER TO supabase_auth_admin; - --- --- Name: TABLE mfa_amr_claims; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin --- - -COMMENT ON TABLE auth.mfa_amr_claims IS 'auth: stores authenticator method reference claims for multi factor authentication'; - - --- --- Name: mfa_challenges; Type: TABLE; Schema: auth; Owner: supabase_auth_admin --- - -CREATE TABLE auth.mfa_challenges ( - id uuid NOT NULL, - factor_id uuid NOT NULL, - created_at timestamp with time zone NOT NULL, - verified_at timestamp with time zone, - ip_address inet NOT NULL -); - - -ALTER TABLE auth.mfa_challenges OWNER TO supabase_auth_admin; - --- --- Name: TABLE mfa_challenges; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin --- - -COMMENT ON TABLE auth.mfa_challenges IS 'auth: stores metadata about challenge requests made'; - - --- --- Name: mfa_factors; Type: TABLE; Schema: auth; Owner: supabase_auth_admin --- - -CREATE TABLE auth.mfa_factors ( - id uuid NOT NULL, - user_id uuid NOT NULL, - friendly_name text, - factor_type auth.factor_type NOT NULL, - status auth.factor_status NOT NULL, - created_at timestamp with time zone NOT NULL, - updated_at timestamp with time zone NOT NULL, - secret text -); - - -ALTER TABLE auth.mfa_factors OWNER TO supabase_auth_admin; - --- --- Name: TABLE mfa_factors; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin --- - -COMMENT ON TABLE auth.mfa_factors IS 'auth: stores metadata about factors'; - - --- --- Name: refresh_tokens; Type: TABLE; Schema: auth; Owner: supabase_auth_admin --- - -CREATE TABLE auth.refresh_tokens ( - instance_id uuid, - id bigint NOT NULL, - token character varying(255), - user_id character varying(255), - revoked boolean, - created_at timestamp with time zone, - updated_at timestamp with time zone, - parent character varying(255), - session_id uuid -); - - -ALTER TABLE auth.refresh_tokens OWNER TO supabase_auth_admin; - --- --- Name: TABLE refresh_tokens; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin --- - -COMMENT ON TABLE auth.refresh_tokens IS 'Auth: Store of tokens used to refresh JWT tokens once they expire.'; - - --- --- Name: refresh_tokens_id_seq; Type: SEQUENCE; Schema: auth; Owner: supabase_auth_admin --- - -CREATE SEQUENCE auth.refresh_tokens_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - -ALTER TABLE auth.refresh_tokens_id_seq OWNER TO supabase_auth_admin; - --- --- Name: refresh_tokens_id_seq; Type: SEQUENCE OWNED BY; Schema: auth; Owner: supabase_auth_admin --- - -ALTER SEQUENCE auth.refresh_tokens_id_seq OWNED BY auth.refresh_tokens.id; - - --- --- Name: saml_providers; Type: TABLE; Schema: auth; Owner: supabase_auth_admin --- - -CREATE TABLE auth.saml_providers ( - id uuid NOT NULL, - sso_provider_id uuid NOT NULL, - entity_id text NOT NULL, - metadata_xml text NOT NULL, - metadata_url text, - attribute_mapping jsonb, - created_at timestamp with time zone, - updated_at timestamp with time zone, - CONSTRAINT "entity_id not empty" CHECK ((char_length(entity_id) > 0)), - CONSTRAINT "metadata_url not empty" CHECK (((metadata_url = NULL::text) OR (char_length(metadata_url) > 0))), - CONSTRAINT "metadata_xml not empty" CHECK ((char_length(metadata_xml) > 0)) -); - - -ALTER TABLE auth.saml_providers OWNER TO supabase_auth_admin; - --- --- Name: TABLE saml_providers; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin --- - -COMMENT ON TABLE auth.saml_providers IS 'Auth: Manages SAML Identity Provider connections.'; - - --- --- Name: saml_relay_states; Type: TABLE; Schema: auth; Owner: supabase_auth_admin --- - -CREATE TABLE auth.saml_relay_states ( - id uuid NOT NULL, - sso_provider_id uuid NOT NULL, - request_id text NOT NULL, - for_email text, - redirect_to text, - from_ip_address inet, - created_at timestamp with time zone, - updated_at timestamp with time zone, - CONSTRAINT "request_id not empty" CHECK ((char_length(request_id) > 0)) -); - - -ALTER TABLE auth.saml_relay_states OWNER TO supabase_auth_admin; - --- --- Name: TABLE saml_relay_states; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin --- - -COMMENT ON TABLE auth.saml_relay_states IS 'Auth: Contains SAML Relay State information for each Service Provider initiated login.'; - - --- --- Name: schema_migrations; Type: TABLE; Schema: auth; Owner: supabase_auth_admin --- - -CREATE TABLE auth.schema_migrations ( - version character varying(255) NOT NULL -); - - -ALTER TABLE auth.schema_migrations OWNER TO supabase_auth_admin; - --- --- Name: TABLE schema_migrations; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin --- - -COMMENT ON TABLE auth.schema_migrations IS 'Auth: Manages updates to the auth system.'; - - --- --- Name: sessions; Type: TABLE; Schema: auth; Owner: supabase_auth_admin --- - -CREATE TABLE auth.sessions ( - id uuid NOT NULL, - user_id uuid NOT NULL, - created_at timestamp with time zone, - updated_at timestamp with time zone, - factor_id uuid, - aal auth.aal_level, - not_after timestamp with time zone -); - - -ALTER TABLE auth.sessions OWNER TO supabase_auth_admin; - --- --- Name: TABLE sessions; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin --- - -COMMENT ON TABLE auth.sessions IS 'Auth: Stores session data associated to a user.'; - - --- --- Name: COLUMN sessions.not_after; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin --- - -COMMENT ON COLUMN auth.sessions.not_after IS 'Auth: Not after is a nullable column that contains a timestamp after which the session should be regarded as expired.'; - - --- --- Name: sso_domains; Type: TABLE; Schema: auth; Owner: supabase_auth_admin --- - -CREATE TABLE auth.sso_domains ( - id uuid NOT NULL, - sso_provider_id uuid NOT NULL, - domain text NOT NULL, - created_at timestamp with time zone, - updated_at timestamp with time zone, - CONSTRAINT "domain not empty" CHECK ((char_length(domain) > 0)) -); - - -ALTER TABLE auth.sso_domains OWNER TO supabase_auth_admin; - --- --- Name: TABLE sso_domains; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin --- - -COMMENT ON TABLE auth.sso_domains IS 'Auth: Manages SSO email address domain mapping to an SSO Identity Provider.'; - - --- --- Name: sso_providers; Type: TABLE; Schema: auth; Owner: supabase_auth_admin --- - -CREATE TABLE auth.sso_providers ( - id uuid NOT NULL, - resource_id text, - created_at timestamp with time zone, - updated_at timestamp with time zone, - CONSTRAINT "resource_id not empty" CHECK (((resource_id = NULL::text) OR (char_length(resource_id) > 0))) -); - - -ALTER TABLE auth.sso_providers OWNER TO supabase_auth_admin; - --- --- Name: TABLE sso_providers; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin --- - -COMMENT ON TABLE auth.sso_providers IS 'Auth: Manages SSO identity provider information; see saml_providers for SAML.'; - - --- --- Name: COLUMN sso_providers.resource_id; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin --- - -COMMENT ON COLUMN auth.sso_providers.resource_id IS 'Auth: Uniquely identifies a SSO provider according to a user-chosen resource ID (case insensitive), useful in infrastructure as code.'; - - --- --- Name: users; Type: TABLE; Schema: auth; Owner: supabase_auth_admin --- - -CREATE TABLE auth.users ( - instance_id uuid, - id uuid NOT NULL, - aud character varying(255), - role character varying(255), - email character varying(255), - encrypted_password character varying(255), - email_confirmed_at timestamp with time zone, - invited_at timestamp with time zone, - confirmation_token character varying(255), - confirmation_sent_at timestamp with time zone, - recovery_token character varying(255), - recovery_sent_at timestamp with time zone, - email_change_token_new character varying(255), - email_change character varying(255), - email_change_sent_at timestamp with time zone, - last_sign_in_at timestamp with time zone, - raw_app_meta_data jsonb, - raw_user_meta_data jsonb, - is_super_admin boolean, - created_at timestamp with time zone, - updated_at timestamp with time zone, - phone text DEFAULT NULL::character varying, - phone_confirmed_at timestamp with time zone, - phone_change text DEFAULT ''::character varying, - phone_change_token character varying(255) DEFAULT ''::character varying, - phone_change_sent_at timestamp with time zone, - confirmed_at timestamp with time zone GENERATED ALWAYS AS (LEAST(email_confirmed_at, phone_confirmed_at)) STORED, - email_change_token_current character varying(255) DEFAULT ''::character varying, - email_change_confirm_status smallint DEFAULT 0, - banned_until timestamp with time zone, - reauthentication_token character varying(255) DEFAULT ''::character varying, - reauthentication_sent_at timestamp with time zone, - is_sso_user boolean DEFAULT false NOT NULL, - deleted_at timestamp with time zone, - CONSTRAINT users_email_change_confirm_status_check CHECK (((email_change_confirm_status >= 0) AND (email_change_confirm_status <= 2))) -); - - -ALTER TABLE auth.users OWNER TO supabase_auth_admin; - --- --- Name: TABLE users; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin --- - -COMMENT ON TABLE auth.users IS 'Auth: Stores user login data within a secure schema.'; - - --- --- Name: COLUMN users.is_sso_user; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin --- - -COMMENT ON COLUMN auth.users.is_sso_user IS 'Auth: Set this column to true when the account comes from SSO. These accounts can have duplicate emails.'; - - --- --- Name: Client; Type: TABLE; Schema: public; Owner: postgres --- - -CREATE TABLE public."Client" ( - "clientId" uuid NOT NULL, - email text, - "emailPreferences" jsonb, - "createdAt" timestamp with time zone DEFAULT now() -); - - -ALTER TABLE public."Client" OWNER TO postgres; - --- --- Name: TABLE "Client"; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON TABLE public."Client" IS 'Client is one browser marked with unique id'; - - --- --- Name: Prompt; Type: TABLE; Schema: public; Owner: postgres --- - -CREATE TABLE public."Prompt" ( - id bigint NOT NULL, - "previousExternalId" text, - "createdAt" timestamp with time zone DEFAULT now() NOT NULL, - "promptAt" timestamp with time zone, - "answerAt" timestamp with time zone, - "systemMessage" text, - prompt text, - answer text, - model text, - "modelSettings" jsonb, - metadata jsonb, - "clientId" uuid, - type text, - "fullCompletion" jsonb, - "externalId" text -); - - -ALTER TABLE public."Prompt" OWNER TO postgres; - --- --- Name: TABLE "Prompt"; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON TABLE public."Prompt" IS 'Log (and in future queue) of prompts'; - - --- --- Name: Prompt_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres --- - -ALTER TABLE public."Prompt" ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY ( - SEQUENCE NAME public."Prompt_id_seq" - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1 -); - - --- --- Name: Reaction; Type: TABLE; Schema: public; Owner: postgres --- - -CREATE TABLE public."Reaction" ( - "wallpaperId" text NOT NULL, - author uuid NOT NULL, - "createdAt" timestamp with time zone DEFAULT now() NOT NULL, - "likedStatus" text NOT NULL -); - - -ALTER TABLE public."Reaction" OWNER TO postgres; - --- --- Name: TABLE "Reaction"; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON TABLE public."Reaction" IS 'Reactions to wallpaper'; - - --- --- Name: Site; Type: TABLE; Schema: public; Owner: postgres --- - -CREATE TABLE public."Site" ( - id bigint NOT NULL, - "createdAt" timestamp with time zone DEFAULT now(), - "wallpaperId" text, - url text, - "ownerEmail" text, - plan text, - note text, - author uuid -); - - -ALTER TABLE public."Site" OWNER TO postgres; - --- --- Name: TABLE "Site"; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON TABLE public."Site" IS 'Registered sites for AiAi'; - - --- --- Name: Site_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres --- - -ALTER TABLE public."Site" ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY ( - SEQUENCE NAME public."Site_id_seq" - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1 -); - - --- --- Name: SupportRequest; Type: TABLE; Schema: public; Owner: postgres --- - -CREATE TABLE public."SupportRequest" ( - id bigint NOT NULL, - "createdAt" timestamp with time zone DEFAULT now(), - "from" text, - message text, - "isSolved" boolean DEFAULT false, - note text, - author uuid -); - - -ALTER TABLE public."SupportRequest" OWNER TO postgres; - --- --- Name: TABLE "SupportRequest"; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON TABLE public."SupportRequest" IS 'Requests for help'; - - --- --- Name: SupportRequest_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres --- - -ALTER TABLE public."SupportRequest" ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY ( - SEQUENCE NAME public."SupportRequest_id_seq" - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1 -); - - --- --- Name: Wallpaper; Type: TABLE; Schema: public; Owner: postgres --- - -CREATE TABLE public."Wallpaper" ( - id text NOT NULL, - parent text, - "createdAt" timestamp with time zone DEFAULT now() NOT NULL, - src text NOT NULL, - prompt text, - "colorStats" jsonb, - title text NOT NULL, - content text NOT NULL, - keywords text[], - author uuid NOT NULL, - "isPublic" boolean DEFAULT false NOT NULL, - "naturalSize" jsonb -); - - -ALTER TABLE public."Wallpaper" OWNER TO postgres; - --- --- Name: TABLE "Wallpaper"; Type: COMMENT; Schema: public; Owner: postgres --- - -COMMENT ON TABLE public."Wallpaper" IS 'Wallpapers (websites) created by users'; - - --- --- Name: Wallpaper_random; Type: VIEW; Schema: public; Owner: postgres --- - -CREATE VIEW public."Wallpaper_random" AS - SELECT "Wallpaper".id, - "Wallpaper".parent, - "Wallpaper"."createdAt", - "Wallpaper".src, - "Wallpaper".prompt, - "Wallpaper"."colorStats", - "Wallpaper".title, - "Wallpaper".content, - "Wallpaper".keywords, - "Wallpaper".author, - "Wallpaper"."isPublic" - FROM public."Wallpaper" - ORDER BY (random()); - - -ALTER TABLE public."Wallpaper_random" OWNER TO postgres; - --- --- Name: buckets; Type: TABLE; Schema: storage; Owner: supabase_storage_admin --- - -CREATE TABLE storage.buckets ( - id text NOT NULL, - name text NOT NULL, - owner uuid, - created_at timestamp with time zone DEFAULT now(), - updated_at timestamp with time zone DEFAULT now(), - public boolean DEFAULT false, - avif_autodetection boolean DEFAULT false, - file_size_limit bigint, - allowed_mime_types text[] -); - - -ALTER TABLE storage.buckets OWNER TO supabase_storage_admin; - --- --- Name: migrations; Type: TABLE; Schema: storage; Owner: supabase_storage_admin --- - -CREATE TABLE storage.migrations ( - id integer NOT NULL, - name character varying(100) NOT NULL, - hash character varying(40) NOT NULL, - executed_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP -); - - -ALTER TABLE storage.migrations OWNER TO supabase_storage_admin; - --- --- Name: objects; Type: TABLE; Schema: storage; Owner: supabase_storage_admin --- - -CREATE TABLE storage.objects ( - id uuid DEFAULT extensions.uuid_generate_v4() NOT NULL, - bucket_id text, - name text, - owner uuid, - created_at timestamp with time zone DEFAULT now(), - updated_at timestamp with time zone DEFAULT now(), - last_accessed_at timestamp with time zone DEFAULT now(), - metadata jsonb, - path_tokens text[] GENERATED ALWAYS AS (string_to_array(name, '/'::text)) STORED, - version text -); - - -ALTER TABLE storage.objects OWNER TO supabase_storage_admin; - --- --- Name: decrypted_secrets; Type: VIEW; Schema: vault; Owner: supabase_admin --- - -CREATE VIEW vault.decrypted_secrets AS - SELECT secrets.id, - secrets.name, - secrets.description, - secrets.secret, - CASE - WHEN (secrets.secret IS NULL) THEN NULL::text - ELSE - CASE - WHEN (secrets.key_id IS NULL) THEN NULL::text - ELSE convert_from(pgsodium.crypto_aead_det_decrypt(decode(secrets.secret, 'base64'::text), convert_to(((((secrets.id)::text || secrets.description) || (secrets.created_at)::text) || (secrets.updated_at)::text), 'utf8'::name), secrets.key_id, secrets.nonce), 'utf8'::name) - END - END AS decrypted_secret, - secrets.key_id, - secrets.nonce, - secrets.created_at, - secrets.updated_at - FROM vault.secrets; - - -ALTER TABLE vault.decrypted_secrets OWNER TO supabase_admin; - --- --- Name: refresh_tokens id; Type: DEFAULT; Schema: auth; Owner: supabase_auth_admin --- - -ALTER TABLE ONLY auth.refresh_tokens ALTER COLUMN id SET DEFAULT nextval('auth.refresh_tokens_id_seq'::regclass); - - --- --- Name: mfa_amr_claims amr_id_pk; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin --- - -ALTER TABLE ONLY auth.mfa_amr_claims - ADD CONSTRAINT amr_id_pk PRIMARY KEY (id); - - --- --- Name: audit_log_entries audit_log_entries_pkey; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin --- - -ALTER TABLE ONLY auth.audit_log_entries - ADD CONSTRAINT audit_log_entries_pkey PRIMARY KEY (id); - - --- --- Name: flow_state flow_state_pkey; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin --- - -ALTER TABLE ONLY auth.flow_state - ADD CONSTRAINT flow_state_pkey PRIMARY KEY (id); - - --- --- Name: identities identities_pkey; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin --- - -ALTER TABLE ONLY auth.identities - ADD CONSTRAINT identities_pkey PRIMARY KEY (provider, id); - - --- --- Name: instances instances_pkey; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin --- - -ALTER TABLE ONLY auth.instances - ADD CONSTRAINT instances_pkey PRIMARY KEY (id); - - --- --- Name: mfa_amr_claims mfa_amr_claims_session_id_authentication_method_pkey; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin --- - -ALTER TABLE ONLY auth.mfa_amr_claims - ADD CONSTRAINT mfa_amr_claims_session_id_authentication_method_pkey UNIQUE (session_id, authentication_method); - - --- --- Name: mfa_challenges mfa_challenges_pkey; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin --- - -ALTER TABLE ONLY auth.mfa_challenges - ADD CONSTRAINT mfa_challenges_pkey PRIMARY KEY (id); - - --- --- Name: mfa_factors mfa_factors_pkey; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin --- - -ALTER TABLE ONLY auth.mfa_factors - ADD CONSTRAINT mfa_factors_pkey PRIMARY KEY (id); - - --- --- Name: refresh_tokens refresh_tokens_pkey; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin --- - -ALTER TABLE ONLY auth.refresh_tokens - ADD CONSTRAINT refresh_tokens_pkey PRIMARY KEY (id); - - --- --- Name: refresh_tokens refresh_tokens_token_unique; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin --- - -ALTER TABLE ONLY auth.refresh_tokens - ADD CONSTRAINT refresh_tokens_token_unique UNIQUE (token); - - --- --- Name: saml_providers saml_providers_entity_id_key; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin --- - -ALTER TABLE ONLY auth.saml_providers - ADD CONSTRAINT saml_providers_entity_id_key UNIQUE (entity_id); - - --- --- Name: saml_providers saml_providers_pkey; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin --- - -ALTER TABLE ONLY auth.saml_providers - ADD CONSTRAINT saml_providers_pkey PRIMARY KEY (id); - - --- --- Name: saml_relay_states saml_relay_states_pkey; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin --- - -ALTER TABLE ONLY auth.saml_relay_states - ADD CONSTRAINT saml_relay_states_pkey PRIMARY KEY (id); - - --- --- Name: schema_migrations schema_migrations_pkey; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin --- - -ALTER TABLE ONLY auth.schema_migrations - ADD CONSTRAINT schema_migrations_pkey PRIMARY KEY (version); - - --- --- Name: sessions sessions_pkey; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin --- - -ALTER TABLE ONLY auth.sessions - ADD CONSTRAINT sessions_pkey PRIMARY KEY (id); - - --- --- Name: sso_domains sso_domains_pkey; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin --- - -ALTER TABLE ONLY auth.sso_domains - ADD CONSTRAINT sso_domains_pkey PRIMARY KEY (id); - - --- --- Name: sso_providers sso_providers_pkey; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin --- - -ALTER TABLE ONLY auth.sso_providers - ADD CONSTRAINT sso_providers_pkey PRIMARY KEY (id); - - --- --- Name: users users_phone_key; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin --- - -ALTER TABLE ONLY auth.users - ADD CONSTRAINT users_phone_key UNIQUE (phone); - - --- --- Name: users users_pkey; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin --- - -ALTER TABLE ONLY auth.users - ADD CONSTRAINT users_pkey PRIMARY KEY (id); - - --- --- Name: Client Client_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public."Client" - ADD CONSTRAINT "Client_pkey" PRIMARY KEY ("clientId"); - - --- --- Name: Prompt Prompt_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public."Prompt" - ADD CONSTRAINT "Prompt_pkey" PRIMARY KEY (id); - - --- --- Name: Reaction Reaction_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public."Reaction" - ADD CONSTRAINT "Reaction_pkey" PRIMARY KEY ("wallpaperId", author, "createdAt"); - - --- --- Name: Site Site_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public."Site" - ADD CONSTRAINT "Site_pkey" PRIMARY KEY (id); - - --- --- Name: Site Site_url_key; Type: CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public."Site" - ADD CONSTRAINT "Site_url_key" UNIQUE (url); - - --- --- Name: SupportRequest SupportRequest_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public."SupportRequest" - ADD CONSTRAINT "SupportRequest_pkey" PRIMARY KEY (id); - - --- --- Name: Wallpaper Wallpaper_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public."Wallpaper" - ADD CONSTRAINT "Wallpaper_pkey" PRIMARY KEY (id); - - --- --- Name: buckets buckets_pkey; Type: CONSTRAINT; Schema: storage; Owner: supabase_storage_admin --- - -ALTER TABLE ONLY storage.buckets - ADD CONSTRAINT buckets_pkey PRIMARY KEY (id); - - --- --- Name: migrations migrations_name_key; Type: CONSTRAINT; Schema: storage; Owner: supabase_storage_admin --- - -ALTER TABLE ONLY storage.migrations - ADD CONSTRAINT migrations_name_key UNIQUE (name); - - --- --- Name: migrations migrations_pkey; Type: CONSTRAINT; Schema: storage; Owner: supabase_storage_admin --- - -ALTER TABLE ONLY storage.migrations - ADD CONSTRAINT migrations_pkey PRIMARY KEY (id); - - --- --- Name: objects objects_pkey; Type: CONSTRAINT; Schema: storage; Owner: supabase_storage_admin --- - -ALTER TABLE ONLY storage.objects - ADD CONSTRAINT objects_pkey PRIMARY KEY (id); - - --- --- Name: audit_logs_instance_id_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin --- - -CREATE INDEX audit_logs_instance_id_idx ON auth.audit_log_entries USING btree (instance_id); - - --- --- Name: confirmation_token_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin --- - -CREATE UNIQUE INDEX confirmation_token_idx ON auth.users USING btree (confirmation_token) WHERE ((confirmation_token)::text !~ '^[0-9 ]*$'::text); - - --- --- Name: email_change_token_current_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin --- - -CREATE UNIQUE INDEX email_change_token_current_idx ON auth.users USING btree (email_change_token_current) WHERE ((email_change_token_current)::text !~ '^[0-9 ]*$'::text); - - --- --- Name: email_change_token_new_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin --- - -CREATE UNIQUE INDEX email_change_token_new_idx ON auth.users USING btree (email_change_token_new) WHERE ((email_change_token_new)::text !~ '^[0-9 ]*$'::text); - - --- --- Name: factor_id_created_at_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin --- - -CREATE INDEX factor_id_created_at_idx ON auth.mfa_factors USING btree (user_id, created_at); - - --- --- Name: flow_state_created_at_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin --- - -CREATE INDEX flow_state_created_at_idx ON auth.flow_state USING btree (created_at DESC); - - --- --- Name: identities_email_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin --- - -CREATE INDEX identities_email_idx ON auth.identities USING btree (email text_pattern_ops); - - --- --- Name: INDEX identities_email_idx; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin --- - -COMMENT ON INDEX auth.identities_email_idx IS 'Auth: Ensures indexed queries on the email column'; - - --- --- Name: identities_user_id_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin --- - -CREATE INDEX identities_user_id_idx ON auth.identities USING btree (user_id); - - --- --- Name: idx_auth_code; Type: INDEX; Schema: auth; Owner: supabase_auth_admin --- - -CREATE INDEX idx_auth_code ON auth.flow_state USING btree (auth_code); - - --- --- Name: idx_user_id_auth_method; Type: INDEX; Schema: auth; Owner: supabase_auth_admin --- - -CREATE INDEX idx_user_id_auth_method ON auth.flow_state USING btree (user_id, authentication_method); - - --- --- Name: mfa_challenge_created_at_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin --- - -CREATE INDEX mfa_challenge_created_at_idx ON auth.mfa_challenges USING btree (created_at DESC); - - --- --- Name: mfa_factors_user_friendly_name_unique; Type: INDEX; Schema: auth; Owner: supabase_auth_admin --- - -CREATE UNIQUE INDEX mfa_factors_user_friendly_name_unique ON auth.mfa_factors USING btree (friendly_name, user_id) WHERE (TRIM(BOTH FROM friendly_name) <> ''::text); - - --- --- Name: reauthentication_token_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin --- - -CREATE UNIQUE INDEX reauthentication_token_idx ON auth.users USING btree (reauthentication_token) WHERE ((reauthentication_token)::text !~ '^[0-9 ]*$'::text); - - --- --- Name: recovery_token_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin --- - -CREATE UNIQUE INDEX recovery_token_idx ON auth.users USING btree (recovery_token) WHERE ((recovery_token)::text !~ '^[0-9 ]*$'::text); - - --- --- Name: refresh_tokens_instance_id_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin --- - -CREATE INDEX refresh_tokens_instance_id_idx ON auth.refresh_tokens USING btree (instance_id); - - --- --- Name: refresh_tokens_instance_id_user_id_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin --- - -CREATE INDEX refresh_tokens_instance_id_user_id_idx ON auth.refresh_tokens USING btree (instance_id, user_id); - - --- --- Name: refresh_tokens_parent_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin --- - -CREATE INDEX refresh_tokens_parent_idx ON auth.refresh_tokens USING btree (parent); - - --- --- Name: refresh_tokens_session_id_revoked_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin --- - -CREATE INDEX refresh_tokens_session_id_revoked_idx ON auth.refresh_tokens USING btree (session_id, revoked); - - --- --- Name: refresh_tokens_updated_at_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin --- - -CREATE INDEX refresh_tokens_updated_at_idx ON auth.refresh_tokens USING btree (updated_at DESC); - - --- --- Name: saml_providers_sso_provider_id_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin --- - -CREATE INDEX saml_providers_sso_provider_id_idx ON auth.saml_providers USING btree (sso_provider_id); - - --- --- Name: saml_relay_states_created_at_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin --- - -CREATE INDEX saml_relay_states_created_at_idx ON auth.saml_relay_states USING btree (created_at DESC); - - --- --- Name: saml_relay_states_for_email_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin --- - -CREATE INDEX saml_relay_states_for_email_idx ON auth.saml_relay_states USING btree (for_email); - - --- --- Name: saml_relay_states_sso_provider_id_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin --- - -CREATE INDEX saml_relay_states_sso_provider_id_idx ON auth.saml_relay_states USING btree (sso_provider_id); - - --- --- Name: sessions_not_after_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin --- - -CREATE INDEX sessions_not_after_idx ON auth.sessions USING btree (not_after DESC); - - --- --- Name: sessions_user_id_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin --- - -CREATE INDEX sessions_user_id_idx ON auth.sessions USING btree (user_id); - - --- --- Name: sso_domains_domain_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin --- - -CREATE UNIQUE INDEX sso_domains_domain_idx ON auth.sso_domains USING btree (lower(domain)); - - --- --- Name: sso_domains_sso_provider_id_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin --- - -CREATE INDEX sso_domains_sso_provider_id_idx ON auth.sso_domains USING btree (sso_provider_id); - - --- --- Name: sso_providers_resource_id_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin --- - -CREATE UNIQUE INDEX sso_providers_resource_id_idx ON auth.sso_providers USING btree (lower(resource_id)); - - --- --- Name: user_id_created_at_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin --- - -CREATE INDEX user_id_created_at_idx ON auth.sessions USING btree (user_id, created_at); - - --- --- Name: users_email_partial_key; Type: INDEX; Schema: auth; Owner: supabase_auth_admin --- - -CREATE UNIQUE INDEX users_email_partial_key ON auth.users USING btree (email) WHERE (is_sso_user = false); - - --- --- Name: INDEX users_email_partial_key; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin --- - -COMMENT ON INDEX auth.users_email_partial_key IS 'Auth: A partial unique index that applies only when is_sso_user is false'; - - --- --- Name: users_instance_id_email_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin --- - -CREATE INDEX users_instance_id_email_idx ON auth.users USING btree (instance_id, lower((email)::text)); - - --- --- Name: users_instance_id_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin --- - -CREATE INDEX users_instance_id_idx ON auth.users USING btree (instance_id); - - --- --- Name: bname; Type: INDEX; Schema: storage; Owner: supabase_storage_admin --- - -CREATE UNIQUE INDEX bname ON storage.buckets USING btree (name); - - --- --- Name: bucketid_objname; Type: INDEX; Schema: storage; Owner: supabase_storage_admin --- - -CREATE UNIQUE INDEX bucketid_objname ON storage.objects USING btree (bucket_id, name); - - --- --- Name: name_prefix_search; Type: INDEX; Schema: storage; Owner: supabase_storage_admin --- - -CREATE INDEX name_prefix_search ON storage.objects USING btree (name text_pattern_ops); - - --- --- Name: objects update_objects_updated_at; Type: TRIGGER; Schema: storage; Owner: supabase_storage_admin --- - -CREATE TRIGGER update_objects_updated_at BEFORE UPDATE ON storage.objects FOR EACH ROW EXECUTE FUNCTION storage.update_updated_at_column(); - - --- --- Name: identities identities_user_id_fkey; Type: FK CONSTRAINT; Schema: auth; Owner: supabase_auth_admin --- - -ALTER TABLE ONLY auth.identities - ADD CONSTRAINT identities_user_id_fkey FOREIGN KEY (user_id) REFERENCES auth.users(id) ON DELETE CASCADE; - - --- --- Name: mfa_amr_claims mfa_amr_claims_session_id_fkey; Type: FK CONSTRAINT; Schema: auth; Owner: supabase_auth_admin --- - -ALTER TABLE ONLY auth.mfa_amr_claims - ADD CONSTRAINT mfa_amr_claims_session_id_fkey FOREIGN KEY (session_id) REFERENCES auth.sessions(id) ON DELETE CASCADE; - - --- --- Name: mfa_challenges mfa_challenges_auth_factor_id_fkey; Type: FK CONSTRAINT; Schema: auth; Owner: supabase_auth_admin --- - -ALTER TABLE ONLY auth.mfa_challenges - ADD CONSTRAINT mfa_challenges_auth_factor_id_fkey FOREIGN KEY (factor_id) REFERENCES auth.mfa_factors(id) ON DELETE CASCADE; - - --- --- Name: mfa_factors mfa_factors_user_id_fkey; Type: FK CONSTRAINT; Schema: auth; Owner: supabase_auth_admin --- - -ALTER TABLE ONLY auth.mfa_factors - ADD CONSTRAINT mfa_factors_user_id_fkey FOREIGN KEY (user_id) REFERENCES auth.users(id) ON DELETE CASCADE; - - --- --- Name: refresh_tokens refresh_tokens_session_id_fkey; Type: FK CONSTRAINT; Schema: auth; Owner: supabase_auth_admin --- - -ALTER TABLE ONLY auth.refresh_tokens - ADD CONSTRAINT refresh_tokens_session_id_fkey FOREIGN KEY (session_id) REFERENCES auth.sessions(id) ON DELETE CASCADE; - - --- --- Name: saml_providers saml_providers_sso_provider_id_fkey; Type: FK CONSTRAINT; Schema: auth; Owner: supabase_auth_admin --- - -ALTER TABLE ONLY auth.saml_providers - ADD CONSTRAINT saml_providers_sso_provider_id_fkey FOREIGN KEY (sso_provider_id) REFERENCES auth.sso_providers(id) ON DELETE CASCADE; - - --- --- Name: saml_relay_states saml_relay_states_sso_provider_id_fkey; Type: FK CONSTRAINT; Schema: auth; Owner: supabase_auth_admin --- - -ALTER TABLE ONLY auth.saml_relay_states - ADD CONSTRAINT saml_relay_states_sso_provider_id_fkey FOREIGN KEY (sso_provider_id) REFERENCES auth.sso_providers(id) ON DELETE CASCADE; - - --- --- Name: sessions sessions_user_id_fkey; Type: FK CONSTRAINT; Schema: auth; Owner: supabase_auth_admin --- - -ALTER TABLE ONLY auth.sessions - ADD CONSTRAINT sessions_user_id_fkey FOREIGN KEY (user_id) REFERENCES auth.users(id) ON DELETE CASCADE; - - --- --- Name: sso_domains sso_domains_sso_provider_id_fkey; Type: FK CONSTRAINT; Schema: auth; Owner: supabase_auth_admin --- - -ALTER TABLE ONLY auth.sso_domains - ADD CONSTRAINT sso_domains_sso_provider_id_fkey FOREIGN KEY (sso_provider_id) REFERENCES auth.sso_providers(id) ON DELETE CASCADE; - - --- --- Name: Reaction Reaction_wallpaperId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public."Reaction" - ADD CONSTRAINT "Reaction_wallpaperId_fkey" FOREIGN KEY ("wallpaperId") REFERENCES public."Wallpaper"(id) ON DELETE CASCADE; - - --- --- Name: buckets buckets_owner_fkey; Type: FK CONSTRAINT; Schema: storage; Owner: supabase_storage_admin --- - -ALTER TABLE ONLY storage.buckets - ADD CONSTRAINT buckets_owner_fkey FOREIGN KEY (owner) REFERENCES auth.users(id); - - --- --- Name: objects objects_bucketId_fkey; Type: FK CONSTRAINT; Schema: storage; Owner: supabase_storage_admin --- - -ALTER TABLE ONLY storage.objects - ADD CONSTRAINT "objects_bucketId_fkey" FOREIGN KEY (bucket_id) REFERENCES storage.buckets(id); - - --- --- Name: objects objects_owner_fkey; Type: FK CONSTRAINT; Schema: storage; Owner: supabase_storage_admin --- - -ALTER TABLE ONLY storage.objects - ADD CONSTRAINT objects_owner_fkey FOREIGN KEY (owner) REFERENCES auth.users(id); - - --- --- Name: SupportRequest Anyone can insert a row; Type: POLICY; Schema: public; Owner: postgres --- - -CREATE POLICY " Anyone can insert a row" ON public."SupportRequest" FOR INSERT TO anon WITH CHECK (true); - - --- --- Name: Wallpaper Anyone can insert a row; Type: POLICY; Schema: public; Owner: postgres --- - -CREATE POLICY " Anyone can insert a row" ON public."Wallpaper" FOR INSERT TO anon WITH CHECK (true); - - --- --- Name: Client Anyone can insert a row; Type: POLICY; Schema: public; Owner: postgres --- - -CREATE POLICY "Anyone can insert a row" ON public."Client" FOR INSERT TO anon WITH CHECK (true); - - --- --- Name: Reaction Anyone can insert a row; Type: POLICY; Schema: public; Owner: postgres --- - -CREATE POLICY "Anyone can insert a row" ON public."Reaction" FOR INSERT TO anon WITH CHECK (true); - - --- --- Name: Site Anyone can insert a row; Type: POLICY; Schema: public; Owner: postgres --- - -CREATE POLICY "Anyone can insert a row" ON public."Site" FOR INSERT TO anon WITH CHECK (true); - - --- --- Name: Client; Type: ROW SECURITY; Schema: public; Owner: postgres --- - -ALTER TABLE public."Client" ENABLE ROW LEVEL SECURITY; - --- --- Name: Prompt; Type: ROW SECURITY; Schema: public; Owner: postgres --- - -ALTER TABLE public."Prompt" ENABLE ROW LEVEL SECURITY; - --- --- Name: Reaction; Type: ROW SECURITY; Schema: public; Owner: postgres --- - -ALTER TABLE public."Reaction" ENABLE ROW LEVEL SECURITY; - --- --- Name: Site; Type: ROW SECURITY; Schema: public; Owner: postgres --- - -ALTER TABLE public."Site" ENABLE ROW LEVEL SECURITY; - --- --- Name: SupportRequest; Type: ROW SECURITY; Schema: public; Owner: postgres --- - -ALTER TABLE public."SupportRequest" ENABLE ROW LEVEL SECURITY; - --- --- Name: Wallpaper; Type: ROW SECURITY; Schema: public; Owner: postgres --- - -ALTER TABLE public."Wallpaper" ENABLE ROW LEVEL SECURITY; - --- --- Name: buckets; Type: ROW SECURITY; Schema: storage; Owner: supabase_storage_admin --- - -ALTER TABLE storage.buckets ENABLE ROW LEVEL SECURITY; - --- --- Name: migrations; Type: ROW SECURITY; Schema: storage; Owner: supabase_storage_admin --- - -ALTER TABLE storage.migrations ENABLE ROW LEVEL SECURITY; - --- --- Name: objects; Type: ROW SECURITY; Schema: storage; Owner: supabase_storage_admin --- - -ALTER TABLE storage.objects ENABLE ROW LEVEL SECURITY; - --- --- Name: supabase_realtime; Type: PUBLICATION; Schema: -; Owner: postgres --- - -CREATE PUBLICATION supabase_realtime WITH (publish = 'insert, update, delete, truncate'); - - -ALTER PUBLICATION supabase_realtime OWNER TO postgres; - --- --- Name: SCHEMA auth; Type: ACL; Schema: -; Owner: supabase_admin --- - -GRANT USAGE ON SCHEMA auth TO anon; -GRANT USAGE ON SCHEMA auth TO authenticated; -GRANT USAGE ON SCHEMA auth TO service_role; -GRANT ALL ON SCHEMA auth TO supabase_auth_admin; -GRANT ALL ON SCHEMA auth TO dashboard_user; -GRANT ALL ON SCHEMA auth TO postgres; - - --- --- Name: SCHEMA extensions; Type: ACL; Schema: -; Owner: postgres --- - -GRANT USAGE ON SCHEMA extensions TO anon; -GRANT USAGE ON SCHEMA extensions TO authenticated; -GRANT USAGE ON SCHEMA extensions TO service_role; -GRANT ALL ON SCHEMA extensions TO dashboard_user; - - --- --- Name: SCHEMA graphql_public; Type: ACL; Schema: -; Owner: supabase_admin --- - -GRANT USAGE ON SCHEMA graphql_public TO postgres; -GRANT USAGE ON SCHEMA graphql_public TO anon; -GRANT USAGE ON SCHEMA graphql_public TO authenticated; -GRANT USAGE ON SCHEMA graphql_public TO service_role; - - --- --- Name: SCHEMA public; Type: ACL; Schema: -; Owner: pg_database_owner --- - -GRANT USAGE ON SCHEMA public TO postgres; -GRANT USAGE ON SCHEMA public TO anon; -GRANT USAGE ON SCHEMA public TO authenticated; -GRANT USAGE ON SCHEMA public TO service_role; - - --- --- Name: SCHEMA realtime; Type: ACL; Schema: -; Owner: supabase_admin --- - -GRANT USAGE ON SCHEMA realtime TO postgres; - - --- --- Name: SCHEMA storage; Type: ACL; Schema: -; Owner: supabase_admin --- - -GRANT ALL ON SCHEMA storage TO postgres; -GRANT USAGE ON SCHEMA storage TO anon; -GRANT USAGE ON SCHEMA storage TO authenticated; -GRANT USAGE ON SCHEMA storage TO service_role; -GRANT ALL ON SCHEMA storage TO supabase_storage_admin; -GRANT ALL ON SCHEMA storage TO dashboard_user; - - --- --- Name: FUNCTION email(); Type: ACL; Schema: auth; Owner: supabase_auth_admin --- - -GRANT ALL ON FUNCTION auth.email() TO dashboard_user; - - --- --- Name: FUNCTION jwt(); Type: ACL; Schema: auth; Owner: supabase_auth_admin --- - -GRANT ALL ON FUNCTION auth.jwt() TO postgres; -GRANT ALL ON FUNCTION auth.jwt() TO dashboard_user; - - --- --- Name: FUNCTION role(); Type: ACL; Schema: auth; Owner: supabase_auth_admin --- - -GRANT ALL ON FUNCTION auth.role() TO dashboard_user; - - --- --- Name: FUNCTION uid(); Type: ACL; Schema: auth; Owner: supabase_auth_admin --- - -GRANT ALL ON FUNCTION auth.uid() TO dashboard_user; - - --- --- Name: FUNCTION algorithm_sign(signables text, secret text, algorithm text); Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON FUNCTION extensions.algorithm_sign(signables text, secret text, algorithm text) FROM postgres; -GRANT ALL ON FUNCTION extensions.algorithm_sign(signables text, secret text, algorithm text) TO postgres WITH GRANT OPTION; -GRANT ALL ON FUNCTION extensions.algorithm_sign(signables text, secret text, algorithm text) TO dashboard_user; - - --- --- Name: FUNCTION armor(bytea); Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON FUNCTION extensions.armor(bytea) FROM postgres; -GRANT ALL ON FUNCTION extensions.armor(bytea) TO postgres WITH GRANT OPTION; -GRANT ALL ON FUNCTION extensions.armor(bytea) TO dashboard_user; - - --- --- Name: FUNCTION armor(bytea, text[], text[]); Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON FUNCTION extensions.armor(bytea, text[], text[]) FROM postgres; -GRANT ALL ON FUNCTION extensions.armor(bytea, text[], text[]) TO postgres WITH GRANT OPTION; -GRANT ALL ON FUNCTION extensions.armor(bytea, text[], text[]) TO dashboard_user; - - --- --- Name: FUNCTION crypt(text, text); Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON FUNCTION extensions.crypt(text, text) FROM postgres; -GRANT ALL ON FUNCTION extensions.crypt(text, text) TO postgres WITH GRANT OPTION; -GRANT ALL ON FUNCTION extensions.crypt(text, text) TO dashboard_user; - - --- --- Name: FUNCTION dearmor(text); Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON FUNCTION extensions.dearmor(text) FROM postgres; -GRANT ALL ON FUNCTION extensions.dearmor(text) TO postgres WITH GRANT OPTION; -GRANT ALL ON FUNCTION extensions.dearmor(text) TO dashboard_user; - - --- --- Name: FUNCTION decrypt(bytea, bytea, text); Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON FUNCTION extensions.decrypt(bytea, bytea, text) FROM postgres; -GRANT ALL ON FUNCTION extensions.decrypt(bytea, bytea, text) TO postgres WITH GRANT OPTION; -GRANT ALL ON FUNCTION extensions.decrypt(bytea, bytea, text) TO dashboard_user; - - --- --- Name: FUNCTION decrypt_iv(bytea, bytea, bytea, text); Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON FUNCTION extensions.decrypt_iv(bytea, bytea, bytea, text) FROM postgres; -GRANT ALL ON FUNCTION extensions.decrypt_iv(bytea, bytea, bytea, text) TO postgres WITH GRANT OPTION; -GRANT ALL ON FUNCTION extensions.decrypt_iv(bytea, bytea, bytea, text) TO dashboard_user; - - --- --- Name: FUNCTION digest(bytea, text); Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON FUNCTION extensions.digest(bytea, text) FROM postgres; -GRANT ALL ON FUNCTION extensions.digest(bytea, text) TO postgres WITH GRANT OPTION; -GRANT ALL ON FUNCTION extensions.digest(bytea, text) TO dashboard_user; - - --- --- Name: FUNCTION digest(text, text); Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON FUNCTION extensions.digest(text, text) FROM postgres; -GRANT ALL ON FUNCTION extensions.digest(text, text) TO postgres WITH GRANT OPTION; -GRANT ALL ON FUNCTION extensions.digest(text, text) TO dashboard_user; - - --- --- Name: FUNCTION encrypt(bytea, bytea, text); Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON FUNCTION extensions.encrypt(bytea, bytea, text) FROM postgres; -GRANT ALL ON FUNCTION extensions.encrypt(bytea, bytea, text) TO postgres WITH GRANT OPTION; -GRANT ALL ON FUNCTION extensions.encrypt(bytea, bytea, text) TO dashboard_user; - - --- --- Name: FUNCTION encrypt_iv(bytea, bytea, bytea, text); Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON FUNCTION extensions.encrypt_iv(bytea, bytea, bytea, text) FROM postgres; -GRANT ALL ON FUNCTION extensions.encrypt_iv(bytea, bytea, bytea, text) TO postgres WITH GRANT OPTION; -GRANT ALL ON FUNCTION extensions.encrypt_iv(bytea, bytea, bytea, text) TO dashboard_user; - - --- --- Name: FUNCTION gen_random_bytes(integer); Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON FUNCTION extensions.gen_random_bytes(integer) FROM postgres; -GRANT ALL ON FUNCTION extensions.gen_random_bytes(integer) TO postgres WITH GRANT OPTION; -GRANT ALL ON FUNCTION extensions.gen_random_bytes(integer) TO dashboard_user; - - --- --- Name: FUNCTION gen_random_uuid(); Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON FUNCTION extensions.gen_random_uuid() FROM postgres; -GRANT ALL ON FUNCTION extensions.gen_random_uuid() TO postgres WITH GRANT OPTION; -GRANT ALL ON FUNCTION extensions.gen_random_uuid() TO dashboard_user; - - --- --- Name: FUNCTION gen_salt(text); Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON FUNCTION extensions.gen_salt(text) FROM postgres; -GRANT ALL ON FUNCTION extensions.gen_salt(text) TO postgres WITH GRANT OPTION; -GRANT ALL ON FUNCTION extensions.gen_salt(text) TO dashboard_user; - - --- --- Name: FUNCTION gen_salt(text, integer); Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON FUNCTION extensions.gen_salt(text, integer) FROM postgres; -GRANT ALL ON FUNCTION extensions.gen_salt(text, integer) TO postgres WITH GRANT OPTION; -GRANT ALL ON FUNCTION extensions.gen_salt(text, integer) TO dashboard_user; - - --- --- Name: FUNCTION grant_pg_cron_access(); Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON FUNCTION extensions.grant_pg_cron_access() FROM postgres; -GRANT ALL ON FUNCTION extensions.grant_pg_cron_access() TO postgres WITH GRANT OPTION; -GRANT ALL ON FUNCTION extensions.grant_pg_cron_access() TO dashboard_user; - - --- --- Name: FUNCTION grant_pg_graphql_access(); Type: ACL; Schema: extensions; Owner: supabase_admin --- - -GRANT ALL ON FUNCTION extensions.grant_pg_graphql_access() TO postgres WITH GRANT OPTION; - - --- --- Name: FUNCTION grant_pg_net_access(); Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON FUNCTION extensions.grant_pg_net_access() FROM postgres; -GRANT ALL ON FUNCTION extensions.grant_pg_net_access() TO postgres WITH GRANT OPTION; -GRANT ALL ON FUNCTION extensions.grant_pg_net_access() TO dashboard_user; - - --- --- Name: FUNCTION hmac(bytea, bytea, text); Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON FUNCTION extensions.hmac(bytea, bytea, text) FROM postgres; -GRANT ALL ON FUNCTION extensions.hmac(bytea, bytea, text) TO postgres WITH GRANT OPTION; -GRANT ALL ON FUNCTION extensions.hmac(bytea, bytea, text) TO dashboard_user; - - --- --- Name: FUNCTION hmac(text, text, text); Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON FUNCTION extensions.hmac(text, text, text) FROM postgres; -GRANT ALL ON FUNCTION extensions.hmac(text, text, text) TO postgres WITH GRANT OPTION; -GRANT ALL ON FUNCTION extensions.hmac(text, text, text) TO dashboard_user; - - --- --- Name: FUNCTION pg_stat_statements(showtext boolean, OUT userid oid, OUT dbid oid, OUT toplevel boolean, OUT queryid bigint, OUT query text, OUT plans bigint, OUT total_plan_time double precision, OUT min_plan_time double precision, OUT max_plan_time double precision, OUT mean_plan_time double precision, OUT stddev_plan_time double precision, OUT calls bigint, OUT total_exec_time double precision, OUT min_exec_time double precision, OUT max_exec_time double precision, OUT mean_exec_time double precision, OUT stddev_exec_time double precision, OUT rows bigint, OUT shared_blks_hit bigint, OUT shared_blks_read bigint, OUT shared_blks_dirtied bigint, OUT shared_blks_written bigint, OUT local_blks_hit bigint, OUT local_blks_read bigint, OUT local_blks_dirtied bigint, OUT local_blks_written bigint, OUT temp_blks_read bigint, OUT temp_blks_written bigint, OUT blk_read_time double precision, OUT blk_write_time double precision, OUT temp_blk_read_time double precision, OUT temp_blk_write_time double precision, OUT wal_records bigint, OUT wal_fpi bigint, OUT wal_bytes numeric, OUT jit_functions bigint, OUT jit_generation_time double precision, OUT jit_inlining_count bigint, OUT jit_inlining_time double precision, OUT jit_optimization_count bigint, OUT jit_optimization_time double precision, OUT jit_emission_count bigint, OUT jit_emission_time double precision); Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON FUNCTION extensions.pg_stat_statements(showtext boolean, OUT userid oid, OUT dbid oid, OUT toplevel boolean, OUT queryid bigint, OUT query text, OUT plans bigint, OUT total_plan_time double precision, OUT min_plan_time double precision, OUT max_plan_time double precision, OUT mean_plan_time double precision, OUT stddev_plan_time double precision, OUT calls bigint, OUT total_exec_time double precision, OUT min_exec_time double precision, OUT max_exec_time double precision, OUT mean_exec_time double precision, OUT stddev_exec_time double precision, OUT rows bigint, OUT shared_blks_hit bigint, OUT shared_blks_read bigint, OUT shared_blks_dirtied bigint, OUT shared_blks_written bigint, OUT local_blks_hit bigint, OUT local_blks_read bigint, OUT local_blks_dirtied bigint, OUT local_blks_written bigint, OUT temp_blks_read bigint, OUT temp_blks_written bigint, OUT blk_read_time double precision, OUT blk_write_time double precision, OUT temp_blk_read_time double precision, OUT temp_blk_write_time double precision, OUT wal_records bigint, OUT wal_fpi bigint, OUT wal_bytes numeric, OUT jit_functions bigint, OUT jit_generation_time double precision, OUT jit_inlining_count bigint, OUT jit_inlining_time double precision, OUT jit_optimization_count bigint, OUT jit_optimization_time double precision, OUT jit_emission_count bigint, OUT jit_emission_time double precision) FROM postgres; -GRANT ALL ON FUNCTION extensions.pg_stat_statements(showtext boolean, OUT userid oid, OUT dbid oid, OUT toplevel boolean, OUT queryid bigint, OUT query text, OUT plans bigint, OUT total_plan_time double precision, OUT min_plan_time double precision, OUT max_plan_time double precision, OUT mean_plan_time double precision, OUT stddev_plan_time double precision, OUT calls bigint, OUT total_exec_time double precision, OUT min_exec_time double precision, OUT max_exec_time double precision, OUT mean_exec_time double precision, OUT stddev_exec_time double precision, OUT rows bigint, OUT shared_blks_hit bigint, OUT shared_blks_read bigint, OUT shared_blks_dirtied bigint, OUT shared_blks_written bigint, OUT local_blks_hit bigint, OUT local_blks_read bigint, OUT local_blks_dirtied bigint, OUT local_blks_written bigint, OUT temp_blks_read bigint, OUT temp_blks_written bigint, OUT blk_read_time double precision, OUT blk_write_time double precision, OUT temp_blk_read_time double precision, OUT temp_blk_write_time double precision, OUT wal_records bigint, OUT wal_fpi bigint, OUT wal_bytes numeric, OUT jit_functions bigint, OUT jit_generation_time double precision, OUT jit_inlining_count bigint, OUT jit_inlining_time double precision, OUT jit_optimization_count bigint, OUT jit_optimization_time double precision, OUT jit_emission_count bigint, OUT jit_emission_time double precision) TO postgres WITH GRANT OPTION; -GRANT ALL ON FUNCTION extensions.pg_stat_statements(showtext boolean, OUT userid oid, OUT dbid oid, OUT toplevel boolean, OUT queryid bigint, OUT query text, OUT plans bigint, OUT total_plan_time double precision, OUT min_plan_time double precision, OUT max_plan_time double precision, OUT mean_plan_time double precision, OUT stddev_plan_time double precision, OUT calls bigint, OUT total_exec_time double precision, OUT min_exec_time double precision, OUT max_exec_time double precision, OUT mean_exec_time double precision, OUT stddev_exec_time double precision, OUT rows bigint, OUT shared_blks_hit bigint, OUT shared_blks_read bigint, OUT shared_blks_dirtied bigint, OUT shared_blks_written bigint, OUT local_blks_hit bigint, OUT local_blks_read bigint, OUT local_blks_dirtied bigint, OUT local_blks_written bigint, OUT temp_blks_read bigint, OUT temp_blks_written bigint, OUT blk_read_time double precision, OUT blk_write_time double precision, OUT temp_blk_read_time double precision, OUT temp_blk_write_time double precision, OUT wal_records bigint, OUT wal_fpi bigint, OUT wal_bytes numeric, OUT jit_functions bigint, OUT jit_generation_time double precision, OUT jit_inlining_count bigint, OUT jit_inlining_time double precision, OUT jit_optimization_count bigint, OUT jit_optimization_time double precision, OUT jit_emission_count bigint, OUT jit_emission_time double precision) TO dashboard_user; - - --- --- Name: FUNCTION pg_stat_statements_info(OUT dealloc bigint, OUT stats_reset timestamp with time zone); Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON FUNCTION extensions.pg_stat_statements_info(OUT dealloc bigint, OUT stats_reset timestamp with time zone) FROM postgres; -GRANT ALL ON FUNCTION extensions.pg_stat_statements_info(OUT dealloc bigint, OUT stats_reset timestamp with time zone) TO postgres WITH GRANT OPTION; -GRANT ALL ON FUNCTION extensions.pg_stat_statements_info(OUT dealloc bigint, OUT stats_reset timestamp with time zone) TO dashboard_user; - - --- --- Name: FUNCTION pg_stat_statements_reset(userid oid, dbid oid, queryid bigint); Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON FUNCTION extensions.pg_stat_statements_reset(userid oid, dbid oid, queryid bigint) FROM postgres; -GRANT ALL ON FUNCTION extensions.pg_stat_statements_reset(userid oid, dbid oid, queryid bigint) TO postgres WITH GRANT OPTION; -GRANT ALL ON FUNCTION extensions.pg_stat_statements_reset(userid oid, dbid oid, queryid bigint) TO dashboard_user; - - --- --- Name: FUNCTION pgp_armor_headers(text, OUT key text, OUT value text); Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON FUNCTION extensions.pgp_armor_headers(text, OUT key text, OUT value text) FROM postgres; -GRANT ALL ON FUNCTION extensions.pgp_armor_headers(text, OUT key text, OUT value text) TO postgres WITH GRANT OPTION; -GRANT ALL ON FUNCTION extensions.pgp_armor_headers(text, OUT key text, OUT value text) TO dashboard_user; - - --- --- Name: FUNCTION pgp_key_id(bytea); Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON FUNCTION extensions.pgp_key_id(bytea) FROM postgres; -GRANT ALL ON FUNCTION extensions.pgp_key_id(bytea) TO postgres WITH GRANT OPTION; -GRANT ALL ON FUNCTION extensions.pgp_key_id(bytea) TO dashboard_user; - - --- --- Name: FUNCTION pgp_pub_decrypt(bytea, bytea); Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON FUNCTION extensions.pgp_pub_decrypt(bytea, bytea) FROM postgres; -GRANT ALL ON FUNCTION extensions.pgp_pub_decrypt(bytea, bytea) TO postgres WITH GRANT OPTION; -GRANT ALL ON FUNCTION extensions.pgp_pub_decrypt(bytea, bytea) TO dashboard_user; - - --- --- Name: FUNCTION pgp_pub_decrypt(bytea, bytea, text); Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON FUNCTION extensions.pgp_pub_decrypt(bytea, bytea, text) FROM postgres; -GRANT ALL ON FUNCTION extensions.pgp_pub_decrypt(bytea, bytea, text) TO postgres WITH GRANT OPTION; -GRANT ALL ON FUNCTION extensions.pgp_pub_decrypt(bytea, bytea, text) TO dashboard_user; - - --- --- Name: FUNCTION pgp_pub_decrypt(bytea, bytea, text, text); Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON FUNCTION extensions.pgp_pub_decrypt(bytea, bytea, text, text) FROM postgres; -GRANT ALL ON FUNCTION extensions.pgp_pub_decrypt(bytea, bytea, text, text) TO postgres WITH GRANT OPTION; -GRANT ALL ON FUNCTION extensions.pgp_pub_decrypt(bytea, bytea, text, text) TO dashboard_user; - - --- --- Name: FUNCTION pgp_pub_decrypt_bytea(bytea, bytea); Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON FUNCTION extensions.pgp_pub_decrypt_bytea(bytea, bytea) FROM postgres; -GRANT ALL ON FUNCTION extensions.pgp_pub_decrypt_bytea(bytea, bytea) TO postgres WITH GRANT OPTION; -GRANT ALL ON FUNCTION extensions.pgp_pub_decrypt_bytea(bytea, bytea) TO dashboard_user; - - --- --- Name: FUNCTION pgp_pub_decrypt_bytea(bytea, bytea, text); Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON FUNCTION extensions.pgp_pub_decrypt_bytea(bytea, bytea, text) FROM postgres; -GRANT ALL ON FUNCTION extensions.pgp_pub_decrypt_bytea(bytea, bytea, text) TO postgres WITH GRANT OPTION; -GRANT ALL ON FUNCTION extensions.pgp_pub_decrypt_bytea(bytea, bytea, text) TO dashboard_user; - - --- --- Name: FUNCTION pgp_pub_decrypt_bytea(bytea, bytea, text, text); Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON FUNCTION extensions.pgp_pub_decrypt_bytea(bytea, bytea, text, text) FROM postgres; -GRANT ALL ON FUNCTION extensions.pgp_pub_decrypt_bytea(bytea, bytea, text, text) TO postgres WITH GRANT OPTION; -GRANT ALL ON FUNCTION extensions.pgp_pub_decrypt_bytea(bytea, bytea, text, text) TO dashboard_user; - - --- --- Name: FUNCTION pgp_pub_encrypt(text, bytea); Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON FUNCTION extensions.pgp_pub_encrypt(text, bytea) FROM postgres; -GRANT ALL ON FUNCTION extensions.pgp_pub_encrypt(text, bytea) TO postgres WITH GRANT OPTION; -GRANT ALL ON FUNCTION extensions.pgp_pub_encrypt(text, bytea) TO dashboard_user; - - --- --- Name: FUNCTION pgp_pub_encrypt(text, bytea, text); Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON FUNCTION extensions.pgp_pub_encrypt(text, bytea, text) FROM postgres; -GRANT ALL ON FUNCTION extensions.pgp_pub_encrypt(text, bytea, text) TO postgres WITH GRANT OPTION; -GRANT ALL ON FUNCTION extensions.pgp_pub_encrypt(text, bytea, text) TO dashboard_user; - - --- --- Name: FUNCTION pgp_pub_encrypt_bytea(bytea, bytea); Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON FUNCTION extensions.pgp_pub_encrypt_bytea(bytea, bytea) FROM postgres; -GRANT ALL ON FUNCTION extensions.pgp_pub_encrypt_bytea(bytea, bytea) TO postgres WITH GRANT OPTION; -GRANT ALL ON FUNCTION extensions.pgp_pub_encrypt_bytea(bytea, bytea) TO dashboard_user; - - --- --- Name: FUNCTION pgp_pub_encrypt_bytea(bytea, bytea, text); Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON FUNCTION extensions.pgp_pub_encrypt_bytea(bytea, bytea, text) FROM postgres; -GRANT ALL ON FUNCTION extensions.pgp_pub_encrypt_bytea(bytea, bytea, text) TO postgres WITH GRANT OPTION; -GRANT ALL ON FUNCTION extensions.pgp_pub_encrypt_bytea(bytea, bytea, text) TO dashboard_user; - - --- --- Name: FUNCTION pgp_sym_decrypt(bytea, text); Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON FUNCTION extensions.pgp_sym_decrypt(bytea, text) FROM postgres; -GRANT ALL ON FUNCTION extensions.pgp_sym_decrypt(bytea, text) TO postgres WITH GRANT OPTION; -GRANT ALL ON FUNCTION extensions.pgp_sym_decrypt(bytea, text) TO dashboard_user; - - --- --- Name: FUNCTION pgp_sym_decrypt(bytea, text, text); Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON FUNCTION extensions.pgp_sym_decrypt(bytea, text, text) FROM postgres; -GRANT ALL ON FUNCTION extensions.pgp_sym_decrypt(bytea, text, text) TO postgres WITH GRANT OPTION; -GRANT ALL ON FUNCTION extensions.pgp_sym_decrypt(bytea, text, text) TO dashboard_user; - - --- --- Name: FUNCTION pgp_sym_decrypt_bytea(bytea, text); Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON FUNCTION extensions.pgp_sym_decrypt_bytea(bytea, text) FROM postgres; -GRANT ALL ON FUNCTION extensions.pgp_sym_decrypt_bytea(bytea, text) TO postgres WITH GRANT OPTION; -GRANT ALL ON FUNCTION extensions.pgp_sym_decrypt_bytea(bytea, text) TO dashboard_user; - - --- --- Name: FUNCTION pgp_sym_decrypt_bytea(bytea, text, text); Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON FUNCTION extensions.pgp_sym_decrypt_bytea(bytea, text, text) FROM postgres; -GRANT ALL ON FUNCTION extensions.pgp_sym_decrypt_bytea(bytea, text, text) TO postgres WITH GRANT OPTION; -GRANT ALL ON FUNCTION extensions.pgp_sym_decrypt_bytea(bytea, text, text) TO dashboard_user; - - --- --- Name: FUNCTION pgp_sym_encrypt(text, text); Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON FUNCTION extensions.pgp_sym_encrypt(text, text) FROM postgres; -GRANT ALL ON FUNCTION extensions.pgp_sym_encrypt(text, text) TO postgres WITH GRANT OPTION; -GRANT ALL ON FUNCTION extensions.pgp_sym_encrypt(text, text) TO dashboard_user; - - --- --- Name: FUNCTION pgp_sym_encrypt(text, text, text); Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON FUNCTION extensions.pgp_sym_encrypt(text, text, text) FROM postgres; -GRANT ALL ON FUNCTION extensions.pgp_sym_encrypt(text, text, text) TO postgres WITH GRANT OPTION; -GRANT ALL ON FUNCTION extensions.pgp_sym_encrypt(text, text, text) TO dashboard_user; - - --- --- Name: FUNCTION pgp_sym_encrypt_bytea(bytea, text); Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON FUNCTION extensions.pgp_sym_encrypt_bytea(bytea, text) FROM postgres; -GRANT ALL ON FUNCTION extensions.pgp_sym_encrypt_bytea(bytea, text) TO postgres WITH GRANT OPTION; -GRANT ALL ON FUNCTION extensions.pgp_sym_encrypt_bytea(bytea, text) TO dashboard_user; - - --- --- Name: FUNCTION pgp_sym_encrypt_bytea(bytea, text, text); Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON FUNCTION extensions.pgp_sym_encrypt_bytea(bytea, text, text) FROM postgres; -GRANT ALL ON FUNCTION extensions.pgp_sym_encrypt_bytea(bytea, text, text) TO postgres WITH GRANT OPTION; -GRANT ALL ON FUNCTION extensions.pgp_sym_encrypt_bytea(bytea, text, text) TO dashboard_user; - - --- --- Name: FUNCTION pgrst_ddl_watch(); Type: ACL; Schema: extensions; Owner: supabase_admin --- - -GRANT ALL ON FUNCTION extensions.pgrst_ddl_watch() TO postgres WITH GRANT OPTION; - - --- --- Name: FUNCTION pgrst_drop_watch(); Type: ACL; Schema: extensions; Owner: supabase_admin --- - -GRANT ALL ON FUNCTION extensions.pgrst_drop_watch() TO postgres WITH GRANT OPTION; - - --- --- Name: FUNCTION set_graphql_placeholder(); Type: ACL; Schema: extensions; Owner: supabase_admin --- - -GRANT ALL ON FUNCTION extensions.set_graphql_placeholder() TO postgres WITH GRANT OPTION; - - --- --- Name: FUNCTION sign(payload json, secret text, algorithm text); Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON FUNCTION extensions.sign(payload json, secret text, algorithm text) FROM postgres; -GRANT ALL ON FUNCTION extensions.sign(payload json, secret text, algorithm text) TO postgres WITH GRANT OPTION; -GRANT ALL ON FUNCTION extensions.sign(payload json, secret text, algorithm text) TO dashboard_user; - - --- --- Name: FUNCTION try_cast_double(inp text); Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON FUNCTION extensions.try_cast_double(inp text) FROM postgres; -GRANT ALL ON FUNCTION extensions.try_cast_double(inp text) TO postgres WITH GRANT OPTION; -GRANT ALL ON FUNCTION extensions.try_cast_double(inp text) TO dashboard_user; - - --- --- Name: FUNCTION url_decode(data text); Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON FUNCTION extensions.url_decode(data text) FROM postgres; -GRANT ALL ON FUNCTION extensions.url_decode(data text) TO postgres WITH GRANT OPTION; -GRANT ALL ON FUNCTION extensions.url_decode(data text) TO dashboard_user; - - --- --- Name: FUNCTION url_encode(data bytea); Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON FUNCTION extensions.url_encode(data bytea) FROM postgres; -GRANT ALL ON FUNCTION extensions.url_encode(data bytea) TO postgres WITH GRANT OPTION; -GRANT ALL ON FUNCTION extensions.url_encode(data bytea) TO dashboard_user; - - --- --- Name: FUNCTION uuid_generate_v1(); Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON FUNCTION extensions.uuid_generate_v1() FROM postgres; -GRANT ALL ON FUNCTION extensions.uuid_generate_v1() TO postgres WITH GRANT OPTION; -GRANT ALL ON FUNCTION extensions.uuid_generate_v1() TO dashboard_user; - - --- --- Name: FUNCTION uuid_generate_v1mc(); Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON FUNCTION extensions.uuid_generate_v1mc() FROM postgres; -GRANT ALL ON FUNCTION extensions.uuid_generate_v1mc() TO postgres WITH GRANT OPTION; -GRANT ALL ON FUNCTION extensions.uuid_generate_v1mc() TO dashboard_user; - - --- --- Name: FUNCTION uuid_generate_v3(namespace uuid, name text); Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON FUNCTION extensions.uuid_generate_v3(namespace uuid, name text) FROM postgres; -GRANT ALL ON FUNCTION extensions.uuid_generate_v3(namespace uuid, name text) TO postgres WITH GRANT OPTION; -GRANT ALL ON FUNCTION extensions.uuid_generate_v3(namespace uuid, name text) TO dashboard_user; - - --- --- Name: FUNCTION uuid_generate_v4(); Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON FUNCTION extensions.uuid_generate_v4() FROM postgres; -GRANT ALL ON FUNCTION extensions.uuid_generate_v4() TO postgres WITH GRANT OPTION; -GRANT ALL ON FUNCTION extensions.uuid_generate_v4() TO dashboard_user; - - --- --- Name: FUNCTION uuid_generate_v5(namespace uuid, name text); Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON FUNCTION extensions.uuid_generate_v5(namespace uuid, name text) FROM postgres; -GRANT ALL ON FUNCTION extensions.uuid_generate_v5(namespace uuid, name text) TO postgres WITH GRANT OPTION; -GRANT ALL ON FUNCTION extensions.uuid_generate_v5(namespace uuid, name text) TO dashboard_user; - - --- --- Name: FUNCTION uuid_nil(); Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON FUNCTION extensions.uuid_nil() FROM postgres; -GRANT ALL ON FUNCTION extensions.uuid_nil() TO postgres WITH GRANT OPTION; -GRANT ALL ON FUNCTION extensions.uuid_nil() TO dashboard_user; - - --- --- Name: FUNCTION uuid_ns_dns(); Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON FUNCTION extensions.uuid_ns_dns() FROM postgres; -GRANT ALL ON FUNCTION extensions.uuid_ns_dns() TO postgres WITH GRANT OPTION; -GRANT ALL ON FUNCTION extensions.uuid_ns_dns() TO dashboard_user; - - --- --- Name: FUNCTION uuid_ns_oid(); Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON FUNCTION extensions.uuid_ns_oid() FROM postgres; -GRANT ALL ON FUNCTION extensions.uuid_ns_oid() TO postgres WITH GRANT OPTION; -GRANT ALL ON FUNCTION extensions.uuid_ns_oid() TO dashboard_user; - - --- --- Name: FUNCTION uuid_ns_url(); Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON FUNCTION extensions.uuid_ns_url() FROM postgres; -GRANT ALL ON FUNCTION extensions.uuid_ns_url() TO postgres WITH GRANT OPTION; -GRANT ALL ON FUNCTION extensions.uuid_ns_url() TO dashboard_user; - - --- --- Name: FUNCTION uuid_ns_x500(); Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON FUNCTION extensions.uuid_ns_x500() FROM postgres; -GRANT ALL ON FUNCTION extensions.uuid_ns_x500() TO postgres WITH GRANT OPTION; -GRANT ALL ON FUNCTION extensions.uuid_ns_x500() TO dashboard_user; - - --- --- Name: FUNCTION verify(token text, secret text, algorithm text); Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON FUNCTION extensions.verify(token text, secret text, algorithm text) FROM postgres; -GRANT ALL ON FUNCTION extensions.verify(token text, secret text, algorithm text) TO postgres WITH GRANT OPTION; -GRANT ALL ON FUNCTION extensions.verify(token text, secret text, algorithm text) TO dashboard_user; - - --- --- Name: FUNCTION comment_directive(comment_ text); Type: ACL; Schema: graphql; Owner: supabase_admin --- - -GRANT ALL ON FUNCTION graphql.comment_directive(comment_ text) TO postgres; -GRANT ALL ON FUNCTION graphql.comment_directive(comment_ text) TO anon; -GRANT ALL ON FUNCTION graphql.comment_directive(comment_ text) TO authenticated; -GRANT ALL ON FUNCTION graphql.comment_directive(comment_ text) TO service_role; - - --- --- Name: FUNCTION exception(message text); Type: ACL; Schema: graphql; Owner: supabase_admin --- - -GRANT ALL ON FUNCTION graphql.exception(message text) TO postgres; -GRANT ALL ON FUNCTION graphql.exception(message text) TO anon; -GRANT ALL ON FUNCTION graphql.exception(message text) TO authenticated; -GRANT ALL ON FUNCTION graphql.exception(message text) TO service_role; - - --- --- Name: FUNCTION get_schema_version(); Type: ACL; Schema: graphql; Owner: supabase_admin --- - -GRANT ALL ON FUNCTION graphql.get_schema_version() TO postgres; -GRANT ALL ON FUNCTION graphql.get_schema_version() TO anon; -GRANT ALL ON FUNCTION graphql.get_schema_version() TO authenticated; -GRANT ALL ON FUNCTION graphql.get_schema_version() TO service_role; - - --- --- Name: FUNCTION increment_schema_version(); Type: ACL; Schema: graphql; Owner: supabase_admin --- - -GRANT ALL ON FUNCTION graphql.increment_schema_version() TO postgres; -GRANT ALL ON FUNCTION graphql.increment_schema_version() TO anon; -GRANT ALL ON FUNCTION graphql.increment_schema_version() TO authenticated; -GRANT ALL ON FUNCTION graphql.increment_schema_version() TO service_role; - - --- --- Name: FUNCTION graphql("operationName" text, query text, variables jsonb, extensions jsonb); Type: ACL; Schema: graphql_public; Owner: supabase_admin --- - -GRANT ALL ON FUNCTION graphql_public.graphql("operationName" text, query text, variables jsonb, extensions jsonb) TO postgres; -GRANT ALL ON FUNCTION graphql_public.graphql("operationName" text, query text, variables jsonb, extensions jsonb) TO anon; -GRANT ALL ON FUNCTION graphql_public.graphql("operationName" text, query text, variables jsonb, extensions jsonb) TO authenticated; -GRANT ALL ON FUNCTION graphql_public.graphql("operationName" text, query text, variables jsonb, extensions jsonb) TO service_role; - - --- --- Name: FUNCTION get_auth(p_usename text); Type: ACL; Schema: pgbouncer; Owner: postgres --- - -REVOKE ALL ON FUNCTION pgbouncer.get_auth(p_usename text) FROM PUBLIC; -GRANT ALL ON FUNCTION pgbouncer.get_auth(p_usename text) TO pgbouncer; - - --- --- Name: FUNCTION crypto_aead_det_decrypt(message bytea, additional bytea, key_uuid uuid, nonce bytea); Type: ACL; Schema: pgsodium; Owner: pgsodium_keymaker --- - -GRANT ALL ON FUNCTION pgsodium.crypto_aead_det_decrypt(message bytea, additional bytea, key_uuid uuid, nonce bytea) TO service_role; - - --- --- Name: FUNCTION crypto_aead_det_encrypt(message bytea, additional bytea, key_uuid uuid, nonce bytea); Type: ACL; Schema: pgsodium; Owner: pgsodium_keymaker --- - -GRANT ALL ON FUNCTION pgsodium.crypto_aead_det_encrypt(message bytea, additional bytea, key_uuid uuid, nonce bytea) TO service_role; - - --- --- Name: FUNCTION crypto_aead_det_keygen(); Type: ACL; Schema: pgsodium; Owner: supabase_admin --- - -GRANT ALL ON FUNCTION pgsodium.crypto_aead_det_keygen() TO service_role; - - --- --- Name: FUNCTION extension(name text); Type: ACL; Schema: storage; Owner: supabase_storage_admin --- - -GRANT ALL ON FUNCTION storage.extension(name text) TO anon; -GRANT ALL ON FUNCTION storage.extension(name text) TO authenticated; -GRANT ALL ON FUNCTION storage.extension(name text) TO service_role; -GRANT ALL ON FUNCTION storage.extension(name text) TO dashboard_user; -GRANT ALL ON FUNCTION storage.extension(name text) TO postgres; - - --- --- Name: FUNCTION filename(name text); Type: ACL; Schema: storage; Owner: supabase_storage_admin --- - -GRANT ALL ON FUNCTION storage.filename(name text) TO anon; -GRANT ALL ON FUNCTION storage.filename(name text) TO authenticated; -GRANT ALL ON FUNCTION storage.filename(name text) TO service_role; -GRANT ALL ON FUNCTION storage.filename(name text) TO dashboard_user; -GRANT ALL ON FUNCTION storage.filename(name text) TO postgres; - - --- --- Name: FUNCTION foldername(name text); Type: ACL; Schema: storage; Owner: supabase_storage_admin --- - -GRANT ALL ON FUNCTION storage.foldername(name text) TO anon; -GRANT ALL ON FUNCTION storage.foldername(name text) TO authenticated; -GRANT ALL ON FUNCTION storage.foldername(name text) TO service_role; -GRANT ALL ON FUNCTION storage.foldername(name text) TO dashboard_user; -GRANT ALL ON FUNCTION storage.foldername(name text) TO postgres; - - --- --- Name: TABLE audit_log_entries; Type: ACL; Schema: auth; Owner: supabase_auth_admin --- - -GRANT ALL ON TABLE auth.audit_log_entries TO dashboard_user; -GRANT ALL ON TABLE auth.audit_log_entries TO postgres; - - --- --- Name: TABLE flow_state; Type: ACL; Schema: auth; Owner: supabase_auth_admin --- - -GRANT ALL ON TABLE auth.flow_state TO postgres; -GRANT ALL ON TABLE auth.flow_state TO dashboard_user; - - --- --- Name: TABLE identities; Type: ACL; Schema: auth; Owner: supabase_auth_admin --- - -GRANT ALL ON TABLE auth.identities TO postgres; -GRANT ALL ON TABLE auth.identities TO dashboard_user; - - --- --- Name: TABLE instances; Type: ACL; Schema: auth; Owner: supabase_auth_admin --- - -GRANT ALL ON TABLE auth.instances TO dashboard_user; -GRANT ALL ON TABLE auth.instances TO postgres; - - --- --- Name: TABLE mfa_amr_claims; Type: ACL; Schema: auth; Owner: supabase_auth_admin --- - -GRANT ALL ON TABLE auth.mfa_amr_claims TO postgres; -GRANT ALL ON TABLE auth.mfa_amr_claims TO dashboard_user; - - --- --- Name: TABLE mfa_challenges; Type: ACL; Schema: auth; Owner: supabase_auth_admin --- - -GRANT ALL ON TABLE auth.mfa_challenges TO postgres; -GRANT ALL ON TABLE auth.mfa_challenges TO dashboard_user; - - --- --- Name: TABLE mfa_factors; Type: ACL; Schema: auth; Owner: supabase_auth_admin --- - -GRANT ALL ON TABLE auth.mfa_factors TO postgres; -GRANT ALL ON TABLE auth.mfa_factors TO dashboard_user; - - --- --- Name: TABLE refresh_tokens; Type: ACL; Schema: auth; Owner: supabase_auth_admin --- - -GRANT ALL ON TABLE auth.refresh_tokens TO dashboard_user; -GRANT ALL ON TABLE auth.refresh_tokens TO postgres; - - --- --- Name: SEQUENCE refresh_tokens_id_seq; Type: ACL; Schema: auth; Owner: supabase_auth_admin --- - -GRANT ALL ON SEQUENCE auth.refresh_tokens_id_seq TO dashboard_user; -GRANT ALL ON SEQUENCE auth.refresh_tokens_id_seq TO postgres; - - --- --- Name: TABLE saml_providers; Type: ACL; Schema: auth; Owner: supabase_auth_admin --- - -GRANT ALL ON TABLE auth.saml_providers TO postgres; -GRANT ALL ON TABLE auth.saml_providers TO dashboard_user; - - --- --- Name: TABLE saml_relay_states; Type: ACL; Schema: auth; Owner: supabase_auth_admin --- - -GRANT ALL ON TABLE auth.saml_relay_states TO postgres; -GRANT ALL ON TABLE auth.saml_relay_states TO dashboard_user; - - --- --- Name: TABLE schema_migrations; Type: ACL; Schema: auth; Owner: supabase_auth_admin --- - -GRANT ALL ON TABLE auth.schema_migrations TO dashboard_user; -GRANT ALL ON TABLE auth.schema_migrations TO postgres; - - --- --- Name: TABLE sessions; Type: ACL; Schema: auth; Owner: supabase_auth_admin --- - -GRANT ALL ON TABLE auth.sessions TO postgres; -GRANT ALL ON TABLE auth.sessions TO dashboard_user; - - --- --- Name: TABLE sso_domains; Type: ACL; Schema: auth; Owner: supabase_auth_admin --- - -GRANT ALL ON TABLE auth.sso_domains TO postgres; -GRANT ALL ON TABLE auth.sso_domains TO dashboard_user; - - --- --- Name: TABLE sso_providers; Type: ACL; Schema: auth; Owner: supabase_auth_admin --- - -GRANT ALL ON TABLE auth.sso_providers TO postgres; -GRANT ALL ON TABLE auth.sso_providers TO dashboard_user; - - --- --- Name: TABLE users; Type: ACL; Schema: auth; Owner: supabase_auth_admin --- - -GRANT ALL ON TABLE auth.users TO dashboard_user; -GRANT ALL ON TABLE auth.users TO postgres; - - --- --- Name: TABLE pg_stat_statements; Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON TABLE extensions.pg_stat_statements FROM postgres; -GRANT ALL ON TABLE extensions.pg_stat_statements TO postgres WITH GRANT OPTION; -GRANT ALL ON TABLE extensions.pg_stat_statements TO dashboard_user; - - --- --- Name: TABLE pg_stat_statements_info; Type: ACL; Schema: extensions; Owner: postgres --- - -REVOKE ALL ON TABLE extensions.pg_stat_statements_info FROM postgres; -GRANT ALL ON TABLE extensions.pg_stat_statements_info TO postgres WITH GRANT OPTION; -GRANT ALL ON TABLE extensions.pg_stat_statements_info TO dashboard_user; - - --- --- Name: SEQUENCE seq_schema_version; Type: ACL; Schema: graphql; Owner: supabase_admin --- - -GRANT ALL ON SEQUENCE graphql.seq_schema_version TO postgres; -GRANT ALL ON SEQUENCE graphql.seq_schema_version TO anon; -GRANT ALL ON SEQUENCE graphql.seq_schema_version TO authenticated; -GRANT ALL ON SEQUENCE graphql.seq_schema_version TO service_role; - - --- --- Name: TABLE decrypted_key; Type: ACL; Schema: pgsodium; Owner: supabase_admin --- - -GRANT ALL ON TABLE pgsodium.decrypted_key TO pgsodium_keyholder; - - --- --- Name: TABLE masking_rule; Type: ACL; Schema: pgsodium; Owner: supabase_admin --- - -GRANT ALL ON TABLE pgsodium.masking_rule TO pgsodium_keyholder; - - --- --- Name: TABLE mask_columns; Type: ACL; Schema: pgsodium; Owner: supabase_admin --- - -GRANT ALL ON TABLE pgsodium.mask_columns TO pgsodium_keyholder; - - --- --- Name: TABLE "Client"; Type: ACL; Schema: public; Owner: postgres --- - -GRANT ALL ON TABLE public."Client" TO anon; -GRANT ALL ON TABLE public."Client" TO authenticated; -GRANT ALL ON TABLE public."Client" TO service_role; - - --- --- Name: TABLE "Prompt"; Type: ACL; Schema: public; Owner: postgres --- - -GRANT ALL ON TABLE public."Prompt" TO anon; -GRANT ALL ON TABLE public."Prompt" TO authenticated; -GRANT ALL ON TABLE public."Prompt" TO service_role; - - --- --- Name: SEQUENCE "Prompt_id_seq"; Type: ACL; Schema: public; Owner: postgres --- - -GRANT ALL ON SEQUENCE public."Prompt_id_seq" TO anon; -GRANT ALL ON SEQUENCE public."Prompt_id_seq" TO authenticated; -GRANT ALL ON SEQUENCE public."Prompt_id_seq" TO service_role; - - --- --- Name: TABLE "Reaction"; Type: ACL; Schema: public; Owner: postgres --- - -GRANT ALL ON TABLE public."Reaction" TO anon; -GRANT ALL ON TABLE public."Reaction" TO authenticated; -GRANT ALL ON TABLE public."Reaction" TO service_role; - - --- --- Name: TABLE "Site"; Type: ACL; Schema: public; Owner: postgres --- - -GRANT ALL ON TABLE public."Site" TO anon; -GRANT ALL ON TABLE public."Site" TO authenticated; -GRANT ALL ON TABLE public."Site" TO service_role; - - --- --- Name: SEQUENCE "Site_id_seq"; Type: ACL; Schema: public; Owner: postgres --- - -GRANT ALL ON SEQUENCE public."Site_id_seq" TO anon; -GRANT ALL ON SEQUENCE public."Site_id_seq" TO authenticated; -GRANT ALL ON SEQUENCE public."Site_id_seq" TO service_role; - - --- --- Name: TABLE "SupportRequest"; Type: ACL; Schema: public; Owner: postgres --- - -GRANT ALL ON TABLE public."SupportRequest" TO anon; -GRANT ALL ON TABLE public."SupportRequest" TO authenticated; -GRANT ALL ON TABLE public."SupportRequest" TO service_role; - - --- --- Name: SEQUENCE "SupportRequest_id_seq"; Type: ACL; Schema: public; Owner: postgres --- - -GRANT ALL ON SEQUENCE public."SupportRequest_id_seq" TO anon; -GRANT ALL ON SEQUENCE public."SupportRequest_id_seq" TO authenticated; -GRANT ALL ON SEQUENCE public."SupportRequest_id_seq" TO service_role; - - --- --- Name: TABLE "Wallpaper"; Type: ACL; Schema: public; Owner: postgres --- - -GRANT ALL ON TABLE public."Wallpaper" TO anon; -GRANT ALL ON TABLE public."Wallpaper" TO authenticated; -GRANT ALL ON TABLE public."Wallpaper" TO service_role; - - --- --- Name: TABLE "Wallpaper_random"; Type: ACL; Schema: public; Owner: postgres --- - -GRANT ALL ON TABLE public."Wallpaper_random" TO anon; -GRANT ALL ON TABLE public."Wallpaper_random" TO authenticated; -GRANT ALL ON TABLE public."Wallpaper_random" TO service_role; - - --- --- Name: TABLE buckets; Type: ACL; Schema: storage; Owner: supabase_storage_admin --- - -GRANT ALL ON TABLE storage.buckets TO anon; -GRANT ALL ON TABLE storage.buckets TO authenticated; -GRANT ALL ON TABLE storage.buckets TO service_role; -GRANT ALL ON TABLE storage.buckets TO postgres; - - --- --- Name: TABLE migrations; Type: ACL; Schema: storage; Owner: supabase_storage_admin --- - -GRANT ALL ON TABLE storage.migrations TO anon; -GRANT ALL ON TABLE storage.migrations TO authenticated; -GRANT ALL ON TABLE storage.migrations TO service_role; -GRANT ALL ON TABLE storage.migrations TO postgres; - - --- --- Name: TABLE objects; Type: ACL; Schema: storage; Owner: supabase_storage_admin --- - -GRANT ALL ON TABLE storage.objects TO anon; -GRANT ALL ON TABLE storage.objects TO authenticated; -GRANT ALL ON TABLE storage.objects TO service_role; -GRANT ALL ON TABLE storage.objects TO postgres; - - --- --- Name: DEFAULT PRIVILEGES FOR SEQUENCES; Type: DEFAULT ACL; Schema: auth; Owner: supabase_auth_admin --- - -ALTER DEFAULT PRIVILEGES FOR ROLE supabase_auth_admin IN SCHEMA auth GRANT ALL ON SEQUENCES TO postgres; -ALTER DEFAULT PRIVILEGES FOR ROLE supabase_auth_admin IN SCHEMA auth GRANT ALL ON SEQUENCES TO dashboard_user; - - --- --- Name: DEFAULT PRIVILEGES FOR FUNCTIONS; Type: DEFAULT ACL; Schema: auth; Owner: supabase_auth_admin --- - -ALTER DEFAULT PRIVILEGES FOR ROLE supabase_auth_admin IN SCHEMA auth GRANT ALL ON FUNCTIONS TO postgres; -ALTER DEFAULT PRIVILEGES FOR ROLE supabase_auth_admin IN SCHEMA auth GRANT ALL ON FUNCTIONS TO dashboard_user; - - --- --- Name: DEFAULT PRIVILEGES FOR TABLES; Type: DEFAULT ACL; Schema: auth; Owner: supabase_auth_admin --- - -ALTER DEFAULT PRIVILEGES FOR ROLE supabase_auth_admin IN SCHEMA auth GRANT ALL ON TABLES TO postgres; -ALTER DEFAULT PRIVILEGES FOR ROLE supabase_auth_admin IN SCHEMA auth GRANT ALL ON TABLES TO dashboard_user; - - --- --- Name: DEFAULT PRIVILEGES FOR SEQUENCES; Type: DEFAULT ACL; Schema: extensions; Owner: supabase_admin --- - -ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA extensions GRANT ALL ON SEQUENCES TO postgres WITH GRANT OPTION; - - --- --- Name: DEFAULT PRIVILEGES FOR FUNCTIONS; Type: DEFAULT ACL; Schema: extensions; Owner: supabase_admin --- - -ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA extensions GRANT ALL ON FUNCTIONS TO postgres WITH GRANT OPTION; - - --- --- Name: DEFAULT PRIVILEGES FOR TABLES; Type: DEFAULT ACL; Schema: extensions; Owner: supabase_admin --- - -ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA extensions GRANT ALL ON TABLES TO postgres WITH GRANT OPTION; - - --- --- Name: DEFAULT PRIVILEGES FOR SEQUENCES; Type: DEFAULT ACL; Schema: graphql; Owner: supabase_admin --- - -ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql GRANT ALL ON SEQUENCES TO postgres; -ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql GRANT ALL ON SEQUENCES TO anon; -ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql GRANT ALL ON SEQUENCES TO authenticated; -ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql GRANT ALL ON SEQUENCES TO service_role; - - --- --- Name: DEFAULT PRIVILEGES FOR FUNCTIONS; Type: DEFAULT ACL; Schema: graphql; Owner: supabase_admin --- - -ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql GRANT ALL ON FUNCTIONS TO postgres; -ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql GRANT ALL ON FUNCTIONS TO anon; -ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql GRANT ALL ON FUNCTIONS TO authenticated; -ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql GRANT ALL ON FUNCTIONS TO service_role; - - --- --- Name: DEFAULT PRIVILEGES FOR TABLES; Type: DEFAULT ACL; Schema: graphql; Owner: supabase_admin --- - -ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql GRANT ALL ON TABLES TO postgres; -ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql GRANT ALL ON TABLES TO anon; -ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql GRANT ALL ON TABLES TO authenticated; -ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql GRANT ALL ON TABLES TO service_role; - - --- --- Name: DEFAULT PRIVILEGES FOR SEQUENCES; Type: DEFAULT ACL; Schema: graphql_public; Owner: supabase_admin --- - -ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql_public GRANT ALL ON SEQUENCES TO postgres; -ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql_public GRANT ALL ON SEQUENCES TO anon; -ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql_public GRANT ALL ON SEQUENCES TO authenticated; -ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql_public GRANT ALL ON SEQUENCES TO service_role; - - --- --- Name: DEFAULT PRIVILEGES FOR FUNCTIONS; Type: DEFAULT ACL; Schema: graphql_public; Owner: supabase_admin --- - -ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql_public GRANT ALL ON FUNCTIONS TO postgres; -ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql_public GRANT ALL ON FUNCTIONS TO anon; -ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql_public GRANT ALL ON FUNCTIONS TO authenticated; -ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql_public GRANT ALL ON FUNCTIONS TO service_role; - - --- --- Name: DEFAULT PRIVILEGES FOR TABLES; Type: DEFAULT ACL; Schema: graphql_public; Owner: supabase_admin --- - -ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql_public GRANT ALL ON TABLES TO postgres; -ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql_public GRANT ALL ON TABLES TO anon; -ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql_public GRANT ALL ON TABLES TO authenticated; -ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql_public GRANT ALL ON TABLES TO service_role; - - --- --- Name: DEFAULT PRIVILEGES FOR SEQUENCES; Type: DEFAULT ACL; Schema: pgsodium; Owner: supabase_admin --- - -ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA pgsodium GRANT ALL ON SEQUENCES TO pgsodium_keyholder; - - --- --- Name: DEFAULT PRIVILEGES FOR TABLES; Type: DEFAULT ACL; Schema: pgsodium; Owner: supabase_admin --- - -ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA pgsodium GRANT ALL ON TABLES TO pgsodium_keyholder; - - --- --- Name: DEFAULT PRIVILEGES FOR SEQUENCES; Type: DEFAULT ACL; Schema: pgsodium_masks; Owner: supabase_admin --- - -ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA pgsodium_masks GRANT ALL ON SEQUENCES TO pgsodium_keyiduser; - - --- --- Name: DEFAULT PRIVILEGES FOR FUNCTIONS; Type: DEFAULT ACL; Schema: pgsodium_masks; Owner: supabase_admin --- - -ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA pgsodium_masks GRANT ALL ON FUNCTIONS TO pgsodium_keyiduser; - - --- --- Name: DEFAULT PRIVILEGES FOR TABLES; Type: DEFAULT ACL; Schema: pgsodium_masks; Owner: supabase_admin --- - -ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA pgsodium_masks GRANT ALL ON TABLES TO pgsodium_keyiduser; - - --- --- Name: DEFAULT PRIVILEGES FOR SEQUENCES; Type: DEFAULT ACL; Schema: public; Owner: postgres --- - -ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA public GRANT ALL ON SEQUENCES TO postgres; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA public GRANT ALL ON SEQUENCES TO anon; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA public GRANT ALL ON SEQUENCES TO authenticated; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA public GRANT ALL ON SEQUENCES TO service_role; - - --- --- Name: DEFAULT PRIVILEGES FOR SEQUENCES; Type: DEFAULT ACL; Schema: public; Owner: supabase_admin --- - -ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA public GRANT ALL ON SEQUENCES TO postgres; -ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA public GRANT ALL ON SEQUENCES TO anon; -ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA public GRANT ALL ON SEQUENCES TO authenticated; -ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA public GRANT ALL ON SEQUENCES TO service_role; - - --- --- Name: DEFAULT PRIVILEGES FOR FUNCTIONS; Type: DEFAULT ACL; Schema: public; Owner: postgres --- - -ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA public GRANT ALL ON FUNCTIONS TO postgres; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA public GRANT ALL ON FUNCTIONS TO anon; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA public GRANT ALL ON FUNCTIONS TO authenticated; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA public GRANT ALL ON FUNCTIONS TO service_role; - - --- --- Name: DEFAULT PRIVILEGES FOR FUNCTIONS; Type: DEFAULT ACL; Schema: public; Owner: supabase_admin --- - -ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA public GRANT ALL ON FUNCTIONS TO postgres; -ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA public GRANT ALL ON FUNCTIONS TO anon; -ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA public GRANT ALL ON FUNCTIONS TO authenticated; -ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA public GRANT ALL ON FUNCTIONS TO service_role; - - --- --- Name: DEFAULT PRIVILEGES FOR TABLES; Type: DEFAULT ACL; Schema: public; Owner: postgres --- - -ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA public GRANT ALL ON TABLES TO postgres; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA public GRANT ALL ON TABLES TO anon; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA public GRANT ALL ON TABLES TO authenticated; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA public GRANT ALL ON TABLES TO service_role; - - --- --- Name: DEFAULT PRIVILEGES FOR TABLES; Type: DEFAULT ACL; Schema: public; Owner: supabase_admin --- - -ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA public GRANT ALL ON TABLES TO postgres; -ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA public GRANT ALL ON TABLES TO anon; -ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA public GRANT ALL ON TABLES TO authenticated; -ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA public GRANT ALL ON TABLES TO service_role; - - --- --- Name: DEFAULT PRIVILEGES FOR SEQUENCES; Type: DEFAULT ACL; Schema: realtime; Owner: supabase_admin --- - -ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA realtime GRANT ALL ON SEQUENCES TO postgres; -ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA realtime GRANT ALL ON SEQUENCES TO dashboard_user; - - --- --- Name: DEFAULT PRIVILEGES FOR FUNCTIONS; Type: DEFAULT ACL; Schema: realtime; Owner: supabase_admin --- - -ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA realtime GRANT ALL ON FUNCTIONS TO postgres; -ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA realtime GRANT ALL ON FUNCTIONS TO dashboard_user; - - --- --- Name: DEFAULT PRIVILEGES FOR TABLES; Type: DEFAULT ACL; Schema: realtime; Owner: supabase_admin --- - -ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA realtime GRANT ALL ON TABLES TO postgres; -ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA realtime GRANT ALL ON TABLES TO dashboard_user; - - --- --- Name: DEFAULT PRIVILEGES FOR SEQUENCES; Type: DEFAULT ACL; Schema: storage; Owner: postgres --- - -ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA storage GRANT ALL ON SEQUENCES TO postgres; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA storage GRANT ALL ON SEQUENCES TO anon; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA storage GRANT ALL ON SEQUENCES TO authenticated; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA storage GRANT ALL ON SEQUENCES TO service_role; - - --- --- Name: DEFAULT PRIVILEGES FOR FUNCTIONS; Type: DEFAULT ACL; Schema: storage; Owner: postgres --- - -ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA storage GRANT ALL ON FUNCTIONS TO postgres; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA storage GRANT ALL ON FUNCTIONS TO anon; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA storage GRANT ALL ON FUNCTIONS TO authenticated; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA storage GRANT ALL ON FUNCTIONS TO service_role; - - --- --- Name: DEFAULT PRIVILEGES FOR TABLES; Type: DEFAULT ACL; Schema: storage; Owner: postgres --- - -ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA storage GRANT ALL ON TABLES TO postgres; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA storage GRANT ALL ON TABLES TO anon; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA storage GRANT ALL ON TABLES TO authenticated; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA storage GRANT ALL ON TABLES TO service_role; - - --- --- Name: issue_graphql_placeholder; Type: EVENT TRIGGER; Schema: -; Owner: supabase_admin --- - -CREATE EVENT TRIGGER issue_graphql_placeholder ON sql_drop - WHEN TAG IN ('DROP EXTENSION') - EXECUTE FUNCTION extensions.set_graphql_placeholder(); - - -ALTER EVENT TRIGGER issue_graphql_placeholder OWNER TO supabase_admin; - --- --- Name: issue_pg_cron_access; Type: EVENT TRIGGER; Schema: -; Owner: postgres --- - -CREATE EVENT TRIGGER issue_pg_cron_access ON ddl_command_end - WHEN TAG IN ('CREATE SCHEMA') - EXECUTE FUNCTION extensions.grant_pg_cron_access(); - - -ALTER EVENT TRIGGER issue_pg_cron_access OWNER TO postgres; - --- --- Name: issue_pg_graphql_access; Type: EVENT TRIGGER; Schema: -; Owner: supabase_admin --- - -CREATE EVENT TRIGGER issue_pg_graphql_access ON ddl_command_end - WHEN TAG IN ('CREATE FUNCTION') - EXECUTE FUNCTION extensions.grant_pg_graphql_access(); - - -ALTER EVENT TRIGGER issue_pg_graphql_access OWNER TO supabase_admin; - --- --- Name: issue_pg_net_access; Type: EVENT TRIGGER; Schema: -; Owner: postgres --- - -CREATE EVENT TRIGGER issue_pg_net_access ON ddl_command_end - WHEN TAG IN ('CREATE EXTENSION') - EXECUTE FUNCTION extensions.grant_pg_net_access(); - - -ALTER EVENT TRIGGER issue_pg_net_access OWNER TO postgres; - --- --- Name: pgrst_ddl_watch; Type: EVENT TRIGGER; Schema: -; Owner: supabase_admin --- - -CREATE EVENT TRIGGER pgrst_ddl_watch ON ddl_command_end - EXECUTE FUNCTION extensions.pgrst_ddl_watch(); - - -ALTER EVENT TRIGGER pgrst_ddl_watch OWNER TO supabase_admin; - --- --- Name: pgrst_drop_watch; Type: EVENT TRIGGER; Schema: -; Owner: supabase_admin --- - -CREATE EVENT TRIGGER pgrst_drop_watch ON sql_drop - EXECUTE FUNCTION extensions.pgrst_drop_watch(); - - -ALTER EVENT TRIGGER pgrst_drop_watch OWNER TO supabase_admin; - --- --- PostgreSQL database dump complete --- - +-- +-- PostgreSQL database dump +-- + +-- Dumped from database version 15.1 (Ubuntu 15.1-1.pgdg20.04+1) +-- Dumped by pg_dump version 15.3 + +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; + +-- +-- Name: auth; Type: SCHEMA; Schema: -; Owner: supabase_admin +-- + +CREATE SCHEMA auth; + + +ALTER SCHEMA auth OWNER TO supabase_admin; + +-- +-- Name: extensions; Type: SCHEMA; Schema: -; Owner: postgres +-- + +CREATE SCHEMA extensions; + + +ALTER SCHEMA extensions OWNER TO postgres; + +-- +-- Name: graphql; Type: SCHEMA; Schema: -; Owner: supabase_admin +-- + +CREATE SCHEMA graphql; + + +ALTER SCHEMA graphql OWNER TO supabase_admin; + +-- +-- Name: graphql_public; Type: SCHEMA; Schema: -; Owner: supabase_admin +-- + +CREATE SCHEMA graphql_public; + + +ALTER SCHEMA graphql_public OWNER TO supabase_admin; + +-- +-- Name: pgbouncer; Type: SCHEMA; Schema: -; Owner: pgbouncer +-- + +CREATE SCHEMA pgbouncer; + + +ALTER SCHEMA pgbouncer OWNER TO pgbouncer; + +-- +-- Name: pgsodium; Type: SCHEMA; Schema: -; Owner: supabase_admin +-- + +CREATE SCHEMA pgsodium; + + +ALTER SCHEMA pgsodium OWNER TO supabase_admin; + +-- +-- Name: pgsodium; Type: EXTENSION; Schema: -; Owner: - +-- + +CREATE EXTENSION IF NOT EXISTS pgsodium WITH SCHEMA pgsodium; + + +-- +-- Name: EXTENSION pgsodium; Type: COMMENT; Schema: -; Owner: +-- + +COMMENT ON EXTENSION pgsodium IS 'Pgsodium is a modern cryptography library for Postgres.'; + + +-- +-- Name: realtime; Type: SCHEMA; Schema: -; Owner: supabase_admin +-- + +CREATE SCHEMA realtime; + + +ALTER SCHEMA realtime OWNER TO supabase_admin; + +-- +-- Name: storage; Type: SCHEMA; Schema: -; Owner: supabase_admin +-- + +CREATE SCHEMA storage; + + +ALTER SCHEMA storage OWNER TO supabase_admin; + +-- +-- Name: vault; Type: SCHEMA; Schema: -; Owner: supabase_admin +-- + +CREATE SCHEMA vault; + + +ALTER SCHEMA vault OWNER TO supabase_admin; + +-- +-- Name: pg_graphql; Type: EXTENSION; Schema: -; Owner: - +-- + +CREATE EXTENSION IF NOT EXISTS pg_graphql WITH SCHEMA graphql; + + +-- +-- Name: EXTENSION pg_graphql; Type: COMMENT; Schema: -; Owner: +-- + +COMMENT ON EXTENSION pg_graphql IS 'pg_graphql: GraphQL support'; + + +-- +-- Name: pg_stat_statements; Type: EXTENSION; Schema: -; Owner: - +-- + +CREATE EXTENSION IF NOT EXISTS pg_stat_statements WITH SCHEMA extensions; + + +-- +-- Name: EXTENSION pg_stat_statements; Type: COMMENT; Schema: -; Owner: +-- + +COMMENT ON EXTENSION pg_stat_statements IS 'track planning and execution statistics of all SQL statements executed'; + + +-- +-- Name: pgcrypto; Type: EXTENSION; Schema: -; Owner: - +-- + +CREATE EXTENSION IF NOT EXISTS pgcrypto WITH SCHEMA extensions; + + +-- +-- Name: EXTENSION pgcrypto; Type: COMMENT; Schema: -; Owner: +-- + +COMMENT ON EXTENSION pgcrypto IS 'cryptographic functions'; + + +-- +-- Name: pgjwt; Type: EXTENSION; Schema: -; Owner: - +-- + +CREATE EXTENSION IF NOT EXISTS pgjwt WITH SCHEMA extensions; + + +-- +-- Name: EXTENSION pgjwt; Type: COMMENT; Schema: -; Owner: +-- + +COMMENT ON EXTENSION pgjwt IS 'JSON Web Token API for Postgresql'; + + +-- +-- Name: supabase_vault; Type: EXTENSION; Schema: -; Owner: - +-- + +CREATE EXTENSION IF NOT EXISTS supabase_vault WITH SCHEMA vault; + + +-- +-- Name: EXTENSION supabase_vault; Type: COMMENT; Schema: -; Owner: +-- + +COMMENT ON EXTENSION supabase_vault IS 'Supabase Vault Extension'; + + +-- +-- Name: uuid-ossp; Type: EXTENSION; Schema: -; Owner: - +-- + +CREATE EXTENSION IF NOT EXISTS "uuid-ossp" WITH SCHEMA extensions; + + +-- +-- Name: EXTENSION "uuid-ossp"; Type: COMMENT; Schema: -; Owner: +-- + +COMMENT ON EXTENSION "uuid-ossp" IS 'generate universally unique identifiers (UUIDs)'; + + +-- +-- Name: aal_level; Type: TYPE; Schema: auth; Owner: supabase_auth_admin +-- + +CREATE TYPE auth.aal_level AS ENUM ( + 'aal1', + 'aal2', + 'aal3' +); + + +ALTER TYPE auth.aal_level OWNER TO supabase_auth_admin; + +-- +-- Name: code_challenge_method; Type: TYPE; Schema: auth; Owner: supabase_auth_admin +-- + +CREATE TYPE auth.code_challenge_method AS ENUM ( + 's256', + 'plain' +); + + +ALTER TYPE auth.code_challenge_method OWNER TO supabase_auth_admin; + +-- +-- Name: factor_status; Type: TYPE; Schema: auth; Owner: supabase_auth_admin +-- + +CREATE TYPE auth.factor_status AS ENUM ( + 'unverified', + 'verified' +); + + +ALTER TYPE auth.factor_status OWNER TO supabase_auth_admin; + +-- +-- Name: factor_type; Type: TYPE; Schema: auth; Owner: supabase_auth_admin +-- + +CREATE TYPE auth.factor_type AS ENUM ( + 'totp', + 'webauthn' +); + + +ALTER TYPE auth.factor_type OWNER TO supabase_auth_admin; + +-- +-- Name: email(); Type: FUNCTION; Schema: auth; Owner: supabase_auth_admin +-- + +CREATE FUNCTION auth.email() RETURNS text + LANGUAGE sql STABLE + AS $$ + select + coalesce( + nullif(current_setting('request.jwt.claim.email', true), ''), + (nullif(current_setting('request.jwt.claims', true), '')::jsonb ->> 'email') + )::text +$$; + + +ALTER FUNCTION auth.email() OWNER TO supabase_auth_admin; + +-- +-- Name: FUNCTION email(); Type: COMMENT; Schema: auth; Owner: supabase_auth_admin +-- + +COMMENT ON FUNCTION auth.email() IS 'Deprecated. Use auth.jwt() -> ''email'' instead.'; + + +-- +-- Name: jwt(); Type: FUNCTION; Schema: auth; Owner: supabase_auth_admin +-- + +CREATE FUNCTION auth.jwt() RETURNS jsonb + LANGUAGE sql STABLE + AS $$ + select + coalesce( + nullif(current_setting('request.jwt.claim', true), ''), + nullif(current_setting('request.jwt.claims', true), '') + )::jsonb +$$; + + +ALTER FUNCTION auth.jwt() OWNER TO supabase_auth_admin; + +-- +-- Name: role(); Type: FUNCTION; Schema: auth; Owner: supabase_auth_admin +-- + +CREATE FUNCTION auth.role() RETURNS text + LANGUAGE sql STABLE + AS $$ + select + coalesce( + nullif(current_setting('request.jwt.claim.role', true), ''), + (nullif(current_setting('request.jwt.claims', true), '')::jsonb ->> 'role') + )::text +$$; + + +ALTER FUNCTION auth.role() OWNER TO supabase_auth_admin; + +-- +-- Name: FUNCTION role(); Type: COMMENT; Schema: auth; Owner: supabase_auth_admin +-- + +COMMENT ON FUNCTION auth.role() IS 'Deprecated. Use auth.jwt() -> ''role'' instead.'; + + +-- +-- Name: uid(); Type: FUNCTION; Schema: auth; Owner: supabase_auth_admin +-- + +CREATE FUNCTION auth.uid() RETURNS uuid + LANGUAGE sql STABLE + AS $$ + select + coalesce( + nullif(current_setting('request.jwt.claim.sub', true), ''), + (nullif(current_setting('request.jwt.claims', true), '')::jsonb ->> 'sub') + )::uuid +$$; + + +ALTER FUNCTION auth.uid() OWNER TO supabase_auth_admin; + +-- +-- Name: FUNCTION uid(); Type: COMMENT; Schema: auth; Owner: supabase_auth_admin +-- + +COMMENT ON FUNCTION auth.uid() IS 'Deprecated. Use auth.jwt() -> ''sub'' instead.'; + + +-- +-- Name: grant_pg_cron_access(); Type: FUNCTION; Schema: extensions; Owner: postgres +-- + +CREATE FUNCTION extensions.grant_pg_cron_access() RETURNS event_trigger + LANGUAGE plpgsql + AS $$ +DECLARE + schema_is_cron bool; +BEGIN + schema_is_cron = ( + SELECT n.nspname = 'cron' + FROM pg_event_trigger_ddl_commands() AS ev + LEFT JOIN pg_catalog.pg_namespace AS n + ON ev.objid = n.oid + ); + + IF schema_is_cron + THEN + grant usage on schema cron to postgres with grant option; + + alter default privileges in schema cron grant all on tables to postgres with grant option; + alter default privileges in schema cron grant all on functions to postgres with grant option; + alter default privileges in schema cron grant all on sequences to postgres with grant option; + + alter default privileges for user supabase_admin in schema cron grant all + on sequences to postgres with grant option; + alter default privileges for user supabase_admin in schema cron grant all + on tables to postgres with grant option; + alter default privileges for user supabase_admin in schema cron grant all + on functions to postgres with grant option; + + grant all privileges on all tables in schema cron to postgres with grant option; + + END IF; + +END; +$$; + + +ALTER FUNCTION extensions.grant_pg_cron_access() OWNER TO postgres; + +-- +-- Name: FUNCTION grant_pg_cron_access(); Type: COMMENT; Schema: extensions; Owner: postgres +-- + +COMMENT ON FUNCTION extensions.grant_pg_cron_access() IS 'Grants access to pg_cron'; + + +-- +-- Name: grant_pg_graphql_access(); Type: FUNCTION; Schema: extensions; Owner: supabase_admin +-- + +CREATE FUNCTION extensions.grant_pg_graphql_access() RETURNS event_trigger + LANGUAGE plpgsql + AS $_$ +DECLARE + func_is_graphql_resolve bool; +BEGIN + func_is_graphql_resolve = ( + SELECT n.proname = 'resolve' + FROM pg_event_trigger_ddl_commands() AS ev + LEFT JOIN pg_catalog.pg_proc AS n + ON ev.objid = n.oid + ); + + IF func_is_graphql_resolve + THEN + -- Update public wrapper to pass all arguments through to the pg_graphql resolve func + DROP FUNCTION IF EXISTS graphql_public.graphql; + create or replace function graphql_public.graphql( + "operationName" text default null, + query text default null, + variables jsonb default null, + extensions jsonb default null + ) + returns jsonb + language sql + as $$ + select graphql.resolve( + query := query, + variables := coalesce(variables, '{}'), + "operationName" := "operationName", + extensions := extensions + ); + $$; + + -- This hook executes when `graphql.resolve` is created. That is not necessarily the last + -- function in the extension so we need to grant permissions on existing entities AND + -- update default permissions to any others that are created after `graphql.resolve` + grant usage on schema graphql to postgres, anon, authenticated, service_role; + grant select on all tables in schema graphql to postgres, anon, authenticated, service_role; + grant execute on all functions in schema graphql to postgres, anon, authenticated, service_role; + grant all on all sequences in schema graphql to postgres, anon, authenticated, service_role; + alter default privileges in schema graphql grant all on tables to postgres, anon, authenticated, service_role; + alter default privileges in schema graphql grant all on functions to postgres, anon, authenticated, service_role; + alter default privileges in schema graphql grant all on sequences to postgres, anon, authenticated, service_role; + END IF; + +END; +$_$; + + +ALTER FUNCTION extensions.grant_pg_graphql_access() OWNER TO supabase_admin; + +-- +-- Name: FUNCTION grant_pg_graphql_access(); Type: COMMENT; Schema: extensions; Owner: supabase_admin +-- + +COMMENT ON FUNCTION extensions.grant_pg_graphql_access() IS 'Grants access to pg_graphql'; + + +-- +-- Name: grant_pg_net_access(); Type: FUNCTION; Schema: extensions; Owner: postgres +-- + +CREATE FUNCTION extensions.grant_pg_net_access() RETURNS event_trigger + LANGUAGE plpgsql + AS $$ +BEGIN + IF EXISTS ( + SELECT 1 + FROM pg_event_trigger_ddl_commands() AS ev + JOIN pg_extension AS ext + ON ev.objid = ext.oid + WHERE ext.extname = 'pg_net' + ) + THEN + IF NOT EXISTS ( + SELECT 1 + FROM pg_roles + WHERE rolname = 'supabase_functions_admin' + ) + THEN + CREATE USER supabase_functions_admin NOINHERIT CREATEROLE LOGIN NOREPLICATION; + END IF; + + GRANT USAGE ON SCHEMA net TO supabase_functions_admin, postgres, anon, authenticated, service_role; + + ALTER function net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) SECURITY DEFINER; + ALTER function net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) SECURITY DEFINER; + + ALTER function net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) SET search_path = net; + ALTER function net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) SET search_path = net; + + REVOKE ALL ON FUNCTION net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) FROM PUBLIC; + REVOKE ALL ON FUNCTION net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) FROM PUBLIC; + + GRANT EXECUTE ON FUNCTION net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) TO supabase_functions_admin, postgres, anon, authenticated, service_role; + GRANT EXECUTE ON FUNCTION net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) TO supabase_functions_admin, postgres, anon, authenticated, service_role; + END IF; +END; +$$; + + +ALTER FUNCTION extensions.grant_pg_net_access() OWNER TO postgres; + +-- +-- Name: FUNCTION grant_pg_net_access(); Type: COMMENT; Schema: extensions; Owner: postgres +-- + +COMMENT ON FUNCTION extensions.grant_pg_net_access() IS 'Grants access to pg_net'; + + +-- +-- Name: pgrst_ddl_watch(); Type: FUNCTION; Schema: extensions; Owner: supabase_admin +-- + +CREATE FUNCTION extensions.pgrst_ddl_watch() RETURNS event_trigger + LANGUAGE plpgsql + AS $$ +DECLARE + cmd record; +BEGIN + FOR cmd IN SELECT * FROM pg_event_trigger_ddl_commands() + LOOP + IF cmd.command_tag IN ( + 'CREATE SCHEMA', 'ALTER SCHEMA' + , 'CREATE TABLE', 'CREATE TABLE AS', 'SELECT INTO', 'ALTER TABLE' + , 'CREATE FOREIGN TABLE', 'ALTER FOREIGN TABLE' + , 'CREATE VIEW', 'ALTER VIEW' + , 'CREATE MATERIALIZED VIEW', 'ALTER MATERIALIZED VIEW' + , 'CREATE FUNCTION', 'ALTER FUNCTION' + , 'CREATE TRIGGER' + , 'CREATE TYPE', 'ALTER TYPE' + , 'CREATE RULE' + , 'COMMENT' + ) + -- don't notify in case of CREATE TEMP table or other objects created on pg_temp + AND cmd.schema_name is distinct from 'pg_temp' + THEN + NOTIFY pgrst, 'reload schema'; + END IF; + END LOOP; +END; $$; + + +ALTER FUNCTION extensions.pgrst_ddl_watch() OWNER TO supabase_admin; + +-- +-- Name: pgrst_drop_watch(); Type: FUNCTION; Schema: extensions; Owner: supabase_admin +-- + +CREATE FUNCTION extensions.pgrst_drop_watch() RETURNS event_trigger + LANGUAGE plpgsql + AS $$ +DECLARE + obj record; +BEGIN + FOR obj IN SELECT * FROM pg_event_trigger_dropped_objects() + LOOP + IF obj.object_type IN ( + 'schema' + , 'table' + , 'foreign table' + , 'view' + , 'materialized view' + , 'function' + , 'trigger' + , 'type' + , 'rule' + ) + AND obj.is_temporary IS false -- no pg_temp objects + THEN + NOTIFY pgrst, 'reload schema'; + END IF; + END LOOP; +END; $$; + + +ALTER FUNCTION extensions.pgrst_drop_watch() OWNER TO supabase_admin; + +-- +-- Name: set_graphql_placeholder(); Type: FUNCTION; Schema: extensions; Owner: supabase_admin +-- + +CREATE FUNCTION extensions.set_graphql_placeholder() RETURNS event_trigger + LANGUAGE plpgsql + AS $_$ + DECLARE + graphql_is_dropped bool; + BEGIN + graphql_is_dropped = ( + SELECT ev.schema_name = 'graphql_public' + FROM pg_event_trigger_dropped_objects() AS ev + WHERE ev.schema_name = 'graphql_public' + ); + + IF graphql_is_dropped + THEN + create or replace function graphql_public.graphql( + "operationName" text default null, + query text default null, + variables jsonb default null, + extensions jsonb default null + ) + returns jsonb + language plpgsql + as $$ + DECLARE + server_version float; + BEGIN + server_version = (SELECT (SPLIT_PART((select version()), ' ', 2))::float); + + IF server_version >= 14 THEN + RETURN jsonb_build_object( + 'errors', jsonb_build_array( + jsonb_build_object( + 'message', 'pg_graphql extension is not enabled.' + ) + ) + ); + ELSE + RETURN jsonb_build_object( + 'errors', jsonb_build_array( + jsonb_build_object( + 'message', 'pg_graphql is only available on projects running Postgres 14 onwards.' + ) + ) + ); + END IF; + END; + $$; + END IF; + + END; +$_$; + + +ALTER FUNCTION extensions.set_graphql_placeholder() OWNER TO supabase_admin; + +-- +-- Name: FUNCTION set_graphql_placeholder(); Type: COMMENT; Schema: extensions; Owner: supabase_admin +-- + +COMMENT ON FUNCTION extensions.set_graphql_placeholder() IS 'Reintroduces placeholder function for graphql_public.graphql'; + + +-- +-- Name: get_auth(text); Type: FUNCTION; Schema: pgbouncer; Owner: postgres +-- + +CREATE FUNCTION pgbouncer.get_auth(p_usename text) RETURNS TABLE(username text, password text) + LANGUAGE plpgsql SECURITY DEFINER + AS $$ +BEGIN + RAISE WARNING 'PgBouncer auth request: %', p_usename; + + RETURN QUERY + SELECT usename::TEXT, passwd::TEXT FROM pg_catalog.pg_shadow + WHERE usename = p_usename; +END; +$$; + + +ALTER FUNCTION pgbouncer.get_auth(p_usename text) OWNER TO postgres; + +-- +-- Name: can_insert_object(text, text, uuid, jsonb); Type: FUNCTION; Schema: storage; Owner: supabase_storage_admin +-- + +CREATE FUNCTION storage.can_insert_object(bucketid text, name text, owner uuid, metadata jsonb) RETURNS void + LANGUAGE plpgsql + AS $$ +BEGIN + INSERT INTO "storage"."objects" ("bucket_id", "name", "owner", "metadata") VALUES (bucketid, name, owner, metadata); + -- hack to rollback the successful insert + RAISE sqlstate 'PT200' using + message = 'ROLLBACK', + detail = 'rollback successful insert'; +END +$$; + + +ALTER FUNCTION storage.can_insert_object(bucketid text, name text, owner uuid, metadata jsonb) OWNER TO supabase_storage_admin; + +-- +-- Name: extension(text); Type: FUNCTION; Schema: storage; Owner: supabase_storage_admin +-- + +CREATE FUNCTION storage.extension(name text) RETURNS text + LANGUAGE plpgsql + AS $$ +DECLARE +_parts text[]; +_filename text; +BEGIN + select string_to_array(name, '/') into _parts; + select _parts[array_length(_parts,1)] into _filename; + -- @todo return the last part instead of 2 + return split_part(_filename, '.', 2); +END +$$; + + +ALTER FUNCTION storage.extension(name text) OWNER TO supabase_storage_admin; + +-- +-- Name: filename(text); Type: FUNCTION; Schema: storage; Owner: supabase_storage_admin +-- + +CREATE FUNCTION storage.filename(name text) RETURNS text + LANGUAGE plpgsql + AS $$ +DECLARE +_parts text[]; +BEGIN + select string_to_array(name, '/') into _parts; + return _parts[array_length(_parts,1)]; +END +$$; + + +ALTER FUNCTION storage.filename(name text) OWNER TO supabase_storage_admin; + +-- +-- Name: foldername(text); Type: FUNCTION; Schema: storage; Owner: supabase_storage_admin +-- + +CREATE FUNCTION storage.foldername(name text) RETURNS text[] + LANGUAGE plpgsql + AS $$ +DECLARE +_parts text[]; +BEGIN + select string_to_array(name, '/') into _parts; + return _parts[1:array_length(_parts,1)-1]; +END +$$; + + +ALTER FUNCTION storage.foldername(name text) OWNER TO supabase_storage_admin; + +-- +-- Name: get_size_by_bucket(); Type: FUNCTION; Schema: storage; Owner: supabase_storage_admin +-- + +CREATE FUNCTION storage.get_size_by_bucket() RETURNS TABLE(size bigint, bucket_id text) + LANGUAGE plpgsql + AS $$ +BEGIN + return query + select sum((metadata->>'size')::int) as size, obj.bucket_id + from "storage".objects as obj + group by obj.bucket_id; +END +$$; + + +ALTER FUNCTION storage.get_size_by_bucket() OWNER TO supabase_storage_admin; + +-- +-- Name: search(text, text, integer, integer, integer, text, text, text); Type: FUNCTION; Schema: storage; Owner: supabase_storage_admin +-- + +CREATE FUNCTION storage.search(prefix text, bucketname text, limits integer DEFAULT 100, levels integer DEFAULT 1, offsets integer DEFAULT 0, search text DEFAULT ''::text, sortcolumn text DEFAULT 'name'::text, sortorder text DEFAULT 'asc'::text) RETURNS TABLE(name text, id uuid, updated_at timestamp with time zone, created_at timestamp with time zone, last_accessed_at timestamp with time zone, metadata jsonb) + LANGUAGE plpgsql STABLE + AS $_$ +declare + v_order_by text; + v_sort_order text; +begin + case + when sortcolumn = 'name' then + v_order_by = 'name'; + when sortcolumn = 'updated_at' then + v_order_by = 'updated_at'; + when sortcolumn = 'created_at' then + v_order_by = 'created_at'; + when sortcolumn = 'last_accessed_at' then + v_order_by = 'last_accessed_at'; + else + v_order_by = 'name'; + end case; + + case + when sortorder = 'asc' then + v_sort_order = 'asc'; + when sortorder = 'desc' then + v_sort_order = 'desc'; + else + v_sort_order = 'asc'; + end case; + + v_order_by = v_order_by || ' ' || v_sort_order; + + return query execute + 'with folders as ( + select path_tokens[$1] as folder + from storage.objects + where objects.name ilike $2 || $3 || ''%'' + and bucket_id = $4 + and array_length(regexp_split_to_array(objects.name, ''/''), 1) <> $1 + group by folder + order by folder ' || v_sort_order || ' + ) + (select folder as "name", + null as id, + null as updated_at, + null as created_at, + null as last_accessed_at, + null as metadata from folders) + union all + (select path_tokens[$1] as "name", + id, + updated_at, + created_at, + last_accessed_at, + metadata + from storage.objects + where objects.name ilike $2 || $3 || ''%'' + and bucket_id = $4 + and array_length(regexp_split_to_array(objects.name, ''/''), 1) = $1 + order by ' || v_order_by || ') + limit $5 + offset $6' using levels, prefix, search, bucketname, limits, offsets; +end; +$_$; + + +ALTER FUNCTION storage.search(prefix text, bucketname text, limits integer, levels integer, offsets integer, search text, sortcolumn text, sortorder text) OWNER TO supabase_storage_admin; + +-- +-- Name: update_updated_at_column(); Type: FUNCTION; Schema: storage; Owner: supabase_storage_admin +-- + +CREATE FUNCTION storage.update_updated_at_column() RETURNS trigger + LANGUAGE plpgsql + AS $$ +BEGIN + NEW.updated_at = now(); + RETURN NEW; +END; +$$; + + +ALTER FUNCTION storage.update_updated_at_column() OWNER TO supabase_storage_admin; + +-- +-- Name: secrets_encrypt_secret_secret(); Type: FUNCTION; Schema: vault; Owner: supabase_admin +-- + +CREATE FUNCTION vault.secrets_encrypt_secret_secret() RETURNS trigger + LANGUAGE plpgsql + AS $$ + BEGIN + new.secret = CASE WHEN new.secret IS NULL THEN NULL ELSE + CASE WHEN new.key_id IS NULL THEN NULL ELSE pg_catalog.encode( + pgsodium.crypto_aead_det_encrypt( + pg_catalog.convert_to(new.secret, 'utf8'), + pg_catalog.convert_to((new.id::text || new.description::text || new.created_at::text || new.updated_at::text)::text, 'utf8'), + new.key_id::uuid, + new.nonce + ), + 'base64') END END; + RETURN new; + END; + $$; + + +ALTER FUNCTION vault.secrets_encrypt_secret_secret() OWNER TO supabase_admin; + +SET default_tablespace = ''; + +SET default_table_access_method = heap; + +-- +-- Name: audit_log_entries; Type: TABLE; Schema: auth; Owner: supabase_auth_admin +-- + +CREATE TABLE auth.audit_log_entries ( + instance_id uuid, + id uuid NOT NULL, + payload json, + created_at timestamp with time zone, + ip_address character varying(64) DEFAULT ''::character varying NOT NULL +); + + +ALTER TABLE auth.audit_log_entries OWNER TO supabase_auth_admin; + +-- +-- Name: TABLE audit_log_entries; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin +-- + +COMMENT ON TABLE auth.audit_log_entries IS 'Auth: Audit trail for user actions.'; + + +-- +-- Name: flow_state; Type: TABLE; Schema: auth; Owner: supabase_auth_admin +-- + +CREATE TABLE auth.flow_state ( + id uuid NOT NULL, + user_id uuid, + auth_code text NOT NULL, + code_challenge_method auth.code_challenge_method NOT NULL, + code_challenge text NOT NULL, + provider_type text NOT NULL, + provider_access_token text, + provider_refresh_token text, + created_at timestamp with time zone, + updated_at timestamp with time zone, + authentication_method text NOT NULL +); + + +ALTER TABLE auth.flow_state OWNER TO supabase_auth_admin; + +-- +-- Name: TABLE flow_state; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin +-- + +COMMENT ON TABLE auth.flow_state IS 'stores metadata for pkce logins'; + + +-- +-- Name: identities; Type: TABLE; Schema: auth; Owner: supabase_auth_admin +-- + +CREATE TABLE auth.identities ( + id text NOT NULL, + user_id uuid NOT NULL, + identity_data jsonb NOT NULL, + provider text NOT NULL, + last_sign_in_at timestamp with time zone, + created_at timestamp with time zone, + updated_at timestamp with time zone, + email text GENERATED ALWAYS AS (lower((identity_data ->> 'email'::text))) STORED +); + + +ALTER TABLE auth.identities OWNER TO supabase_auth_admin; + +-- +-- Name: TABLE identities; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin +-- + +COMMENT ON TABLE auth.identities IS 'Auth: Stores identities associated to a user.'; + + +-- +-- Name: COLUMN identities.email; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin +-- + +COMMENT ON COLUMN auth.identities.email IS 'Auth: Email is a generated column that references the optional email property in the identity_data'; + + +-- +-- Name: instances; Type: TABLE; Schema: auth; Owner: supabase_auth_admin +-- + +CREATE TABLE auth.instances ( + id uuid NOT NULL, + uuid uuid, + raw_base_config text, + created_at timestamp with time zone, + updated_at timestamp with time zone +); + + +ALTER TABLE auth.instances OWNER TO supabase_auth_admin; + +-- +-- Name: TABLE instances; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin +-- + +COMMENT ON TABLE auth.instances IS 'Auth: Manages users across multiple sites.'; + + +-- +-- Name: mfa_amr_claims; Type: TABLE; Schema: auth; Owner: supabase_auth_admin +-- + +CREATE TABLE auth.mfa_amr_claims ( + session_id uuid NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + authentication_method text NOT NULL, + id uuid NOT NULL +); + + +ALTER TABLE auth.mfa_amr_claims OWNER TO supabase_auth_admin; + +-- +-- Name: TABLE mfa_amr_claims; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin +-- + +COMMENT ON TABLE auth.mfa_amr_claims IS 'auth: stores authenticator method reference claims for multi factor authentication'; + + +-- +-- Name: mfa_challenges; Type: TABLE; Schema: auth; Owner: supabase_auth_admin +-- + +CREATE TABLE auth.mfa_challenges ( + id uuid NOT NULL, + factor_id uuid NOT NULL, + created_at timestamp with time zone NOT NULL, + verified_at timestamp with time zone, + ip_address inet NOT NULL +); + + +ALTER TABLE auth.mfa_challenges OWNER TO supabase_auth_admin; + +-- +-- Name: TABLE mfa_challenges; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin +-- + +COMMENT ON TABLE auth.mfa_challenges IS 'auth: stores metadata about challenge requests made'; + + +-- +-- Name: mfa_factors; Type: TABLE; Schema: auth; Owner: supabase_auth_admin +-- + +CREATE TABLE auth.mfa_factors ( + id uuid NOT NULL, + user_id uuid NOT NULL, + friendly_name text, + factor_type auth.factor_type NOT NULL, + status auth.factor_status NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + secret text +); + + +ALTER TABLE auth.mfa_factors OWNER TO supabase_auth_admin; + +-- +-- Name: TABLE mfa_factors; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin +-- + +COMMENT ON TABLE auth.mfa_factors IS 'auth: stores metadata about factors'; + + +-- +-- Name: refresh_tokens; Type: TABLE; Schema: auth; Owner: supabase_auth_admin +-- + +CREATE TABLE auth.refresh_tokens ( + instance_id uuid, + id bigint NOT NULL, + token character varying(255), + user_id character varying(255), + revoked boolean, + created_at timestamp with time zone, + updated_at timestamp with time zone, + parent character varying(255), + session_id uuid +); + + +ALTER TABLE auth.refresh_tokens OWNER TO supabase_auth_admin; + +-- +-- Name: TABLE refresh_tokens; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin +-- + +COMMENT ON TABLE auth.refresh_tokens IS 'Auth: Store of tokens used to refresh JWT tokens once they expire.'; + + +-- +-- Name: refresh_tokens_id_seq; Type: SEQUENCE; Schema: auth; Owner: supabase_auth_admin +-- + +CREATE SEQUENCE auth.refresh_tokens_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +ALTER TABLE auth.refresh_tokens_id_seq OWNER TO supabase_auth_admin; + +-- +-- Name: refresh_tokens_id_seq; Type: SEQUENCE OWNED BY; Schema: auth; Owner: supabase_auth_admin +-- + +ALTER SEQUENCE auth.refresh_tokens_id_seq OWNED BY auth.refresh_tokens.id; + + +-- +-- Name: saml_providers; Type: TABLE; Schema: auth; Owner: supabase_auth_admin +-- + +CREATE TABLE auth.saml_providers ( + id uuid NOT NULL, + sso_provider_id uuid NOT NULL, + entity_id text NOT NULL, + metadata_xml text NOT NULL, + metadata_url text, + attribute_mapping jsonb, + created_at timestamp with time zone, + updated_at timestamp with time zone, + CONSTRAINT "entity_id not empty" CHECK ((char_length(entity_id) > 0)), + CONSTRAINT "metadata_url not empty" CHECK (((metadata_url = NULL::text) OR (char_length(metadata_url) > 0))), + CONSTRAINT "metadata_xml not empty" CHECK ((char_length(metadata_xml) > 0)) +); + + +ALTER TABLE auth.saml_providers OWNER TO supabase_auth_admin; + +-- +-- Name: TABLE saml_providers; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin +-- + +COMMENT ON TABLE auth.saml_providers IS 'Auth: Manages SAML Identity Provider connections.'; + + +-- +-- Name: saml_relay_states; Type: TABLE; Schema: auth; Owner: supabase_auth_admin +-- + +CREATE TABLE auth.saml_relay_states ( + id uuid NOT NULL, + sso_provider_id uuid NOT NULL, + request_id text NOT NULL, + for_email text, + redirect_to text, + from_ip_address inet, + created_at timestamp with time zone, + updated_at timestamp with time zone, + CONSTRAINT "request_id not empty" CHECK ((char_length(request_id) > 0)) +); + + +ALTER TABLE auth.saml_relay_states OWNER TO supabase_auth_admin; + +-- +-- Name: TABLE saml_relay_states; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin +-- + +COMMENT ON TABLE auth.saml_relay_states IS 'Auth: Contains SAML Relay State information for each Service Provider initiated login.'; + + +-- +-- Name: schema_migrations; Type: TABLE; Schema: auth; Owner: supabase_auth_admin +-- + +CREATE TABLE auth.schema_migrations ( + version character varying(255) NOT NULL +); + + +ALTER TABLE auth.schema_migrations OWNER TO supabase_auth_admin; + +-- +-- Name: TABLE schema_migrations; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin +-- + +COMMENT ON TABLE auth.schema_migrations IS 'Auth: Manages updates to the auth system.'; + + +-- +-- Name: sessions; Type: TABLE; Schema: auth; Owner: supabase_auth_admin +-- + +CREATE TABLE auth.sessions ( + id uuid NOT NULL, + user_id uuid NOT NULL, + created_at timestamp with time zone, + updated_at timestamp with time zone, + factor_id uuid, + aal auth.aal_level, + not_after timestamp with time zone +); + + +ALTER TABLE auth.sessions OWNER TO supabase_auth_admin; + +-- +-- Name: TABLE sessions; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin +-- + +COMMENT ON TABLE auth.sessions IS 'Auth: Stores session data associated to a user.'; + + +-- +-- Name: COLUMN sessions.not_after; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin +-- + +COMMENT ON COLUMN auth.sessions.not_after IS 'Auth: Not after is a nullable column that contains a timestamp after which the session should be regarded as expired.'; + + +-- +-- Name: sso_domains; Type: TABLE; Schema: auth; Owner: supabase_auth_admin +-- + +CREATE TABLE auth.sso_domains ( + id uuid NOT NULL, + sso_provider_id uuid NOT NULL, + domain text NOT NULL, + created_at timestamp with time zone, + updated_at timestamp with time zone, + CONSTRAINT "domain not empty" CHECK ((char_length(domain) > 0)) +); + + +ALTER TABLE auth.sso_domains OWNER TO supabase_auth_admin; + +-- +-- Name: TABLE sso_domains; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin +-- + +COMMENT ON TABLE auth.sso_domains IS 'Auth: Manages SSO email address domain mapping to an SSO Identity Provider.'; + + +-- +-- Name: sso_providers; Type: TABLE; Schema: auth; Owner: supabase_auth_admin +-- + +CREATE TABLE auth.sso_providers ( + id uuid NOT NULL, + resource_id text, + created_at timestamp with time zone, + updated_at timestamp with time zone, + CONSTRAINT "resource_id not empty" CHECK (((resource_id = NULL::text) OR (char_length(resource_id) > 0))) +); + + +ALTER TABLE auth.sso_providers OWNER TO supabase_auth_admin; + +-- +-- Name: TABLE sso_providers; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin +-- + +COMMENT ON TABLE auth.sso_providers IS 'Auth: Manages SSO identity provider information; see saml_providers for SAML.'; + + +-- +-- Name: COLUMN sso_providers.resource_id; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin +-- + +COMMENT ON COLUMN auth.sso_providers.resource_id IS 'Auth: Uniquely identifies a SSO provider according to a user-chosen resource ID (case insensitive), useful in infrastructure as code.'; + + +-- +-- Name: users; Type: TABLE; Schema: auth; Owner: supabase_auth_admin +-- + +CREATE TABLE auth.users ( + instance_id uuid, + id uuid NOT NULL, + aud character varying(255), + role character varying(255), + email character varying(255), + encrypted_password character varying(255), + email_confirmed_at timestamp with time zone, + invited_at timestamp with time zone, + confirmation_token character varying(255), + confirmation_sent_at timestamp with time zone, + recovery_token character varying(255), + recovery_sent_at timestamp with time zone, + email_change_token_new character varying(255), + email_change character varying(255), + email_change_sent_at timestamp with time zone, + last_sign_in_at timestamp with time zone, + raw_app_meta_data jsonb, + raw_user_meta_data jsonb, + is_super_admin boolean, + created_at timestamp with time zone, + updated_at timestamp with time zone, + phone text DEFAULT NULL::character varying, + phone_confirmed_at timestamp with time zone, + phone_change text DEFAULT ''::character varying, + phone_change_token character varying(255) DEFAULT ''::character varying, + phone_change_sent_at timestamp with time zone, + confirmed_at timestamp with time zone GENERATED ALWAYS AS (LEAST(email_confirmed_at, phone_confirmed_at)) STORED, + email_change_token_current character varying(255) DEFAULT ''::character varying, + email_change_confirm_status smallint DEFAULT 0, + banned_until timestamp with time zone, + reauthentication_token character varying(255) DEFAULT ''::character varying, + reauthentication_sent_at timestamp with time zone, + is_sso_user boolean DEFAULT false NOT NULL, + deleted_at timestamp with time zone, + CONSTRAINT users_email_change_confirm_status_check CHECK (((email_change_confirm_status >= 0) AND (email_change_confirm_status <= 2))) +); + + +ALTER TABLE auth.users OWNER TO supabase_auth_admin; + +-- +-- Name: TABLE users; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin +-- + +COMMENT ON TABLE auth.users IS 'Auth: Stores user login data within a secure schema.'; + + +-- +-- Name: COLUMN users.is_sso_user; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin +-- + +COMMENT ON COLUMN auth.users.is_sso_user IS 'Auth: Set this column to true when the account comes from SSO. These accounts can have duplicate emails.'; + + +-- +-- Name: Client; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE public."Client" ( + "clientId" uuid NOT NULL, + email text, + "emailPreferences" jsonb, + "createdAt" timestamp with time zone DEFAULT now() +); + + +ALTER TABLE public."Client" OWNER TO postgres; + +-- +-- Name: TABLE "Client"; Type: COMMENT; Schema: public; Owner: postgres +-- + +COMMENT ON TABLE public."Client" IS 'Client is one browser marked with unique id'; + + +-- +-- Name: Prompt; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE public."Prompt" ( + id bigint NOT NULL, + "previousExternalId" text, + "createdAt" timestamp with time zone DEFAULT now() NOT NULL, + "promptAt" timestamp with time zone, + "answerAt" timestamp with time zone, + "systemMessage" text, + prompt text, + answer text, + model text, + "modelSettings" jsonb, + metadata jsonb, + "clientId" uuid, + type text, + "fullCompletion" jsonb, + "externalId" text +); + + +ALTER TABLE public."Prompt" OWNER TO postgres; + +-- +-- Name: TABLE "Prompt"; Type: COMMENT; Schema: public; Owner: postgres +-- + +COMMENT ON TABLE public."Prompt" IS 'Log (and in future queue) of prompts'; + + +-- +-- Name: Prompt_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres +-- + +ALTER TABLE public."Prompt" ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY ( + SEQUENCE NAME public."Prompt_id_seq" + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1 +); + + +-- +-- Name: Prompt_stats; Type: VIEW; Schema: public; Owner: postgres +-- + +CREATE VIEW public."Prompt_stats" AS + SELECT "Prompt".id, + "Prompt".type, + "Prompt"."createdAt", + "Prompt"."clientId", + "Prompt".metadata, + ("Prompt"."answerAt" - "Prompt"."promptAt") AS duration, + "Prompt".model, + "Prompt"."modelSettings", + "Prompt".prompt, + "Prompt"."systemMessage", + "Prompt"."previousExternalId", + "Prompt"."promptAt", + "Prompt".answer, + "Prompt"."externalId", + "Prompt"."fullCompletion", + "Prompt"."answerAt", + 2 AS nonce + FROM public."Prompt" + ORDER BY "Prompt"."answerAt"; + + +ALTER TABLE public."Prompt_stats" OWNER TO postgres; + +-- +-- Name: Reaction; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE public."Reaction" ( + "wallpaperId" text NOT NULL, + author uuid NOT NULL, + "createdAt" timestamp with time zone DEFAULT now() NOT NULL, + "likedStatus" text NOT NULL +); + + +ALTER TABLE public."Reaction" OWNER TO postgres; + +-- +-- Name: TABLE "Reaction"; Type: COMMENT; Schema: public; Owner: postgres +-- + +COMMENT ON TABLE public."Reaction" IS 'Reactions to wallpaper'; + + +-- +-- Name: Site; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE public."Site" ( + id bigint NOT NULL, + "createdAt" timestamp with time zone DEFAULT now(), + "wallpaperId" text, + url text, + "ownerEmail" text, + plan text, + note text, + author uuid +); + + +ALTER TABLE public."Site" OWNER TO postgres; + +-- +-- Name: TABLE "Site"; Type: COMMENT; Schema: public; Owner: postgres +-- + +COMMENT ON TABLE public."Site" IS 'Registered sites for AiAi'; + + +-- +-- Name: Site_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres +-- + +ALTER TABLE public."Site" ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY ( + SEQUENCE NAME public."Site_id_seq" + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1 +); + + +-- +-- Name: SupportRequest; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE public."SupportRequest" ( + id bigint NOT NULL, + "createdAt" timestamp with time zone DEFAULT now(), + "from" text, + message text, + "isSolved" boolean DEFAULT false, + note text, + author uuid +); + + +ALTER TABLE public."SupportRequest" OWNER TO postgres; + +-- +-- Name: TABLE "SupportRequest"; Type: COMMENT; Schema: public; Owner: postgres +-- + +COMMENT ON TABLE public."SupportRequest" IS 'Requests for help'; + + +-- +-- Name: SupportRequest_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres +-- + +ALTER TABLE public."SupportRequest" ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY ( + SEQUENCE NAME public."SupportRequest_id_seq" + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1 +); + + +-- +-- Name: Value; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE public."Value" ( + id bigint NOT NULL, + "createdAt" timestamp with time zone DEFAULT now() NOT NULL, + "validUntil" timestamp with time zone, + key text, + value jsonb, + note text +); + + +ALTER TABLE public."Value" OWNER TO postgres; + +-- +-- Name: TABLE "Value"; Type: COMMENT; Schema: public; Owner: postgres +-- + +COMMENT ON TABLE public."Value" IS 'Key-value store'; + + +-- +-- Name: Value_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres +-- + +ALTER TABLE public."Value" ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY ( + SEQUENCE NAME public."Value_id_seq" + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1 +); + + +-- +-- Name: Wallpaper; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE public."Wallpaper" ( + id text NOT NULL, + parent text, + "createdAt" timestamp with time zone DEFAULT now() NOT NULL, + src text NOT NULL, + prompt text, + "colorStats" jsonb, + title text NOT NULL, + content text NOT NULL, + keywords text[], + author uuid NOT NULL, + "isPublic" boolean DEFAULT false NOT NULL, + "naturalSize" jsonb +); + + +ALTER TABLE public."Wallpaper" OWNER TO postgres; + +-- +-- Name: TABLE "Wallpaper"; Type: COMMENT; Schema: public; Owner: postgres +-- + +COMMENT ON TABLE public."Wallpaper" IS 'Wallpapers (websites) created by users'; + + +-- +-- Name: Wallpaper_random; Type: VIEW; Schema: public; Owner: postgres +-- + +CREATE VIEW public."Wallpaper_random" AS + SELECT "Wallpaper".id, + "Wallpaper".parent, + "Wallpaper"."createdAt", + "Wallpaper".src, + "Wallpaper".prompt, + "Wallpaper"."colorStats", + "Wallpaper".title, + "Wallpaper".content, + "Wallpaper".keywords, + "Wallpaper".author, + "Wallpaper"."isPublic", + 1 AS nonce + FROM public."Wallpaper" + ORDER BY (random()); + + +ALTER TABLE public."Wallpaper_random" OWNER TO postgres; + +-- +-- Name: buckets; Type: TABLE; Schema: storage; Owner: supabase_storage_admin +-- + +CREATE TABLE storage.buckets ( + id text NOT NULL, + name text NOT NULL, + owner uuid, + created_at timestamp with time zone DEFAULT now(), + updated_at timestamp with time zone DEFAULT now(), + public boolean DEFAULT false, + avif_autodetection boolean DEFAULT false, + file_size_limit bigint, + allowed_mime_types text[] +); + + +ALTER TABLE storage.buckets OWNER TO supabase_storage_admin; + +-- +-- Name: migrations; Type: TABLE; Schema: storage; Owner: supabase_storage_admin +-- + +CREATE TABLE storage.migrations ( + id integer NOT NULL, + name character varying(100) NOT NULL, + hash character varying(40) NOT NULL, + executed_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP +); + + +ALTER TABLE storage.migrations OWNER TO supabase_storage_admin; + +-- +-- Name: objects; Type: TABLE; Schema: storage; Owner: supabase_storage_admin +-- + +CREATE TABLE storage.objects ( + id uuid DEFAULT extensions.uuid_generate_v4() NOT NULL, + bucket_id text, + name text, + owner uuid, + created_at timestamp with time zone DEFAULT now(), + updated_at timestamp with time zone DEFAULT now(), + last_accessed_at timestamp with time zone DEFAULT now(), + metadata jsonb, + path_tokens text[] GENERATED ALWAYS AS (string_to_array(name, '/'::text)) STORED, + version text +); + + +ALTER TABLE storage.objects OWNER TO supabase_storage_admin; + +-- +-- Name: decrypted_secrets; Type: VIEW; Schema: vault; Owner: supabase_admin +-- + +CREATE VIEW vault.decrypted_secrets AS + SELECT secrets.id, + secrets.name, + secrets.description, + secrets.secret, + CASE + WHEN (secrets.secret IS NULL) THEN NULL::text + ELSE + CASE + WHEN (secrets.key_id IS NULL) THEN NULL::text + ELSE convert_from(pgsodium.crypto_aead_det_decrypt(decode(secrets.secret, 'base64'::text), convert_to(((((secrets.id)::text || secrets.description) || (secrets.created_at)::text) || (secrets.updated_at)::text), 'utf8'::name), secrets.key_id, secrets.nonce), 'utf8'::name) + END + END AS decrypted_secret, + secrets.key_id, + secrets.nonce, + secrets.created_at, + secrets.updated_at + FROM vault.secrets; + + +ALTER TABLE vault.decrypted_secrets OWNER TO supabase_admin; + +-- +-- Name: refresh_tokens id; Type: DEFAULT; Schema: auth; Owner: supabase_auth_admin +-- + +ALTER TABLE ONLY auth.refresh_tokens ALTER COLUMN id SET DEFAULT nextval('auth.refresh_tokens_id_seq'::regclass); + + +-- +-- Name: mfa_amr_claims amr_id_pk; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin +-- + +ALTER TABLE ONLY auth.mfa_amr_claims + ADD CONSTRAINT amr_id_pk PRIMARY KEY (id); + + +-- +-- Name: audit_log_entries audit_log_entries_pkey; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin +-- + +ALTER TABLE ONLY auth.audit_log_entries + ADD CONSTRAINT audit_log_entries_pkey PRIMARY KEY (id); + + +-- +-- Name: flow_state flow_state_pkey; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin +-- + +ALTER TABLE ONLY auth.flow_state + ADD CONSTRAINT flow_state_pkey PRIMARY KEY (id); + + +-- +-- Name: identities identities_pkey; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin +-- + +ALTER TABLE ONLY auth.identities + ADD CONSTRAINT identities_pkey PRIMARY KEY (provider, id); + + +-- +-- Name: instances instances_pkey; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin +-- + +ALTER TABLE ONLY auth.instances + ADD CONSTRAINT instances_pkey PRIMARY KEY (id); + + +-- +-- Name: mfa_amr_claims mfa_amr_claims_session_id_authentication_method_pkey; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin +-- + +ALTER TABLE ONLY auth.mfa_amr_claims + ADD CONSTRAINT mfa_amr_claims_session_id_authentication_method_pkey UNIQUE (session_id, authentication_method); + + +-- +-- Name: mfa_challenges mfa_challenges_pkey; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin +-- + +ALTER TABLE ONLY auth.mfa_challenges + ADD CONSTRAINT mfa_challenges_pkey PRIMARY KEY (id); + + +-- +-- Name: mfa_factors mfa_factors_pkey; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin +-- + +ALTER TABLE ONLY auth.mfa_factors + ADD CONSTRAINT mfa_factors_pkey PRIMARY KEY (id); + + +-- +-- Name: refresh_tokens refresh_tokens_pkey; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin +-- + +ALTER TABLE ONLY auth.refresh_tokens + ADD CONSTRAINT refresh_tokens_pkey PRIMARY KEY (id); + + +-- +-- Name: refresh_tokens refresh_tokens_token_unique; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin +-- + +ALTER TABLE ONLY auth.refresh_tokens + ADD CONSTRAINT refresh_tokens_token_unique UNIQUE (token); + + +-- +-- Name: saml_providers saml_providers_entity_id_key; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin +-- + +ALTER TABLE ONLY auth.saml_providers + ADD CONSTRAINT saml_providers_entity_id_key UNIQUE (entity_id); + + +-- +-- Name: saml_providers saml_providers_pkey; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin +-- + +ALTER TABLE ONLY auth.saml_providers + ADD CONSTRAINT saml_providers_pkey PRIMARY KEY (id); + + +-- +-- Name: saml_relay_states saml_relay_states_pkey; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin +-- + +ALTER TABLE ONLY auth.saml_relay_states + ADD CONSTRAINT saml_relay_states_pkey PRIMARY KEY (id); + + +-- +-- Name: schema_migrations schema_migrations_pkey; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin +-- + +ALTER TABLE ONLY auth.schema_migrations + ADD CONSTRAINT schema_migrations_pkey PRIMARY KEY (version); + + +-- +-- Name: sessions sessions_pkey; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin +-- + +ALTER TABLE ONLY auth.sessions + ADD CONSTRAINT sessions_pkey PRIMARY KEY (id); + + +-- +-- Name: sso_domains sso_domains_pkey; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin +-- + +ALTER TABLE ONLY auth.sso_domains + ADD CONSTRAINT sso_domains_pkey PRIMARY KEY (id); + + +-- +-- Name: sso_providers sso_providers_pkey; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin +-- + +ALTER TABLE ONLY auth.sso_providers + ADD CONSTRAINT sso_providers_pkey PRIMARY KEY (id); + + +-- +-- Name: users users_phone_key; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin +-- + +ALTER TABLE ONLY auth.users + ADD CONSTRAINT users_phone_key UNIQUE (phone); + + +-- +-- Name: users users_pkey; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin +-- + +ALTER TABLE ONLY auth.users + ADD CONSTRAINT users_pkey PRIMARY KEY (id); + + +-- +-- Name: Client Client_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public."Client" + ADD CONSTRAINT "Client_pkey" PRIMARY KEY ("clientId"); + + +-- +-- Name: Prompt Prompt_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public."Prompt" + ADD CONSTRAINT "Prompt_pkey" PRIMARY KEY (id); + + +-- +-- Name: Reaction Reaction_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public."Reaction" + ADD CONSTRAINT "Reaction_pkey" PRIMARY KEY ("wallpaperId", author, "createdAt"); + + +-- +-- Name: Site Site_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public."Site" + ADD CONSTRAINT "Site_pkey" PRIMARY KEY (id); + + +-- +-- Name: Site Site_url_key; Type: CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public."Site" + ADD CONSTRAINT "Site_url_key" UNIQUE (url); + + +-- +-- Name: SupportRequest SupportRequest_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public."SupportRequest" + ADD CONSTRAINT "SupportRequest_pkey" PRIMARY KEY (id); + + +-- +-- Name: Value Value_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public."Value" + ADD CONSTRAINT "Value_pkey" PRIMARY KEY (id); + + +-- +-- Name: Wallpaper Wallpaper_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public."Wallpaper" + ADD CONSTRAINT "Wallpaper_pkey" PRIMARY KEY (id); + + +-- +-- Name: buckets buckets_pkey; Type: CONSTRAINT; Schema: storage; Owner: supabase_storage_admin +-- + +ALTER TABLE ONLY storage.buckets + ADD CONSTRAINT buckets_pkey PRIMARY KEY (id); + + +-- +-- Name: migrations migrations_name_key; Type: CONSTRAINT; Schema: storage; Owner: supabase_storage_admin +-- + +ALTER TABLE ONLY storage.migrations + ADD CONSTRAINT migrations_name_key UNIQUE (name); + + +-- +-- Name: migrations migrations_pkey; Type: CONSTRAINT; Schema: storage; Owner: supabase_storage_admin +-- + +ALTER TABLE ONLY storage.migrations + ADD CONSTRAINT migrations_pkey PRIMARY KEY (id); + + +-- +-- Name: objects objects_pkey; Type: CONSTRAINT; Schema: storage; Owner: supabase_storage_admin +-- + +ALTER TABLE ONLY storage.objects + ADD CONSTRAINT objects_pkey PRIMARY KEY (id); + + +-- +-- Name: audit_logs_instance_id_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin +-- + +CREATE INDEX audit_logs_instance_id_idx ON auth.audit_log_entries USING btree (instance_id); + + +-- +-- Name: confirmation_token_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin +-- + +CREATE UNIQUE INDEX confirmation_token_idx ON auth.users USING btree (confirmation_token) WHERE ((confirmation_token)::text !~ '^[0-9 ]*$'::text); + + +-- +-- Name: email_change_token_current_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin +-- + +CREATE UNIQUE INDEX email_change_token_current_idx ON auth.users USING btree (email_change_token_current) WHERE ((email_change_token_current)::text !~ '^[0-9 ]*$'::text); + + +-- +-- Name: email_change_token_new_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin +-- + +CREATE UNIQUE INDEX email_change_token_new_idx ON auth.users USING btree (email_change_token_new) WHERE ((email_change_token_new)::text !~ '^[0-9 ]*$'::text); + + +-- +-- Name: factor_id_created_at_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin +-- + +CREATE INDEX factor_id_created_at_idx ON auth.mfa_factors USING btree (user_id, created_at); + + +-- +-- Name: flow_state_created_at_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin +-- + +CREATE INDEX flow_state_created_at_idx ON auth.flow_state USING btree (created_at DESC); + + +-- +-- Name: identities_email_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin +-- + +CREATE INDEX identities_email_idx ON auth.identities USING btree (email text_pattern_ops); + + +-- +-- Name: INDEX identities_email_idx; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin +-- + +COMMENT ON INDEX auth.identities_email_idx IS 'Auth: Ensures indexed queries on the email column'; + + +-- +-- Name: identities_user_id_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin +-- + +CREATE INDEX identities_user_id_idx ON auth.identities USING btree (user_id); + + +-- +-- Name: idx_auth_code; Type: INDEX; Schema: auth; Owner: supabase_auth_admin +-- + +CREATE INDEX idx_auth_code ON auth.flow_state USING btree (auth_code); + + +-- +-- Name: idx_user_id_auth_method; Type: INDEX; Schema: auth; Owner: supabase_auth_admin +-- + +CREATE INDEX idx_user_id_auth_method ON auth.flow_state USING btree (user_id, authentication_method); + + +-- +-- Name: mfa_challenge_created_at_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin +-- + +CREATE INDEX mfa_challenge_created_at_idx ON auth.mfa_challenges USING btree (created_at DESC); + + +-- +-- Name: mfa_factors_user_friendly_name_unique; Type: INDEX; Schema: auth; Owner: supabase_auth_admin +-- + +CREATE UNIQUE INDEX mfa_factors_user_friendly_name_unique ON auth.mfa_factors USING btree (friendly_name, user_id) WHERE (TRIM(BOTH FROM friendly_name) <> ''::text); + + +-- +-- Name: reauthentication_token_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin +-- + +CREATE UNIQUE INDEX reauthentication_token_idx ON auth.users USING btree (reauthentication_token) WHERE ((reauthentication_token)::text !~ '^[0-9 ]*$'::text); + + +-- +-- Name: recovery_token_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin +-- + +CREATE UNIQUE INDEX recovery_token_idx ON auth.users USING btree (recovery_token) WHERE ((recovery_token)::text !~ '^[0-9 ]*$'::text); + + +-- +-- Name: refresh_tokens_instance_id_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin +-- + +CREATE INDEX refresh_tokens_instance_id_idx ON auth.refresh_tokens USING btree (instance_id); + + +-- +-- Name: refresh_tokens_instance_id_user_id_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin +-- + +CREATE INDEX refresh_tokens_instance_id_user_id_idx ON auth.refresh_tokens USING btree (instance_id, user_id); + + +-- +-- Name: refresh_tokens_parent_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin +-- + +CREATE INDEX refresh_tokens_parent_idx ON auth.refresh_tokens USING btree (parent); + + +-- +-- Name: refresh_tokens_session_id_revoked_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin +-- + +CREATE INDEX refresh_tokens_session_id_revoked_idx ON auth.refresh_tokens USING btree (session_id, revoked); + + +-- +-- Name: refresh_tokens_updated_at_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin +-- + +CREATE INDEX refresh_tokens_updated_at_idx ON auth.refresh_tokens USING btree (updated_at DESC); + + +-- +-- Name: saml_providers_sso_provider_id_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin +-- + +CREATE INDEX saml_providers_sso_provider_id_idx ON auth.saml_providers USING btree (sso_provider_id); + + +-- +-- Name: saml_relay_states_created_at_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin +-- + +CREATE INDEX saml_relay_states_created_at_idx ON auth.saml_relay_states USING btree (created_at DESC); + + +-- +-- Name: saml_relay_states_for_email_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin +-- + +CREATE INDEX saml_relay_states_for_email_idx ON auth.saml_relay_states USING btree (for_email); + + +-- +-- Name: saml_relay_states_sso_provider_id_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin +-- + +CREATE INDEX saml_relay_states_sso_provider_id_idx ON auth.saml_relay_states USING btree (sso_provider_id); + + +-- +-- Name: sessions_not_after_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin +-- + +CREATE INDEX sessions_not_after_idx ON auth.sessions USING btree (not_after DESC); + + +-- +-- Name: sessions_user_id_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin +-- + +CREATE INDEX sessions_user_id_idx ON auth.sessions USING btree (user_id); + + +-- +-- Name: sso_domains_domain_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin +-- + +CREATE UNIQUE INDEX sso_domains_domain_idx ON auth.sso_domains USING btree (lower(domain)); + + +-- +-- Name: sso_domains_sso_provider_id_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin +-- + +CREATE INDEX sso_domains_sso_provider_id_idx ON auth.sso_domains USING btree (sso_provider_id); + + +-- +-- Name: sso_providers_resource_id_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin +-- + +CREATE UNIQUE INDEX sso_providers_resource_id_idx ON auth.sso_providers USING btree (lower(resource_id)); + + +-- +-- Name: user_id_created_at_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin +-- + +CREATE INDEX user_id_created_at_idx ON auth.sessions USING btree (user_id, created_at); + + +-- +-- Name: users_email_partial_key; Type: INDEX; Schema: auth; Owner: supabase_auth_admin +-- + +CREATE UNIQUE INDEX users_email_partial_key ON auth.users USING btree (email) WHERE (is_sso_user = false); + + +-- +-- Name: INDEX users_email_partial_key; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin +-- + +COMMENT ON INDEX auth.users_email_partial_key IS 'Auth: A partial unique index that applies only when is_sso_user is false'; + + +-- +-- Name: users_instance_id_email_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin +-- + +CREATE INDEX users_instance_id_email_idx ON auth.users USING btree (instance_id, lower((email)::text)); + + +-- +-- Name: users_instance_id_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin +-- + +CREATE INDEX users_instance_id_idx ON auth.users USING btree (instance_id); + + +-- +-- Name: bname; Type: INDEX; Schema: storage; Owner: supabase_storage_admin +-- + +CREATE UNIQUE INDEX bname ON storage.buckets USING btree (name); + + +-- +-- Name: bucketid_objname; Type: INDEX; Schema: storage; Owner: supabase_storage_admin +-- + +CREATE UNIQUE INDEX bucketid_objname ON storage.objects USING btree (bucket_id, name); + + +-- +-- Name: name_prefix_search; Type: INDEX; Schema: storage; Owner: supabase_storage_admin +-- + +CREATE INDEX name_prefix_search ON storage.objects USING btree (name text_pattern_ops); + + +-- +-- Name: objects update_objects_updated_at; Type: TRIGGER; Schema: storage; Owner: supabase_storage_admin +-- + +CREATE TRIGGER update_objects_updated_at BEFORE UPDATE ON storage.objects FOR EACH ROW EXECUTE FUNCTION storage.update_updated_at_column(); + + +-- +-- Name: identities identities_user_id_fkey; Type: FK CONSTRAINT; Schema: auth; Owner: supabase_auth_admin +-- + +ALTER TABLE ONLY auth.identities + ADD CONSTRAINT identities_user_id_fkey FOREIGN KEY (user_id) REFERENCES auth.users(id) ON DELETE CASCADE; + + +-- +-- Name: mfa_amr_claims mfa_amr_claims_session_id_fkey; Type: FK CONSTRAINT; Schema: auth; Owner: supabase_auth_admin +-- + +ALTER TABLE ONLY auth.mfa_amr_claims + ADD CONSTRAINT mfa_amr_claims_session_id_fkey FOREIGN KEY (session_id) REFERENCES auth.sessions(id) ON DELETE CASCADE; + + +-- +-- Name: mfa_challenges mfa_challenges_auth_factor_id_fkey; Type: FK CONSTRAINT; Schema: auth; Owner: supabase_auth_admin +-- + +ALTER TABLE ONLY auth.mfa_challenges + ADD CONSTRAINT mfa_challenges_auth_factor_id_fkey FOREIGN KEY (factor_id) REFERENCES auth.mfa_factors(id) ON DELETE CASCADE; + + +-- +-- Name: mfa_factors mfa_factors_user_id_fkey; Type: FK CONSTRAINT; Schema: auth; Owner: supabase_auth_admin +-- + +ALTER TABLE ONLY auth.mfa_factors + ADD CONSTRAINT mfa_factors_user_id_fkey FOREIGN KEY (user_id) REFERENCES auth.users(id) ON DELETE CASCADE; + + +-- +-- Name: refresh_tokens refresh_tokens_session_id_fkey; Type: FK CONSTRAINT; Schema: auth; Owner: supabase_auth_admin +-- + +ALTER TABLE ONLY auth.refresh_tokens + ADD CONSTRAINT refresh_tokens_session_id_fkey FOREIGN KEY (session_id) REFERENCES auth.sessions(id) ON DELETE CASCADE; + + +-- +-- Name: saml_providers saml_providers_sso_provider_id_fkey; Type: FK CONSTRAINT; Schema: auth; Owner: supabase_auth_admin +-- + +ALTER TABLE ONLY auth.saml_providers + ADD CONSTRAINT saml_providers_sso_provider_id_fkey FOREIGN KEY (sso_provider_id) REFERENCES auth.sso_providers(id) ON DELETE CASCADE; + + +-- +-- Name: saml_relay_states saml_relay_states_sso_provider_id_fkey; Type: FK CONSTRAINT; Schema: auth; Owner: supabase_auth_admin +-- + +ALTER TABLE ONLY auth.saml_relay_states + ADD CONSTRAINT saml_relay_states_sso_provider_id_fkey FOREIGN KEY (sso_provider_id) REFERENCES auth.sso_providers(id) ON DELETE CASCADE; + + +-- +-- Name: sessions sessions_user_id_fkey; Type: FK CONSTRAINT; Schema: auth; Owner: supabase_auth_admin +-- + +ALTER TABLE ONLY auth.sessions + ADD CONSTRAINT sessions_user_id_fkey FOREIGN KEY (user_id) REFERENCES auth.users(id) ON DELETE CASCADE; + + +-- +-- Name: sso_domains sso_domains_sso_provider_id_fkey; Type: FK CONSTRAINT; Schema: auth; Owner: supabase_auth_admin +-- + +ALTER TABLE ONLY auth.sso_domains + ADD CONSTRAINT sso_domains_sso_provider_id_fkey FOREIGN KEY (sso_provider_id) REFERENCES auth.sso_providers(id) ON DELETE CASCADE; + + +-- +-- Name: Reaction Reaction_wallpaperId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public."Reaction" + ADD CONSTRAINT "Reaction_wallpaperId_fkey" FOREIGN KEY ("wallpaperId") REFERENCES public."Wallpaper"(id) ON DELETE CASCADE; + + +-- +-- Name: buckets buckets_owner_fkey; Type: FK CONSTRAINT; Schema: storage; Owner: supabase_storage_admin +-- + +ALTER TABLE ONLY storage.buckets + ADD CONSTRAINT buckets_owner_fkey FOREIGN KEY (owner) REFERENCES auth.users(id); + + +-- +-- Name: objects objects_bucketId_fkey; Type: FK CONSTRAINT; Schema: storage; Owner: supabase_storage_admin +-- + +ALTER TABLE ONLY storage.objects + ADD CONSTRAINT "objects_bucketId_fkey" FOREIGN KEY (bucket_id) REFERENCES storage.buckets(id); + + +-- +-- Name: objects objects_owner_fkey; Type: FK CONSTRAINT; Schema: storage; Owner: supabase_storage_admin +-- + +ALTER TABLE ONLY storage.objects + ADD CONSTRAINT objects_owner_fkey FOREIGN KEY (owner) REFERENCES auth.users(id); + + +-- +-- Name: SupportRequest Anyone can insert a row; Type: POLICY; Schema: public; Owner: postgres +-- + +CREATE POLICY " Anyone can insert a row" ON public."SupportRequest" FOR INSERT TO anon WITH CHECK (true); + + +-- +-- Name: Wallpaper Anyone can insert a row; Type: POLICY; Schema: public; Owner: postgres +-- + +CREATE POLICY " Anyone can insert a row" ON public."Wallpaper" FOR INSERT TO anon WITH CHECK (true); + + +-- +-- Name: Client Anyone can insert a row; Type: POLICY; Schema: public; Owner: postgres +-- + +CREATE POLICY "Anyone can insert a row" ON public."Client" FOR INSERT TO anon WITH CHECK (true); + + +-- +-- Name: Reaction Anyone can insert a row; Type: POLICY; Schema: public; Owner: postgres +-- + +CREATE POLICY "Anyone can insert a row" ON public."Reaction" FOR INSERT TO anon WITH CHECK (true); + + +-- +-- Name: Site Anyone can insert a row; Type: POLICY; Schema: public; Owner: postgres +-- + +CREATE POLICY "Anyone can insert a row" ON public."Site" FOR INSERT TO anon WITH CHECK (true); + + +-- +-- Name: Client; Type: ROW SECURITY; Schema: public; Owner: postgres +-- + +ALTER TABLE public."Client" ENABLE ROW LEVEL SECURITY; + +-- +-- Name: Prompt; Type: ROW SECURITY; Schema: public; Owner: postgres +-- + +ALTER TABLE public."Prompt" ENABLE ROW LEVEL SECURITY; + +-- +-- Name: Reaction; Type: ROW SECURITY; Schema: public; Owner: postgres +-- + +ALTER TABLE public."Reaction" ENABLE ROW LEVEL SECURITY; + +-- +-- Name: Site; Type: ROW SECURITY; Schema: public; Owner: postgres +-- + +ALTER TABLE public."Site" ENABLE ROW LEVEL SECURITY; + +-- +-- Name: SupportRequest; Type: ROW SECURITY; Schema: public; Owner: postgres +-- + +ALTER TABLE public."SupportRequest" ENABLE ROW LEVEL SECURITY; + +-- +-- Name: Value; Type: ROW SECURITY; Schema: public; Owner: postgres +-- + +ALTER TABLE public."Value" ENABLE ROW LEVEL SECURITY; + +-- +-- Name: Wallpaper; Type: ROW SECURITY; Schema: public; Owner: postgres +-- + +ALTER TABLE public."Wallpaper" ENABLE ROW LEVEL SECURITY; + +-- +-- Name: buckets; Type: ROW SECURITY; Schema: storage; Owner: supabase_storage_admin +-- + +ALTER TABLE storage.buckets ENABLE ROW LEVEL SECURITY; + +-- +-- Name: migrations; Type: ROW SECURITY; Schema: storage; Owner: supabase_storage_admin +-- + +ALTER TABLE storage.migrations ENABLE ROW LEVEL SECURITY; + +-- +-- Name: objects; Type: ROW SECURITY; Schema: storage; Owner: supabase_storage_admin +-- + +ALTER TABLE storage.objects ENABLE ROW LEVEL SECURITY; + +-- +-- Name: supabase_realtime; Type: PUBLICATION; Schema: -; Owner: postgres +-- + +CREATE PUBLICATION supabase_realtime WITH (publish = 'insert, update, delete, truncate'); + + +ALTER PUBLICATION supabase_realtime OWNER TO postgres; + +-- +-- Name: SCHEMA auth; Type: ACL; Schema: -; Owner: supabase_admin +-- + +GRANT USAGE ON SCHEMA auth TO anon; +GRANT USAGE ON SCHEMA auth TO authenticated; +GRANT USAGE ON SCHEMA auth TO service_role; +GRANT ALL ON SCHEMA auth TO supabase_auth_admin; +GRANT ALL ON SCHEMA auth TO dashboard_user; +GRANT ALL ON SCHEMA auth TO postgres; + + +-- +-- Name: SCHEMA extensions; Type: ACL; Schema: -; Owner: postgres +-- + +GRANT USAGE ON SCHEMA extensions TO anon; +GRANT USAGE ON SCHEMA extensions TO authenticated; +GRANT USAGE ON SCHEMA extensions TO service_role; +GRANT ALL ON SCHEMA extensions TO dashboard_user; + + +-- +-- Name: SCHEMA graphql_public; Type: ACL; Schema: -; Owner: supabase_admin +-- + +GRANT USAGE ON SCHEMA graphql_public TO postgres; +GRANT USAGE ON SCHEMA graphql_public TO anon; +GRANT USAGE ON SCHEMA graphql_public TO authenticated; +GRANT USAGE ON SCHEMA graphql_public TO service_role; + + +-- +-- Name: SCHEMA public; Type: ACL; Schema: -; Owner: pg_database_owner +-- + +GRANT USAGE ON SCHEMA public TO postgres; +GRANT USAGE ON SCHEMA public TO anon; +GRANT USAGE ON SCHEMA public TO authenticated; +GRANT USAGE ON SCHEMA public TO service_role; + + +-- +-- Name: SCHEMA realtime; Type: ACL; Schema: -; Owner: supabase_admin +-- + +GRANT USAGE ON SCHEMA realtime TO postgres; + + +-- +-- Name: SCHEMA storage; Type: ACL; Schema: -; Owner: supabase_admin +-- + +GRANT ALL ON SCHEMA storage TO postgres; +GRANT USAGE ON SCHEMA storage TO anon; +GRANT USAGE ON SCHEMA storage TO authenticated; +GRANT USAGE ON SCHEMA storage TO service_role; +GRANT ALL ON SCHEMA storage TO supabase_storage_admin; +GRANT ALL ON SCHEMA storage TO dashboard_user; + + +-- +-- Name: FUNCTION email(); Type: ACL; Schema: auth; Owner: supabase_auth_admin +-- + +GRANT ALL ON FUNCTION auth.email() TO dashboard_user; + + +-- +-- Name: FUNCTION jwt(); Type: ACL; Schema: auth; Owner: supabase_auth_admin +-- + +GRANT ALL ON FUNCTION auth.jwt() TO postgres; +GRANT ALL ON FUNCTION auth.jwt() TO dashboard_user; + + +-- +-- Name: FUNCTION role(); Type: ACL; Schema: auth; Owner: supabase_auth_admin +-- + +GRANT ALL ON FUNCTION auth.role() TO dashboard_user; + + +-- +-- Name: FUNCTION uid(); Type: ACL; Schema: auth; Owner: supabase_auth_admin +-- + +GRANT ALL ON FUNCTION auth.uid() TO dashboard_user; + + +-- +-- Name: FUNCTION algorithm_sign(signables text, secret text, algorithm text); Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON FUNCTION extensions.algorithm_sign(signables text, secret text, algorithm text) FROM postgres; +GRANT ALL ON FUNCTION extensions.algorithm_sign(signables text, secret text, algorithm text) TO postgres WITH GRANT OPTION; +GRANT ALL ON FUNCTION extensions.algorithm_sign(signables text, secret text, algorithm text) TO dashboard_user; + + +-- +-- Name: FUNCTION armor(bytea); Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON FUNCTION extensions.armor(bytea) FROM postgres; +GRANT ALL ON FUNCTION extensions.armor(bytea) TO postgres WITH GRANT OPTION; +GRANT ALL ON FUNCTION extensions.armor(bytea) TO dashboard_user; + + +-- +-- Name: FUNCTION armor(bytea, text[], text[]); Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON FUNCTION extensions.armor(bytea, text[], text[]) FROM postgres; +GRANT ALL ON FUNCTION extensions.armor(bytea, text[], text[]) TO postgres WITH GRANT OPTION; +GRANT ALL ON FUNCTION extensions.armor(bytea, text[], text[]) TO dashboard_user; + + +-- +-- Name: FUNCTION crypt(text, text); Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON FUNCTION extensions.crypt(text, text) FROM postgres; +GRANT ALL ON FUNCTION extensions.crypt(text, text) TO postgres WITH GRANT OPTION; +GRANT ALL ON FUNCTION extensions.crypt(text, text) TO dashboard_user; + + +-- +-- Name: FUNCTION dearmor(text); Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON FUNCTION extensions.dearmor(text) FROM postgres; +GRANT ALL ON FUNCTION extensions.dearmor(text) TO postgres WITH GRANT OPTION; +GRANT ALL ON FUNCTION extensions.dearmor(text) TO dashboard_user; + + +-- +-- Name: FUNCTION decrypt(bytea, bytea, text); Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON FUNCTION extensions.decrypt(bytea, bytea, text) FROM postgres; +GRANT ALL ON FUNCTION extensions.decrypt(bytea, bytea, text) TO postgres WITH GRANT OPTION; +GRANT ALL ON FUNCTION extensions.decrypt(bytea, bytea, text) TO dashboard_user; + + +-- +-- Name: FUNCTION decrypt_iv(bytea, bytea, bytea, text); Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON FUNCTION extensions.decrypt_iv(bytea, bytea, bytea, text) FROM postgres; +GRANT ALL ON FUNCTION extensions.decrypt_iv(bytea, bytea, bytea, text) TO postgres WITH GRANT OPTION; +GRANT ALL ON FUNCTION extensions.decrypt_iv(bytea, bytea, bytea, text) TO dashboard_user; + + +-- +-- Name: FUNCTION digest(bytea, text); Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON FUNCTION extensions.digest(bytea, text) FROM postgres; +GRANT ALL ON FUNCTION extensions.digest(bytea, text) TO postgres WITH GRANT OPTION; +GRANT ALL ON FUNCTION extensions.digest(bytea, text) TO dashboard_user; + + +-- +-- Name: FUNCTION digest(text, text); Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON FUNCTION extensions.digest(text, text) FROM postgres; +GRANT ALL ON FUNCTION extensions.digest(text, text) TO postgres WITH GRANT OPTION; +GRANT ALL ON FUNCTION extensions.digest(text, text) TO dashboard_user; + + +-- +-- Name: FUNCTION encrypt(bytea, bytea, text); Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON FUNCTION extensions.encrypt(bytea, bytea, text) FROM postgres; +GRANT ALL ON FUNCTION extensions.encrypt(bytea, bytea, text) TO postgres WITH GRANT OPTION; +GRANT ALL ON FUNCTION extensions.encrypt(bytea, bytea, text) TO dashboard_user; + + +-- +-- Name: FUNCTION encrypt_iv(bytea, bytea, bytea, text); Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON FUNCTION extensions.encrypt_iv(bytea, bytea, bytea, text) FROM postgres; +GRANT ALL ON FUNCTION extensions.encrypt_iv(bytea, bytea, bytea, text) TO postgres WITH GRANT OPTION; +GRANT ALL ON FUNCTION extensions.encrypt_iv(bytea, bytea, bytea, text) TO dashboard_user; + + +-- +-- Name: FUNCTION gen_random_bytes(integer); Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON FUNCTION extensions.gen_random_bytes(integer) FROM postgres; +GRANT ALL ON FUNCTION extensions.gen_random_bytes(integer) TO postgres WITH GRANT OPTION; +GRANT ALL ON FUNCTION extensions.gen_random_bytes(integer) TO dashboard_user; + + +-- +-- Name: FUNCTION gen_random_uuid(); Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON FUNCTION extensions.gen_random_uuid() FROM postgres; +GRANT ALL ON FUNCTION extensions.gen_random_uuid() TO postgres WITH GRANT OPTION; +GRANT ALL ON FUNCTION extensions.gen_random_uuid() TO dashboard_user; + + +-- +-- Name: FUNCTION gen_salt(text); Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON FUNCTION extensions.gen_salt(text) FROM postgres; +GRANT ALL ON FUNCTION extensions.gen_salt(text) TO postgres WITH GRANT OPTION; +GRANT ALL ON FUNCTION extensions.gen_salt(text) TO dashboard_user; + + +-- +-- Name: FUNCTION gen_salt(text, integer); Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON FUNCTION extensions.gen_salt(text, integer) FROM postgres; +GRANT ALL ON FUNCTION extensions.gen_salt(text, integer) TO postgres WITH GRANT OPTION; +GRANT ALL ON FUNCTION extensions.gen_salt(text, integer) TO dashboard_user; + + +-- +-- Name: FUNCTION grant_pg_cron_access(); Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON FUNCTION extensions.grant_pg_cron_access() FROM postgres; +GRANT ALL ON FUNCTION extensions.grant_pg_cron_access() TO postgres WITH GRANT OPTION; +GRANT ALL ON FUNCTION extensions.grant_pg_cron_access() TO dashboard_user; + + +-- +-- Name: FUNCTION grant_pg_graphql_access(); Type: ACL; Schema: extensions; Owner: supabase_admin +-- + +GRANT ALL ON FUNCTION extensions.grant_pg_graphql_access() TO postgres WITH GRANT OPTION; + + +-- +-- Name: FUNCTION grant_pg_net_access(); Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON FUNCTION extensions.grant_pg_net_access() FROM postgres; +GRANT ALL ON FUNCTION extensions.grant_pg_net_access() TO postgres WITH GRANT OPTION; +GRANT ALL ON FUNCTION extensions.grant_pg_net_access() TO dashboard_user; + + +-- +-- Name: FUNCTION hmac(bytea, bytea, text); Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON FUNCTION extensions.hmac(bytea, bytea, text) FROM postgres; +GRANT ALL ON FUNCTION extensions.hmac(bytea, bytea, text) TO postgres WITH GRANT OPTION; +GRANT ALL ON FUNCTION extensions.hmac(bytea, bytea, text) TO dashboard_user; + + +-- +-- Name: FUNCTION hmac(text, text, text); Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON FUNCTION extensions.hmac(text, text, text) FROM postgres; +GRANT ALL ON FUNCTION extensions.hmac(text, text, text) TO postgres WITH GRANT OPTION; +GRANT ALL ON FUNCTION extensions.hmac(text, text, text) TO dashboard_user; + + +-- +-- Name: FUNCTION pg_stat_statements(showtext boolean, OUT userid oid, OUT dbid oid, OUT toplevel boolean, OUT queryid bigint, OUT query text, OUT plans bigint, OUT total_plan_time double precision, OUT min_plan_time double precision, OUT max_plan_time double precision, OUT mean_plan_time double precision, OUT stddev_plan_time double precision, OUT calls bigint, OUT total_exec_time double precision, OUT min_exec_time double precision, OUT max_exec_time double precision, OUT mean_exec_time double precision, OUT stddev_exec_time double precision, OUT rows bigint, OUT shared_blks_hit bigint, OUT shared_blks_read bigint, OUT shared_blks_dirtied bigint, OUT shared_blks_written bigint, OUT local_blks_hit bigint, OUT local_blks_read bigint, OUT local_blks_dirtied bigint, OUT local_blks_written bigint, OUT temp_blks_read bigint, OUT temp_blks_written bigint, OUT blk_read_time double precision, OUT blk_write_time double precision, OUT temp_blk_read_time double precision, OUT temp_blk_write_time double precision, OUT wal_records bigint, OUT wal_fpi bigint, OUT wal_bytes numeric, OUT jit_functions bigint, OUT jit_generation_time double precision, OUT jit_inlining_count bigint, OUT jit_inlining_time double precision, OUT jit_optimization_count bigint, OUT jit_optimization_time double precision, OUT jit_emission_count bigint, OUT jit_emission_time double precision); Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON FUNCTION extensions.pg_stat_statements(showtext boolean, OUT userid oid, OUT dbid oid, OUT toplevel boolean, OUT queryid bigint, OUT query text, OUT plans bigint, OUT total_plan_time double precision, OUT min_plan_time double precision, OUT max_plan_time double precision, OUT mean_plan_time double precision, OUT stddev_plan_time double precision, OUT calls bigint, OUT total_exec_time double precision, OUT min_exec_time double precision, OUT max_exec_time double precision, OUT mean_exec_time double precision, OUT stddev_exec_time double precision, OUT rows bigint, OUT shared_blks_hit bigint, OUT shared_blks_read bigint, OUT shared_blks_dirtied bigint, OUT shared_blks_written bigint, OUT local_blks_hit bigint, OUT local_blks_read bigint, OUT local_blks_dirtied bigint, OUT local_blks_written bigint, OUT temp_blks_read bigint, OUT temp_blks_written bigint, OUT blk_read_time double precision, OUT blk_write_time double precision, OUT temp_blk_read_time double precision, OUT temp_blk_write_time double precision, OUT wal_records bigint, OUT wal_fpi bigint, OUT wal_bytes numeric, OUT jit_functions bigint, OUT jit_generation_time double precision, OUT jit_inlining_count bigint, OUT jit_inlining_time double precision, OUT jit_optimization_count bigint, OUT jit_optimization_time double precision, OUT jit_emission_count bigint, OUT jit_emission_time double precision) FROM postgres; +GRANT ALL ON FUNCTION extensions.pg_stat_statements(showtext boolean, OUT userid oid, OUT dbid oid, OUT toplevel boolean, OUT queryid bigint, OUT query text, OUT plans bigint, OUT total_plan_time double precision, OUT min_plan_time double precision, OUT max_plan_time double precision, OUT mean_plan_time double precision, OUT stddev_plan_time double precision, OUT calls bigint, OUT total_exec_time double precision, OUT min_exec_time double precision, OUT max_exec_time double precision, OUT mean_exec_time double precision, OUT stddev_exec_time double precision, OUT rows bigint, OUT shared_blks_hit bigint, OUT shared_blks_read bigint, OUT shared_blks_dirtied bigint, OUT shared_blks_written bigint, OUT local_blks_hit bigint, OUT local_blks_read bigint, OUT local_blks_dirtied bigint, OUT local_blks_written bigint, OUT temp_blks_read bigint, OUT temp_blks_written bigint, OUT blk_read_time double precision, OUT blk_write_time double precision, OUT temp_blk_read_time double precision, OUT temp_blk_write_time double precision, OUT wal_records bigint, OUT wal_fpi bigint, OUT wal_bytes numeric, OUT jit_functions bigint, OUT jit_generation_time double precision, OUT jit_inlining_count bigint, OUT jit_inlining_time double precision, OUT jit_optimization_count bigint, OUT jit_optimization_time double precision, OUT jit_emission_count bigint, OUT jit_emission_time double precision) TO postgres WITH GRANT OPTION; +GRANT ALL ON FUNCTION extensions.pg_stat_statements(showtext boolean, OUT userid oid, OUT dbid oid, OUT toplevel boolean, OUT queryid bigint, OUT query text, OUT plans bigint, OUT total_plan_time double precision, OUT min_plan_time double precision, OUT max_plan_time double precision, OUT mean_plan_time double precision, OUT stddev_plan_time double precision, OUT calls bigint, OUT total_exec_time double precision, OUT min_exec_time double precision, OUT max_exec_time double precision, OUT mean_exec_time double precision, OUT stddev_exec_time double precision, OUT rows bigint, OUT shared_blks_hit bigint, OUT shared_blks_read bigint, OUT shared_blks_dirtied bigint, OUT shared_blks_written bigint, OUT local_blks_hit bigint, OUT local_blks_read bigint, OUT local_blks_dirtied bigint, OUT local_blks_written bigint, OUT temp_blks_read bigint, OUT temp_blks_written bigint, OUT blk_read_time double precision, OUT blk_write_time double precision, OUT temp_blk_read_time double precision, OUT temp_blk_write_time double precision, OUT wal_records bigint, OUT wal_fpi bigint, OUT wal_bytes numeric, OUT jit_functions bigint, OUT jit_generation_time double precision, OUT jit_inlining_count bigint, OUT jit_inlining_time double precision, OUT jit_optimization_count bigint, OUT jit_optimization_time double precision, OUT jit_emission_count bigint, OUT jit_emission_time double precision) TO dashboard_user; + + +-- +-- Name: FUNCTION pg_stat_statements_info(OUT dealloc bigint, OUT stats_reset timestamp with time zone); Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON FUNCTION extensions.pg_stat_statements_info(OUT dealloc bigint, OUT stats_reset timestamp with time zone) FROM postgres; +GRANT ALL ON FUNCTION extensions.pg_stat_statements_info(OUT dealloc bigint, OUT stats_reset timestamp with time zone) TO postgres WITH GRANT OPTION; +GRANT ALL ON FUNCTION extensions.pg_stat_statements_info(OUT dealloc bigint, OUT stats_reset timestamp with time zone) TO dashboard_user; + + +-- +-- Name: FUNCTION pg_stat_statements_reset(userid oid, dbid oid, queryid bigint); Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON FUNCTION extensions.pg_stat_statements_reset(userid oid, dbid oid, queryid bigint) FROM postgres; +GRANT ALL ON FUNCTION extensions.pg_stat_statements_reset(userid oid, dbid oid, queryid bigint) TO postgres WITH GRANT OPTION; +GRANT ALL ON FUNCTION extensions.pg_stat_statements_reset(userid oid, dbid oid, queryid bigint) TO dashboard_user; + + +-- +-- Name: FUNCTION pgp_armor_headers(text, OUT key text, OUT value text); Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON FUNCTION extensions.pgp_armor_headers(text, OUT key text, OUT value text) FROM postgres; +GRANT ALL ON FUNCTION extensions.pgp_armor_headers(text, OUT key text, OUT value text) TO postgres WITH GRANT OPTION; +GRANT ALL ON FUNCTION extensions.pgp_armor_headers(text, OUT key text, OUT value text) TO dashboard_user; + + +-- +-- Name: FUNCTION pgp_key_id(bytea); Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON FUNCTION extensions.pgp_key_id(bytea) FROM postgres; +GRANT ALL ON FUNCTION extensions.pgp_key_id(bytea) TO postgres WITH GRANT OPTION; +GRANT ALL ON FUNCTION extensions.pgp_key_id(bytea) TO dashboard_user; + + +-- +-- Name: FUNCTION pgp_pub_decrypt(bytea, bytea); Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON FUNCTION extensions.pgp_pub_decrypt(bytea, bytea) FROM postgres; +GRANT ALL ON FUNCTION extensions.pgp_pub_decrypt(bytea, bytea) TO postgres WITH GRANT OPTION; +GRANT ALL ON FUNCTION extensions.pgp_pub_decrypt(bytea, bytea) TO dashboard_user; + + +-- +-- Name: FUNCTION pgp_pub_decrypt(bytea, bytea, text); Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON FUNCTION extensions.pgp_pub_decrypt(bytea, bytea, text) FROM postgres; +GRANT ALL ON FUNCTION extensions.pgp_pub_decrypt(bytea, bytea, text) TO postgres WITH GRANT OPTION; +GRANT ALL ON FUNCTION extensions.pgp_pub_decrypt(bytea, bytea, text) TO dashboard_user; + + +-- +-- Name: FUNCTION pgp_pub_decrypt(bytea, bytea, text, text); Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON FUNCTION extensions.pgp_pub_decrypt(bytea, bytea, text, text) FROM postgres; +GRANT ALL ON FUNCTION extensions.pgp_pub_decrypt(bytea, bytea, text, text) TO postgres WITH GRANT OPTION; +GRANT ALL ON FUNCTION extensions.pgp_pub_decrypt(bytea, bytea, text, text) TO dashboard_user; + + +-- +-- Name: FUNCTION pgp_pub_decrypt_bytea(bytea, bytea); Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON FUNCTION extensions.pgp_pub_decrypt_bytea(bytea, bytea) FROM postgres; +GRANT ALL ON FUNCTION extensions.pgp_pub_decrypt_bytea(bytea, bytea) TO postgres WITH GRANT OPTION; +GRANT ALL ON FUNCTION extensions.pgp_pub_decrypt_bytea(bytea, bytea) TO dashboard_user; + + +-- +-- Name: FUNCTION pgp_pub_decrypt_bytea(bytea, bytea, text); Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON FUNCTION extensions.pgp_pub_decrypt_bytea(bytea, bytea, text) FROM postgres; +GRANT ALL ON FUNCTION extensions.pgp_pub_decrypt_bytea(bytea, bytea, text) TO postgres WITH GRANT OPTION; +GRANT ALL ON FUNCTION extensions.pgp_pub_decrypt_bytea(bytea, bytea, text) TO dashboard_user; + + +-- +-- Name: FUNCTION pgp_pub_decrypt_bytea(bytea, bytea, text, text); Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON FUNCTION extensions.pgp_pub_decrypt_bytea(bytea, bytea, text, text) FROM postgres; +GRANT ALL ON FUNCTION extensions.pgp_pub_decrypt_bytea(bytea, bytea, text, text) TO postgres WITH GRANT OPTION; +GRANT ALL ON FUNCTION extensions.pgp_pub_decrypt_bytea(bytea, bytea, text, text) TO dashboard_user; + + +-- +-- Name: FUNCTION pgp_pub_encrypt(text, bytea); Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON FUNCTION extensions.pgp_pub_encrypt(text, bytea) FROM postgres; +GRANT ALL ON FUNCTION extensions.pgp_pub_encrypt(text, bytea) TO postgres WITH GRANT OPTION; +GRANT ALL ON FUNCTION extensions.pgp_pub_encrypt(text, bytea) TO dashboard_user; + + +-- +-- Name: FUNCTION pgp_pub_encrypt(text, bytea, text); Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON FUNCTION extensions.pgp_pub_encrypt(text, bytea, text) FROM postgres; +GRANT ALL ON FUNCTION extensions.pgp_pub_encrypt(text, bytea, text) TO postgres WITH GRANT OPTION; +GRANT ALL ON FUNCTION extensions.pgp_pub_encrypt(text, bytea, text) TO dashboard_user; + + +-- +-- Name: FUNCTION pgp_pub_encrypt_bytea(bytea, bytea); Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON FUNCTION extensions.pgp_pub_encrypt_bytea(bytea, bytea) FROM postgres; +GRANT ALL ON FUNCTION extensions.pgp_pub_encrypt_bytea(bytea, bytea) TO postgres WITH GRANT OPTION; +GRANT ALL ON FUNCTION extensions.pgp_pub_encrypt_bytea(bytea, bytea) TO dashboard_user; + + +-- +-- Name: FUNCTION pgp_pub_encrypt_bytea(bytea, bytea, text); Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON FUNCTION extensions.pgp_pub_encrypt_bytea(bytea, bytea, text) FROM postgres; +GRANT ALL ON FUNCTION extensions.pgp_pub_encrypt_bytea(bytea, bytea, text) TO postgres WITH GRANT OPTION; +GRANT ALL ON FUNCTION extensions.pgp_pub_encrypt_bytea(bytea, bytea, text) TO dashboard_user; + + +-- +-- Name: FUNCTION pgp_sym_decrypt(bytea, text); Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON FUNCTION extensions.pgp_sym_decrypt(bytea, text) FROM postgres; +GRANT ALL ON FUNCTION extensions.pgp_sym_decrypt(bytea, text) TO postgres WITH GRANT OPTION; +GRANT ALL ON FUNCTION extensions.pgp_sym_decrypt(bytea, text) TO dashboard_user; + + +-- +-- Name: FUNCTION pgp_sym_decrypt(bytea, text, text); Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON FUNCTION extensions.pgp_sym_decrypt(bytea, text, text) FROM postgres; +GRANT ALL ON FUNCTION extensions.pgp_sym_decrypt(bytea, text, text) TO postgres WITH GRANT OPTION; +GRANT ALL ON FUNCTION extensions.pgp_sym_decrypt(bytea, text, text) TO dashboard_user; + + +-- +-- Name: FUNCTION pgp_sym_decrypt_bytea(bytea, text); Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON FUNCTION extensions.pgp_sym_decrypt_bytea(bytea, text) FROM postgres; +GRANT ALL ON FUNCTION extensions.pgp_sym_decrypt_bytea(bytea, text) TO postgres WITH GRANT OPTION; +GRANT ALL ON FUNCTION extensions.pgp_sym_decrypt_bytea(bytea, text) TO dashboard_user; + + +-- +-- Name: FUNCTION pgp_sym_decrypt_bytea(bytea, text, text); Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON FUNCTION extensions.pgp_sym_decrypt_bytea(bytea, text, text) FROM postgres; +GRANT ALL ON FUNCTION extensions.pgp_sym_decrypt_bytea(bytea, text, text) TO postgres WITH GRANT OPTION; +GRANT ALL ON FUNCTION extensions.pgp_sym_decrypt_bytea(bytea, text, text) TO dashboard_user; + + +-- +-- Name: FUNCTION pgp_sym_encrypt(text, text); Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON FUNCTION extensions.pgp_sym_encrypt(text, text) FROM postgres; +GRANT ALL ON FUNCTION extensions.pgp_sym_encrypt(text, text) TO postgres WITH GRANT OPTION; +GRANT ALL ON FUNCTION extensions.pgp_sym_encrypt(text, text) TO dashboard_user; + + +-- +-- Name: FUNCTION pgp_sym_encrypt(text, text, text); Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON FUNCTION extensions.pgp_sym_encrypt(text, text, text) FROM postgres; +GRANT ALL ON FUNCTION extensions.pgp_sym_encrypt(text, text, text) TO postgres WITH GRANT OPTION; +GRANT ALL ON FUNCTION extensions.pgp_sym_encrypt(text, text, text) TO dashboard_user; + + +-- +-- Name: FUNCTION pgp_sym_encrypt_bytea(bytea, text); Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON FUNCTION extensions.pgp_sym_encrypt_bytea(bytea, text) FROM postgres; +GRANT ALL ON FUNCTION extensions.pgp_sym_encrypt_bytea(bytea, text) TO postgres WITH GRANT OPTION; +GRANT ALL ON FUNCTION extensions.pgp_sym_encrypt_bytea(bytea, text) TO dashboard_user; + + +-- +-- Name: FUNCTION pgp_sym_encrypt_bytea(bytea, text, text); Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON FUNCTION extensions.pgp_sym_encrypt_bytea(bytea, text, text) FROM postgres; +GRANT ALL ON FUNCTION extensions.pgp_sym_encrypt_bytea(bytea, text, text) TO postgres WITH GRANT OPTION; +GRANT ALL ON FUNCTION extensions.pgp_sym_encrypt_bytea(bytea, text, text) TO dashboard_user; + + +-- +-- Name: FUNCTION pgrst_ddl_watch(); Type: ACL; Schema: extensions; Owner: supabase_admin +-- + +GRANT ALL ON FUNCTION extensions.pgrst_ddl_watch() TO postgres WITH GRANT OPTION; + + +-- +-- Name: FUNCTION pgrst_drop_watch(); Type: ACL; Schema: extensions; Owner: supabase_admin +-- + +GRANT ALL ON FUNCTION extensions.pgrst_drop_watch() TO postgres WITH GRANT OPTION; + + +-- +-- Name: FUNCTION set_graphql_placeholder(); Type: ACL; Schema: extensions; Owner: supabase_admin +-- + +GRANT ALL ON FUNCTION extensions.set_graphql_placeholder() TO postgres WITH GRANT OPTION; + + +-- +-- Name: FUNCTION sign(payload json, secret text, algorithm text); Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON FUNCTION extensions.sign(payload json, secret text, algorithm text) FROM postgres; +GRANT ALL ON FUNCTION extensions.sign(payload json, secret text, algorithm text) TO postgres WITH GRANT OPTION; +GRANT ALL ON FUNCTION extensions.sign(payload json, secret text, algorithm text) TO dashboard_user; + + +-- +-- Name: FUNCTION try_cast_double(inp text); Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON FUNCTION extensions.try_cast_double(inp text) FROM postgres; +GRANT ALL ON FUNCTION extensions.try_cast_double(inp text) TO postgres WITH GRANT OPTION; +GRANT ALL ON FUNCTION extensions.try_cast_double(inp text) TO dashboard_user; + + +-- +-- Name: FUNCTION url_decode(data text); Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON FUNCTION extensions.url_decode(data text) FROM postgres; +GRANT ALL ON FUNCTION extensions.url_decode(data text) TO postgres WITH GRANT OPTION; +GRANT ALL ON FUNCTION extensions.url_decode(data text) TO dashboard_user; + + +-- +-- Name: FUNCTION url_encode(data bytea); Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON FUNCTION extensions.url_encode(data bytea) FROM postgres; +GRANT ALL ON FUNCTION extensions.url_encode(data bytea) TO postgres WITH GRANT OPTION; +GRANT ALL ON FUNCTION extensions.url_encode(data bytea) TO dashboard_user; + + +-- +-- Name: FUNCTION uuid_generate_v1(); Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON FUNCTION extensions.uuid_generate_v1() FROM postgres; +GRANT ALL ON FUNCTION extensions.uuid_generate_v1() TO postgres WITH GRANT OPTION; +GRANT ALL ON FUNCTION extensions.uuid_generate_v1() TO dashboard_user; + + +-- +-- Name: FUNCTION uuid_generate_v1mc(); Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON FUNCTION extensions.uuid_generate_v1mc() FROM postgres; +GRANT ALL ON FUNCTION extensions.uuid_generate_v1mc() TO postgres WITH GRANT OPTION; +GRANT ALL ON FUNCTION extensions.uuid_generate_v1mc() TO dashboard_user; + + +-- +-- Name: FUNCTION uuid_generate_v3(namespace uuid, name text); Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON FUNCTION extensions.uuid_generate_v3(namespace uuid, name text) FROM postgres; +GRANT ALL ON FUNCTION extensions.uuid_generate_v3(namespace uuid, name text) TO postgres WITH GRANT OPTION; +GRANT ALL ON FUNCTION extensions.uuid_generate_v3(namespace uuid, name text) TO dashboard_user; + + +-- +-- Name: FUNCTION uuid_generate_v4(); Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON FUNCTION extensions.uuid_generate_v4() FROM postgres; +GRANT ALL ON FUNCTION extensions.uuid_generate_v4() TO postgres WITH GRANT OPTION; +GRANT ALL ON FUNCTION extensions.uuid_generate_v4() TO dashboard_user; + + +-- +-- Name: FUNCTION uuid_generate_v5(namespace uuid, name text); Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON FUNCTION extensions.uuid_generate_v5(namespace uuid, name text) FROM postgres; +GRANT ALL ON FUNCTION extensions.uuid_generate_v5(namespace uuid, name text) TO postgres WITH GRANT OPTION; +GRANT ALL ON FUNCTION extensions.uuid_generate_v5(namespace uuid, name text) TO dashboard_user; + + +-- +-- Name: FUNCTION uuid_nil(); Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON FUNCTION extensions.uuid_nil() FROM postgres; +GRANT ALL ON FUNCTION extensions.uuid_nil() TO postgres WITH GRANT OPTION; +GRANT ALL ON FUNCTION extensions.uuid_nil() TO dashboard_user; + + +-- +-- Name: FUNCTION uuid_ns_dns(); Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON FUNCTION extensions.uuid_ns_dns() FROM postgres; +GRANT ALL ON FUNCTION extensions.uuid_ns_dns() TO postgres WITH GRANT OPTION; +GRANT ALL ON FUNCTION extensions.uuid_ns_dns() TO dashboard_user; + + +-- +-- Name: FUNCTION uuid_ns_oid(); Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON FUNCTION extensions.uuid_ns_oid() FROM postgres; +GRANT ALL ON FUNCTION extensions.uuid_ns_oid() TO postgres WITH GRANT OPTION; +GRANT ALL ON FUNCTION extensions.uuid_ns_oid() TO dashboard_user; + + +-- +-- Name: FUNCTION uuid_ns_url(); Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON FUNCTION extensions.uuid_ns_url() FROM postgres; +GRANT ALL ON FUNCTION extensions.uuid_ns_url() TO postgres WITH GRANT OPTION; +GRANT ALL ON FUNCTION extensions.uuid_ns_url() TO dashboard_user; + + +-- +-- Name: FUNCTION uuid_ns_x500(); Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON FUNCTION extensions.uuid_ns_x500() FROM postgres; +GRANT ALL ON FUNCTION extensions.uuid_ns_x500() TO postgres WITH GRANT OPTION; +GRANT ALL ON FUNCTION extensions.uuid_ns_x500() TO dashboard_user; + + +-- +-- Name: FUNCTION verify(token text, secret text, algorithm text); Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON FUNCTION extensions.verify(token text, secret text, algorithm text) FROM postgres; +GRANT ALL ON FUNCTION extensions.verify(token text, secret text, algorithm text) TO postgres WITH GRANT OPTION; +GRANT ALL ON FUNCTION extensions.verify(token text, secret text, algorithm text) TO dashboard_user; + + +-- +-- Name: FUNCTION comment_directive(comment_ text); Type: ACL; Schema: graphql; Owner: supabase_admin +-- + +GRANT ALL ON FUNCTION graphql.comment_directive(comment_ text) TO postgres; +GRANT ALL ON FUNCTION graphql.comment_directive(comment_ text) TO anon; +GRANT ALL ON FUNCTION graphql.comment_directive(comment_ text) TO authenticated; +GRANT ALL ON FUNCTION graphql.comment_directive(comment_ text) TO service_role; + + +-- +-- Name: FUNCTION exception(message text); Type: ACL; Schema: graphql; Owner: supabase_admin +-- + +GRANT ALL ON FUNCTION graphql.exception(message text) TO postgres; +GRANT ALL ON FUNCTION graphql.exception(message text) TO anon; +GRANT ALL ON FUNCTION graphql.exception(message text) TO authenticated; +GRANT ALL ON FUNCTION graphql.exception(message text) TO service_role; + + +-- +-- Name: FUNCTION get_schema_version(); Type: ACL; Schema: graphql; Owner: supabase_admin +-- + +GRANT ALL ON FUNCTION graphql.get_schema_version() TO postgres; +GRANT ALL ON FUNCTION graphql.get_schema_version() TO anon; +GRANT ALL ON FUNCTION graphql.get_schema_version() TO authenticated; +GRANT ALL ON FUNCTION graphql.get_schema_version() TO service_role; + + +-- +-- Name: FUNCTION increment_schema_version(); Type: ACL; Schema: graphql; Owner: supabase_admin +-- + +GRANT ALL ON FUNCTION graphql.increment_schema_version() TO postgres; +GRANT ALL ON FUNCTION graphql.increment_schema_version() TO anon; +GRANT ALL ON FUNCTION graphql.increment_schema_version() TO authenticated; +GRANT ALL ON FUNCTION graphql.increment_schema_version() TO service_role; + + +-- +-- Name: FUNCTION graphql("operationName" text, query text, variables jsonb, extensions jsonb); Type: ACL; Schema: graphql_public; Owner: supabase_admin +-- + +GRANT ALL ON FUNCTION graphql_public.graphql("operationName" text, query text, variables jsonb, extensions jsonb) TO postgres; +GRANT ALL ON FUNCTION graphql_public.graphql("operationName" text, query text, variables jsonb, extensions jsonb) TO anon; +GRANT ALL ON FUNCTION graphql_public.graphql("operationName" text, query text, variables jsonb, extensions jsonb) TO authenticated; +GRANT ALL ON FUNCTION graphql_public.graphql("operationName" text, query text, variables jsonb, extensions jsonb) TO service_role; + + +-- +-- Name: FUNCTION get_auth(p_usename text); Type: ACL; Schema: pgbouncer; Owner: postgres +-- + +REVOKE ALL ON FUNCTION pgbouncer.get_auth(p_usename text) FROM PUBLIC; +GRANT ALL ON FUNCTION pgbouncer.get_auth(p_usename text) TO pgbouncer; + + +-- +-- Name: FUNCTION crypto_aead_det_decrypt(message bytea, additional bytea, key_uuid uuid, nonce bytea); Type: ACL; Schema: pgsodium; Owner: pgsodium_keymaker +-- + +GRANT ALL ON FUNCTION pgsodium.crypto_aead_det_decrypt(message bytea, additional bytea, key_uuid uuid, nonce bytea) TO service_role; + + +-- +-- Name: FUNCTION crypto_aead_det_encrypt(message bytea, additional bytea, key_uuid uuid, nonce bytea); Type: ACL; Schema: pgsodium; Owner: pgsodium_keymaker +-- + +GRANT ALL ON FUNCTION pgsodium.crypto_aead_det_encrypt(message bytea, additional bytea, key_uuid uuid, nonce bytea) TO service_role; + + +-- +-- Name: FUNCTION crypto_aead_det_keygen(); Type: ACL; Schema: pgsodium; Owner: supabase_admin +-- + +GRANT ALL ON FUNCTION pgsodium.crypto_aead_det_keygen() TO service_role; + + +-- +-- Name: FUNCTION extension(name text); Type: ACL; Schema: storage; Owner: supabase_storage_admin +-- + +GRANT ALL ON FUNCTION storage.extension(name text) TO anon; +GRANT ALL ON FUNCTION storage.extension(name text) TO authenticated; +GRANT ALL ON FUNCTION storage.extension(name text) TO service_role; +GRANT ALL ON FUNCTION storage.extension(name text) TO dashboard_user; +GRANT ALL ON FUNCTION storage.extension(name text) TO postgres; + + +-- +-- Name: FUNCTION filename(name text); Type: ACL; Schema: storage; Owner: supabase_storage_admin +-- + +GRANT ALL ON FUNCTION storage.filename(name text) TO anon; +GRANT ALL ON FUNCTION storage.filename(name text) TO authenticated; +GRANT ALL ON FUNCTION storage.filename(name text) TO service_role; +GRANT ALL ON FUNCTION storage.filename(name text) TO dashboard_user; +GRANT ALL ON FUNCTION storage.filename(name text) TO postgres; + + +-- +-- Name: FUNCTION foldername(name text); Type: ACL; Schema: storage; Owner: supabase_storage_admin +-- + +GRANT ALL ON FUNCTION storage.foldername(name text) TO anon; +GRANT ALL ON FUNCTION storage.foldername(name text) TO authenticated; +GRANT ALL ON FUNCTION storage.foldername(name text) TO service_role; +GRANT ALL ON FUNCTION storage.foldername(name text) TO dashboard_user; +GRANT ALL ON FUNCTION storage.foldername(name text) TO postgres; + + +-- +-- Name: TABLE audit_log_entries; Type: ACL; Schema: auth; Owner: supabase_auth_admin +-- + +GRANT ALL ON TABLE auth.audit_log_entries TO dashboard_user; +GRANT ALL ON TABLE auth.audit_log_entries TO postgres; + + +-- +-- Name: TABLE flow_state; Type: ACL; Schema: auth; Owner: supabase_auth_admin +-- + +GRANT ALL ON TABLE auth.flow_state TO postgres; +GRANT ALL ON TABLE auth.flow_state TO dashboard_user; + + +-- +-- Name: TABLE identities; Type: ACL; Schema: auth; Owner: supabase_auth_admin +-- + +GRANT ALL ON TABLE auth.identities TO postgres; +GRANT ALL ON TABLE auth.identities TO dashboard_user; + + +-- +-- Name: TABLE instances; Type: ACL; Schema: auth; Owner: supabase_auth_admin +-- + +GRANT ALL ON TABLE auth.instances TO dashboard_user; +GRANT ALL ON TABLE auth.instances TO postgres; + + +-- +-- Name: TABLE mfa_amr_claims; Type: ACL; Schema: auth; Owner: supabase_auth_admin +-- + +GRANT ALL ON TABLE auth.mfa_amr_claims TO postgres; +GRANT ALL ON TABLE auth.mfa_amr_claims TO dashboard_user; + + +-- +-- Name: TABLE mfa_challenges; Type: ACL; Schema: auth; Owner: supabase_auth_admin +-- + +GRANT ALL ON TABLE auth.mfa_challenges TO postgres; +GRANT ALL ON TABLE auth.mfa_challenges TO dashboard_user; + + +-- +-- Name: TABLE mfa_factors; Type: ACL; Schema: auth; Owner: supabase_auth_admin +-- + +GRANT ALL ON TABLE auth.mfa_factors TO postgres; +GRANT ALL ON TABLE auth.mfa_factors TO dashboard_user; + + +-- +-- Name: TABLE refresh_tokens; Type: ACL; Schema: auth; Owner: supabase_auth_admin +-- + +GRANT ALL ON TABLE auth.refresh_tokens TO dashboard_user; +GRANT ALL ON TABLE auth.refresh_tokens TO postgres; + + +-- +-- Name: SEQUENCE refresh_tokens_id_seq; Type: ACL; Schema: auth; Owner: supabase_auth_admin +-- + +GRANT ALL ON SEQUENCE auth.refresh_tokens_id_seq TO dashboard_user; +GRANT ALL ON SEQUENCE auth.refresh_tokens_id_seq TO postgres; + + +-- +-- Name: TABLE saml_providers; Type: ACL; Schema: auth; Owner: supabase_auth_admin +-- + +GRANT ALL ON TABLE auth.saml_providers TO postgres; +GRANT ALL ON TABLE auth.saml_providers TO dashboard_user; + + +-- +-- Name: TABLE saml_relay_states; Type: ACL; Schema: auth; Owner: supabase_auth_admin +-- + +GRANT ALL ON TABLE auth.saml_relay_states TO postgres; +GRANT ALL ON TABLE auth.saml_relay_states TO dashboard_user; + + +-- +-- Name: TABLE schema_migrations; Type: ACL; Schema: auth; Owner: supabase_auth_admin +-- + +GRANT ALL ON TABLE auth.schema_migrations TO dashboard_user; +GRANT ALL ON TABLE auth.schema_migrations TO postgres; + + +-- +-- Name: TABLE sessions; Type: ACL; Schema: auth; Owner: supabase_auth_admin +-- + +GRANT ALL ON TABLE auth.sessions TO postgres; +GRANT ALL ON TABLE auth.sessions TO dashboard_user; + + +-- +-- Name: TABLE sso_domains; Type: ACL; Schema: auth; Owner: supabase_auth_admin +-- + +GRANT ALL ON TABLE auth.sso_domains TO postgres; +GRANT ALL ON TABLE auth.sso_domains TO dashboard_user; + + +-- +-- Name: TABLE sso_providers; Type: ACL; Schema: auth; Owner: supabase_auth_admin +-- + +GRANT ALL ON TABLE auth.sso_providers TO postgres; +GRANT ALL ON TABLE auth.sso_providers TO dashboard_user; + + +-- +-- Name: TABLE users; Type: ACL; Schema: auth; Owner: supabase_auth_admin +-- + +GRANT ALL ON TABLE auth.users TO dashboard_user; +GRANT ALL ON TABLE auth.users TO postgres; + + +-- +-- Name: TABLE pg_stat_statements; Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON TABLE extensions.pg_stat_statements FROM postgres; +GRANT ALL ON TABLE extensions.pg_stat_statements TO postgres WITH GRANT OPTION; +GRANT ALL ON TABLE extensions.pg_stat_statements TO dashboard_user; + + +-- +-- Name: TABLE pg_stat_statements_info; Type: ACL; Schema: extensions; Owner: postgres +-- + +REVOKE ALL ON TABLE extensions.pg_stat_statements_info FROM postgres; +GRANT ALL ON TABLE extensions.pg_stat_statements_info TO postgres WITH GRANT OPTION; +GRANT ALL ON TABLE extensions.pg_stat_statements_info TO dashboard_user; + + +-- +-- Name: SEQUENCE seq_schema_version; Type: ACL; Schema: graphql; Owner: supabase_admin +-- + +GRANT ALL ON SEQUENCE graphql.seq_schema_version TO postgres; +GRANT ALL ON SEQUENCE graphql.seq_schema_version TO anon; +GRANT ALL ON SEQUENCE graphql.seq_schema_version TO authenticated; +GRANT ALL ON SEQUENCE graphql.seq_schema_version TO service_role; + + +-- +-- Name: TABLE decrypted_key; Type: ACL; Schema: pgsodium; Owner: supabase_admin +-- + +GRANT ALL ON TABLE pgsodium.decrypted_key TO pgsodium_keyholder; + + +-- +-- Name: TABLE masking_rule; Type: ACL; Schema: pgsodium; Owner: supabase_admin +-- + +GRANT ALL ON TABLE pgsodium.masking_rule TO pgsodium_keyholder; + + +-- +-- Name: TABLE mask_columns; Type: ACL; Schema: pgsodium; Owner: supabase_admin +-- + +GRANT ALL ON TABLE pgsodium.mask_columns TO pgsodium_keyholder; + + +-- +-- Name: TABLE "Client"; Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON TABLE public."Client" TO anon; +GRANT ALL ON TABLE public."Client" TO authenticated; +GRANT ALL ON TABLE public."Client" TO service_role; + + +-- +-- Name: TABLE "Prompt"; Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON TABLE public."Prompt" TO anon; +GRANT ALL ON TABLE public."Prompt" TO authenticated; +GRANT ALL ON TABLE public."Prompt" TO service_role; + + +-- +-- Name: SEQUENCE "Prompt_id_seq"; Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON SEQUENCE public."Prompt_id_seq" TO anon; +GRANT ALL ON SEQUENCE public."Prompt_id_seq" TO authenticated; +GRANT ALL ON SEQUENCE public."Prompt_id_seq" TO service_role; + + +-- +-- Name: TABLE "Prompt_stats"; Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON TABLE public."Prompt_stats" TO anon; +GRANT ALL ON TABLE public."Prompt_stats" TO authenticated; +GRANT ALL ON TABLE public."Prompt_stats" TO service_role; + + +-- +-- Name: TABLE "Reaction"; Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON TABLE public."Reaction" TO anon; +GRANT ALL ON TABLE public."Reaction" TO authenticated; +GRANT ALL ON TABLE public."Reaction" TO service_role; + + +-- +-- Name: TABLE "Site"; Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON TABLE public."Site" TO anon; +GRANT ALL ON TABLE public."Site" TO authenticated; +GRANT ALL ON TABLE public."Site" TO service_role; + + +-- +-- Name: SEQUENCE "Site_id_seq"; Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON SEQUENCE public."Site_id_seq" TO anon; +GRANT ALL ON SEQUENCE public."Site_id_seq" TO authenticated; +GRANT ALL ON SEQUENCE public."Site_id_seq" TO service_role; + + +-- +-- Name: TABLE "SupportRequest"; Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON TABLE public."SupportRequest" TO anon; +GRANT ALL ON TABLE public."SupportRequest" TO authenticated; +GRANT ALL ON TABLE public."SupportRequest" TO service_role; + + +-- +-- Name: SEQUENCE "SupportRequest_id_seq"; Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON SEQUENCE public."SupportRequest_id_seq" TO anon; +GRANT ALL ON SEQUENCE public."SupportRequest_id_seq" TO authenticated; +GRANT ALL ON SEQUENCE public."SupportRequest_id_seq" TO service_role; + + +-- +-- Name: TABLE "Value"; Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON TABLE public."Value" TO anon; +GRANT ALL ON TABLE public."Value" TO authenticated; +GRANT ALL ON TABLE public."Value" TO service_role; + + +-- +-- Name: SEQUENCE "Value_id_seq"; Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON SEQUENCE public."Value_id_seq" TO anon; +GRANT ALL ON SEQUENCE public."Value_id_seq" TO authenticated; +GRANT ALL ON SEQUENCE public."Value_id_seq" TO service_role; + + +-- +-- Name: TABLE "Wallpaper"; Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON TABLE public."Wallpaper" TO anon; +GRANT ALL ON TABLE public."Wallpaper" TO authenticated; +GRANT ALL ON TABLE public."Wallpaper" TO service_role; + + +-- +-- Name: TABLE "Wallpaper_random"; Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON TABLE public."Wallpaper_random" TO anon; +GRANT ALL ON TABLE public."Wallpaper_random" TO authenticated; +GRANT ALL ON TABLE public."Wallpaper_random" TO service_role; + + +-- +-- Name: TABLE buckets; Type: ACL; Schema: storage; Owner: supabase_storage_admin +-- + +GRANT ALL ON TABLE storage.buckets TO anon; +GRANT ALL ON TABLE storage.buckets TO authenticated; +GRANT ALL ON TABLE storage.buckets TO service_role; +GRANT ALL ON TABLE storage.buckets TO postgres; + + +-- +-- Name: TABLE migrations; Type: ACL; Schema: storage; Owner: supabase_storage_admin +-- + +GRANT ALL ON TABLE storage.migrations TO anon; +GRANT ALL ON TABLE storage.migrations TO authenticated; +GRANT ALL ON TABLE storage.migrations TO service_role; +GRANT ALL ON TABLE storage.migrations TO postgres; + + +-- +-- Name: TABLE objects; Type: ACL; Schema: storage; Owner: supabase_storage_admin +-- + +GRANT ALL ON TABLE storage.objects TO anon; +GRANT ALL ON TABLE storage.objects TO authenticated; +GRANT ALL ON TABLE storage.objects TO service_role; +GRANT ALL ON TABLE storage.objects TO postgres; + + +-- +-- Name: DEFAULT PRIVILEGES FOR SEQUENCES; Type: DEFAULT ACL; Schema: auth; Owner: supabase_auth_admin +-- + +ALTER DEFAULT PRIVILEGES FOR ROLE supabase_auth_admin IN SCHEMA auth GRANT ALL ON SEQUENCES TO postgres; +ALTER DEFAULT PRIVILEGES FOR ROLE supabase_auth_admin IN SCHEMA auth GRANT ALL ON SEQUENCES TO dashboard_user; + + +-- +-- Name: DEFAULT PRIVILEGES FOR FUNCTIONS; Type: DEFAULT ACL; Schema: auth; Owner: supabase_auth_admin +-- + +ALTER DEFAULT PRIVILEGES FOR ROLE supabase_auth_admin IN SCHEMA auth GRANT ALL ON FUNCTIONS TO postgres; +ALTER DEFAULT PRIVILEGES FOR ROLE supabase_auth_admin IN SCHEMA auth GRANT ALL ON FUNCTIONS TO dashboard_user; + + +-- +-- Name: DEFAULT PRIVILEGES FOR TABLES; Type: DEFAULT ACL; Schema: auth; Owner: supabase_auth_admin +-- + +ALTER DEFAULT PRIVILEGES FOR ROLE supabase_auth_admin IN SCHEMA auth GRANT ALL ON TABLES TO postgres; +ALTER DEFAULT PRIVILEGES FOR ROLE supabase_auth_admin IN SCHEMA auth GRANT ALL ON TABLES TO dashboard_user; + + +-- +-- Name: DEFAULT PRIVILEGES FOR SEQUENCES; Type: DEFAULT ACL; Schema: extensions; Owner: supabase_admin +-- + +ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA extensions GRANT ALL ON SEQUENCES TO postgres WITH GRANT OPTION; + + +-- +-- Name: DEFAULT PRIVILEGES FOR FUNCTIONS; Type: DEFAULT ACL; Schema: extensions; Owner: supabase_admin +-- + +ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA extensions GRANT ALL ON FUNCTIONS TO postgres WITH GRANT OPTION; + + +-- +-- Name: DEFAULT PRIVILEGES FOR TABLES; Type: DEFAULT ACL; Schema: extensions; Owner: supabase_admin +-- + +ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA extensions GRANT ALL ON TABLES TO postgres WITH GRANT OPTION; + + +-- +-- Name: DEFAULT PRIVILEGES FOR SEQUENCES; Type: DEFAULT ACL; Schema: graphql; Owner: supabase_admin +-- + +ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql GRANT ALL ON SEQUENCES TO postgres; +ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql GRANT ALL ON SEQUENCES TO anon; +ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql GRANT ALL ON SEQUENCES TO authenticated; +ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql GRANT ALL ON SEQUENCES TO service_role; + + +-- +-- Name: DEFAULT PRIVILEGES FOR FUNCTIONS; Type: DEFAULT ACL; Schema: graphql; Owner: supabase_admin +-- + +ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql GRANT ALL ON FUNCTIONS TO postgres; +ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql GRANT ALL ON FUNCTIONS TO anon; +ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql GRANT ALL ON FUNCTIONS TO authenticated; +ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql GRANT ALL ON FUNCTIONS TO service_role; + + +-- +-- Name: DEFAULT PRIVILEGES FOR TABLES; Type: DEFAULT ACL; Schema: graphql; Owner: supabase_admin +-- + +ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql GRANT ALL ON TABLES TO postgres; +ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql GRANT ALL ON TABLES TO anon; +ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql GRANT ALL ON TABLES TO authenticated; +ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql GRANT ALL ON TABLES TO service_role; + + +-- +-- Name: DEFAULT PRIVILEGES FOR SEQUENCES; Type: DEFAULT ACL; Schema: graphql_public; Owner: supabase_admin +-- + +ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql_public GRANT ALL ON SEQUENCES TO postgres; +ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql_public GRANT ALL ON SEQUENCES TO anon; +ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql_public GRANT ALL ON SEQUENCES TO authenticated; +ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql_public GRANT ALL ON SEQUENCES TO service_role; + + +-- +-- Name: DEFAULT PRIVILEGES FOR FUNCTIONS; Type: DEFAULT ACL; Schema: graphql_public; Owner: supabase_admin +-- + +ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql_public GRANT ALL ON FUNCTIONS TO postgres; +ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql_public GRANT ALL ON FUNCTIONS TO anon; +ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql_public GRANT ALL ON FUNCTIONS TO authenticated; +ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql_public GRANT ALL ON FUNCTIONS TO service_role; + + +-- +-- Name: DEFAULT PRIVILEGES FOR TABLES; Type: DEFAULT ACL; Schema: graphql_public; Owner: supabase_admin +-- + +ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql_public GRANT ALL ON TABLES TO postgres; +ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql_public GRANT ALL ON TABLES TO anon; +ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql_public GRANT ALL ON TABLES TO authenticated; +ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql_public GRANT ALL ON TABLES TO service_role; + + +-- +-- Name: DEFAULT PRIVILEGES FOR SEQUENCES; Type: DEFAULT ACL; Schema: pgsodium; Owner: supabase_admin +-- + +ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA pgsodium GRANT ALL ON SEQUENCES TO pgsodium_keyholder; + + +-- +-- Name: DEFAULT PRIVILEGES FOR TABLES; Type: DEFAULT ACL; Schema: pgsodium; Owner: supabase_admin +-- + +ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA pgsodium GRANT ALL ON TABLES TO pgsodium_keyholder; + + +-- +-- Name: DEFAULT PRIVILEGES FOR SEQUENCES; Type: DEFAULT ACL; Schema: pgsodium_masks; Owner: supabase_admin +-- + +ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA pgsodium_masks GRANT ALL ON SEQUENCES TO pgsodium_keyiduser; + + +-- +-- Name: DEFAULT PRIVILEGES FOR FUNCTIONS; Type: DEFAULT ACL; Schema: pgsodium_masks; Owner: supabase_admin +-- + +ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA pgsodium_masks GRANT ALL ON FUNCTIONS TO pgsodium_keyiduser; + + +-- +-- Name: DEFAULT PRIVILEGES FOR TABLES; Type: DEFAULT ACL; Schema: pgsodium_masks; Owner: supabase_admin +-- + +ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA pgsodium_masks GRANT ALL ON TABLES TO pgsodium_keyiduser; + + +-- +-- Name: DEFAULT PRIVILEGES FOR SEQUENCES; Type: DEFAULT ACL; Schema: public; Owner: postgres +-- + +ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA public GRANT ALL ON SEQUENCES TO postgres; +ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA public GRANT ALL ON SEQUENCES TO anon; +ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA public GRANT ALL ON SEQUENCES TO authenticated; +ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA public GRANT ALL ON SEQUENCES TO service_role; + + +-- +-- Name: DEFAULT PRIVILEGES FOR SEQUENCES; Type: DEFAULT ACL; Schema: public; Owner: supabase_admin +-- + +ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA public GRANT ALL ON SEQUENCES TO postgres; +ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA public GRANT ALL ON SEQUENCES TO anon; +ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA public GRANT ALL ON SEQUENCES TO authenticated; +ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA public GRANT ALL ON SEQUENCES TO service_role; + + +-- +-- Name: DEFAULT PRIVILEGES FOR FUNCTIONS; Type: DEFAULT ACL; Schema: public; Owner: postgres +-- + +ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA public GRANT ALL ON FUNCTIONS TO postgres; +ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA public GRANT ALL ON FUNCTIONS TO anon; +ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA public GRANT ALL ON FUNCTIONS TO authenticated; +ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA public GRANT ALL ON FUNCTIONS TO service_role; + + +-- +-- Name: DEFAULT PRIVILEGES FOR FUNCTIONS; Type: DEFAULT ACL; Schema: public; Owner: supabase_admin +-- + +ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA public GRANT ALL ON FUNCTIONS TO postgres; +ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA public GRANT ALL ON FUNCTIONS TO anon; +ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA public GRANT ALL ON FUNCTIONS TO authenticated; +ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA public GRANT ALL ON FUNCTIONS TO service_role; + + +-- +-- Name: DEFAULT PRIVILEGES FOR TABLES; Type: DEFAULT ACL; Schema: public; Owner: postgres +-- + +ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA public GRANT ALL ON TABLES TO postgres; +ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA public GRANT ALL ON TABLES TO anon; +ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA public GRANT ALL ON TABLES TO authenticated; +ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA public GRANT ALL ON TABLES TO service_role; + + +-- +-- Name: DEFAULT PRIVILEGES FOR TABLES; Type: DEFAULT ACL; Schema: public; Owner: supabase_admin +-- + +ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA public GRANT ALL ON TABLES TO postgres; +ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA public GRANT ALL ON TABLES TO anon; +ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA public GRANT ALL ON TABLES TO authenticated; +ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA public GRANT ALL ON TABLES TO service_role; + + +-- +-- Name: DEFAULT PRIVILEGES FOR SEQUENCES; Type: DEFAULT ACL; Schema: realtime; Owner: supabase_admin +-- + +ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA realtime GRANT ALL ON SEQUENCES TO postgres; +ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA realtime GRANT ALL ON SEQUENCES TO dashboard_user; + + +-- +-- Name: DEFAULT PRIVILEGES FOR FUNCTIONS; Type: DEFAULT ACL; Schema: realtime; Owner: supabase_admin +-- + +ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA realtime GRANT ALL ON FUNCTIONS TO postgres; +ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA realtime GRANT ALL ON FUNCTIONS TO dashboard_user; + + +-- +-- Name: DEFAULT PRIVILEGES FOR TABLES; Type: DEFAULT ACL; Schema: realtime; Owner: supabase_admin +-- + +ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA realtime GRANT ALL ON TABLES TO postgres; +ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA realtime GRANT ALL ON TABLES TO dashboard_user; + + +-- +-- Name: DEFAULT PRIVILEGES FOR SEQUENCES; Type: DEFAULT ACL; Schema: storage; Owner: postgres +-- + +ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA storage GRANT ALL ON SEQUENCES TO postgres; +ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA storage GRANT ALL ON SEQUENCES TO anon; +ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA storage GRANT ALL ON SEQUENCES TO authenticated; +ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA storage GRANT ALL ON SEQUENCES TO service_role; + + +-- +-- Name: DEFAULT PRIVILEGES FOR FUNCTIONS; Type: DEFAULT ACL; Schema: storage; Owner: postgres +-- + +ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA storage GRANT ALL ON FUNCTIONS TO postgres; +ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA storage GRANT ALL ON FUNCTIONS TO anon; +ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA storage GRANT ALL ON FUNCTIONS TO authenticated; +ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA storage GRANT ALL ON FUNCTIONS TO service_role; + + +-- +-- Name: DEFAULT PRIVILEGES FOR TABLES; Type: DEFAULT ACL; Schema: storage; Owner: postgres +-- + +ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA storage GRANT ALL ON TABLES TO postgres; +ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA storage GRANT ALL ON TABLES TO anon; +ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA storage GRANT ALL ON TABLES TO authenticated; +ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA storage GRANT ALL ON TABLES TO service_role; + + +-- +-- Name: issue_graphql_placeholder; Type: EVENT TRIGGER; Schema: -; Owner: supabase_admin +-- + +CREATE EVENT TRIGGER issue_graphql_placeholder ON sql_drop + WHEN TAG IN ('DROP EXTENSION') + EXECUTE FUNCTION extensions.set_graphql_placeholder(); + + +ALTER EVENT TRIGGER issue_graphql_placeholder OWNER TO supabase_admin; + +-- +-- Name: issue_pg_cron_access; Type: EVENT TRIGGER; Schema: -; Owner: postgres +-- + +CREATE EVENT TRIGGER issue_pg_cron_access ON ddl_command_end + WHEN TAG IN ('CREATE SCHEMA') + EXECUTE FUNCTION extensions.grant_pg_cron_access(); + + +ALTER EVENT TRIGGER issue_pg_cron_access OWNER TO postgres; + +-- +-- Name: issue_pg_graphql_access; Type: EVENT TRIGGER; Schema: -; Owner: supabase_admin +-- + +CREATE EVENT TRIGGER issue_pg_graphql_access ON ddl_command_end + WHEN TAG IN ('CREATE FUNCTION') + EXECUTE FUNCTION extensions.grant_pg_graphql_access(); + + +ALTER EVENT TRIGGER issue_pg_graphql_access OWNER TO supabase_admin; + +-- +-- Name: issue_pg_net_access; Type: EVENT TRIGGER; Schema: -; Owner: postgres +-- + +CREATE EVENT TRIGGER issue_pg_net_access ON ddl_command_end + WHEN TAG IN ('CREATE EXTENSION') + EXECUTE FUNCTION extensions.grant_pg_net_access(); + + +ALTER EVENT TRIGGER issue_pg_net_access OWNER TO postgres; + +-- +-- Name: pgrst_ddl_watch; Type: EVENT TRIGGER; Schema: -; Owner: supabase_admin +-- + +CREATE EVENT TRIGGER pgrst_ddl_watch ON ddl_command_end + EXECUTE FUNCTION extensions.pgrst_ddl_watch(); + + +ALTER EVENT TRIGGER pgrst_ddl_watch OWNER TO supabase_admin; + +-- +-- Name: pgrst_drop_watch; Type: EVENT TRIGGER; Schema: -; Owner: supabase_admin +-- + +CREATE EVENT TRIGGER pgrst_drop_watch ON sql_drop + EXECUTE FUNCTION extensions.pgrst_drop_watch(); + + +ALTER EVENT TRIGGER pgrst_drop_watch OWNER TO supabase_admin; + +-- +-- PostgreSQL database dump complete +-- + diff --git a/documents/contact.md b/documents/contact.md index 9f7ee7eade..a9fd6dd150 100644 --- a/documents/contact.md +++ b/documents/contact.md @@ -6,3 +6,9 @@ - [Messenger](https://m.me/hejny) - [Telegram](https://t.me/hejny) - https://www.pavolhejny.com/contact + +## Social 1-2i + +- [Facebook](https://www.facebook.com/profile.php?id=61551015609140) +- [Instagram](https://www.instagram.com/_1_2i_/) +- [LinkedIn](https://www.linkedin.com/company/1-2i/) diff --git a/package-lock.json b/package-lock.json index 89df292784..3449515562 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,6 +25,7 @@ "file-saver": "2.0.5", "formidable": "3.5.0", "html-react-parser": "3.0.12", + "insta-fetcher": "^1.3.26", "isomorphic-fetch": "3.0.0", "jszip": "3.10.1", "lodash": "4.17.21", @@ -5088,6 +5089,28 @@ "node": ">=4" } }, + "node_modules/axios": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz", + "integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==", + "dependencies": { + "follow-redirects": "^1.14.9", + "form-data": "^4.0.0" + } + }, + "node_modules/axios/node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/axobject-query": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-3.2.1.tgz", @@ -5392,6 +5415,14 @@ "tweetnacl": "^0.14.3" } }, + "node_modules/big-integer": { + "version": "1.6.51", + "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.51.tgz", + "integrity": "sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg==", + "engines": { + "node": ">=0.6" + } + }, "node_modules/big.js": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", @@ -8169,6 +8200,25 @@ "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", "dev": true }, + "node_modules/follow-redirects": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", + "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, "node_modules/for-each": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", @@ -9201,6 +9251,29 @@ "resolved": "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.1.1.tgz", "integrity": "sha512-7NXolsK4CAS5+xvdj5OMMbI962hU/wvwoxk+LWR9Ek9bVtyuuYScDN6eS0rUm6TxApFpw7CX1o4uJzcd4AyD3Q==" }, + "node_modules/insta-fetcher": { + "version": "1.3.26", + "resolved": "https://registry.npmjs.org/insta-fetcher/-/insta-fetcher-1.3.26.tgz", + "integrity": "sha512-KtmUaClyn2ekNJDT8TycYiOr49a+DAZVJ4AIPPhgraUygbeqUsg02EcfIBIUxh7e9uhlzLohLS2j4Me3pOZpdg==", + "dependencies": { + "axios": "^0.27.2", + "big-integer": "^1.6.51", + "form-data": "^4.0.0" + } + }, + "node_modules/insta-fetcher/node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/internal-slot": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.5.tgz", @@ -19907,6 +19980,27 @@ "integrity": "sha512-9l850jDDPnKq48nbad8SiEelCv4OrUWrKab/cPj0GScVg6cb6NbCCt/Ulk26QEq5jP9NnGr04Bit1BHyV6r5CQ==", "dev": true }, + "axios": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz", + "integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==", + "requires": { + "follow-redirects": "^1.14.9", + "form-data": "^4.0.0" + }, + "dependencies": { + "form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + } + } + } + }, "axobject-query": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-3.2.1.tgz", @@ -20119,6 +20213,11 @@ "tweetnacl": "^0.14.3" } }, + "big-integer": { + "version": "1.6.51", + "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.51.tgz", + "integrity": "sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg==" + }, "big.js": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", @@ -22201,6 +22300,11 @@ "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", "dev": true }, + "follow-redirects": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", + "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==" + }, "for-each": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", @@ -22971,6 +23075,28 @@ "resolved": "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.1.1.tgz", "integrity": "sha512-7NXolsK4CAS5+xvdj5OMMbI962hU/wvwoxk+LWR9Ek9bVtyuuYScDN6eS0rUm6TxApFpw7CX1o4uJzcd4AyD3Q==" }, + "insta-fetcher": { + "version": "1.3.26", + "resolved": "https://registry.npmjs.org/insta-fetcher/-/insta-fetcher-1.3.26.tgz", + "integrity": "sha512-KtmUaClyn2ekNJDT8TycYiOr49a+DAZVJ4AIPPhgraUygbeqUsg02EcfIBIUxh7e9uhlzLohLS2j4Me3pOZpdg==", + "requires": { + "axios": "^0.27.2", + "big-integer": "^1.6.51", + "form-data": "^4.0.0" + }, + "dependencies": { + "form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + } + } + } + }, "internal-slot": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.5.tgz", diff --git a/package.json b/package.json index 1c65d361f1..678d7df463 100644 --- a/package.json +++ b/package.json @@ -45,6 +45,7 @@ "file-saver": "2.0.5", "formidable": "3.5.0", "html-react-parser": "3.0.12", + "insta-fetcher": "^1.3.26", "isomorphic-fetch": "3.0.0", "jszip": "3.10.1", "lodash": "4.17.21", diff --git a/src/ai/text-to-text/ChatThread.ts b/src/ai/text-to-text/ChatThread.ts index 33bc8e118f..88efcd6409 100644 --- a/src/ai/text-to-text/ChatThread.ts +++ b/src/ai/text-to-text/ChatThread.ts @@ -20,7 +20,7 @@ export class ChatThread { /** * Makes a request to the OpenAI API and returns a response wrapped in ChatThread - * @private utility function + * @private Utility method within the class ChatThread */ private static async create( parentChatThread: null | ChatThread, diff --git a/src/ai/text-to-text/completeWithGpt.ts b/src/ai/text-to-text/completeWithGpt.ts index 5f62664f70..6bcf01ae56 100644 --- a/src/ai/text-to-text/completeWithGpt.ts +++ b/src/ai/text-to-text/completeWithGpt.ts @@ -19,8 +19,8 @@ export async function completeWithGpt( const model = 'text-davinci-003'; const modelSettings = { model, - max_tokens: 500, - // <- TODO: [🤡] Tweak, hardcode+note or put in config + Pick the best model, max_tokens, top_t,... other params + max_tokens: 1500, + // <- TODO: !!! [🤡] Tweak, hardcode+note or put in config + Pick the best model, max_tokens, top_t,... other params }; const promptAt = new Date(); @@ -125,6 +125,7 @@ export async function completeWithGpt( /** * TODO: (Probbably no) Are there failed requests - analyze them + * Make some statistics for PromptTemeplates * TODO: DRY ChatThread+completeWithGpt * TODO: [🧠] Wording: response or answer? * TODO: [🧠][5] Log also failed requests diff --git a/src/ai/text-to-text/writeWallpaperContent.ts b/src/ai/text-to-text/writeWallpaperContent.ts index e9d8d65684..7e647a2dff 100644 --- a/src/ai/text-to-text/writeWallpaperContent.ts +++ b/src/ai/text-to-text/writeWallpaperContent.ts @@ -1,18 +1,86 @@ import spaceTrim from 'spacetrim'; +import { FONTS } from '../../../config'; import { parseTitleAndTopic } from '../../utils/content/parseTitleAndTopic'; import { removeQuotes } from '../../utils/content/removeQuotes'; -import { - image_description, - string_font_family, - string_markdown, - string_midjourney_prompt, - uuid, -} from '../../utils/typeAliases'; +import { randomItem } from '../../utils/randomItem'; +import { description, string_markdown, string_name, string_url, title, uuid } from '../../utils/typeAliases'; import { ChatThread } from './ChatThread'; import { completeWithGpt } from './completeWithGpt'; -import { createFontPromptTemplate } from './prompt-templates/createFontPromptTemplate'; import { createTitlePromptTemplate } from './prompt-templates/createTitlePromptTemplate'; +export interface WriteWallpaperContentOptions { + /** + * Client ID to validate the request + */ + clientId: uuid /* <-[🌺] */; + + /** + * Title of the wallpaper + * + * If set, the generated content will start with this title + * If null, it will be written by AI + */ + title: Exclude | null; + + /** + * Assigment of the wallpaper + * + * It is the detailed description of the wallpaper, please include information like: + * - What is the page about + * - What is the goal of the page + * - What is the user supposed to do on the page + * + * Note: There are two simmilar propertie: + * - `description` which describes content of the image + * - `assigment` which describes requirements for the page + */ + assigment: Exclude | null; + + /** + * Additional sections to be added to the content + */ + addSections: Array<{ + /** + * Unique name of the section + * Note: It is used for example as element ID to lead anchor links to this section + */ + name: string_name; + + /** + * Title of the section + */ + title: Exclude; + + /** + * Order of the section + * TODO: [🧠] Some transparent system to order sections + */ + order: number; + + /** + * Content of the section + */ + content: string_markdown; + + // <- TODO: !! [🧠] Maybe allow to have empty name+title+content just write assigment and auto generate + }>; + + /** + * Links to be added to the content + */ + links: Array<{ + /** + * Title of the link - it is used as link text and also as title attribute + */ + title: Exclude; + + /** + * URL of the link + */ + url: string_url; + }>; +} + /** * Writes the rich content of the wallpaper page * @@ -21,42 +89,115 @@ import { createTitlePromptTemplate } from './prompt-templates/createTitlePromptT * @param wallpaperAssigment as a plain description what is on the wallpaper (created for expample from imageToText or midjourney prompt) * @returns Content of the wallpaper page */ -export async function writeWallpaperContent( - wallpaperAssigment: Exclude | string_midjourney_prompt, - clientId: uuid /* <-[🌺] */, -): Promise { - const prompt = createTitlePromptTemplate(wallpaperAssigment); - const chatThread = await ChatThread.ask(prompt, clientId); - const { response, model: modelToCreateTitle } = chatThread; - const { title, topic } = parseTitleAndTopic(removeQuotes(response)); - - const contentStart = spaceTrim( - (block) => ` +export async function writeWallpaperContent(options: WriteWallpaperContentOptions): Promise { + const { clientId, assigment, addSections, links } = options; + let { title } = options; - # ${block(title)} - ${block(!topic ? `` : `\n\n> ${topic}\n\n`)} + let contentStart: string_markdown = ''; + + if (!assigment) { + throw new Error('You must provide assigment'); + } + + if (title !== null) { + contentStart = spaceTrim( + (block) => ` + + # ${block(title!)} + + + `, + ); + } else { + const prompt = createTitlePromptTemplate(assigment); + const chatThread = await ChatThread.ask(prompt, clientId); + const { response } = chatThread; + const { title, topic } = parseTitleAndTopic(removeQuotes(response)); + + contentStart = spaceTrim( + (block) => ` + + # ${block(title)} + ${block(!topic ? `` : `\n\n> ${topic}\n\n`)} + + `, + ); + } + + // TODO: !!! Use here addSections and links - `, - ); const { response: contentMiddle, model: modelToCreateContent } = await completeWithGpt( spaceTrim( // TODO: [🤡] This prompt should be also created in some template function // TODO: [🤡] Pefect this prompt + + // https://www.instagram.com/michelangelato.zmrzlinarna/ + // TODO: !!! Try Completion (send do Dan) vs Chat + // TODO: !!! Unhardcode MichelanGELATO + // TODO: !!! Unhardcode CS + // TODO: !!! Unhardcode keywords + + /* + Testing Assigments + + --- + +Nejlepší zmrzlina v Olomouci +Gelato neboli tradiční italská zmrzlina.🍨❤️ +Pavelčákova 8, Olomouc. +Po - Ne od 10:00 - 19:00 hodin +Řemeslně připravovaná v naší olomoucké kuchyni.👌 +Michaela.macakova@michelangelato.cz +774 198 084 +http://michelangelato.cz/ + + -- + + */ (block) => ` - Following is markdown content of a webpage: + Jako zkušenému copywriterovi a webdesignérovi vám bylo svěřeno vytvoření textu pro novou webovou stránku zmrzlinárny MichelanGELATO v Olomouci. + + Zadání od zákazníka: + \`\`\` + "${block(assigment)}" + \`\`\` + + Pokyny: + - Formátování textu je v Markdownu + - Buďte struční a výstižní + - Použijte klíčová slova, avšak ta mají být přirozeně v textu + - Jedná se o kompletní obsah stránky, tedy nezapomeňte na všechny důležité informace a prvky, co by měla stránka obsahovat + - Použijte nadpisy, odrážky, formátování textu + + Klíčová slova: + - Zmrzlina + - Olomouc + - Kvalita + - Rodina + - Tradice + - Itálie + - Řemeslo + Začátek obsahu: + \`\`\` ${block(contentStart)} + \`\`\` + + Pokračujte obsahem: `, ), clientId, ); + /* + TODO: !!! Better const chatThreadFont = await chatThread.ask(createFontPromptTemplate()); const font = removeQuotes(chatThreadFont.response) as string_font_family; + */ - // console.log(chatThreadFont); + const font = randomItem(...FONTS); return spaceTrim( (block) => ` @@ -65,14 +206,6 @@ export async function writeWallpaperContent( ${block(contentStart)} ${block(contentMiddle)} - - `, ); diff --git a/src/components/ControlPanel/ControlPanel.tsx b/src/components/ControlPanel/ControlPanel.tsx index 123e10cf85..8c77100509 100644 --- a/src/components/ControlPanel/ControlPanel.tsx +++ b/src/components/ControlPanel/ControlPanel.tsx @@ -1,5 +1,6 @@ import Image from 'next/image'; import { useRouter } from 'next/router'; +import { IS_VERIFIED_EMAIL_REQUIRED } from '../../../config'; import { classNames } from '../../utils/classNames'; import { computeWallpaperUriid } from '../../utils/computeWallpaperUriid'; import { useCurrentWallpaper } from '../../utils/hooks/useCurrentWallpaper'; @@ -34,7 +35,7 @@ export function ControlPanel() { className={classNames(styles.button, styles.callToAction)} onClick={async () => { const clientId = await provideClientId({ - isVerifiedEmailRequired: false, + isVerifiedEmailRequired: IS_VERIFIED_EMAIL_REQUIRED.EDIT, }); const newWallpaper = modifyWallpaper((modifiedWallpaper) => { // Note: [🗄] title is computed after each change id+parent+author+keywords are computed just once before save diff --git a/src/components/CopilotInput/CopilotInput.module.css b/src/components/CopilotInput/CopilotInput.module.css new file mode 100644 index 0000000000..b4dd037881 --- /dev/null +++ b/src/components/CopilotInput/CopilotInput.module.css @@ -0,0 +1,89 @@ +.CopilotInput { + /*/ + outline: 1px dotted rgb(255, 38, 38); + /**/ + + margin: 20px; +} + +.CopilotInput label { + margin-left: 30px; +} + +.CopilotInput .CopilotInputInner { + /*/ + outline: 1px dotted rgb(255, 125, 38); + /**/ + + z-index: 10; /* <- Local order of */ + + width: 350px; + max-width: 100vw; + height: 60px; + + /* TODO: [👨‍🌾] Make just one css for floating control panel */ + + background-color: rgba(0, 0, 0, 0.8); + border: 1px solid rgba(255, 255, 255, 0.43); + box-shadow: 0 0 50px rgba(0, 0, 0, 0.8); + backdrop-filter: blur(10px); + border-radius: 60px; + overflow: clip; + + display: grid; + grid-template-columns: 1fr 60px; +} + +.CopilotInput .CopilotInputInner input { + /*/ + outline: 1px dotted rgb(56, 255, 38) !important; + /**/ + + outline: none; + border: none; + background-color: transparent; + + padding: 5px; + padding-left: 15px; + padding-right: 15px; + + width: 100%; + + font-size: 1.3em; +} + +.CopilotInput .CopilotInputInner .Button { + /*/ + outline: 1px dotted rgb(56, 255, 38) !important; + /**/ + + outline: none; + border: none; + + text-align: center; + background-color: transparent; + border-left: 1px solid rgba(255, 255, 255, 0.43); + transition: background-color 0.1s ease-in-out; + + cursor: pointer; + + display: flex; + justify-content: center; + align-items: center; +} + +.CopilotInput .CopilotInputInner .Button > * { + transition: transform 0.1s ease-in-out; +} + +.CopilotInput .CopilotInputInner .Button:hover > * { + transform: scale(1.3); +} + +.CopilotInput .CopilotInputInner .Button:disabled { + opacity: 0.5; +} + +.CopilotInput .CopilotInputInner .Button button { + all: unset; +} diff --git a/src/components/CopilotInput/CopilotInput.tsx b/src/components/CopilotInput/CopilotInput.tsx new file mode 100644 index 0000000000..252839c565 --- /dev/null +++ b/src/components/CopilotInput/CopilotInput.tsx @@ -0,0 +1,124 @@ +import Image from 'next/image'; +import { useCallback, useRef, useState } from 'react'; +import spaceTrim from 'spacetrim'; +import { classNames } from '../../utils/classNames'; +import { focusRef } from '../../utils/focusRef'; +import { useRotatingPlaceholder } from '../../utils/hooks/useRotatingPlaceholder'; +import { string_prompt } from '../../utils/typeAliases'; +import { TorusInteractiveImage } from '../TaskInProgress/TorusInteractiveImage'; +import styles from './CopilotInput.module.css'; + +interface useRouterProps { + /** + * Label for the input + */ + label: string; + + /** + * The html comment to export + */ + onPrompt(prompt: string_prompt): Promise; + + /** + * The placeholders to rotate through when the input is empty + */ + placeholders: Array; +} + +/** + * Renders the co-pilot panel for text commands to edit the page. + */ +export function CopilotInput(props: useRouterProps) { + const { label, onPrompt, placeholders } = props; + const [isRunning, setRunning] = useState(false); + const inputRef = useRef(null); + const placeholder = useRotatingPlaceholder(...placeholders); + + const handlePrompt = useCallback(async () => { + if (isRunning) { + console.error('Prompt is already running' /* <- TODO: Pass this textation as prop */); + return; + } + + let prompt = inputRef.current?.value || ''; + + try { + setRunning(true); + + // TODO: [🍛] Make same normalization as in the backend + prompt = spaceTrim(prompt); + + console.info( + `%c${prompt}`, + spaceTrim(` + display: block; + background: #067597; + color: #FFFFFF; + padding: 5px; + border-radius: 3px; + `), + ); + + await onPrompt(prompt); + } finally { + setRunning(false); + } + }, [inputRef, onPrompt, isRunning]); + + return ( +
+ +
{ + if (event.key === 'Enter') { + handlePrompt(); + } + }} + > + { + // TODO: [🍘] Use joinRefs + focusRef(element); + inputRef.current = element; + }} + disabled={isRunning} + /> + + +
+
+ ); +} + +/** + * TODO: Name "copilot-input" should be generated and memoized + * TODO: [🌂] DRY and (also css) + * TODO: [🧠] Maybe somehow integrate here + */ diff --git a/src/components/CopilotPanel/CopilotPanel.tsx b/src/components/CopilotPanel/CopilotPanel.tsx index 0d32097e2d..6edfb82202 100644 --- a/src/components/CopilotPanel/CopilotPanel.tsx +++ b/src/components/CopilotPanel/CopilotPanel.tsx @@ -2,7 +2,7 @@ import Image from 'next/image'; import { useRouter } from 'next/router'; import { useCallback, useMemo, useRef, useState } from 'react'; import spaceTrim from 'spacetrim'; -import { COPILOT_PLACEHOLDERS } from '../../../config'; +import { COPILOT_PLACEHOLDERS, IS_VERIFIED_EMAIL_REQUIRED } from '../../../config'; import type { UpdateWallpaperContentRequest, UpdateWallpaperContentResponse, @@ -69,7 +69,9 @@ export function CopilotPanel() { const { content: oldContent } = wallpaper; const response = await fetch( - `/api/update-wallpaper-content?clientId=${await provideClientId({ isVerifiedEmailRequired: true })}`, + `/api/update-wallpaper-content?clientId=${await provideClientId({ + isVerifiedEmailRequired: IS_VERIFIED_EMAIL_REQUIRED.EDIT, + })}`, { method: 'POST', body: JSON.stringify({ @@ -129,7 +131,7 @@ export function CopilotPanel() { }} > { @@ -197,7 +199,7 @@ export function CopilotPanel() { className={styles.extraFeatured} onClick={async () => { const clientId = await provideClientId({ - isVerifiedEmailRequired: false, + isVerifiedEmailRequired: IS_VERIFIED_EMAIL_REQUIRED.EDIT, }); const newWallpaper = modifyWallpaper((modifiedWallpaper) => { // Note: [🗄] title is computed after each change id+parent+author+keywords are computed just once before save @@ -314,6 +316,7 @@ export function CopilotPanel() { } /** + * TODO: [🌂] DRY and (also css) * TODO: !! CopilotPanel: Fully line design * TODO: !! CopilotPanel: Show errors * TODO: !! CopilotPanel: Log errors into Sentry diff --git a/src/components/Dialogues/dialogues/promptDialogue.tsx b/src/components/Dialogues/dialogues/promptDialogue.tsx index f694ddc3e2..89fdfbf0f3 100644 --- a/src/components/Dialogues/dialogues/promptDialogue.tsx +++ b/src/components/Dialogues/dialogues/promptDialogue.tsx @@ -28,7 +28,7 @@ export interface IPromptDialogueOptions { * Represents a prompt message that is waiting for an answer or is already answered * * Note: This is not a prompt to language model but a prompt to the user - * @private this should be used only withing this folder Dialogues + * @private Use only withing the folder Dialogues */ export interface IPromptInQueue extends IPromptDialogueOptions { /** diff --git a/src/components/Dialogues/locks/Dialogues.lock.ts b/src/components/Dialogues/locks/Dialogues.lock.ts index 842ffcbf43..82cb2a2648 100644 --- a/src/components/Dialogues/locks/Dialogues.lock.ts +++ b/src/components/Dialogues/locks/Dialogues.lock.ts @@ -1,6 +1,6 @@ /** * Is component currently rendered * Is used to prevent multiple instances of Dialogues in the app - * @private this should be used only withing this folder Dialogues + * @private Use only withing the folder Dialogues */ export let isDialoguesRendered = { value: false }; diff --git a/src/components/Dialogues/queues/prompts.ts b/src/components/Dialogues/queues/prompts.ts index 8f8e4863e9..38e02c1dc8 100644 --- a/src/components/Dialogues/queues/prompts.ts +++ b/src/components/Dialogues/queues/prompts.ts @@ -3,6 +3,6 @@ import { IPromptInQueue } from "../dialogues/promptDialogue"; /** * Queue of prompt dialogues that are waiting for an answer * - * @private this should be used only withing this folder Dialogues + * @private Use only withing the folder Dialogues */ export const promptDialogueQueue: Array = []; diff --git a/src/components/ExportModal/ExportModal.tsx b/src/components/ExportModal/ExportModal.tsx index 4bc68b6fed..401c1a3565 100644 --- a/src/components/ExportModal/ExportModal.tsx +++ b/src/components/ExportModal/ExportModal.tsx @@ -1,6 +1,7 @@ import { useRouter } from 'next/router'; import { useState } from 'react'; import spaceTrim from 'spacetrim'; +import { IS_VERIFIED_EMAIL_REQUIRED } from '../../../config'; import { exportAsZip } from '../../export/exportAsZip'; import { induceFileDownload } from '../../export/utils/induceFileDownload'; import { classNames } from '../../utils/classNames'; @@ -73,7 +74,7 @@ export function ExportModal() { ownerEmail: email, plan, author: await provideClientId({ - isVerifiedEmailRequired: true, + isVerifiedEmailRequired: IS_VERIFIED_EMAIL_REQUIRED.PUBLISH, }), }, ]); @@ -92,7 +93,7 @@ export function ExportModal() { { from: email, author: await provideClientId({ - isVerifiedEmailRequired: false, + isVerifiedEmailRequired: IS_VERIFIED_EMAIL_REQUIRED.PUBLISH, }), message: spaceTrim(` Hi, diff --git a/src/components/Scenarios/Scenarios.tsx b/src/components/Scenarios/Scenarios.tsx index 4939e22014..70a536ec9f 100644 --- a/src/components/Scenarios/Scenarios.tsx +++ b/src/components/Scenarios/Scenarios.tsx @@ -34,6 +34,14 @@ export function Scenarios() { +
  • + + +

    Instagram

    + profile to generate your website +
    + +
  • ); diff --git a/src/components/TaskInProgress/task/mock/_tasks.tsx b/src/components/TaskInProgress/task/mock/_tasks.tsx index 3202a7ca49..446c4ae423 100644 --- a/src/components/TaskInProgress/task/mock/_tasks.tsx +++ b/src/components/TaskInProgress/task/mock/_tasks.tsx @@ -3,7 +3,7 @@ import { TaskProgress } from '../TaskProgress'; /** * Just an list of miscellaneous (im)possible tasks * - * @private do not use outside of this folder, use one of mock... functions instead + * @private Use only withing the folder mock */ export const MOCKED_TASKS_PROGRESS_QUEUE: Array = [ { diff --git a/src/components/UploadNewWallpaper/UploadNewWallpaper.tsx b/src/components/UploadNewWallpaper/UploadNewWallpaper.tsx index cf053e0706..81240c5d45 100644 --- a/src/components/UploadNewWallpaper/UploadNewWallpaper.tsx +++ b/src/components/UploadNewWallpaper/UploadNewWallpaper.tsx @@ -1,6 +1,7 @@ import { useRouter } from 'next/router'; import { ReactNode, useState } from 'react'; import spaceTrim from 'spacetrim'; +import { IS_VERIFIED_EMAIL_REQUIRED } from '../../../config'; import { classNames } from '../../utils/classNames'; import { provideClientId } from '../../utils/supabase/provideClientId'; import { string_css_class } from '../../utils/typeAliases'; @@ -28,7 +29,9 @@ export function UploadNewWallpaper(props: UploadZoneProps) { const { children, className } = props; const router = useRouter(); const [isWorking, setWorking] = useState(false); - const [tasksProgress, setTasksProgress] = useState>([]); + const [tasksProgress, setTasksProgress] = useState>( + [], + ); /* <- TODO: [🌄] useTasksProgress + DRY */ return ( <> @@ -49,9 +52,13 @@ export function UploadNewWallpaper(props: UploadZoneProps) { const { wallpaperId } = await createNewWallpaperForBrowser( { author: await provideClientId({ - isVerifiedEmailRequired: false, + isVerifiedEmailRequired: IS_VERIFIED_EMAIL_REQUIRED.CREATE, }), wallpaperImage: file, + title: null, + description: null, + addSections: [], + links: [], }, (newTaskProgress: TaskProgress) => { console.info('☑', newTaskProgress); @@ -71,6 +78,7 @@ export function UploadNewWallpaper(props: UploadZoneProps) { alert( // <- TODO: Use here alertDialogue + // TODO: [🏔] DRY spaceTrim( (block) => ` Sorry for the inconvenience 😔 @@ -106,7 +114,8 @@ export function UploadNewWallpaper(props: UploadZoneProps) { * TODO: [🧠] !! Speed up the computation of colorstats * TODO: [🧠] !! Compute ONLY colorstats in worker, rest here - split workers into multiple parts * TODO: [🧠] !! Upload image and Compute colorstats in parallel + remove the comment blocks - * TODO: Maybe derive isWorking from taskProgress + * TODO: [☃] Maybe derive isWorking from taskProgress * TODO: Maybe it is not very efficient to first convert image to dataurl and create image from the dataurl - maybe just createImageFromFile / createImageFromBlob * TODO: !! It Should be possible to list private wallpapers via getSupabaseForBrowser().from('Wallpaper').select('*').eq('isPublic', false) + * TODO: [🏍] Standardize process of getting input data for new wallpaper */ diff --git a/src/pages/api/TODO.txt b/src/pages/api/TODO.txt index 7ce750a9b2..0ef1bf7f14 100644 --- a/src/pages/api/TODO.txt +++ b/src/pages/api/TODO.txt @@ -1 +1,2 @@ +TODO: [🌺] There should be some middleware which automatically chacks clientId + some token to prevent misuse TODO: [🌺] There should be probbably some middleware which automatically passes clientId through \ No newline at end of file diff --git a/src/pages/api/about.tsx b/src/pages/api/about.tsx index 0b92f48d00..64458ed130 100644 --- a/src/pages/api/about.tsx +++ b/src/pages/api/about.tsx @@ -10,6 +10,9 @@ interface AboutResponse { } */ +/** + * API endpoint handler which returns information about the application + */ export default async function aboutHandler(request: NextApiRequest, response: NextApiResponse /**/) { const hardcodedWallpapersCount = (await getHardcodedWallpapers()).length; const { count: dynamicWallpapersCount } = await getSupabaseForServer() diff --git a/src/pages/api/client/is-client-verified.ts b/src/pages/api/client/is-client-verified.ts index d90dccb91b..389e469414 100644 --- a/src/pages/api/client/is-client-verified.ts +++ b/src/pages/api/client/is-client-verified.ts @@ -23,12 +23,18 @@ export default async function isClientVerifiedHandler( const clientId = request.query.clientId; if (!isValidClientId(clientId)) { - return response.status(400).json({ message: 'GET param clientId is not valid client ID' } as any /* <-[🌋] */); + return response + .status(400) + .json( + { + message: + 'GET param clientId is not valid client ID' /* <- TODO: [🌻] Unite wrong GET param message */, + } as any /* <-[🌋] */, + ); } const selectResult = await getSupabaseForServer().from('Client').select('email').eq('clientId', clientId).limit(1); - if ((selectResult.data?.length || 0) > 0) { return response .status(200) diff --git a/src/pages/api/custom/TODO.txt b/src/pages/api/custom/TODO.txt deleted file mode 100644 index 776a69ce46..0000000000 --- a/src/pages/api/custom/TODO.txt +++ /dev/null @@ -1 +0,0 @@ -TODO: [🚵‍♂️] Maybe do here also the colorstats \ No newline at end of file diff --git a/src/pages/api/custom/write-wallpaper-content.ts b/src/pages/api/custom/write-wallpaper-content.ts index 011c028343..84475344b3 100644 --- a/src/pages/api/custom/write-wallpaper-content.ts +++ b/src/pages/api/custom/write-wallpaper-content.ts @@ -1,9 +1,10 @@ import type { NextApiRequest, NextApiResponse } from 'next'; -import { writeWallpaperContent } from '../../../ai/text-to-text/writeWallpaperContent'; - -import { description, string_markdown, uuid } from '../../../utils/typeAliases'; +import { writeWallpaperContent, WriteWallpaperContentOptions } from '../../../ai/text-to-text/writeWallpaperContent'; +import { string_markdown, uuid } from '../../../utils/typeAliases'; import { isValidClientId } from '../../../utils/validators/isValidClientId'; +export type WriteWallpaperContentRequest = Omit; + export interface WriteWallpaperContentResponse { // TODO: [🌋] ErrorableResponse wallpaperContent: string_markdown; @@ -18,18 +19,15 @@ export default async function writeWallpaperContentHandler( } const clientId = request.query.clientId as uuid; /* <-[🌺] */ - const wallpaperAssigment = request.body.wallpaperAssigment as Exclude; if (!isValidClientId(clientId)) { return response.status(400).json({ message: 'Parameter "clientId" must be valid client ID' } as any); } - if (!wallpaperAssigment) { - return response.status(400).json({ message: 'Parameter "wallpaperAssigment" is required' } as any); - } + const { title, assigment, addSections, links } = request.body as WriteWallpaperContentRequest; try { - const wallpaperContent = await writeWallpaperContent(wallpaperAssigment, clientId); + const wallpaperContent = await writeWallpaperContent({ clientId, title, assigment, addSections, links }); return response.status(200 /* <- TODO: [🕶] What is the right HTTP code to be here */).json({ wallpaperContent, diff --git a/src/pages/api/og-image.tsx b/src/pages/api/og-image.tsx index 7a0f12005d..6193550755 100644 --- a/src/pages/api/og-image.tsx +++ b/src/pages/api/og-image.tsx @@ -3,11 +3,19 @@ import type { NextApiRequest, NextApiResponse } from 'next'; import { string_wallpaper_id } from '../../utils/typeAliases'; import { isValidWallpaperId } from '../../utils/validators/isValidWallpaperId'; -export default async function ogImageHandler(request: NextApiRequest, response: NextApiResponse) { +/** + * API endpoint handler to return preview image + */ +export default async function ogImageHandler( + request: NextApiRequest, + response: NextApiResponse /* <- TODO: [❄] What is the best way how to type non-json reposnses */, +) { const wallpaperId = request.query.wallpaperId as string_wallpaper_id; if (!isValidWallpaperId(wallpaperId)) { - return response.status(400).json({ message: 'GET param wallpaperId is not valid UUID' }); + return response.status(400).json({ + message: 'GET param wallpaperId is not valid UUID' /* <- TODO: [🌻] Unite wrong GET param message */, + }); } /*/ @@ -53,6 +61,7 @@ export default async function ogImageHandler(request: NextApiRequest, response: } /** + * TODO: !! Rename to preview-image * TODO: [🦋] Do simmilar thing for icons * TODO: [👔] This is not working on edge runtime - fix after @see https://github.com/vercel/satori/issues/475 @see https://github.com/nzws/nzws.me/issues/574 * TODO: [🦺] Maybe we need robots.txt @see https://vercel.com/docs/concepts/functions/edge-functions/og-image-generation diff --git a/src/pages/api/random-wallpaper.ts b/src/pages/api/random-wallpaper.ts index 0bc402750a..bf1c24a346 100644 --- a/src/pages/api/random-wallpaper.ts +++ b/src/pages/api/random-wallpaper.ts @@ -6,6 +6,10 @@ export interface RandomWallpaperResponse { randomWallpaper: IWallpaperSerialized; } +/** + * API endpoint handler to get random wallpaper + * Note: It picks only public wallpapers + */ export default async function randomWallpaperHandler( request: NextApiRequest, response: NextApiResponse, @@ -17,11 +21,9 @@ export default async function randomWallpaperHandler( .limit(1) .single(); - return response - .status(200) - .json( - { - randomWallpaper: result.data, - } as any /* <- TODO: Remove any and replace by satisfies RandomWallpaperResponse*/, - ); + return response.status(200).json( + { + randomWallpaper: result.data, + } as any /* <- TODO: Remove any and replace by satisfies RandomWallpaperResponse*/, + ); } diff --git a/src/pages/api/recommend-wallpaper.ts b/src/pages/api/recommend-wallpaper.ts index 4bff486384..777c0deea3 100644 --- a/src/pages/api/recommend-wallpaper.ts +++ b/src/pages/api/recommend-wallpaper.ts @@ -14,6 +14,9 @@ export interface RecommendWallpaperResponse { recommendedWallpaper: IWallpaperSerialized; } +/** + * API endpoint handler to recommend new wallpaper to the user according to his previous reactions + */ export default async function recommendWallpaperHandler( request: NextApiRequest, response: NextApiResponse, @@ -21,9 +24,12 @@ export default async function recommendWallpaperHandler( const author = request.query.author; if (!isValidUuid(author)) { - return response - .status(400) - .json({ message: 'GET param author is not set or not a valid UUID' } as any /* <- [🌋] */); + return response.status(400).json( + { + message: + 'GET param author is not set or not a valid UUID' /* <- TODO: [🌻] Unite wrong GET param message */, + } as any /* <- [🌋] */, + ); } try { diff --git a/src/pages/api/register-script.ts b/src/pages/api/register-script.ts index 8b1a048250..0922d99b06 100644 --- a/src/pages/api/register-script.ts +++ b/src/pages/api/register-script.ts @@ -5,6 +5,10 @@ import { prettifyJavascript } from '../../export/utils/prettifyJavascript'; import { uuid } from '../../utils/typeAliases'; import { isValidWallpaperId } from '../../utils/validators/isValidWallpaperId'; +/** + * Function for registering new site into the system + * It is injected into the response of registerScriptHandler as a string + */ async function register(wallpaperId: uuid) { console.info('🔌', 'Registering your page'); console.info('🔌', 'hostname', window.location.hostname); @@ -24,11 +28,19 @@ async function register(wallpaperId: uuid) { console.info('🔌', message); } -export default async function registerScriptHandler(request: NextApiRequest, response: NextApiResponse) { +/** + * API endpoint handler to return javascript for registering new site into the system + */ +export default async function registerScriptHandler( + request: NextApiRequest, + response: NextApiResponse /* <- TODO: [❄] What is the best way how to type non-json reposnses */, +) { const wallpaperId = request.query.wallpaperId; if (!isValidWallpaperId(wallpaperId)) { - return response.status(400).json({ message: 'GET param wallpaperId is not valid UUID' }); + return response.status(400).json({ + message: 'GET param wallpaperId is not valid UUID' /* <- TODO: [🌻] Unite wrong GET param message */, + }); } return response diff --git a/src/pages/api/register.ts b/src/pages/api/register.ts index 0d7a4bf9f6..fd00e8c447 100644 --- a/src/pages/api/register.ts +++ b/src/pages/api/register.ts @@ -9,6 +9,9 @@ interface RegisterResponse { message: string; } +/** + * API endpoint handler to register new site into the system + */ export default async function registerHandler(request: NextApiRequest, response: NextApiResponse) { response.setHeader('Access-Control-Allow-Origin', '*'); response.setHeader('Access-Control-Allow-Methods', 'GET, PUT, OPTIONS'); @@ -26,11 +29,15 @@ export default async function registerHandler(request: NextApiRequest, response: const url = request.query.url as string_url; if (!isValidWallpaperId(wallpaperId)) { - return response.status(400).json({ message: 'GET param wallpaperId is not valid UUID' }); + return response.status(400).json({ + message: 'GET param wallpaperId is not valid UUID' /* <- TODO: [🌻] Unite wrong GET param message */, + }); } if (!isValidUrl(url)) { - return response.status(400).json({ message: 'GET param url is not valid URL' }); + return response + .status(400) + .json({ message: 'GET param url is not valid URL' /* <- TODO: [🌻] Unite wrong GET param message */ }); } const selectResult = await getSupabaseForServer().from('Site').select('id').eq('url', url).limit(1); diff --git a/src/pages/api/scrape/scrape-image.ts b/src/pages/api/scrape/scrape-image.ts new file mode 100644 index 0000000000..3724e21004 --- /dev/null +++ b/src/pages/api/scrape/scrape-image.ts @@ -0,0 +1,92 @@ +import type { NextApiRequest, NextApiResponse } from 'next'; +import { string_url } from '../../../utils/typeAliases'; +import { isUrlOnPrivateNetwork } from '../../../utils/validators/isUrlOnPrivateNetwork'; +import { isValidClientId } from '../../../utils/validators/isValidClientId'; +import { isValidUrl } from '../../../utils/validators/isValidUrl'; + +/** + * API endpoint handler for scraping Instagram user + */ +export default async function scrapeInstagramUserHandler( + request: NextApiRequest, + response: NextApiResponse /* <- TODO: [❄] What is the best way how to type non-json reposnses */, +) { + //--------------- + // TODO: !! Put to every API endpoint + // TODO: [🌺] Make middleware for this: + const clientId = request.query.clientId; /* <- TODO: [🌺][1] Maybe pass clientId as header X-Client-Id */ + if (!isValidClientId(clientId) /* <- TODO: [🌺][2] Also check if the email of client is validated */) { + return response.status(400).json( + { + message: 'You must pass valid clientId' /* <- TODO: [🌻] Unite wrong GET param message */, + } as any /* <-[🌋] */, + ); + } + // TODO: [🌺] Log cost for this request and attribute it to the client + //--------------- + + const url = request.query.url; + + if (!isValidUrl(url)) { + return response.status(400).json( + { + message: 'GET param url is not valid URL' /* <- TODO: [🌻] Unite wrong GET param message */, + } as any /* <-[🌋] */, + ); + } + + if (isUrlOnPrivateNetwork(url)) { + return response.status(403).json( + { + message: `Url "${url}" is on private network. This is not allowed for security reasons.`, + } as any /* <-[🌋] */, + ); + } + + const imageResponse = await fetch( + url as string_url, + // TODO: Limit size and timeout + ).catch((response) => ({ + status: 404 as const, + })); + + if (imageResponse.status === 404) { + return response.status(404).json( + { + message: `Url "${url}" does not exist`, + } as any /* <-[🌋] */, + ); + } + + if (imageResponse.status !== 200) { + return response.status(400).json( + { + message: `Url "${url}" does not responded with 200 but ${imageResponse.status}`, + } as any /* <-[🌋] */, + ); + } + + const contentType = imageResponse.headers.get('Content-Type') || 'unknown'; + + if (!contentType.startsWith('image/')) { + return response.status(403).json( + { + message: `Url "${url}" is not image but ${imageResponse.type}`, + } as any /* <-[🌋] */, + ); + } + console.log(response); + + return response + .setHeader('Content-Type', contentType) + .status(200) + .end( + Buffer.from( + await imageResponse.arrayBuffer(), + ) /* <- TODO: Can it be made more elegantely then converting response -> arrayBuffer -> buffer? */, + ); +} + +/** + * TODO: Maybe> response.setHeader('Cache-Control', 'public, max-age=31536000, immutable'); + */ diff --git a/src/pages/api/scrape/scrape-instagram-user.ts b/src/pages/api/scrape/scrape-instagram-user.ts new file mode 100644 index 0000000000..f49e23569c --- /dev/null +++ b/src/pages/api/scrape/scrape-instagram-user.ts @@ -0,0 +1,96 @@ +import type { GraphqlUser } from 'insta-fetcher/dist/types'; +import type { NextApiRequest, NextApiResponse } from 'next'; +import spaceTrim from 'spacetrim'; +import { explainError } from '../../../utils/extraMessage'; +import { + getInstagramApiForServer, + resetInstagramApiForServer, +} from '../../../utils/scraping/getInstagramApiForServer/getInstagramApiForServer'; +import { isValidClientId } from '../../../utils/validators/isValidClientId'; + +export interface ScrapeInstagramUserResponse { + // TODO: [🌋] ErrorableResponse + + /** + * Information about the Instagram user + */ + instagramUser: GraphqlUser; +} + +/** + * API endpoint handler for scraping Instagram user + */ +export default async function scrapeInstagramUserHandler( + request: NextApiRequest, + response: NextApiResponse, +) { + //--------------- + // TODO: [🌺] Make middleware for this: + const clientId = request.query.clientId; /* <- TODO: [🌺][1] Maybe pass clientId as header X-Client-Id */ + if (!isValidClientId(clientId) /* <- TODO: [🌺][2] Also check if the email of client is validated */) { + return response.status(400).json( + { + message: 'You must pass valid clientId' /* <- TODO: [🌻] Unite wrong GET param message */, + } as any /* <-[🌋] */, + ); + } + // TODO: [🌺] Log cost for this request and attribute it to the client + //--------------- + + const instagramName = request.query.instagramName; + + if (typeof instagramName !== 'string' /* <- TODO: Better validation */) { + return response.status(400).json( + { + message: 'GET param instagramName is not valid' /* <- TODO: [🌻] Unite wrong GET param message */, + } as any /* <-[🌋] */, + ); + } + + try { + const instagramApi = await getInstagramApiForServer(); + + const instagramUser = await instagramApi + .fetchUserV2(instagramName) + .catch(explainError(`Can not fetch Instagram user @${instagramName}`)); + // console.info('👤', { instagramUser }); + + return response.status(200).json({ instagramUser } satisfies ScrapeInstagramUserResponse); + } catch (error) { + if (!(error instanceof Error)) { + throw error; + } + + if (error.message.includes('Invalid cookie') || error.message.includes('failed with status code 401')) { + await resetInstagramApiForServer(); + return response.status(425).json( + { + message: 'Refreshing Instagram session. Please try again in few seconds.', + } as any /* <-[🌋] */, + ); + } + + console.error(error); + return response.status(500).json( + { + message: spaceTrim( + (block) => ` + + There was an error while scraping Instagram user @${instagramName} + + ${block((error as Error).message)} + `, + ), + } as any /* <-[🌋] */, + ); + } +} + +/** + * TODO: [🕍] Cache the scraping + * TODO: [🧠] Automatically folow on Instagram when scraping + * TODO: [🧠] Automatically post newly created web as story / post on Instagram + * TODO: Maybe API URL for scraping be like> /api/scrape/instagram/@hejny + * TODO: Maybe obtain session_id from username+password + * > const session_id = await getCookie('pavolhejny', '...'); + */ diff --git a/src/pages/api/update-wallpaper-content.ts b/src/pages/api/update-wallpaper-content.ts index a347fceffb..a7384eaae6 100644 --- a/src/pages/api/update-wallpaper-content.ts +++ b/src/pages/api/update-wallpaper-content.ts @@ -16,6 +16,9 @@ export interface UpdateWallpaperContentResponse { updatedWallpaper: Pick; } +/** + * API endpoint handler for updating wallpaper content according to user prompt + */ export default async function updateWallpaperContentHandler( request: NextApiRequest, response: NextApiResponse, diff --git a/src/pages/api/wallpapers-min.ts b/src/pages/api/wallpapers-min.ts index 90c688fbe3..d01f4cb799 100644 --- a/src/pages/api/wallpapers-min.ts +++ b/src/pages/api/wallpapers-min.ts @@ -5,6 +5,11 @@ import { string_color, string_wallpaper_id } from '../../utils/typeAliases'; interface WallpapersResponse { wallpapers: Array<{ id: string_wallpaper_id; primaryColor: string_color }>; } + +/** + * API endpoint handler for getting all wallpapers IDs with primary colors + * It is usefull to generate gallery of