Use strict database table schema
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
67b9801f42
commit
b4f4633f6a
@ -18,9 +18,9 @@ type Package struct {
|
|||||||
Licenses []string `sh:"license"`
|
Licenses []string `sh:"license"`
|
||||||
Provides []string `sh:"provides"`
|
Provides []string `sh:"provides"`
|
||||||
Conflicts []string `sh:"conflicts"`
|
Conflicts []string `sh:"conflicts"`
|
||||||
|
Replaces []string `sh:"replaces"`
|
||||||
Depends map[string][]string
|
Depends map[string][]string
|
||||||
BuildDepends map[string][]string
|
BuildDepends map[string][]string
|
||||||
Replaces []string `sh:"replaces"`
|
|
||||||
Repository string
|
Repository string
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -28,10 +28,22 @@ type Package struct {
|
|||||||
func Init(db *genji.DB) error {
|
func Init(db *genji.DB) error {
|
||||||
return db.Exec(`
|
return db.Exec(`
|
||||||
CREATE TABLE IF NOT EXISTS pkgs (
|
CREATE TABLE IF NOT EXISTS pkgs (
|
||||||
name TEXT,
|
name TEXT NOT NULL,
|
||||||
repository TEXT NOT NULL,
|
repository TEXT NOT NULL,
|
||||||
UNIQUE(name, repository),
|
version TEXT NOT NULL,
|
||||||
...
|
release INT NOT NULL,
|
||||||
|
epoch INT,
|
||||||
|
description TEXT,
|
||||||
|
homepage TEXT,
|
||||||
|
maintainer TEXT,
|
||||||
|
architectures ARRAY,
|
||||||
|
licenses ARRAY,
|
||||||
|
provides ARRAY,
|
||||||
|
conflicts ARRAY,
|
||||||
|
replaces ARRAY,
|
||||||
|
depends (...),
|
||||||
|
builddepends (...),
|
||||||
|
UNIQUE(name, repository)
|
||||||
);
|
);
|
||||||
`)
|
`)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user