chore: Enable comments for database dump / models (#3661)

This commit is contained in:
Mathias Fredriksson 2022-08-24 15:44:30 +03:00 committed by GitHub
parent 253e6cbffa
commit 7a71180ae6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 3 deletions

View File

@ -56,7 +56,7 @@ build: site/out/index.html $(shell find . -not -path './vendor/*' -type f -name
.PHONY: build
# Runs migrations to output a dump of the database.
coderd/database/dump.sql: $(wildcard coderd/database/migrations/*.sql)
coderd/database/dump.sql: coderd/database/dump/main.go $(wildcard coderd/database/migrations/*.sql)
go run coderd/database/dump/main.go
# Generates Go code for querying the database.

View File

@ -138,6 +138,8 @@ CREATE TABLE licenses (
exp timestamp with time zone NOT NULL
);
COMMENT ON COLUMN licenses.exp IS 'exp tracks the claim of the same name in the JWT, and we include it here so that we can easily query for licenses that have not yet expired.';
CREATE SEQUENCE licenses_id_seq
AS integer
START WITH 1

View File

@ -41,7 +41,6 @@ func main() {
connection,
"--no-privileges",
"--no-owner",
"--no-comments",
// We never want to manually generate
// queries executing against this table.

View File

@ -360,7 +360,8 @@ type License struct {
ID int32 `db:"id" json:"id"`
UploadedAt time.Time `db:"uploaded_at" json:"uploaded_at"`
JWT string `db:"jwt" json:"jwt"`
Exp time.Time `db:"exp" json:"exp"`
// exp tracks the claim of the same name in the JWT, and we include it here so that we can easily query for licenses that have not yet expired.
Exp time.Time `db:"exp" json:"exp"`
}
type Organization struct {