···11+// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
22+33+package tangled
44+55+// schema: sh.tangled.repo.artifact
66+77+import (
88+ "github.com/bluesky-social/indigo/lex/util"
99+)
1010+1111+const (
1212+ RepoArtifactNSID = "sh.tangled.repo.artifact"
1313+)
1414+1515+func init() {
1616+ util.RegisterType("sh.tangled.repo.artifact", &RepoArtifact{})
1717+} //
1818+// RECORDTYPE: RepoArtifact
1919+type RepoArtifact struct {
2020+ LexiconTypeID string `json:"$type,const=sh.tangled.repo.artifact" cborgen:"$type,const=sh.tangled.repo.artifact"`
2121+ // artifact: the artifact
2222+ Artifact *util.LexBlob `json:"artifact" cborgen:"artifact"`
2323+ // createdAt: time of creation of this artifact
2424+ CreatedAt string `json:"createdAt" cborgen:"createdAt"`
2525+ // name: name of the artifact
2626+ Name string `json:"name" cborgen:"name"`
2727+ // repo: repo that this artifact is being uploaded to
2828+ Repo string `json:"repo" cborgen:"repo"`
2929+ // tag: hash of the tag object that this artifact is attached to (only annotated tags are supported)
3030+ Tag util.LexBytes `json:"tag,omitempty" cborgen:"tag,omitempty"`
3131+}
···208208 unique(did, email)
209209 );
210210211211+ create table if not exists artifacts (
212212+ -- id
213213+ id integer primary key autoincrement,
214214+ did text not null,
215215+ rkey text not null,
216216+217217+ -- meta
218218+ repo_at text not null,
219219+ tag binary(20) not null,
220220+ created text not null default (strftime('%Y-%m-%dT%H:%M:%SZ', 'now')),
221221+222222+ -- data
223223+ blob_cid text not null,
224224+ name text not null,
225225+ size integer not null default 0,
226226+ mimetype string not null default "*/*",
227227+228228+ -- constraints
229229+ unique(did, rkey), -- record must be unique
230230+ unique(repo_at, tag, name), -- for a given tag object, each file must be unique
231231+ foreign key (repo_at) references repos(at_uri) on delete cascade
232232+ );
233233+211234 create table if not exists migrations (
212235 id integer primary key autoincrement,
213236 name text unique