mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: Move httpapi, httpmw, & database into coderd (#568)
* chore: Move httpmw to /coderd directory httpmw is specific to coderd and should be scoped under coderd * chore: Move httpapi to /coderd directory httpapi is specific to coderd and should be scoped under coderd * chore: Move database to /coderd directory database is specific to coderd and should be scoped under coderd * chore: Update codecov & gitattributes for generated files * chore: Update Makefile
This commit is contained in:
@@ -10,15 +10,15 @@ build: site/out bin
|
||||
.PHONY: build
|
||||
|
||||
# Runs migrations to output a dump of the database.
|
||||
database/dump.sql: $(wildcard database/migrations/*.sql)
|
||||
go run database/dump/main.go
|
||||
coderd/database/dump.sql: $(wildcard coderd/database/migrations/*.sql)
|
||||
go run coderd/database/dump/main.go
|
||||
|
||||
# Generates Go code for querying the database.
|
||||
database/generate: fmt/sql database/dump.sql database/query.sql
|
||||
cd database && sqlc generate && rm db_tmp.go
|
||||
cd database && gofmt -w -r 'Querier -> querier' *.go
|
||||
cd database && gofmt -w -r 'Queries -> sqlQuerier' *.go
|
||||
.PHONY: database/generate
|
||||
coderd/database/generate: fmt/sql coderd/database/dump.sql coderd/database/query.sql
|
||||
cd coderd/database && sqlc generate && rm db_tmp.go
|
||||
cd coderd/database && gofmt -w -r 'Querier -> querier' *.go
|
||||
cd coderd/database && gofmt -w -r 'Queries -> sqlQuerier' *.go
|
||||
.PHONY: coderd/database/generate
|
||||
|
||||
fmt/prettier:
|
||||
@echo "--- prettier"
|
||||
@@ -30,18 +30,18 @@ else
|
||||
endif
|
||||
.PHONY: fmt/prettier
|
||||
|
||||
fmt/sql: ./database/query.sql
|
||||
fmt/sql: ./coderd/database/query.sql
|
||||
npx sql-formatter \
|
||||
--language postgresql \
|
||||
--lines-between-queries 2 \
|
||||
./database/query.sql \
|
||||
--output ./database/query.sql
|
||||
sed -i 's/@ /@/g' ./database/query.sql
|
||||
./coderd/database/query.sql \
|
||||
--output ./coderd/database/query.sql
|
||||
sed -i 's/@ /@/g' ./coderd/database/query.sql
|
||||
|
||||
fmt: fmt/prettier fmt/sql
|
||||
.PHONY: fmt
|
||||
|
||||
gen: database/generate peerbroker/proto provisionersdk/proto provisionerd/proto
|
||||
gen: coderd/database/generate peerbroker/proto provisionersdk/proto provisionerd/proto
|
||||
.PHONY: gen
|
||||
|
||||
install: bin
|
||||
|
||||
Reference in New Issue
Block a user