schema.sql 989 B

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