mirror of
https://github.com/coder/coder.git
synced 2025-07-15 22:20:27 +00:00
chore: Enable comments for database dump / models (#3661)
This commit is contained in:
committed by
GitHub
parent
253e6cbffa
commit
7a71180ae6
2
Makefile
2
Makefile
@ -56,7 +56,7 @@ build: site/out/index.html $(shell find . -not -path './vendor/*' -type f -name
|
|||||||
.PHONY: build
|
.PHONY: build
|
||||||
|
|
||||||
# Runs migrations to output a dump of the database.
|
# 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
|
go run coderd/database/dump/main.go
|
||||||
|
|
||||||
# Generates Go code for querying the database.
|
# Generates Go code for querying the database.
|
||||||
|
2
coderd/database/dump.sql
generated
2
coderd/database/dump.sql
generated
@ -138,6 +138,8 @@ CREATE TABLE licenses (
|
|||||||
exp timestamp with time zone NOT NULL
|
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
|
CREATE SEQUENCE licenses_id_seq
|
||||||
AS integer
|
AS integer
|
||||||
START WITH 1
|
START WITH 1
|
||||||
|
@ -41,7 +41,6 @@ func main() {
|
|||||||
connection,
|
connection,
|
||||||
"--no-privileges",
|
"--no-privileges",
|
||||||
"--no-owner",
|
"--no-owner",
|
||||||
"--no-comments",
|
|
||||||
|
|
||||||
// We never want to manually generate
|
// We never want to manually generate
|
||||||
// queries executing against this table.
|
// queries executing against this table.
|
||||||
|
@ -360,7 +360,8 @@ type License struct {
|
|||||||
ID int32 `db:"id" json:"id"`
|
ID int32 `db:"id" json:"id"`
|
||||||
UploadedAt time.Time `db:"uploaded_at" json:"uploaded_at"`
|
UploadedAt time.Time `db:"uploaded_at" json:"uploaded_at"`
|
||||||
JWT string `db:"jwt" json:"jwt"`
|
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 {
|
type Organization struct {
|
||||||
|
Reference in New Issue
Block a user