mirror of
https://github.com/Kozea/Radicale.git
synced 2025-06-26 16:45:52 +00:00
Add SQL schema
This commit is contained in:
parent
5c4fb8529d
commit
81d668a576
1 changed files with 33 additions and 0 deletions
33
schema.sql
Normal file
33
schema.sql
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
-- This is the database schema for PostgreSQL.
|
||||||
|
|
||||||
|
begin;
|
||||||
|
|
||||||
|
create table collection (
|
||||||
|
path varchar primary key not null,
|
||||||
|
parent_path varchar references collection (path));
|
||||||
|
|
||||||
|
create table item (
|
||||||
|
name varchar primary key not null,
|
||||||
|
tag varchar not null,
|
||||||
|
collection_path varchar references collection (path) not null);
|
||||||
|
|
||||||
|
create table header (
|
||||||
|
key varchar not null,
|
||||||
|
value varchar not null,
|
||||||
|
collection_path varchar references collection (path) not null,
|
||||||
|
primary key (key, collection_path));
|
||||||
|
|
||||||
|
create table line (
|
||||||
|
key varchar not null,
|
||||||
|
value varchar not null,
|
||||||
|
item_name varchar references item (name) not null,
|
||||||
|
timestamp timestamp not null,
|
||||||
|
primary key (key, item_name));
|
||||||
|
|
||||||
|
create table property (
|
||||||
|
key varchar not null,
|
||||||
|
value varchar not null,
|
||||||
|
collection_path varchar references collection (path) not null,
|
||||||
|
primary key (key, collection_path));
|
||||||
|
|
||||||
|
commit;
|
Loading…
Add table
Add a link
Reference in a new issue