@@ -44,8 +44,6 @@ interface SequenceDefinition {
4444 cycle : boolean ;
4545}
4646
47-
48-
4947async function getSequences (
5048 db : Kysely < Record < string , unknown > > ,
5149) : Promise < string [ ] > {
@@ -350,48 +348,45 @@ export async function generateSchemaStatements(
350348 db : Kysely < Record < string , unknown > > ,
351349 tables : string [ ] ,
352350) : Promise < string [ ] > {
353- console . log ( "📦 Exporting sequences..." ) ;
351+ console . log ( "Exporting sequences..." ) ;
354352 const sequences = await getSequences ( db ) ;
355353
356- console . log ( "📦 Exporting custom types..." ) ;
354+ console . log ( "Exporting custom types..." ) ;
357355 const enumTypes = await getEnumTypes ( db ) ;
358356
359- console . log ( "📦 Exporting tables..." ) ;
357+ console . log ( "Exporting tables..." ) ;
360358 const createTableStatements : string [ ] = [ ] ;
361359 for ( const table of tables ) {
362360 try {
363361 const createTableStatement = await getTableSchema ( db , table ) ;
364362 createTableStatements . push ( createTableStatement ) ;
365363 } catch ( e ) {
366- console . error ( `❌ Failed to export schema for table "${ table } ":` , e ) ;
364+ console . error ( `Failed to export schema for table "${ table } ":` , e ) ;
367365 }
368366 }
369367
370- console . log ( "📦 Exporting sequence ownerships..." ) ;
368+ console . log ( "Exporting sequence ownerships..." ) ;
371369 const sequenceOwnerships = await getSequenceOwnerships ( db ) ;
372370
373- console . log ( "📦 Exporting foreign keys..." ) ;
371+ console . log ( "Exporting foreign keys..." ) ;
374372 const foreignKeyStatements : string [ ] = [ ] ;
375373 for ( const table of tables ) {
376374 try {
377375 const fks = await getForeignKeys ( db , table ) ;
378376 foreignKeyStatements . push ( ...fks ) ;
379377 } catch ( e ) {
380- console . error (
381- `❌ Failed to export foreign keys for table "${ table } ":` ,
382- e ,
383- ) ;
378+ console . error ( `Failed to export foreign keys for table "${ table } ":` , e ) ;
384379 }
385380 }
386381
387- console . log ( "📦 Exporting indexes..." ) ;
382+ console . log ( "Exporting indexes..." ) ;
388383 const indexStatements : string [ ] = [ ] ;
389384 for ( const table of tables ) {
390385 try {
391386 const indexes = await getIndexes ( db , table ) ;
392387 indexStatements . push ( ...indexes ) ;
393388 } catch ( e ) {
394- console . error ( `❌ Failed to export indexes for table "${ table } ":` , e ) ;
389+ console . error ( `Failed to export indexes for table "${ table } ":` , e ) ;
395390 }
396391 }
397392
@@ -412,12 +407,12 @@ export async function exportSchema(
412407 dbName : string ,
413408) {
414409 const tables = await getAllTableNames ( db ) ;
415- console . log ( `📦 Found ${ tables . length } tables to export schema for.` ) ;
410+ console . log ( `Found ${ tables . length } tables to export schema for.` ) ;
416411
417412 const statements = await generateSchemaStatements ( db , tables ) ;
418413
419414 for ( const table of tables ) {
420- console . log ( `✅ Exported schema for table ${ table } ` ) ;
415+ console . log ( `Exported schema for table ${ table } ` ) ;
421416 }
422417
423418 const fullSQL = statements . join ( "\n\n" ) ;
@@ -426,5 +421,5 @@ export async function exportSchema(
426421 mkdirSync ( path . dirname ( OUTPUT_FILE ) , { recursive : true } ) ;
427422 writeFileSync ( OUTPUT_FILE , fullSQL ) ;
428423
429- console . log ( `🎉 Schema SQL generated at ${ OUTPUT_FILE } ` ) ;
424+ console . log ( `Schema SQL generated at ${ OUTPUT_FILE } ` ) ;
430425}
0 commit comments