forked from NetBSDfr/pkgin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpkgin.sql
155 lines (143 loc) · 4.1 KB
/
pkgin.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
CREATE TABLE IF NOT EXISTS [PKGDB] (
"PKGDB_MTIME" INTEGER
);
CREATE TABLE IF NOT EXISTS [REPOS] (
"REPO_URL" TEXT UNIQUE,
"REPO_MTIME" INTEGER
);
CREATE TABLE IF NOT EXISTS [REMOTE_PKG] (
"PKG_ID" INTEGER PRIMARY KEY,
"FULLPKGNAME" TEXT UNIQUE,
"PKGNAME" TEXT,
"PKGVERS" TEXT,
"COMMENT" TEXT ,
"LICENSE" TEXT NULL,
"PKGTOOLS_VERSION" TEXT ,
"HOMEPAGE" TEXT NULL,
"OS_VERSION" TEXT ,
"DESCRIPTION" TEXT ,
"PKGPATH" TEXT ,
"PKG_OPTIONS" TEXT NULL,
"CATEGORIES" TEXT ,
"SIZE_PKG" TEXT ,
"FILE_SIZE" TEXT ,
"OPSYS" TEXT,
"REPOSITORY" TEXT
);
CREATE TABLE IF NOT EXISTS [LOCAL_PKG] (
"PKG_ID" INTEGER PRIMARY KEY,
"FULLPKGNAME" TEXT UNIQUE,
"PKGNAME" TEXT,
"PKGVERS" TEXT,
"COMMENT" TEXT ,
"LICENSE" TEXT NULL,
"PKGTOOLS_VERSION" TEXT ,
"HOMEPAGE" TEXT NULL,
"OS_VERSION" TEXT ,
"DESCRIPTION" TEXT ,
"PKGPATH" TEXT ,
"PKG_OPTIONS" TEXT NULL,
"CATEGORIES" TEXT ,
"SIZE_PKG" TEXT ,
"FILE_SIZE" TEXT ,
"OPSYS" TEXT,
"PKG_KEEP" INTEGER NULL
);
CREATE TABLE IF NOT EXISTS [LOCAL_DEPS] (
[LOCAL_DEPS_ID] INTEGER PRIMARY KEY AUTOINCREMENT ,
[PKG_ID] INTEGER ,
[LOCAL_DEPS_PKGNAME] TEXT,
[LOCAL_DEPS_DEWEY] TEXT
);
CREATE TABLE IF NOT EXISTS [REMOTE_DEPS] (
[REMOTE_DEPS_ID] INTEGER PRIMARY KEY AUTOINCREMENT ,
[PKG_ID] INTEGER ,
[REMOTE_DEPS_PKGNAME] TEXT,
[REMOTE_DEPS_DEWEY] TEXT
);
CREATE TABLE IF NOT EXISTS [LOCAL_CONFLICTS] (
[LOCAL_CONFLICTS_ID] INTEGER PRIMARY KEY AUTOINCREMENT ,
[PKG_ID] INTEGER ,
[LOCAL_CONFLICTS_PKGNAME] TEXT
);
CREATE TABLE IF NOT EXISTS [REMOTE_CONFLICTS] (
[REMOTE_CONFLICTS_ID] INTEGER PRIMARY KEY AUTOINCREMENT ,
[PKG_ID] INTEGER ,
[REMOTE_CONFLICTS_PKGNAME] TEXT
);
CREATE TABLE IF NOT EXISTS [LOCAL_REQUIRES] (
[LOCAL_REQUIRES_ID] INTEGER PRIMARY KEY AUTOINCREMENT ,
[PKG_ID] INTEGER ,
[LOCAL_REQUIRES_PKGNAME] TEXT
);
CREATE TABLE IF NOT EXISTS [REMOTE_REQUIRES] (
[REMOTE_REQUIRES_ID] INTEGER PRIMARY KEY AUTOINCREMENT ,
[PKG_ID] INTEGER ,
[REMOTE_REQUIRES_PKGNAME] TEXT
);
CREATE TABLE IF NOT EXISTS [LOCAL_PROVIDES] (
[LOCAL_PROVIDES_ID] INTEGER PRIMARY KEY AUTOINCREMENT ,
[PKG_ID] INTEGER ,
[LOCAL_PROVIDES_PKGNAME] TEXT
);
CREATE TABLE IF NOT EXISTS [REMOTE_PROVIDES] (
[REMOTE_PROVIDES_ID] INTEGER PRIMARY KEY AUTOINCREMENT ,
[PKG_ID] INTEGER ,
[REMOTE_PROVIDES_PKGNAME] TEXT
);
CREATE INDEX IF NOT EXISTS [idx_remote_pkg_category] ON [REMOTE_PKG](
[CATEGORIES] ASC
);
CREATE INDEX IF NOT EXISTS [idx_remote_pkg_comment] ON [REMOTE_PKG](
[COMMENT] ASC
);
CREATE INDEX IF NOT EXISTS [idx_remote_pkg_description] ON [REMOTE_PKG](
[DESCRIPTION] ASC
);
CREATE INDEX IF NOT EXISTS [idx_remote_pkg_name] ON [REMOTE_PKG](
[PKGNAME] ASC
);
CREATE INDEX IF NOT EXISTS [idx_local_pkg_category] ON [LOCAL_PKG](
[CATEGORIES] ASC
);
CREATE INDEX IF NOT EXISTS [idx_local_pkg_comment] ON [LOCAL_PKG](
[COMMENT] ASC
);
CREATE INDEX IF NOT EXISTS [idx_local_pkg_description] ON [LOCAL_PKG](
[DESCRIPTION] ASC
);
CREATE INDEX IF NOT EXISTS [idx_local_pkg_name] ON [LOCAL_PKG](
[PKGNAME] ASC
);
CREATE INDEX IF NOT EXISTS [idx_local_deps_pkg_id_pkg_name] ON [LOCAL_DEPS](
[PKG_ID] ASC,
[LOCAL_DEPS_PKGNAME] ASC
);
CREATE INDEX IF NOT EXISTS [idx_remote_deps_pkg_id_remote_pkg_name] ON [REMOTE_DEPS](
[PKG_ID] ASC,
[REMOTE_DEPS_PKGNAME] ASC
);
CREATE INDEX IF NOT EXISTS [idx_local_conflicts_pkg_id_local_pkg_name] ON [LOCAL_CONFLICTS](
[PKG_ID] ASC,
[LOCAL_CONFLICTS_PKGNAME] ASC
);
CREATE INDEX IF NOT EXISTS [idx_remote_conflicts_pkg_id_remote_pkg_name] ON [REMOTE_CONFLICTS](
[PKG_ID] ASC,
[REMOTE_CONFLICTS_PKGNAME] ASC
);
CREATE INDEX IF NOT EXISTS [idx_local_requires_pkg_id_local_pkg_name] ON [LOCAL_REQUIRES](
[PKG_ID] ASC,
[LOCAL_REQUIRES_PKGNAME] ASC
);
CREATE INDEX IF NOT EXISTS [idx_remote_requires_pkg_id_remote_pkg_name] ON [REMOTE_REQUIRES](
[PKG_ID] ASC,
[REMOTE_REQUIRES_PKGNAME] ASC
);
CREATE INDEX IF NOT EXISTS [idx_local_provides_pkg_id_local_pkg_name] ON [LOCAL_PROVIDES](
[PKG_ID] ASC,
[LOCAL_PROVIDES_PKGNAME] ASC
);
CREATE INDEX IF NOT EXISTS [idx_remote_provides_pkg_id_remote_pkg_name] ON [REMOTE_PROVIDES](
[PKG_ID] ASC,
[REMOTE_PROVIDES_PKGNAME] ASC
);