Skip to content

Commit

Permalink
chore: replace migrate with goose
Browse files Browse the repository at this point in the history
  • Loading branch information
luigibarbato committed Jan 22, 2024
1 parent fe43420 commit d10be79
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ endif

install-tools:
@go install gotest.tools/gotestsum@latest
@go install github.com/pressly/goose/v3/cmd/[email protected]

.PHONY: generate

Expand Down Expand Up @@ -59,7 +60,7 @@ build:
.PHONY: migrate

migrate:
@migrate --path db/migration/ --database "postgresql://${UNCONDITIONAL_API_DATABASE_USER}:${UNCONDITIONAL_API_DATABASE_PASSWORD}@localhost:5432/${UNCONDITIONAL_API_DATABASE_NAME}?sslmode=disable" --verbose up
@goose --dir db/migration postgres "postgresql://${UNCONDITIONAL_API_DATABASE_USER}:${UNCONDITIONAL_API_DATABASE_PASSWORD}@localhost:5432/${UNCONDITIONAL_API_DATABASE_NAME}?sslmode=disable" up

# Helpers
check-variable-%: # detection of undefined variables.
Expand Down
1 change: 0 additions & 1 deletion db/migration/000001_create_feeds_table.down.sql

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
-- +goose Up
CREATE TABLE feeds (
title VARCHAR(255) NOT NULL,
link VARCHAR(255) PRIMARY KEY,
Expand All @@ -9,3 +10,6 @@ CREATE TABLE feeds (
date timestamptz,
embedding vector(384)
);

-- +goose Down
DROP TABLE feeds;

0 comments on commit d10be79

Please sign in to comment.