Skip to content

Commit 299d1d4

Browse files
committed
actually use port from args/config in dbm
1 parent 0b84dd7 commit 299d1d4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/dbm/main.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ int main( int32_t argc, char* argv[] )
116116

117117
std::string migrationName;
118118

119+
uint16_t port;
120+
119121
bool force = false;
120122

121123
// load config first so it can still be overridden if required
@@ -127,6 +129,7 @@ int main( int32_t argc, char* argv[] )
127129
database = globalConfig.database.database;
128130
user = globalConfig.database.user;
129131
pass = globalConfig.database.password;
132+
port = globalConfig.database.port;
130133
}
131134

132135
std::vector< std::string > args( argv + 1, argv + argc );
@@ -155,6 +158,8 @@ int main( int32_t argc, char* argv[] )
155158
iFile = val;
156159
else if( arg == "force" )
157160
force = true;
161+
else if( arg == "port" )
162+
port = atoi( val.c_str() );
158163
else if( arg == "name" )
159164
migrationName = val;
160165
}
@@ -168,7 +173,7 @@ int main( int32_t argc, char* argv[] )
168173
return 0;
169174
}
170175

171-
auto dbm = DbManager( host, database, user, pass, 3306 );
176+
auto dbm = DbManager( host, database, user, pass, port );
172177

173178
if( !sFile.empty() && !iFile.empty() )
174179
{

0 commit comments

Comments
 (0)