index.js
// check for & maybe create log table
check for & maybe create log table
check for & maybe create log table
async install() {
		const { rows } = await this.dbh.query(`SELECT EXISTS(
			SELECT 1
			FROM information_schema.tables
			WHERE table_schema = current_schema() AND table_name = $1
		)`, [ `${ this.prefix }migrations` ])
		if (!rows[0].exists) {
			await this.dbh.query(`CREATE TABLE ${ this.prefix }migrations (
				id serial NOT NULL PRIMARY KEY,
				name text NOT NULL UNIQUE,
				ran timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
			)`);
		}
		await this.dbh.query('BEGIN');
		return this;
	}
async install ( ) { const { rows } = await this . dbh . query ( ` ` , [ ` ${ this . prefix } ` ] ) if ( ! rows [ 0 ] . exists ) { await this . dbh . query ( ` ${ this . prefix } ` ) ; } await this . dbh . query ( 'BEGIN' ) ; return this ; }
check for & maybe create log table
check for & maybe create log table
// check for log table