Compare commits

...

4 Commits

2 changed files with 12 additions and 10 deletions

View File

@ -8,8 +8,9 @@ import (
) )
type User struct { type User struct {
Name string `json:"name"` Name string `json:"name"`
IsAdmin bool `json:"isAdmin"` IsAdmin bool `json:"isAdmin"`
CanCreate bool `json:"canCreate"`
} }
type MIME struct { type MIME struct {
@ -47,12 +48,12 @@ type (
} }
FileFull struct { FileFull struct {
FileCore FileCore
CreatedAt time.Time `json:"createdAt"` CreatedAt time.Time `json:"createdAt"`
Creator User `json:"creator"` Creator User `json:"creator"`
Notes pgtype.Text `json:"notes"` Notes pgtype.Text `json:"notes"`
Metadata *json.RawMessage `json:"metadata"` Metadata json.RawMessage `json:"metadata"`
Tags []TagCore `json:"tags"` Tags []TagCore `json:"tags"`
Viewed int `json:"viewed"` Viewed int `json:"viewed"`
} }
) )

View File

@ -304,7 +304,7 @@ CREATE TABLE data.files (
mime_id smallint NOT NULL, mime_id smallint NOT NULL,
datetime timestamp with time zone DEFAULT clock_timestamp() NOT NULL, datetime timestamp with time zone DEFAULT clock_timestamp() NOT NULL,
notes text, notes text,
metadata jsonb, metadata jsonb NOT NULL,
creator_id smallint NOT NULL, creator_id smallint NOT NULL,
is_deleted boolean DEFAULT false NOT NULL is_deleted boolean DEFAULT false NOT NULL
); );
@ -375,7 +375,8 @@ CREATE TABLE system.users (
id smallint NOT NULL, id smallint NOT NULL,
name character varying(32) NOT NULL, name character varying(32) NOT NULL,
password text NOT NULL, password text NOT NULL,
is_admin boolean DEFAULT false NOT NULL is_admin boolean DEFAULT false NOT NULL,
can_create boolean DEFAULT false NOT NULL
); );