Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 27 additions & 66 deletions .github/workflows/atlas-ci.yml
Original file line number Diff line number Diff line change
@@ -1,83 +1,44 @@
name: Atlas
on:
push:
branches: [ main ]
branches:
- main
paths:
- .github/workflows/ci-atlas.yaml
- 'migrations/*'
pull_request:
branches: [ main ]
workflow_dispatch:
paths:
- 'migrations/*'
# Permissions to write comments on the pull request.
permissions:
contents: read
pull-requests: write
jobs:
plan:
if: ${{ github.event_name == 'pull_request' }}
services:
# Spin up a postgres:15 container to be used as the dev-database for analysis.
postgres:
image: postgres:15
env:
POSTGRES_DB: dev
POSTGRES_PASSWORD: pass
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-start-period 10s
--health-timeout 5s
--health-retries 5
atlas:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ github.token }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ariga/setup-atlas@v0
with:
cloud-token: ${{ secrets.ATLAS_CLOUD_TOKEN }}
- uses: ariga/atlas-action/schema/plan@v1
cloud-token: '${{ secrets.ATLAS_CLOUD_TOKEN }}'
version: 'beta'
- uses: ariga/atlas-action/migrate/lint@v1
with:
env: ci
dev-url: 'postgres://postgres:pass@localhost:5432/dev?search_path=public&sslmode=disable'
push:
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
services:
# Spin up a postgres:15 container to be used as the dev-database for analysis.
postgres:
image: postgres:15
dev-url: '${{ secrets.DEV_DATABRICKS_URL }}'
dir: 'file://migrations'
dir-name: 'databricks-demo'
env:
POSTGRES_DB: dev
POSTGRES_PASSWORD: pass
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-start-period 10s
--health-timeout 5s
--health-retries 5
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ github.token }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: ariga/setup-atlas@v0
with:
cloud-token: ${{ secrets.ATLAS_CLOUD_TOKEN }}
- uses: ariga/atlas-action/schema/plan/approve@v1
id: plan-approve
with:
env: ci
dev-url: 'postgres://postgres:pass@localhost:5432/dev?search_path=public&sslmode=disable'
- uses: ariga/atlas-action/schema/push@v1
with:
env: ci
dev-url: 'postgres://postgres:pass@localhost:5432/dev?search_path=public&sslmode=disable'
- uses: ariga/atlas-action/schema/apply@v1
with:
env: ci
dev-url: 'postgres://postgres:pass@localhost:5432/dev?search_path=public&sslmode=disable'
GITHUB_TOKEN: '${{ github.token }}'
- uses: ariga/atlas-action/migrate/push@v1
if: github.ref == 'refs/heads/main'
with:
dir: 'file://migrations'
dev-url: '${{ secrets.DEV_DATABRICKS_URL }}'
dir-name: 'databricks-demo'
- uses: ariga/atlas-action/migrate/apply@v1
if: github.ref == 'refs/heads/main'
with:
dir: 'file://migrations'
url: '${{ secrets.DB_URL }}'
75 changes: 0 additions & 75 deletions migrations/20250623120536_v1.sql

This file was deleted.

4 changes: 0 additions & 4 deletions migrations/20250626123506_v2.sql

This file was deleted.

2 changes: 0 additions & 2 deletions migrations/20250626123922_v3.sql

This file was deleted.

2 changes: 0 additions & 2 deletions migrations/20250626124204_v4.sql

This file was deleted.

2 changes: 0 additions & 2 deletions migrations/20250626124240_v5_drop_fk.sql

This file was deleted.

2 changes: 0 additions & 2 deletions migrations/20250626125310_v6_drop_col.sql

This file was deleted.

4 changes: 0 additions & 4 deletions migrations/20250626125426_v7_drop_table.sql

This file was deleted.

67 changes: 0 additions & 67 deletions migrations/20250626132249_checkpoint.sql

This file was deleted.

2 changes: 0 additions & 2 deletions migrations/20250629115627_v8_drop_column.sql

This file was deleted.

9 changes: 0 additions & 9 deletions migrations/20250630075631_v9_drop_more_column.sql

This file was deleted.

11 changes: 11 additions & 0 deletions migrations/20251019081741_init.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
CREATE TABLE IF NOT EXISTS users (
user_id BIGINT NOT NULL,
name STRING,
email STRING,
created_at TIMESTAMP
)
USING delta
TBLPROPERTIES (
'delta.autoOptimize.optimizeWrite' = 'true',
'delta.autoOptimize.autoCompact' = 'true'
);
13 changes: 2 additions & 11 deletions migrations/atlas.sum
Original file line number Diff line number Diff line change
@@ -1,11 +1,2 @@
h1:2wD6xiUAJ0Sa8pOAfPzS2XG/JwfqRqM574sehzBc2UQ=
20250623120536_v1.sql h1:H003UXn06tr6/7xk2Ao75gjsyCIPZei7XgsVC4z4Hzk=
20250626123506_v2.sql h1:KpcwYLYS75uXnwWzlAfMXxNZeR2hYANasYK+pCLqLrc=
20250626123922_v3.sql h1:/5ut3XUVGvymCmMNQBJh++ekWbCW8H7NgyGJLyaidPM=
20250626124204_v4.sql h1:lj/F8l2DM1EXD2ZyVwyaVLhOToOhQ3cTqN4VKPWQj/w=
20250626124240_v5_drop_fk.sql h1:TBL+e1GP1+q+ns65JUhG6f61dVfWjcRkbxNcDoHEupA=
20250626125310_v6_drop_col.sql h1:hW8UBFmzBVXbqlHPNkO5LEBp1vTaPJMgcJ7P6s6Bo6g=
20250626125426_v7_drop_table.sql h1:tv9BQjv4xaAECoNBqAL3kpNK3klOxiQ1vOxgP+FMjDI=
20250626132249_checkpoint.sql h1:0uxqK5OkdPJRy9EbxJShtx8oSXQ9Txc3R7ly/jLH0PU=
20250629115627_v8_drop_column.sql h1:hE/PuQ0kuwSer+a6l0X+n3iNaPGgBC2ve3DPvetWkrM=
20250630075631_v9_drop_more_column.sql h1:FpqoD8nw0eZJMURxWeO4rSGwvsm8TldALRFvGml0M48=
h1:zDkasFnjaXDWodrK4DMjfsD+FOLfuPVLB3R2AiE70Ek=
20251019081741_init.sql h1:5WYPKesNylGppoSKPLRD59pDWBi0j5jTf4nD3LS1oX8=