Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
darthmaim committed Nov 28, 2024
1 parent c84303b commit bcfe478
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/prisma-pending-migrations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ jobs:
pending-migrations:
name: Pending Migrations
runs-on: ubuntu-latest
env:
DB: postgresql://gw2treasures:gw2treasures@localhost:5432/gw2treasures
services:
database:
image: timescale/timescaledb:2.17.2-pg17
Expand All @@ -24,11 +26,15 @@ jobs:
- uses: actions/checkout@v4
- name: Setup Node.js env
uses: ./.github/actions/setup-node-env
- name: Setup database
run: |
psql "${{ env.DB }}" -c 'CREATE EXTENSION IF NOT EXISTS "timescaledb";'
psql "${{ env.DB }}" -c 'ALTER EXTENSION "timescaledb" UPDATE;'
- name: Run prisma diff
run: |
pnpm --filter @gw2treasures/database exec \
prisma migrate diff \
--exit-code \
--from-schema-datamodel "./prisma/schema.prisma" \
--to-migrations "./prisma/migrations" \
--shadow-database-url "postgresql://gw2treasures:gw2treasures@localhost:5432/gw2treasures?schema=public"
--shadow-database-url "${{ env.DB }}?schema=public"
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
-- enable extension
CREATE EXTENSION IF NOT EXISTS "timescaledb";
-- CREATE EXTENSION IF NOT EXISTS "timescaledb";
SELECT * FROM pg_extension;

SELECT CURRENT_SCHEMA;

-- create hypertable TradingPostHistory
SELECT create_hypertable('"TradingPostHistory"', by_range('time'), migrate_data => true, create_default_indexes => false);
Expand Down

0 comments on commit bcfe478

Please sign in to comment.