add Failed column to Messages table
This commit is contained in:
parent
de0d8f73f0
commit
ca136b65a3
4 changed files with 7 additions and 4 deletions
|
@ -1,11 +1,9 @@
|
||||||
#!/usr/bin/env python3
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
from sys import argv, stderr
|
from sys import argv, stderr
|
||||||
from .ui import ui
|
from .ui import ui
|
||||||
|
|
||||||
if len(argv) == 0:
|
if len(argv) == 0:
|
||||||
print("You've met with a terrible fate.", file=stderr)
|
print("malformed arguments", file=stderr)
|
||||||
ret = 2
|
ret = 2
|
||||||
else:
|
else:
|
||||||
ret = ui(argv[0], argv[1:])
|
ret = ui(argv[0], argv[1:])
|
||||||
|
|
|
@ -252,8 +252,11 @@ class RespoDB:
|
||||||
else:
|
else:
|
||||||
exception = None
|
exception = None
|
||||||
|
|
||||||
|
failed = not entry.success
|
||||||
|
|
||||||
message = self.new_message(
|
message = self.new_message(
|
||||||
execution=entry.execution,
|
execution=entry.execution,
|
||||||
server=server, domain=domain,
|
server=server, domain=domain,
|
||||||
record_id=record_id, exception=exception)
|
record_id=record_id, exception=exception,
|
||||||
|
failed=failed)
|
||||||
self.flush()
|
self.flush()
|
||||||
|
|
|
@ -67,6 +67,7 @@ CREATE TABLE IF NOT EXISTS Messages (
|
||||||
DomainId INTEGER NOT NULL,
|
DomainId INTEGER NOT NULL,
|
||||||
RecordId INTEGER,
|
RecordId INTEGER,
|
||||||
ExceptionId INTEGER,
|
ExceptionId INTEGER,
|
||||||
|
Failed BOOLEAN DEFAULT 0 NOT NULL,
|
||||||
FOREIGN KEY(ServerId) REFERENCES Ips(IpId),
|
FOREIGN KEY(ServerId) REFERENCES Ips(IpId),
|
||||||
FOREIGN KEY(ExecutionId) REFERENCES Executions(ExecutionId),
|
FOREIGN KEY(ExecutionId) REFERENCES Executions(ExecutionId),
|
||||||
FOREIGN KEY(DomainId) REFERENCES Domains(DomainId),
|
FOREIGN KEY(DomainId) REFERENCES Domains(DomainId),
|
||||||
|
|
|
@ -61,6 +61,7 @@ class TMessage(rain.Storm, AttrCheck):
|
||||||
domain_id = rain.Int("DomainId")
|
domain_id = rain.Int("DomainId")
|
||||||
record_id = rain.Int("RecordId")
|
record_id = rain.Int("RecordId")
|
||||||
exception_id = rain.Int("ExceptionId")
|
exception_id = rain.Int("ExceptionId")
|
||||||
|
failed = rain.Bool("Failed")
|
||||||
execution = rain.Reference(execution_id, "TExecution.execution_id")
|
execution = rain.Reference(execution_id, "TExecution.execution_id")
|
||||||
server = rain.Reference(server_id, "TAddress.address_id")
|
server = rain.Reference(server_id, "TAddress.address_id")
|
||||||
domain = rain.Reference(domain_id, "TDomain.domain_id")
|
domain = rain.Reference(domain_id, "TDomain.domain_id")
|
||||||
|
|
Loading…
Add table
Reference in a new issue