mirror of
https://github.com/coder/coder.git
synced 2025-07-06 15:41:45 +00:00
* POST license API Signed-off-by: Spike Curtis <spike@coder.com> * Support interface{} types in generated Typescript Signed-off-by: Spike Curtis <spike@coder.com> * Disable linting on empty interface any Signed-off-by: Spike Curtis <spike@coder.com> * Code review updates Signed-off-by: Spike Curtis <spike@coder.com> * Enforce unique licenses Signed-off-by: Spike Curtis <spike@coder.com> * Renames from code review Signed-off-by: Spike Curtis <spike@coder.com> * Code review renames and comments Signed-off-by: Spike Curtis <spike@coder.com> Signed-off-by: Spike Curtis <spike@coder.com>
11 lines
609 B
SQL
11 lines
609 B
SQL
-- No valid licenses should exist, but to be sure, drop all rows
|
|
DELETE FROM licenses;
|
|
ALTER TABLE licenses DROP COLUMN license;
|
|
ALTER TABLE licenses RENAME COLUMN created_at to uploaded_at;
|
|
ALTER TABLE licenses ADD COLUMN jwt text NOT NULL;
|
|
-- prevent adding the same license more than once
|
|
ALTER TABLE licenses ADD CONSTRAINT licenses_jwt_key UNIQUE (jwt);
|
|
ALTER TABLE licenses ADD COLUMN 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.';
|
|
|