Git Product home page Git Product logo

payload-railway-postgres's Introduction

Payload CMS v2 with PostgreSQL Database

Deploy on Railway

The original project was created using npx create-payload-app and used the blank template.

How to Use Locally with Remote PostgreSQL Database

Following these instructions will have the application pointing to the hosted PostgreSQL database

  • yarn install to install the needed dependencies
  • Install and configure the Railway CLI
  • railway run yarn dev will start up your application and reload on any changes. At this point changes in the schema will be automatically updated in the remote PostgreSQL database
  • to create migration before committing your code railway run yarn payload migrate:create

How to Use Locally with Local PostgreSQL Database

  • yarn install to install the needed dependencies
  • Create your own local Postgres Database and update the .env file with the DATABASE_URI
  • Set the other .env file variables
  • yarn dev will start up your application and reload on any changes
  • Payload will update the database schema locally so you will need to run railway run yarn payload migrate:create before committing to GitHub so the schema changes get committed. The deployment script will run the appropriate migrate command to push changes to the database

PostgreSQL Information

How To Create a Local PostgreSQL Database

Open the terminal and run the command

sudo -u postgres psql

Create PostgreSQL Database

CREATE DATABASE myproject;

Create User

CREATE USER myprojectuser WITH PASSWORD 'password';

Update the .env file variable DATABASE_URI appropriately to point to the correct server

payload-railway-postgres's People

Contributors

aaronksaunders avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.