Skip to content

Commit

Permalink
Changed Database Migration Tool
Browse files Browse the repository at this point in the history
  • Loading branch information
AriaFantom committed Nov 22, 2024
1 parent cc96d30 commit 5d7b8e0
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 69 deletions.
6 changes: 3 additions & 3 deletions backend/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ go:
MIGRATION_DIR=migration
.PHONY: migrate-up
migrate-up:
cd $(MIGRATION_DIR) && goose postgres postgresql://root:root@localhost:5432/postgres up
migrate -path $(MIGRATION_DIR) -database postgresql://root:root@localhost:5432/postgres up

migrate-down:
cd $(MIGRATION_DIR) && goose postgres postgresql://root:root@localhost:5432/postgres down
migrate -path $(MIGRATION_DIR) -database postgresql://root:root@localhost:5432/postgres down

migration-new:
cd $(MIGRATION_DIR) && goose create new_schema sql
migrate create -ext sql -dir $(MIGRATION_DIR) -seq create_table
28 changes: 0 additions & 28 deletions backend/migration/20240915115947_create_database.sql

This file was deleted.

35 changes: 0 additions & 35 deletions backend/migration/20240917041307_new_schema.sql

This file was deleted.

6 changes: 3 additions & 3 deletions backend/routes/route.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ func HandleRoutes(app *fiber.App) {
app.Post("/inventory", handler.CreateInventory, middleware.CheckPermission("create:inventory"))

// Inventory fetch routes
app.Get("/categories", handler.FetchAllCategories, middleware.CheckPermission("read:category"))
app.Get("/suppliers", handler.FetchAllSuppliers, middleware.CheckPermission("read:supplier"))
app.Get("/inventory", handler.FetchAllInventory, middleware.CheckPermission("read:inventory"))
app.Get("/categories", handler.FetchAllCategories)
app.Get("/suppliers", handler.FetchAllSuppliers)
app.Get("/inventory", handler.FetchAllInventory)

}

0 comments on commit 5d7b8e0

Please sign in to comment.