65B, Computer Village, Ikeja Along, Lagos State
65B, Computer Village, Ikeja Along, Lagos State
sudo apt update
sudo apt install postgresql postgresql-contrib
# Force-start the engine processes
sudo systemctl start postgresql
# Enable it to run automatically on system boot
sudo systemctl enable postgresql
# Verify the operational status (should say "active (running)")
sudo systemctl status postgresql
sudo -u postgres psql
-- Create the 3 main system accounts using explicit passwords
CREATE ROLE fresible_migrator WITH LOGIN PASSWORD 'local_migrator';
CREATE ROLE fresible_app WITH LOGIN PASSWORD 'local_app';
CREATE ROLE fresible_platform WITH LOGIN PASSWORD 'local_platform';
-- Elevate the migrator role with Superuser permissions to modify database structures
ALTER ROLE fresible_migrator CREATEDB SUPERUSER;
-- Provision the structural environments owned by the primary migration account
CREATE DATABASE fresible_dev OWNER fresible_migrator;
CREATE DATABASE fresible_test OWNER fresible_migrator;
-- Safely disconnect and close the admin prompt
\q
cd ~/projects/PMS-BE
.env) explicitly includes the mapped local routing paths matching the users created above:DATABASE_URL="postgresql://fresible_migrator:local_migrator@localhost:5432/fresible_dev?schema=public"
APP_DATABASE_URL="postgresql://fresible_app:local_app@localhost:5432/fresible_dev?schema=public"
PLATFORM_DATABASE_URL="postgresql://fresible_platform:local_platform@localhost:5432/fresible_dev?schema=public"
TEST_DATABASE_URL="postgresql://fresible_migrator:local_migrator@localhost:5432/fresible_test?schema=public"
pnpm prisma db push
pnpm prisma studio
Leave a Comment