Skip to content

Commit

Permalink
[cleanup] Move db_schemas to build folder (#1067)
Browse files Browse the repository at this point in the history
* Move db_schemas to build folder

* Fix readme links
  • Loading branch information
barroco authored Aug 13, 2024
1 parent 73c2675 commit ed31e91
Show file tree
Hide file tree
Showing 28 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ COPY --from=build /go/bin/db-manager /usr/bin
COPY --from=build /go/bin/dlv /usr/bin
COPY build/jwt-public-certs /jwt-public-certs
COPY build/test-certs /test-certs
COPY build/deploy/db_schemas /db-schemas
COPY build/db_schemas /db-schemas
HEALTHCHECK CMD cat service.ready || exit 1
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ test-go-units:
test-go-units-crdb: cleanup-test-go-units-crdb
@docker run -d --name dss-crdb-for-testing -p 26257:26257 -p 8080:8080 cockroachdb/cockroach:v21.2.7 start-single-node --listen-addr=0.0.0.0 --insecure > /dev/null
@until [ -n "`docker logs dss-crdb-for-testing | grep 'nodeID'`" ]; do echo "Waiting for CRDB to be ready"; sleep 3; done;
go run ./cmds/db-manager/main.go --schemas_dir ./build/deploy/db_schemas/rid --db_version latest --cockroach_host localhost
go run ./cmds/db-manager/main.go --schemas_dir ./build/db_schemas/rid --db_version latest --cockroach_host localhost
go test -count=1 -v ./pkg/rid/store/cockroach --cockroach_host localhost --cockroach_port 26257 --cockroach_ssl_mode disable --cockroach_user root --cockroach_db_name rid
go test -count=1 -v ./pkg/rid/application --cockroach_host localhost --cockroach_port 26257 --cockroach_ssl_mode disable --cockroach_user root --cockroach_db_name rid
@docker stop dss-crdb-for-testing > /dev/null
Expand Down
2 changes: 1 addition & 1 deletion build/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ warning.
## Upgrading Database Schemas
All schemas-related files are in `deploy/db_schemas` directory. Any changes you
All schemas-related files are in `db_schemas` directory. Any changes you
wish to make to the database schema should be done in their respective database
folders. The files are applied in sequential numeric steps from the current
version M to the desired version N.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ When a new database version is created, it needs to be targeted in a number of
places:
* Both .sql files in the appropriate folder in db_schemas when setting
schema_versions.schema_version
* [DSS main.jsonnet](../examples/minimum/main.jsonnet)
* [Schema manager main.jsonnet](../examples/schema_manager/main.jsonnet)
* scd_ or rid_ bootstrapper.sh in [dev/startup](../../dev/startup)
* [DSS main.jsonnet](../deploy/examples/minimum/main.jsonnet)
* [Schema manager main.jsonnet](../deploy/examples/schema_manager/main.jsonnet)
* scd_ or rid_ bootstrapper.sh in [dev/startup](../dev/startup)
* /pkg/{rid|scd}/store/cockroach/store.go
* /deploy/infrastructure/dependencies/terraform-commons-dss/default_latest.tf
* /deploy/infrastructure/dependencies/terraform-commons-dss/default_latest.tf
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions build/dev/standalone_instance.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ See all `docker compose` verbs
`run_locally.sh` automatically creates a database with the latest schema
versions. To migrate to a different version, use
[`migrate_local_db.sh`](migrate_local_db.sh). It accepts two arguments: the
database name ([`rid`](../deploy/db_schemas/rid) for remote ID or
[`scd`](../deploy/db_schemas/rid) for SCD) and the desired schema version (see
[`db_schemas`](../deploy/db_schemas) for options). The desired schema version
database name ([`rid`](../db_schemas/rid) for remote ID or
[`scd`](../db_schemas/rid) for SCD) and the desired schema version (see
[`db_schemas`](../db_schemas) for options). The desired schema version
may also be `latest`. For example:

```bash
Expand Down
4 changes: 2 additions & 2 deletions cmds/core-service/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ Once an initialized CockroachDB cluster is available, the necessary databases wi

```bash
go run ./cmds/db-manager \
--schemas_dir ./build/deploy/db_schemas/rid \
--schemas_dir ./build/db_schemas/rid \
--db_version latest \
--cockroach_host localhost
go run ./cmds/db-manager \
--schemas_dir ./build/deploy/db_schemas/scd \
--schemas_dir ./build/db_schemas/scd \
--db_version latest \
--cockroach_host localhost
```

0 comments on commit ed31e91

Please sign in to comment.