Skip to content

Commit

Permalink
Merge pull request #142 from Cufee/release
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
Cufee authored Jan 20, 2025
2 parents 733078d + f5ed5f0 commit 2b63c36
Show file tree
Hide file tree
Showing 41 changed files with 1,597 additions and 1,178 deletions.
6 changes: 5 additions & 1 deletion Dockerfile.migrate
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
FROM arigaio/atlas:latest
FROM golang:1.23-bookworm as builder-go

RUN go install -tags 'sqlite3' github.com/golang-migrate/migrate/v4/cmd/migrate@latest

COPY ./internal/database/migrations /migrations

ENTRYPOINT [ "migrate" ]
4 changes: 2 additions & 2 deletions Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ tasks:
cmds:
# variables will be pulled from global vars declaration unless overwritten in the task call
- echo "Applying migrations to $DATABASE_PATH/$DATABASE_NAME"
- atlas migrate apply --env local
- migrate -verbose -path internal/database/migrations -database sqlite3://{{.DATABASE_PATH}}/{{.DATABASE_NAME}}?_fk=1 up

db-migrate-tests:
desc: apply migrations using atlas
dotenv:
- ".env.test"
cmds:
- atlas migrate apply --env local
- migrate -verbose -path internal/database/migrations -database sqlite3://{{.DATABASE_PATH}}/{{.DATABASE_NAME}}?_fk=1 up

build-widget:
desc: Build amth-widget js assets
Expand Down
4 changes: 2 additions & 2 deletions atlas.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ variable "database_path" {
default = getenv("DATABASE_PATH")
}
variable "sources" {
type = list(string)
type = list(string)
default = [
"file://internal/database/schema/schema.hcl",
"file://internal/database/schema/accounts.hcl",
Expand All @@ -24,7 +24,7 @@ env "local" {
src = var.sources

migration {
dir = "file://internal/database/migrations"
dir = "file://internal/database/migrations?format=golang-migrate"
}

url = "sqlite://${var.database_path}/${var.database_name}?_fk=1"
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
services:
aftermath-migrate-base:
pull_policy: always
image: ghcr.io/cufee/aftermath-migrations:${ENVIRONMENT}
# image: ghcr.io/cufee/aftermath-migrations:${ENVIRONMENT}
build:
context: .
dockerfile: Dockerfile.migrate
command: migrate apply --allow-dirty --dir "file:///migrations" --tx-mode all --url "sqlite:///data/${DATABASE_NAME}?_fk=1"
command: -source file:///migrations -database sqlite3:///data/${DATABASE_NAME}?_fk=1 up
volumes:
- ${DATABASE_PATH}:/data
deploy:
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.dokploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ services:
- docker-volume-backup.stop-during-backup=true # https://hub.docker.com/r/offen/docker-volume-backup
depends_on:
aftermath-migrate:
condition: service_started
condition: service_completed_successfully

networks:
dokploy-network:
Expand Down
170 changes: 0 additions & 170 deletions internal/database/migrations/20240709203105.sql

This file was deleted.

20 changes: 0 additions & 20 deletions internal/database/migrations/20240709213804.sql

This file was deleted.

6 changes: 0 additions & 6 deletions internal/database/migrations/20240710142748.sql

This file was deleted.

4 changes: 0 additions & 4 deletions internal/database/migrations/20240714172357.sql

This file was deleted.

4 changes: 0 additions & 4 deletions internal/database/migrations/20240717182230.sql

This file was deleted.

2 changes: 0 additions & 2 deletions internal/database/migrations/20240718195751.sql

This file was deleted.

4 changes: 0 additions & 4 deletions internal/database/migrations/20240720185422.sql

This file was deleted.

12 changes: 0 additions & 12 deletions internal/database/migrations/20240721174451.sql

This file was deleted.

2 changes: 0 additions & 2 deletions internal/database/migrations/20240721174654.sql

This file was deleted.

14 changes: 0 additions & 14 deletions internal/database/migrations/20240722193937.sql

This file was deleted.

8 changes: 0 additions & 8 deletions internal/database/migrations/20240722221009.sql

This file was deleted.

18 changes: 0 additions & 18 deletions internal/database/migrations/20240723170847.sql

This file was deleted.

22 changes: 0 additions & 22 deletions internal/database/migrations/20240724172106.sql

This file was deleted.

24 changes: 0 additions & 24 deletions internal/database/migrations/20240728003612.sql

This file was deleted.

Loading

0 comments on commit 2b63c36

Please sign in to comment.