File: robot_entity.sql

package info (click to toggle)
ledgersmb 1.6.33%2Bds-2.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 33,000 kB
  • sloc: perl: 52,612; sql: 43,562; xml: 36,194; javascript: 2,428; sh: 1,099; makefile: 361; pascal: 25
file content (18 lines) | stat: -rw-r--r-- 872 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
INSERT INTO entity_class (id,class)
VALUES (9,'Sub-contractor'),
       (10,'Robot');    -- Software robot for automation of user-based tasks, Migration reconciliation approval authority, for example

SELECT setval('entity_class_id_seq',10);

-- Software robot. Currently implemented as a degraded person
CREATE TABLE robot (
    id serial PRIMARY KEY,
    entity_id integer references entity(id) not null,
    first_name text check (first_name ~ '[[:alnum:] _\-\.\*]?'),
    middle_name text,
    last_name text check (last_name ~ '[[:alnum:] _\-\.\*]') NOT NULL,
    created date not null default current_date,
    unique(entity_id)
 );

COMMENT ON TABLE robot IS $$ Every robot, must have an entity to derive a common or display name. The correct way to get class information on a robot would be robot.entity_id->entity_class_to_entity.entity_id. $$;