Commit 0e6ffad 1 parent 30171f3 commit 0e6ffad Copy full SHA for 0e6ffad
File tree 2 files changed +9
-0
lines changed
packages/medusa/src/commands/plugin/db
2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " @medusajs/medusa " : patch
3
+ ---
4
+
5
+ fix: allow setting DB_PORT and DATABASE_URL env variables
Original file line number Diff line number Diff line change @@ -102,6 +102,8 @@ async function generateMigrations(
102
102
const DB_HOST = process . env . DB_HOST ?? "localhost"
103
103
const DB_USERNAME = process . env . DB_USERNAME ?? ""
104
104
const DB_PASSWORD = process . env . DB_PASSWORD ?? ""
105
+ const DB_PORT = process . env . DB_PORT ? Number ( process . env . DB_PORT ) : 5432
106
+ const DATABASE_URL = process . env . DATABASE_URL
105
107
106
108
for ( const moduleDescriptor of moduleDescriptors ) {
107
109
logger . info (
@@ -113,8 +115,10 @@ async function generateMigrations(
113
115
{
114
116
entities : moduleDescriptor . entities ,
115
117
host : DB_HOST ,
118
+ port : DB_PORT ,
116
119
user : DB_USERNAME ,
117
120
password : DB_PASSWORD ,
121
+ ...( DATABASE_URL ? { clientUrl : DATABASE_URL } : { } ) ,
118
122
migrations : {
119
123
path : moduleDescriptor . migrationsPath ,
120
124
} ,
You can’t perform that action at this time.
0 commit comments