PageSourceSearch

https://docs-pactflow-preview.netlify.app/assets/js/c2692d61.9c011e66.js

js docs-pactflow-preview.netlify.app collected 2026-10-03 10:41:38 UTC 8,904 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkpartners=self.webpackChunkpartners||[]).push([[20002],{15680:(e,a,t)=>{t.d(a,{xA:()=>c,yg:()=>g});var n=t(96540);function r(e,a,t){return a in e?Object.defineProperty(e,a,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[a]=t,e}function o(e,a){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);a&&(n=n.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),t.push.apply(t,n)}return t}function i(e){for(var a=1;a<arguments.length;a++){var t=null!=arguments[a]?arguments[a]:{};a%2?o(Object(t),!0).forEach((function(a){r(e,a,t[a])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):o(Object(t)).forEach((function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(t,a))}))}return e}function s(e,a){if(null==e)return{};var t,n,r=function(e,a){if(null==e)return{};var t,n,r={},o=Object.keys(e);for(n=0;n<o.length;n++)t=o[n],a.indexOf(t)>=0||(r[t]=e[t]);return r}(e,a);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)t=o[n],a.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}var l=n.createContext({}),p=function(e){var a=n.useContext(l),t=a;return e&&(t="function"==typeof e?e(a):i(i({},a),e)),t},c=function(e){var a=p(e.components);return n.createElement(l.Provider,{value:a},e.children)},m="mdxType",d={inlineCode:"code",wrapper:function(e){var a=e.children;return n.createElement(n.Fragment,{},a)}},u=n.forwardRef((function(e,a){var t=e.components,r=e.mdxType,o=e.originalType,l=e.parentName,c=s(e,["components","mdxType","originalType","parentName"]),m=p(t),u=r,g=m["".concat(l,".").concat(u)]||m[u]||d[u]||o;return t?n.createElement(g,i(i({ref:a},c),{},{components:t})):n.createElement(g,i({ref:a},c))}));function g(e,a){var t=arguments,r=a&&a.mdxType;if("string"==typeof e||r){var o=t.length,i=new Array(o);i[0]=u;var s={};for(var l in a)hasOwnProperty.call(a,l)&&(s[l]=a[l]);s.originalType=e,s[m]="string"==typeof e?e:r,i[1]=s;for(var p=2;p<o;p++)i[p]=t[p];return n.createElement.apply(null,i)}return n.createElement.apply(null,t)}u.displayName="MDXCreateElement"},72095:(e,a,t)=>{t.r(a),t.d(a,{assets:()=>l,contentTitle:()=>i,default:()=>d,frontMatter:()=>o,metadata:()=>s,toc:()=>p});var n=t(58168),r=(t(96540),t(15680));const o={title:"Database"},i=void 0,s={unversionedId:"docs/on-premises-2x/database",id:"docs/on-premises-2x/database",title:"Database",description:"A PostgreSQL database is required for storage of the application data.",source:"@site/docs/docs/on-premises-2x/database.md",sourceDirName:"docs/on-premises-2x",slug:"/docs/on-premises-2x/database",permalink:"/docs/on-premises-2x/database",draft:!1,editUrl:"https://github.com/pactflow/docs.pactflow.io/edit/master/website/docs/docs/on-premises-2x/database.md",tags:[],version:"current",lastUpdatedBy:"Matt Fellows",lastUpdatedAt:1751508618,formattedLastUpdatedAt:"Jul 3, 2025",frontMatter:{title:"Database"},sidebar:"onprem",previous:{title:"Migrating from Pact Broker",permalink:"/docs/on-premises-2x/installation/migrating"},next:{title:"Cache",permalink:"/docs/on-premises-2x/redis"}},l={},p=[{value:"Supported versions",id:"supported-versions",level:2},{value:"Database creation",id:"database-creation",level:2},{value:"SSL",id:"ssl",level:2},{value:"Authentication",id:"authentication",level:2},{value:"Username/password authentication",id:"usernamepassword-authentication",level:2},{value:"AWS IAM authentication",id:"aws-iam-authentication",level:2},{value:"Schema migrations",id:"schema-migrations",level:2},{value:"Migrating from OSS Pact Broker to PactFlow",id:"migrating-from-oss-pact-broker-to-pactflow",level:3},{value:"Schema",id:"schema",level:2}],c={toc:p},m="wrapper";function d(e){let{components:a,...o}=e;return(0,r.yg)(m,(0,n.A)({},c,o,{components:a,mdxType:"MDXLayout"}),(0,r.yg)("p",null,"A PostgreSQL database is required for storage of the application data."),(0,r.yg)("admonition",{type:"info"},(0,r.yg)("p",{parentName:"admonition"}," If you would like to migrate an existing PostgreSQL database, skip this 
1section and instead follow the guide ",(0,r.yg)("a",{parentName:"p",href:"/docs/on-premises-2x/installation/migrating"},(0,r.yg)("strong",{parentName:"a"},"here")),".")),(0,r.yg)("h2",{id:"supported-versions"},"Supported versions"),(0,r.yg)("p",null,"PostgreSQL version 10.6 and later are supported."),(0,r.yg)("h2",{id:"database-creation"},"Database creation"),(0,r.yg)("p",null,"Log in as your database administrator, and execute the following statements in an SQL session."),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-sql"},"CREATE USER pactflow_user WITH PASSWORD '<password>';\nCREATE DATABASE pactflow;\nGRANT ALL PRIVILEGES ON DATABASE pactflow TO pactflow_user;\nREVOKE ALL ON DATABASE pactflow FROM PUBLIC;\n")),(0,r.yg)("h2",{id:"ssl"},"SSL"),(0,r.yg)("p",null,"The application's PostgreSQL SSL mode is set to ",(0,r.yg)("inlineCode",{parentName:"p"},"require")," by default, which means it requires the connection to the database to be encrypted, but does not verify the server's certificate. See the documentation for the ",(0,r.yg)("a",{parentName:"p",href:"environment-variables#pactflow_database_sslmode"},"PACTFLOW_DATABASE_SSLMODE")," environment variable for more options. It is not recommended to use any option weaker than ",(0,r.yg)("inlineCode",{parentName:"p"},"require"),"."),(0,r.yg)("h2",{id:"authentication"},"Authentication"),(0,r.yg)("h2",{id:"usernamepassword-authentication"},"Username/password authentication"),(0,r.yg)("p",null,"Database access between the PactFlow application and Postgres instance can be secured using a ",(0,r.yg)("a",{parentName:"p",href:"/docs/on-premises-2x/environment-variables#pactflow_database_username"},"username")," and ",(0,r.yg)("a",{parentName:"p",href:"/docs/on-premises-2x/environment-variables#pactflow_database_password"},"password"),", configured via environment variables."),(0,r.yg)("h2",{id:"aws-iam-authentication"},"AWS IAM authentication"),(0,r.yg)("p",null,"When deploying PactFlow on AWS Cloud infrastructure, database access between the PactFlow application and the RDS Postgres instance can be secured using IAM. Please see the ",(0,r.yg)("a",{parentName:"p",href:"https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAM.html"},"AWS RDS IAM documentation")," for more information."),(0,r.yg)("p",null,"The following environmet variables must be set for the PactFlow application:"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"/docs/on-premises-2x/environment-variables#pactflow_database_adapter"},(0,r.yg)("inlineCode",{parentName:"a"},'PACTFLOW_DATABASE_ADAPTER="postgresiam"'))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"/docs/on-premises-2x/environment-variables#pactflow_database_username"},(0,r.yg)("inlineCode",{parentName:"a"},"PACTFLOW_DATABASE_USERNAME"))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"/docs/on-premises-2x/environment-variables#pactflow_database_host"},(0,r.yg)("inlineCode",{parentName:"a"},"PACTFLOW_DATABASE_HOST"))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"/docs/on-premises-2x/environment-variables#pactflow_database_port"},(0,r.yg)("inlineCode",{parentName:"a"},"PACTFLOW_DATABASE_PORT"))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"/docs/on-premises-2x/environment-variables#pactflow_database_name"},(0,r.yg)("inlineCode",{parentName:"a"},"PACTFLOW_DATABASE_NAME"))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"/docs/on-premises-2x/environment-variables#pactflow_database_sslmode"},(0,r.yg)("inlineCode",{parentName:"a"},'PACTFLOW_DATABASE_SSLMODE="require"'))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"/docs/on-premises-2x/environment-variables#aws_region"},(0,r.yg)("inlineCode",{parentName:"a"},"AWS_REGION")))),(0,r.yg)("h2",{id:"schema-migrations"},"Schema migrations"),(0,r.yg)("p",null,"The database schema migrations will be run automatically on start up. See the documentation on ",(0,r.yg)("a",{parentName:"p",href:"upgrading/database-migrations"},"Database migrations")," for more information."),(0,r.yg)("h3",{id:"migrating-from-oss-pact-broker-to-pactflow"},"Migrating from OSS Pact Broker to PactFlow"),(0,r.yg)("p",null,"If you have been hosting your own instance of the open source Pact Broker, you can point the new PactFlow On-Premises application at the same database, and the missing migrations will be applied."),(0,r.yg)("h2",{id:"schema"},"Schema"),(0,r.yg)("p",null,(0,r.yg)("img",{alt:"Database schema",src:t(5452).A,width:"2081",height:"4395"})))}d.isMDXComponent=!0},5452:(e,a,t)=>{t.d(a,{A:()=>n});const n=t.p+"assets/images/schema-99e9527486de5a4bee69e73546739132.png"}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.