-
Notifications
You must be signed in to change notification settings - Fork 0
feat: PostgreSQLをprimary DBに移行する #64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
5a35205
feat: PostgreSQLをprimary DBに移行する (#62)
strnh 9206b0d
fix: CIを実行環境とプロジェクト構成に合わせる
strnh 817e6c7
fix: PostgreSQL CIのテスト環境差を解消する
strnh 2bee28e
test: align BackupStorageTest audit schema
Copilot 8ed56fb
fix: PostgreSQLテスト接続とfixtureを固定する
strnh f632223
fix: sequence同期で同一DB接続を再利用する
strnh d39f345
fix: PostgreSQL再初期化と監査fixtureを堅牢化する
strnh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| name: Frontend checks | ||
|
|
||
| on: | ||
| pull_request: | ||
| push: | ||
| branches: [main] | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: frontend-${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| frontend: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| - name: Set up Node.js | ||
| uses: actions/setup-node@v6 | ||
| with: | ||
| node-version: '22' | ||
| cache: npm | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci --ignore-scripts | ||
|
|
||
| - name: Type check | ||
| run: npm run type-check | ||
|
|
||
| - name: Build | ||
| run: npm run build |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| name: PHP tests | ||
|
|
||
| on: | ||
| pull_request: | ||
| push: | ||
| branches: [main] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| feature-tests: | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| APP_ENV: testing | ||
| DB_CONNECTION: pgsql | ||
| DB_HOST: 127.0.0.1 | ||
| DB_PORT: 55433 | ||
| DB_DATABASE: quotebuilder_test | ||
| DB_USERNAME: quotebuilder | ||
| DB_PASSWORD: quotebuilder | ||
| DB_URL: '' | ||
| services: | ||
| postgres: | ||
| image: postgres:17 | ||
| env: | ||
| POSTGRES_DB: quotebuilder_test | ||
| POSTGRES_USER: quotebuilder | ||
| POSTGRES_PASSWORD: quotebuilder | ||
| ports: | ||
| - 55433:5432 | ||
| options: >- | ||
| --health-cmd "pg_isready -U quotebuilder -d quotebuilder_test" | ||
| --health-interval 5s | ||
| --health-timeout 3s | ||
| --health-retries 10 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| - name: Set up PHP | ||
| uses: shivammathur/setup-php@v2 | ||
| with: | ||
| php-version: '8.5' | ||
| extensions: pdo_pgsql, pdo_sqlite, sqlite3 | ||
| coverage: none | ||
|
|
||
| - name: Install system dependencies | ||
| run: sudo apt-get update && sudo apt-get install -y poppler-utils sqlite3 | ||
|
|
||
| - name: Install dependencies | ||
| run: composer install --no-interaction --prefer-dist | ||
|
|
||
| - name: Prepare application | ||
| run: | | ||
| cp .env.example .env | ||
| php artisan key:generate | ||
|
|
||
| - name: Verify PostgreSQL migrations | ||
| run: php artisan migrate:fresh --env=testing --force | ||
|
|
||
| - name: Run tests | ||
| run: php artisan test | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| # 開発用 PostgreSQL。podman compose / docker compose のどちらでも動く。 | ||
| # receiptbuilder (55432) と同時起動できるよう host port は 55433 を使う。 | ||
|
|
||
| services: | ||
| db: | ||
| image: docker.io/library/postgres:17 | ||
| restart: unless-stopped | ||
|
Copilot marked this conversation as resolved.
|
||
| environment: | ||
| POSTGRES_DB: quotebuilder | ||
| POSTGRES_USER: quotebuilder | ||
| POSTGRES_PASSWORD: quotebuilder | ||
| ports: | ||
| - "127.0.0.1:55433:5432" | ||
| volumes: | ||
| - quotebuilder-pgdata:/var/lib/postgresql/data | ||
| - ./docker/postgres/init:/docker-entrypoint-initdb.d:ro | ||
| healthcheck: | ||
| test: ["CMD-SHELL", "pg_isready -U quotebuilder -d quotebuilder"] | ||
| interval: 5s | ||
| timeout: 3s | ||
| retries: 10 | ||
|
|
||
| volumes: | ||
| quotebuilder-pgdata: | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| -- phpunit 用の DB。RefreshDatabase が各テストの状態を初期化するため、開発用 DB とは分ける。 | ||
| -- このスクリプトは volume が空の初回起動時のみ実行される。 | ||
| CREATE DATABASE quotebuilder_test OWNER quotebuilder; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.