-
Notifications
You must be signed in to change notification settings - Fork 0
/
SQLRequest.sql
49 lines (44 loc) · 1002 Bytes
/
SQLRequest.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
CREATE TABLE "ID" (
"Key" TEXT NOT NULL UNIQUE,
"PC_name" TEXT NOT NULL UNIQUE,
PRIMARY KEY("Key")
);
CREATE TABLE "admin" (
"username" TEXT,
"password" TEXT
);
CREATE TABLE "infoDisk" (
"idDisk" INTEGER PRIMARY KEY AUTOINCREMENT,
"pcKey" TEXT,
"pcName" TEXT,
"totalSpace" REAL,
"dir" TEXT,
"diskKey" TEXT,
"saveSpace" REAL,
"usedSpace" REAL,
"freeSpace" REAL,
"lastUpdate" TEXT,
FOREIGN KEY("pcKey") REFERENCES "ID"("Key")
);
CREATE TABLE "shareList" (
"idShare" INTEGER PRIMARY KEY AUTOINCREMENT,
"idTorrent" TEXT,
"idPair" TEXT,
"left" REAL DEFAULT 0,
FOREIGN KEY("idPair") REFERENCES "ID"("Key"),
FOREIGN KEY("idTorrent") REFERENCES "torrent"("idTorrent")
);
CREATE TABLE "tempID" (
"Key" TEXT NOT NULL,
"PC_name" TEXT NOT NULL,
PRIMARY KEY("Key","PC_name")
);
CREATE TABLE "torrent" (
"idTorrent" INTEGER PRIMARY KEY AUTOINCREMENT,
"libelle" TEXT,
"taille" REAL,
"statut" INTEGER,
"hash" TEXT,
"idSource" TEXT,
FOREIGN KEY("idSource") REFERENCES "ID"("Key")
);