@@ -209,10 +209,9 @@ async fn main() {
209
209
. await
210
210
. expect ( "Could not establish a connection to the database" )
211
211
} )
212
- . await
213
- . clone ( ) ;
212
+ . await ;
214
213
215
- if database:: check_migrating_from_spacebar ( & db)
214
+ if database:: check_migrating_from_spacebar ( db)
216
215
. await
217
216
. expect ( "Failed to check migrating from spacebar" )
218
217
{
@@ -221,40 +220,40 @@ async fn main() {
221
220
std:: process:: exit ( 0 ) ;
222
221
} else {
223
222
log:: warn!( target: "symfonia::db" , "Migrating from spacebar to symfonia" ) ;
224
- database:: delete_spacebar_migrations ( & db)
223
+ database:: delete_spacebar_migrations ( db)
225
224
. await
226
225
. expect ( "Failed to delete spacebar migrations table" ) ;
227
226
log:: info!( target: "symfonia::db" , "Running migrations" ) ;
228
227
sqlx:: migrate!( "./spacebar-migrations" )
229
- . run ( & db)
228
+ . run ( db)
230
229
. await
231
230
. expect ( "Failed to run migrations" ) ;
232
231
}
233
232
} else {
234
233
sqlx:: migrate!( )
235
- . run ( & db)
234
+ . run ( db)
236
235
. await
237
236
. expect ( "Failed to run migrations" ) ;
238
237
}
239
238
240
- if database:: check_fresh_db ( & db)
239
+ if database:: check_fresh_db ( db)
241
240
. await
242
241
. expect ( "Failed to check fresh db" )
243
242
{
244
243
log:: info!( target: "symfonia::db" , "Fresh database detected. Seeding database with config data" ) ;
245
- database:: seed_config ( & db)
244
+ database:: seed_config ( db)
246
245
. await
247
246
. expect ( "Failed to seed config" ) ;
248
247
}
249
248
250
- let symfonia_config = crate :: database:: entities:: Config :: init ( & db)
249
+ let symfonia_config = crate :: database:: entities:: Config :: init ( db)
251
250
. await
252
251
. unwrap_or_default ( ) ;
253
252
254
253
let connected_users = ConnectedUsers :: default ( ) ;
255
254
log:: debug!( target: "symfonia" , "Initializing Role->User map..." ) ;
256
255
connected_users
257
- . init_role_user_map ( & db)
256
+ . init_role_user_map ( db)
258
257
. await
259
258
. expect ( "Failed to init role user map" ) ;
260
259
log:: trace!( target: "symfonia" , "Role->User map initialized with {} entries" , connected_users. role_user_map. lock( ) . await . len( ) ) ;
0 commit comments