mrdrewk

Untitled

Jun 19th, 2024
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.08 KB | None | 0 0
  1. --
  2. -- PostgreSQL database cluster dump
  3. --
  4.  
  5. SET default_transaction_read_only = off;
  6.  
  7. SET client_encoding = 'UTF8';
  8. SET standard_conforming_strings = on;
  9.  
  10. --
  11. -- Drop databases (except postgres and template1)
  12. --
  13.  
  14. DROP DATABASE immichdb;
  15. DROP DATABASE nextclouddb;
  16.  
  17.  
  18.  
  19.  
  20. --
  21. -- Drop roles
  22. --
  23.  
  24. DROP ROLE immich;
  25. DROP ROLE immichuser;
  26. DROP ROLE nextcloud;
  27. DROP ROLE postgres;
  28.  
  29.  
  30. --
  31. -- Roles
  32. --
  33.  
  34. CREATE ROLE immich;
  35. ALTER ROLE immich WITH SUPERUSER INHERIT NOCREATEROLE NOCREATEDB LOGIN NOREPLICATION NOBYPASSRLS PASSWORD 'SCRAM-SHA-256$4096:xxxxxxxxxxxxxxxx';
  36. CREATE ROLE immichuser;
  37. ALTER ROLE immichuser WITH SUPERUSER INHERIT NOCREATEROLE NOCREATEDB LOGIN NOREPLICATION NOBYPASSRLS PASSWORD 'SCRAM-SHA-256$4096:xxxxxxxxxxxx';
  38. CREATE ROLE nextcloud;
  39. ALTER ROLE nextcloud WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB LOGIN NOREPLICATION NOBYPASSRLS PASSWORD 'SCRAM-SHA-256$4096:xxxxxxxxxxxxxxxxxxx';
  40. CREATE ROLE postgres;
  41. ALTER ROLE postgres WITH SUPERUSER INHERIT CREATEROLE CREATEDB LOGIN REPLICATION BYPASSRLS PASSWORD 'SCRAM-SHA-256$4096:xxxxxxxxxxxxxxxxxxxxxx';
  42.  
  43. --
  44. -- User Configurations
  45. --
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54. --
  55. -- Databases
  56. --
  57.  
  58. --
  59. -- Database "template1" dump
  60. --
  61.  
  62. --
  63. -- PostgreSQL database dump
  64. --
  65.  
  66. -- Dumped from database version 16.1 (Debian 16.1-1.pgdg120+1)
  67. -- Dumped by pg_dump version 16.1 (Debian 16.1-1.pgdg120+1)
  68.  
  69. SET statement_timeout = 0;
  70. SET lock_timeout = 0;
  71. SET idle_in_transaction_session_timeout = 0;
  72. SET client_encoding = 'UTF8';
  73. SET standard_conforming_strings = on;
  74. SELECT pg_catalog.set_config('search_path', '', false);
  75. SET check_function_bodies = false;
  76. SET xmloption = content;
  77. SET client_min_messages = warning;
  78. SET row_security = off;
  79.  
  80. UPDATE pg_catalog.pg_database SET datistemplate = false WHERE datname = 'template1';
  81. DROP DATABASE template1;
  82. --
  83. -- Name: template1; Type: DATABASE; Schema: -; Owner: postgres
  84. --
  85.  
  86. CREATE DATABASE template1 WITH TEMPLATE = template0 ENCODING = 'UTF8' LOCALE_PROVIDER = libc LOCALE = 'en_US.utf8';
  87.  
  88.  
  89. ALTER DATABASE template1 OWNER TO postgres;
  90.  
  91. \connect template1
  92.  
  93. SET statement_timeout = 0;
  94. SET lock_timeout = 0;
  95. SET idle_in_transaction_session_timeout = 0;
  96. SET client_encoding = 'UTF8';
  97. SET standard_conforming_strings = on;
  98. SELECT pg_catalog.set_config('search_path', '', false);
  99. SET check_function_bodies = false;
  100. SET xmloption = content;
  101. SET client_min_messages = warning;
  102. SET row_security = off;
  103.  
  104. --
  105. -- Name: DATABASE template1; Type: COMMENT; Schema: -; Owner: postgres
  106. --
  107.  
  108. COMMENT ON DATABASE template1 IS 'default template for new databases';
  109.  
  110.  
  111. --
  112. -- Name: template1; Type: DATABASE PROPERTIES; Schema: -; Owner: postgres
  113. --
  114.  
  115. ALTER DATABASE template1 IS_TEMPLATE = true;
  116.  
  117.  
  118. \connect template1
  119.  
  120. SET statement_timeout = 0;
  121. SET lock_timeout = 0;
  122. SET idle_in_transaction_session_timeout = 0;
  123. SET client_encoding = 'UTF8';
  124. SET standard_conforming_strings = on;
  125. SELECT pg_catalog.set_config('search_path', '', false);
  126. SET check_function_bodies = false;
  127. SET xmloption = content;
  128. SET client_min_messages = warning;
  129. SET row_security = off;
  130.  
  131. --
  132. -- Name: DATABASE template1; Type: ACL; Schema: -; Owner: postgres
  133. --
  134.  
  135. REVOKE CONNECT,TEMPORARY ON DATABASE template1 FROM PUBLIC;
  136. GRANT CONNECT ON DATABASE template1 TO PUBLIC;
  137.  
  138.  
  139. --
  140. -- PostgreSQL database dump complete
  141. --
  142.  
  143. --
  144. -- Database "immichdb" dump
  145. --
  146.  
  147. --
  148. -- PostgreSQL database dump
  149. --
  150.  
  151. -- Dumped from database version 16.1 (Debian 16.1-1.pgdg120+1)
  152. -- Dumped by pg_dump version 16.1 (Debian 16.1-1.pgdg120+1)
  153.  
  154. SET statement_timeout = 0;
  155. SET lock_timeout = 0;
  156. SET idle_in_transaction_session_timeout = 0;
  157. SET client_encoding = 'UTF8';
  158. SET standard_conforming_strings = on;
  159. SELECT pg_catalog.set_config('search_path', '', false);
  160. SET check_function_bodies = false;
  161. SET xmloption = content;
  162. SET client_min_messages = warning;
  163. SET row_security = off;
  164.  
  165. --
  166. -- Name: immichdb; Type: DATABASE; Schema: -; Owner: immichuser
  167. --
  168.  
  169. CREATE DATABASE immichdb WITH TEMPLATE = template0 ENCODING = 'UTF8' LOCALE_PROVIDER = libc LOCALE = 'en_US.utf8';
  170.  
  171.  
  172. ALTER DATABASE immichdb OWNER TO immichuser;
  173.  
  174. \connect immichdb
  175.  
Advertisement
Add Comment
Please, Sign In to add comment