-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.sql
67 lines (61 loc) · 1.49 KB
/
schema.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
create table inode
(
id integer not null
primary key autoincrement,
size integer not null,
/* access time */
atime integer,
/* modified time */
mtime integer not null,
/* change time */
ctime integer not null,
/* creation time */
crtime integer not null,
kind text not null,
perm integer not null,
nlink integer not null,
uid integer not null,
gid integer not null,
rdev integer not null,
blksize integer not null,
flags integer not null,
has_xattr INT
);
create table directory
(
parent integer
constraint directory_inode_id_fk
references inode,
entry blob,
inode integer
constraint directory_inode_id_fk_2
references inode,
constraint directory_pk
primary key (parent, entry)
);
create table inode_xattrs
(
inode integer,
key blob,
value blob
);
create index inode_xattrs_inode_index
on inode_xattrs (inode);
create table storage_block
(
inode integer,
idx integer,
size integer,
topology TEXT
);
create table storage_block_shard
(
inode integer,
idx integer,
shard_idx integer not null,
pool text not null,
bucket text not null,
filename text not null,
constraint storage_block_shard_storage_block_inode_idx_fk
foreign key (inode, idx) references storage_block (inode, idx)
);