(client)
| 44 | }; |
| 45 | |
| 46 | const getCurrentSchemaVersion = async (client) => { |
| 47 | await ensureMigrationLedger(client); |
| 48 | const result = await client.query( |
| 49 | `SELECT version, label, applied_at FROM ${migrationTable} ORDER BY version DESC LIMIT 1` |
| 50 | ); |
| 51 | |
| 52 | if (result.rows.length === 0) { |
| 53 | return null; |
| 54 | } |
| 55 | |
| 56 | return result.rows[0]; |
| 57 | }; |
| 58 | |
| 59 | const createTables = async (client) => { |
| 60 | logger.info('📊 Creating database tables...'); |
no test coverage detected