Skip to content

Commit

Permalink
chore: add pr title and deleteSchema method
Browse files Browse the repository at this point in the history
  • Loading branch information
nimrodkor committed Oct 10, 2024
1 parent 3cff851 commit fa184dc
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/pr-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ name: PR Tests

on:
pull_request:
types:
- opened
- synchronize
- reopened

jobs:
test:
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/pr-validations.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: PR Validations

on:
pull_request:
types:
- opened
- edited
- reopened

jobs:
title:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6 changes: 6 additions & 0 deletions src/classes/pgmq.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ export class Pgmq {
await connection.query(query)
}

public async deleteSchema() {
const connection = await this.pool.connect()
const query = `DROP SCHEMA IF EXISTS ${PGMQ_SCHEMA}`
await connection.query(query)
}

/**
* Creates a queue and a matching archive if does not exist. If queue or archive already exist does not throw error
* @param name - the name of the queue
Expand Down
1 change: 1 addition & 0 deletions test/integration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ describe("Integration test", () => {

after(async () => {
await pgmq.deleteQueue(QUEUE)
await pgmq.deleteSchema()
})

beforeEach(async () => {
Expand Down

0 comments on commit fa184dc

Please sign in to comment.