schema.sql 965 B

1234567891011121314151617181920212223242526272829
  1. -- This is the database schema for PostgreSQL.
  2. create table collection (
  3. path varchar primary key not null,
  4. parent_path varchar references collection (path));
  5. create table item (
  6. name varchar primary key not null,
  7. tag varchar not null,
  8. collection_path varchar references collection (path) not null);
  9. create table header (
  10. key varchar not null,
  11. value varchar not null,
  12. collection_path varchar references collection (path) not null,
  13. primary key (key, collection_path));
  14. create table line (
  15. key varchar not null,
  16. value varchar not null,
  17. item_name varchar references item (name) not null,
  18. timestamp timestamp not null,
  19. primary key (key, value, item_name, timestamp));
  20. create table property (
  21. key varchar not null,
  22. value varchar not null,
  23. collection_path varchar references collection (path) not null,
  24. primary key (key, collection_path));