memoryking 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- memoryking/__init__.py +3 -0
- memoryking/__main__.py +1328 -0
- memoryking/adapters/__init__.py +1 -0
- memoryking/adapters/adapter_state.py +242 -0
- memoryking/adapters/anchor_schema.sql +7 -0
- memoryking/adapters/atlas.py +441 -0
- memoryking/adapters/browser_commands.py +125 -0
- memoryking/adapters/dashboard.py +510 -0
- memoryking/adapters/dense_search.py +86 -0
- memoryking/adapters/egress_policy.py +244 -0
- memoryking/adapters/egress_schema.sql +13 -0
- memoryking/adapters/embedding.schema.json +302 -0
- memoryking/adapters/embedding_store.py +469 -0
- memoryking/adapters/execution.py +369 -0
- memoryking/adapters/experience.py +423 -0
- memoryking/adapters/experience.schema.json +1508 -0
- memoryking/adapters/experience_records.py +239 -0
- memoryking/adapters/experience_schema.sql +23 -0
- memoryking/adapters/handoff.py +494 -0
- memoryking/adapters/handoff.schema.json +299 -0
- memoryking/adapters/handoff_schema.sql +17 -0
- memoryking/adapters/index_schema.sql +11 -0
- memoryking/adapters/inference.py +454 -0
- memoryking/adapters/inference.schema.json +541 -0
- memoryking/adapters/inspection.py +1128 -0
- memoryking/adapters/inspection.schema.json +568 -0
- memoryking/adapters/knowledge.schema.json +633 -0
- memoryking/adapters/knowledge_schema.sql +37 -0
- memoryking/adapters/knowledge_store.py +800 -0
- memoryking/adapters/legacy_snapshot.py +358 -0
- memoryking/adapters/legacy_tables.py +49 -0
- memoryking/adapters/local_contract.py +45 -0
- memoryking/adapters/local_embeddings.py +189 -0
- memoryking/adapters/local_files.py +242 -0
- memoryking/adapters/local_ipc.py +258 -0
- memoryking/adapters/local_schema.sql +44 -0
- memoryking/adapters/local_store.py +632 -0
- memoryking/adapters/local_wire.schema.json +7672 -0
- memoryking/adapters/models/minilm-l6-v2-onnx.json +57 -0
- memoryking/adapters/models/ms-marco-minilm-l6-v2-onnx.json +57 -0
- memoryking/adapters/optional_schema.sql +43 -0
- memoryking/adapters/plan_dashboard.py +51 -0
- memoryking/adapters/plans.py +253 -0
- memoryking/adapters/postgres_admin.py +300 -0
- memoryking/adapters/postgres_anchor_schema.sql +9 -0
- memoryking/adapters/postgres_counter.sql +14 -0
- memoryking/adapters/postgres_egress_schema.sql +15 -0
- memoryking/adapters/postgres_experience_schema.sql +39 -0
- memoryking/adapters/postgres_index_schema.sql +7 -0
- memoryking/adapters/postgres_optional_schema.sql +71 -0
- memoryking/adapters/postgres_pool.py +77 -0
- memoryking/adapters/postgres_recovery.py +525 -0
- memoryking/adapters/postgres_schema.sql +365 -0
- memoryking/adapters/postgres_sql.py +102 -0
- memoryking/adapters/postgres_store.py +428 -0
- memoryking/adapters/postgres_summary_schema.sql +12 -0
- memoryking/adapters/postgres_trust_schema.sql +20 -0
- memoryking/adapters/processing.schema.json +471 -0
- memoryking/adapters/processing_store.py +346 -0
- memoryking/adapters/projects.py +83 -0
- memoryking/adapters/proposals.py +238 -0
- memoryking/adapters/ranking.py +315 -0
- memoryking/adapters/repository.schema.json +664 -0
- memoryking/adapters/repository_git.py +264 -0
- memoryking/adapters/repository_schema.sql +25 -0
- memoryking/adapters/repository_store.py +960 -0
- memoryking/adapters/retrieval.py +1285 -0
- memoryking/adapters/retrieval.schema.json +553 -0
- memoryking/adapters/retrieval_schema.sql +10 -0
- memoryking/adapters/shared_control.py +40 -0
- memoryking/adapters/shared_dashboard.py +636 -0
- memoryking/adapters/shared_gateway.py +63 -0
- memoryking/adapters/shared_http.py +216 -0
- memoryking/adapters/shared_mcp.py +159 -0
- memoryking/adapters/shared_service.py +124 -0
- memoryking/adapters/stdio.py +193 -0
- memoryking/adapters/stdio.tools.json +6776 -0
- memoryking/adapters/summary_schema.sql +10 -0
- memoryking/adapters/team.py +253 -0
- memoryking/adapters/timeline.py +80 -0
- memoryking/adapters/token_count.py +55 -0
- memoryking/adapters/tokenizers/LICENSE +21 -0
- memoryking/adapters/tokenizers/cl100k_base.tiktoken +100256 -0
- memoryking/adapters/trust.py +123 -0
- memoryking/adapters/trust_schema.sql +13 -0
- memoryking/adapters/web/app.css +1251 -0
- memoryking/adapters/web/app.js +907 -0
- memoryking/adapters/web/brand.js +44 -0
- memoryking/adapters/web/crown-mono.svg +1 -0
- memoryking/adapters/web/crown.svg +8 -0
- memoryking/adapters/web/elephant.png +0 -0
- memoryking/adapters/web/favicon.svg +8 -0
- memoryking/adapters/web/graph-layout.js +52 -0
- memoryking/adapters/web/graph-worker.js +10 -0
- memoryking/adapters/web/graph.js +570 -0
- memoryking/adapters/web/index.html +208 -0
- memoryking/adapters/web/observatory.js +1208 -0
- memoryking/adapters/web/team.js +151 -0
- memoryking/adapters/web/wordmark.svg +1 -0
- memoryking/adapters/working.py +971 -0
- memoryking/adapters/working.schema.json +1717 -0
- memoryking/adapters/working_schema.sql +24 -0
- memoryking/application/__init__.py +1 -0
- memoryking/application/conformance.py +50 -0
- memoryking/application/legacy_import.py +337 -0
- memoryking/application/local_port.py +9 -0
- memoryking/application/storage.py +117 -0
- memoryking/application/store_core.py +1292 -0
- memoryking/backups.py +131 -0
- memoryking/contracts/__init__.py +6 -0
- memoryking/contracts/__main__.py +20 -0
- memoryking/contracts/canonical.py +88 -0
- memoryking/contracts/embedding.schema.json +302 -0
- memoryking/contracts/embedding_generated.py +65 -0
- memoryking/contracts/experience.schema.json +1508 -0
- memoryking/contracts/experience_generated.py +239 -0
- memoryking/contracts/generated.py +122 -0
- memoryking/contracts/handoff.schema.json +299 -0
- memoryking/contracts/handoff_generated.py +69 -0
- memoryking/contracts/inference.schema.json +541 -0
- memoryking/contracts/inference_generated.py +106 -0
- memoryking/contracts/processing.schema.json +471 -0
- memoryking/contracts/processing_generated.py +82 -0
- memoryking/contracts/py.typed +0 -0
- memoryking/contracts/repository.schema.json +664 -0
- memoryking/contracts/repository_generated.py +144 -0
- memoryking/contracts/retrieval.schema.json +553 -0
- memoryking/contracts/retrieval_generated.py +110 -0
- memoryking/contracts/schema.json +696 -0
- memoryking/contracts/validation.py +92 -0
- memoryking/contracts/working.schema.json +1717 -0
- memoryking/contracts/working_generated.py +291 -0
- memoryking/domain/__init__.py +1 -0
- memoryking/domain/anchors.py +97 -0
- memoryking/domain/briefing.py +108 -0
- memoryking/domain/briefing_text.py +222 -0
- memoryking/domain/checkpoint.py +118 -0
- memoryking/domain/compression.py +64 -0
- memoryking/domain/delta.py +129 -0
- memoryking/domain/embeddings.py +90 -0
- memoryking/domain/hints.py +465 -0
- memoryking/domain/http_status.py +45 -0
- memoryking/domain/learning.py +62 -0
- memoryking/domain/local.py +65 -0
- memoryking/domain/plans.py +140 -0
- memoryking/domain/repository.py +118 -0
- memoryking/domain/selectors.py +356 -0
- memoryking/domain/summary.py +88 -0
- memoryking/domain/usage.py +163 -0
- memoryking/embedding_loop.py +98 -0
- memoryking/embedding_worker.py +131 -0
- memoryking/harness.py +882 -0
- memoryking/harness_context.py +376 -0
- memoryking/hooks.py +171 -0
- memoryking/host_hooks.py +454 -0
- memoryking/lean.py +352 -0
- memoryking/memory_tool.py +776 -0
- memoryking/migration.py +194 -0
- memoryking/model_install.py +78 -0
- memoryking/observability.py +101 -0
- memoryking/observability_metrics.py +100 -0
- memoryking/profiles.py +150 -0
- memoryking/providers.py +330 -0
- memoryking/py.typed +0 -0
- memoryking/pytest_plugin.py +69 -0
- memoryking/reference_agent.py +152 -0
- memoryking/repository_worker.py +57 -0
- memoryking/resume_adapter.py +154 -0
- memoryking/sdk.py +302 -0
- memoryking/shared.py +301 -0
- memoryking/shared_sdk.py +101 -0
- memoryking/vault.py +176 -0
- memoryking-0.1.0.dist-info/METADATA +157 -0
- memoryking-0.1.0.dist-info/RECORD +179 -0
- memoryking-0.1.0.dist-info/WHEEL +5 -0
- memoryking-0.1.0.dist-info/entry_points.txt +7 -0
- memoryking-0.1.0.dist-info/licenses/LICENSE +202 -0
- memoryking-0.1.0.dist-info/licenses/NOTICE +12 -0
- memoryking-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
"""Immutable, audience-bound outcome/feedback revisions; observed retrieval is not usefulness."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import json
|
|
6
|
+
from typing import Any
|
|
7
|
+
|
|
8
|
+
from memoryking.adapters.knowledge_store import Knowledge
|
|
9
|
+
from memoryking.adapters.local_store import uid
|
|
10
|
+
from memoryking.adapters.retrieval import Retrieval
|
|
11
|
+
from memoryking.application.store_core import StoreCore
|
|
12
|
+
from memoryking.contracts.canonical import canonical_bytes, canonical_hash
|
|
13
|
+
from memoryking.domain.local import LocalError
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class ExperienceRecords:
|
|
17
|
+
def __init__(self, store: StoreCore):
|
|
18
|
+
self.s, self.db = store, store.db
|
|
19
|
+
|
|
20
|
+
def available(self, who: dict[str, Any], row: Any, at: int) -> bool:
|
|
21
|
+
if row["body"] is None or row["incarnation"] != self.s.incarnation:
|
|
22
|
+
return False
|
|
23
|
+
if canonical_hash(json.loads(row["body"])) != row["body_hash"]:
|
|
24
|
+
return False
|
|
25
|
+
readers = json.loads(row["readers"])
|
|
26
|
+
if readers is not None and who["principal"] not in readers:
|
|
27
|
+
return False
|
|
28
|
+
try:
|
|
29
|
+
self.s._subject_auth(
|
|
30
|
+
self.s._token("credential", tenant=who["tenant"], principal=who["principal"]),
|
|
31
|
+
"read",
|
|
32
|
+
row["project"],
|
|
33
|
+
at,
|
|
34
|
+
)
|
|
35
|
+
for dep in json.loads(row["dependencies"]):
|
|
36
|
+
Retrieval(self.s)._dependency(who, dep, at)
|
|
37
|
+
except LocalError:
|
|
38
|
+
return False
|
|
39
|
+
return True
|
|
40
|
+
|
|
41
|
+
def get(self, who: dict[str, Any], project: str, reference: str, kind: str, at: int) -> Any:
|
|
42
|
+
row = self.db.execute(
|
|
43
|
+
"SELECT * FROM experience_records WHERE tenant=? AND project=? AND id=? AND kind=?",
|
|
44
|
+
(who["tenant"], project, reference, kind),
|
|
45
|
+
).fetchone()
|
|
46
|
+
if row is None or not self.available(who, row, at):
|
|
47
|
+
raise LocalError("experience_record_unavailable")
|
|
48
|
+
if canonical_hash(json.loads(row["body"])) != row["body_hash"]:
|
|
49
|
+
raise LocalError("experience_integrity_failure")
|
|
50
|
+
return row
|
|
51
|
+
|
|
52
|
+
def save(
|
|
53
|
+
self,
|
|
54
|
+
who: dict[str, Any],
|
|
55
|
+
project: str,
|
|
56
|
+
kind: str,
|
|
57
|
+
key: str,
|
|
58
|
+
expected: int,
|
|
59
|
+
body: dict[str, Any],
|
|
60
|
+
deps: list[dict[str, str]],
|
|
61
|
+
readers: list[str] | None,
|
|
62
|
+
at: int,
|
|
63
|
+
) -> dict[str, Any]:
|
|
64
|
+
if readers is not None and who["principal"] not in readers:
|
|
65
|
+
raise LocalError("experience_actor_audience_required")
|
|
66
|
+
if len(canonical_bytes(body)) > 65536 or len(deps) > 256:
|
|
67
|
+
raise LocalError("experience_record_limit")
|
|
68
|
+
current = (
|
|
69
|
+
self.db.execute(
|
|
70
|
+
"SELECT max(revision) FROM experience_records WHERE tenant=? AND project=? AND principal=? AND incarnation=? AND kind=? AND logical_key=?",
|
|
71
|
+
(who["tenant"], project, who["principal"], self.s.incarnation, kind, key),
|
|
72
|
+
).fetchone()[0]
|
|
73
|
+
or 0
|
|
74
|
+
)
|
|
75
|
+
if current != expected:
|
|
76
|
+
raise LocalError("experience_revision_conflict")
|
|
77
|
+
if (
|
|
78
|
+
self.db.execute(
|
|
79
|
+
"SELECT count(*) FROM experience_records WHERE tenant=?", (who["tenant"],)
|
|
80
|
+
).fetchone()[0]
|
|
81
|
+
>= 10000
|
|
82
|
+
):
|
|
83
|
+
raise LocalError("experience_capacity")
|
|
84
|
+
for dep in deps:
|
|
85
|
+
Retrieval(self.s)._dependency(who, dep, at)
|
|
86
|
+
ident = uid("exp")
|
|
87
|
+
position = self.s._event(who["tenant"], "experience_" + kind, ident, at, who["principal"])
|
|
88
|
+
self.db.execute(
|
|
89
|
+
"INSERT INTO experience_records VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)",
|
|
90
|
+
(
|
|
91
|
+
who["tenant"],
|
|
92
|
+
ident,
|
|
93
|
+
project,
|
|
94
|
+
who["principal"],
|
|
95
|
+
self.s.incarnation,
|
|
96
|
+
kind,
|
|
97
|
+
key,
|
|
98
|
+
current + 1,
|
|
99
|
+
json.dumps(body),
|
|
100
|
+
canonical_hash(body),
|
|
101
|
+
json.dumps(deps),
|
|
102
|
+
json.dumps(readers),
|
|
103
|
+
position,
|
|
104
|
+
),
|
|
105
|
+
)
|
|
106
|
+
self.s._enqueue(who["tenant"], position, None, who["principal"])
|
|
107
|
+
return {
|
|
108
|
+
"record": ident,
|
|
109
|
+
"revision": current + 1,
|
|
110
|
+
"kind": kind,
|
|
111
|
+
"position": position,
|
|
112
|
+
"assurance": "actor_reported",
|
|
113
|
+
"body_hash": canonical_hash(body),
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
def outcome(self, who: dict[str, Any], args: dict[str, Any], at: int) -> dict[str, Any]:
|
|
117
|
+
body = args["body"]
|
|
118
|
+
Knowledge(self.s)._support(who, body["acceptance_evidence"], at)
|
|
119
|
+
if body["result"] == "success" and not body["acceptance_evidence"]:
|
|
120
|
+
raise LocalError("acceptance_evidence_required")
|
|
121
|
+
if body["cached_input_tokens"] is not None and (
|
|
122
|
+
body["input_tokens"] is None or body["cached_input_tokens"] > body["input_tokens"]
|
|
123
|
+
):
|
|
124
|
+
raise LocalError("invalid_usage")
|
|
125
|
+
deps = [
|
|
126
|
+
{"kind": "observation", "id": source}
|
|
127
|
+
for source in sorted({e["observation"] for e in body["acceptance_evidence"]})
|
|
128
|
+
]
|
|
129
|
+
return self.save(
|
|
130
|
+
who,
|
|
131
|
+
args["project"],
|
|
132
|
+
"outcome",
|
|
133
|
+
args["logical_key"],
|
|
134
|
+
args["expected_revision"],
|
|
135
|
+
{
|
|
136
|
+
**body,
|
|
137
|
+
"assurance": "actor_reported",
|
|
138
|
+
"acceptance_semantics": "evidence_bytes_checked_result_not_independently_judged",
|
|
139
|
+
"usage_assurance": "actor_reported_unknowns_preserved",
|
|
140
|
+
},
|
|
141
|
+
deps,
|
|
142
|
+
body["readers"],
|
|
143
|
+
at,
|
|
144
|
+
)
|
|
145
|
+
|
|
146
|
+
def feedback(self, who: dict[str, Any], args: dict[str, Any], at: int) -> dict[str, Any]:
|
|
147
|
+
r = Retrieval(self.s)
|
|
148
|
+
artifact = r._artifact(who, args["project"], args["receipt"], at)
|
|
149
|
+
packet = json.loads(bytes(artifact["body"]))
|
|
150
|
+
request = json.loads(artifact["request_json"])
|
|
151
|
+
if request.get("task") not in {None, args["task"]} or request.get("run") not in {
|
|
152
|
+
None,
|
|
153
|
+
args["run"],
|
|
154
|
+
}:
|
|
155
|
+
raise LocalError("feedback_scope_mismatch")
|
|
156
|
+
item = next(
|
|
157
|
+
(
|
|
158
|
+
i
|
|
159
|
+
for i in packet.get("guidance", []) + packet.get("constraints", [])
|
|
160
|
+
if i["reference"] == args["reference"]
|
|
161
|
+
),
|
|
162
|
+
None,
|
|
163
|
+
)
|
|
164
|
+
if item is None:
|
|
165
|
+
raise LocalError("feedback_reference_not_retrieved")
|
|
166
|
+
if args["usefulness"] == "helpful" and args["use"] != "used":
|
|
167
|
+
raise LocalError("feedback_use_required")
|
|
168
|
+
deps = r._dependencies([item])
|
|
169
|
+
body = {
|
|
170
|
+
key: value
|
|
171
|
+
for key, value in args.items()
|
|
172
|
+
if key not in {"project", "expected_revision", "readers"}
|
|
173
|
+
}
|
|
174
|
+
body.update(
|
|
175
|
+
retrieved="receipt_verified",
|
|
176
|
+
use_assurance="actor_reported",
|
|
177
|
+
usefulness_assurance="actor_reported",
|
|
178
|
+
receipt_hash=artifact["body_hash"],
|
|
179
|
+
target_hash=canonical_hash(item),
|
|
180
|
+
causal_claim=False,
|
|
181
|
+
)
|
|
182
|
+
# A new receipt/exposure cannot create another independent vote for the same run/item.
|
|
183
|
+
key = canonical_hash([args["task"], args["run"], args["reference"]])
|
|
184
|
+
return self.save(
|
|
185
|
+
who,
|
|
186
|
+
args["project"],
|
|
187
|
+
"feedback",
|
|
188
|
+
key,
|
|
189
|
+
args["expected_revision"],
|
|
190
|
+
body,
|
|
191
|
+
deps,
|
|
192
|
+
args["readers"],
|
|
193
|
+
at,
|
|
194
|
+
)
|
|
195
|
+
|
|
196
|
+
def records(self, who: dict[str, Any], args: dict[str, Any], at: int) -> dict[str, Any]:
|
|
197
|
+
rows = self.db.execute(
|
|
198
|
+
"SELECT e.* FROM experience_records e WHERE e.tenant=? AND e.project=? AND e.incarnation=? AND e.kind=? AND (e.readers='null' OR EXISTS(SELECT 1 FROM json_each(e.readers) WHERE value=?)) AND NOT EXISTS(SELECT 1 FROM experience_records n WHERE n.tenant=e.tenant AND n.project=e.project AND n.principal=e.principal AND n.incarnation=e.incarnation AND n.kind=e.kind AND n.logical_key=e.logical_key AND n.revision>e.revision) ORDER BY e.position DESC LIMIT 257",
|
|
199
|
+
(who["tenant"], args["project"], self.s.incarnation, args["kind"], who["principal"]),
|
|
200
|
+
).fetchall()
|
|
201
|
+
items = []
|
|
202
|
+
for row in rows[:256]:
|
|
203
|
+
if self.available(who, row, at):
|
|
204
|
+
items.append(
|
|
205
|
+
{
|
|
206
|
+
"record": row["id"],
|
|
207
|
+
"revision": row["revision"],
|
|
208
|
+
"kind": row["kind"],
|
|
209
|
+
"actor": row["principal"],
|
|
210
|
+
"position": row["position"],
|
|
211
|
+
"body": json.loads(row["body"]),
|
|
212
|
+
"body_hash": row["body_hash"],
|
|
213
|
+
}
|
|
214
|
+
)
|
|
215
|
+
return {
|
|
216
|
+
"status": "partial" if len(rows) > 256 else "complete",
|
|
217
|
+
"items": items,
|
|
218
|
+
"coverage": "current_authorized_latest_revisions",
|
|
219
|
+
"limit": 256,
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
def record(self, who: dict[str, Any], args: dict[str, Any], at: int) -> dict[str, Any]:
|
|
223
|
+
row = self.get(who, args["project"], args["record"], args["kind"], at)
|
|
224
|
+
return {
|
|
225
|
+
"record": row["id"],
|
|
226
|
+
"kind": row["kind"],
|
|
227
|
+
"revision": row["revision"],
|
|
228
|
+
"actor": row["principal"],
|
|
229
|
+
"body": json.loads(row["body"]),
|
|
230
|
+
"body_hash": row["body_hash"],
|
|
231
|
+
"position": row["position"],
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
def verify_dependency(self, who: dict[str, Any], reference: str, at: int) -> None:
|
|
235
|
+
row = self.db.execute(
|
|
236
|
+
"SELECT * FROM experience_records WHERE tenant=? AND id=?", (who["tenant"], reference)
|
|
237
|
+
).fetchone()
|
|
238
|
+
if row is None or not self.available(who, row, at):
|
|
239
|
+
raise LocalError("replay_denied")
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
BEGIN IMMEDIATE;
|
|
2
|
+
CREATE TABLE experience_records (
|
|
3
|
+
tenant TEXT NOT NULL REFERENCES tenants, id TEXT NOT NULL, project TEXT NOT NULL,
|
|
4
|
+
principal TEXT NOT NULL, incarnation TEXT NOT NULL, kind TEXT NOT NULL,
|
|
5
|
+
logical_key TEXT NOT NULL, revision INTEGER NOT NULL, body TEXT,
|
|
6
|
+
body_hash TEXT NOT NULL, dependencies TEXT NOT NULL, readers TEXT,
|
|
7
|
+
position INTEGER NOT NULL,
|
|
8
|
+
PRIMARY KEY(tenant,id), UNIQUE(tenant,project,principal,incarnation,kind,logical_key,revision),
|
|
9
|
+
FOREIGN KEY(tenant,position) REFERENCES events(tenant,position));
|
|
10
|
+
CREATE INDEX experience_lookup ON experience_records(tenant,project,kind,position);
|
|
11
|
+
CREATE TABLE ranking_state (
|
|
12
|
+
tenant TEXT NOT NULL REFERENCES tenants, project TEXT NOT NULL, version INTEGER NOT NULL,
|
|
13
|
+
configuration TEXT, reconciliation INTEGER NOT NULL DEFAULT 0,
|
|
14
|
+
PRIMARY KEY(tenant,project),
|
|
15
|
+
FOREIGN KEY(tenant,configuration) REFERENCES experience_records(tenant,id));
|
|
16
|
+
CREATE TABLE ranking_history (
|
|
17
|
+
tenant TEXT NOT NULL, project TEXT NOT NULL, position INTEGER NOT NULL,
|
|
18
|
+
configuration TEXT, detail TEXT NOT NULL,
|
|
19
|
+
PRIMARY KEY(tenant,project,position),
|
|
20
|
+
FOREIGN KEY(tenant,configuration) REFERENCES experience_records(tenant,id),
|
|
21
|
+
FOREIGN KEY(tenant,position) REFERENCES events(tenant,position));
|
|
22
|
+
PRAGMA user_version=8;
|
|
23
|
+
COMMIT;
|